[coreboot] New patch to review: 5ec011a Lenovo H8 EC: add usb_power_enable()

Sven Schnelle (svens@stackframe.org) gerrit at coreboot.org
Thu Jun 16 16:46:43 CEST 2011


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

-gerrit

commit 5ec011a230a23bdc51e2c37c0b799cb44560fb6f
Author: Sven Schnelle <svens at stackframe.org>
Date:   Thu Jun 16 16:43:04 2011 +0200

    Lenovo H8 EC: add usb_power_enable()
    
    Can be used to disable/enable Power output on USB ports.
    
    Change-Id: I5eb52b33c9e3359b0e5874bda2c0c8d75c196bc2
    Signed-off-by: Sven Schnelle <svens at stackframe.org>
---
 src/ec/lenovo/h8/acpi/ec.asl |    8 ++++++++
 src/ec/lenovo/h8/h8.c        |    9 +++++++++
 src/ec/lenovo/h8/h8.h        |    1 +
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl
index 0bcf441..3ba4aa9 100644
--- a/src/ec/lenovo/h8/acpi/ec.asl
+++ b/src/ec/lenovo/h8/acpi/ec.asl
@@ -40,6 +40,8 @@ Device(EC)
 		Offset (0x3B),
 				    , 1,
 				KBLT, 1,        /* Keyboard Light */
+				    , 2,
+				USPW, 1,	/* USB Power enable */
 		Offset (0x4e),
 		               WAKE, 16,
 		Offset (0x78),
@@ -73,6 +75,12 @@ Device(EC)
 		Store(Arg0, AMUT)
 	}
 
+	Method (USBP, 1, NotSerialized)
+	{
+		Store(Arg0, USPW)
+	}
+
+
 	/* Sleep Button pressed */
 	Method(_Q13, 0, NotSerialized)
 	{
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index ef308b1..2c25d29 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -88,6 +88,14 @@ void h8_disable_event(int event)
 
 }
 
+void h8_usb_power_enable(int onoff)
+{
+	if (onoff)
+		ec_set_bit(0x3b, 4);
+	else
+		ec_clr_bit(0x3b, 4);
+}
+
 int h8_ultrabay_device_present(void)
 {
 	return ec_read(H8_STATUS1) & 0x5 ? 0 : 1;
@@ -129,6 +137,7 @@ static void h8_enable(device_t dev)
 	ec_write(H8_FAN_CONTROL, H8_FAN_CONTROL_AUTO);
 	h8_wlan_enable(conf->wlan_enable);
 	h8_trackpoint_enable(conf->trackpoint_enable);
+	h8_usb_power_enable(1);
 
 	if (!get_option(&val, "volume"))
 		ec_write(H8_VOLUME_CONTROL, val);
diff --git a/src/ec/lenovo/h8/h8.h b/src/ec/lenovo/h8/h8.h
index c87ace4..717c0ce 100644
--- a/src/ec/lenovo/h8/h8.h
+++ b/src/ec/lenovo/h8/h8.h
@@ -23,6 +23,7 @@
 void h8_trackpoint_enable(int on);
 void h8_wlan_enable(int on);
 void h8_set_audio_mute(int on);
+void h8_usb_power_enable(int on);
 void h8_enable_event(int event);
 void h8_disable_event(int event);
 int h8_ultrabay_device_present(void);




More information about the coreboot mailing list