diff options
author | Sven Schnelle <svens@stackframe.org> | 2011-12-07 14:30:58 -0800 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2011-12-14 09:41:46 +0100 |
commit | d5992b8dd1e4a7d73e0aaf042f0cb96a5c28533a (patch) | |
tree | f86cdb0fd3f5d47e8ecdcfb8db5e3373715885b8 /src/ec/lenovo | |
parent | 009ad83d5c1791816801216c496ba9b3fe352fb5 (diff) |
Lenovo X60/T60: add first_battery setting
The EC allows to select the order in which batteries are (dis)charged.
Make this setting available to the user.
Change-Id: Id2a98192565419dbb53f3a7cf0b2c46b672a3ed8
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/475
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'src/ec/lenovo')
-rw-r--r-- | src/ec/lenovo/h8/h8.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c index f81a39cb24..f20cd389dc 100644 --- a/src/ec/lenovo/h8/h8.c +++ b/src/ec/lenovo/h8/h8.c @@ -104,7 +104,7 @@ int h8_ultrabay_device_present(void) 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(); @@ -142,6 +142,13 @@ static void h8_enable(device_t dev) if (!get_option(&val, "volume")) ec_write(H8_VOLUME_CONTROL, 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); } |