summaryrefslogtreecommitdiff
path: root/src/ec
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-01-11 10:29:14 +0100
committerVladimir Serbinenko <phcoder@gmail.com>2014-01-12 17:42:11 +0100
commitfc7090b249ddfc7d5332ca8bee0f322607643960 (patch)
tree4c8462b0e78136a05d26081ae6654257368aca92 /src/ec
parent128741682250e196ccc9ff0bf9e7a5db5dfcdbd3 (diff)
ec/lenovo/h8: Add an option to swap ctrl and fn.
Tested on my X201 and X230. Change-Id: I3c7ec65681157d15c6e87eea64779a08e03ae5a8 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/4660 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/ec')
-rw-r--r--src/ec/lenovo/h8/h8.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index 8dfec0614c..e44a2781f5 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -62,6 +62,14 @@ static void h8_wwan_enable(int on)
ec_clr_bit(0x3a, 6);
}
+static void h8_fn_ctrl_swap(int on)
+{
+ if (on)
+ ec_set_bit(0xce, 4);
+ else
+ ec_clr_bit(0xce, 4);
+}
+
static void h8_log_ec_version(void)
{
char ecfw[17];
@@ -190,6 +198,10 @@ static void h8_enable(device_t dev)
h8_wwan_enable(val);
+ if (get_option(&val, "fn_ctrl_swap") != CB_SUCCESS)
+ val = 0;
+ h8_fn_ctrl_swap(val);
+
if (get_option(&val, "first_battery") != CB_SUCCESS)
val = 1;