#include "chip.h"
#include <pc80/mc146818rtc.h>
+static void h8_bluetooth_enable(int on)
+{
+ if (on)
+ ec_set_bit(0x3a, 4);
+ else
+ ec_clr_bit(0x3a, 4);
+}
+
void h8_trackpoint_enable(int on)
{
ec_write(H8_TRACKPOINT_CTRL,
fwvh >> 4, fwvh & 0x0f, fwvl >> 4, 0x41 + (fwvl & 0xf));
}
-void h8_set_audio_mute(int on)
+void h8_set_audio_mute(int mute)
{
- if (on)
- ec_clr_bit(0x3a, 0);
+ if (mute)
+ ec_set_bit(0x3a, 0);
else
- ec_set_bit(0x3a, 1);
+ ec_clr_bit(0x3a, 0);
}
void h8_enable_event(int event)
static void h8_enable(device_t dev)
{
struct ec_lenovo_h8_config *conf = dev->chip_info;
- u8 val;
+ u8 val, tmp;
h8_log_ec_version();
if (!get_option(&val, "volume"))
ec_write(H8_VOLUME_CONTROL, val);
+
+ if (!get_option(&val, "bluetooth"))
+ h8_bluetooth_enable(val);
+
+ if (!get_option(&val, "first_battery")) {
+ tmp = ec_read(H8_CONFIG3);
+ tmp &= ~(1 << 4);
+ tmp |= (val & 1)<< 4;
+ ec_write(H8_CONFIG3, tmp);
+ }
h8_set_audio_mute(0);
}