From 4f4322dd68575402e099e2dfda057687388f064e Mon Sep 17 00:00:00 2001 From: Nathaniel Roach Date: Sat, 10 Nov 2018 08:34:44 +0800 Subject: lenovo/h8,thinkpads: Re-do USB Always On Re-write the UAO handling code as it had stopped working (#171) (the flag was not getting read from the RTC properly in SMM) Remove the SMM code as it's not needed (but EC flag won't be set upon entering S3 now) Set the EC flags on boot the same way other flags are set Document bitwise operators for clarity Propagate changes to other Thinkpads (updated X201 to have 2 bits for the flag as it only had 1) Per Nicola Corna's previous commits, 0x0d is set for "AC only" "AC only" does exhibit different behaviour - the USB port is turned on a few seconds after entering S3, rather than < 1 sec, regardless of AC status Tested on X220 Change-Id: If812cd1ef8fb1a24d7fadbe834f574b40cbcd56a Signed-off-by: Nathaniel Roach Reviewed-on: https://review.coreboot.org/c/29565 Tested-by: build bot (Jenkins) Reviewed-by: Philipp Deppenwiese --- src/ec/lenovo/h8/h8.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ec/lenovo/h8/h8.h') diff --git a/src/ec/lenovo/h8/h8.h b/src/ec/lenovo/h8/h8.h index 4ac395a098..a46ba1f5e0 100644 --- a/src/ec/lenovo/h8/h8.h +++ b/src/ec/lenovo/h8/h8.h @@ -19,9 +19,16 @@ #include #include +enum usb_always_on { + UAO_OFF = 0, + UAO_AC_AND_BATTERY = 1, + UAO_AC_ONLY = 2 +}; + void h8_trackpoint_enable(int on); void h8_wlan_enable(int on); void h8_set_audio_mute(int on); +void h8_usb_always_on_enable(enum usb_always_on on); void h8_usb_power_enable(int on); void h8_enable_event(int event); void h8_disable_event(int event); -- cgit v1.2.3