[coreboot] New patch to review for coreboot: c18ecfd Lenovo X60/T60: add first_battery setting

Sven Schnelle (svens@stackframe.org) gerrit at coreboot.org
Wed Dec 7 23:36:35 CET 2011


Sven Schnelle (svens at stackframe.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/475

-gerrit

commit c18ecfd8b74b1a38bee90270e36630f9fad74b98
Author: Sven Schnelle <svens at stackframe.org>
Date:   Wed Dec 7 14:30:58 2011 -0800

    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 at stackframe.org>
---
 src/ec/lenovo/h8/h8.c                |    9 ++++++++-
 src/mainboard/lenovo/t60/cmos.layout |    4 +++-
 src/mainboard/lenovo/x60/cmos.layout |    3 +++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index f81a39c..f20cd38 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);
 }
 
diff --git a/src/mainboard/lenovo/t60/cmos.layout b/src/mainboard/lenovo/t60/cmos.layout
index a946b4b..8d9dce4 100644
--- a/src/mainboard/lenovo/t60/cmos.layout
+++ b/src/mainboard/lenovo/t60/cmos.layout
@@ -109,6 +109,7 @@ entries
 
 1060         1       e       1        touchpad
 1064         8       h       0        volume
+1072         1       e       9        first_battery
 # -----------------------------------------------------------------
 
 enumerations
@@ -142,7 +143,8 @@ enumerations
 7     2     Keep
 8     0     No
 8     1     Yes
-
+9     0	    Secondary
+9     1	    Primary
 # -----------------------------------------------------------------
 checksums
 
diff --git a/src/mainboard/lenovo/x60/cmos.layout b/src/mainboard/lenovo/x60/cmos.layout
index a157513..cae70cb 100644
--- a/src/mainboard/lenovo/x60/cmos.layout
+++ b/src/mainboard/lenovo/x60/cmos.layout
@@ -109,6 +109,7 @@ entries
 
 1064         8       h       0        volume
 1072         8       h       0        tft_brightness
+1080         1       e       9        first_battery
 # -----------------------------------------------------------------
 
 enumerations
@@ -142,6 +143,8 @@ enumerations
 7     2     Keep
 8     0     No
 8     1     Yes
+9     0	    Secondary
+9     1	    Primary
 
 # -----------------------------------------------------------------
 checksums




More information about the coreboot mailing list