From fc7090b249ddfc7d5332ca8bee0f322607643960 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 11 Jan 2014 10:29:14 +0100 Subject: 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 Reviewed-on: http://review.coreboot.org/4660 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/ec/lenovo/h8/h8.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/ec') 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; -- cgit v1.2.3