Forkoz has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/51179 )
Change subject: The current f1 to f12 as primary just enables FN Lock and causes a light to enable on the keyboard of the T440P. Newer machine firmware has the option to invert FN Lock so that the unlocked state has the light on and locked has it off. This way you have no light and can use the F keys instead of hotkeys unless you hold FN or enable FN lock. ......................................................................
The current f1 to f12 as primary just enables FN Lock and causes a light to enable on the keyboard of the T440P. Newer machine firmware has the option to invert FN Lock so that the unlocked state has the light on and locked has it off. This way you have no light and can use the F keys instead of hotkeys unless you hold FN or enable FN lock.
Obviously now we don't want FN lock on by default. This was tested on both the T440P and X250 so should be present in all thinkpads with a FN light that had the option in the bios.
Change-Id: Ic3f03a9fbd7e16d6c30828a66502d2b72f499dfe --- M src/ec/lenovo/h8/Kconfig M src/ec/lenovo/h8/h8.c M src/mainboard/lenovo/t440p/cmos.default M src/mainboard/lenovo/t440p/cmos.layout 4 files changed, 24 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/79/51179/1
diff --git a/src/ec/lenovo/h8/Kconfig b/src/ec/lenovo/h8/Kconfig index 2ea4faa9..16fe156 100644 --- a/src/ec/lenovo/h8/Kconfig +++ b/src/ec/lenovo/h8/Kconfig @@ -44,6 +44,10 @@ bool default n
+config H8_SWAP_FN_LOCK + bool + default n + config THINKPADEC_HKEY_EISAID string default "IBM0068" diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c index 093a639..310b4e0 100644 --- a/src/ec/lenovo/h8/h8.c +++ b/src/ec/lenovo/h8/h8.c @@ -76,9 +76,18 @@ static void f1_to_f12_as_primary(int on) { if (on) - ec_set_bit(0x3b, 3); + ec_set_bit(0x3b, 3); // Enable FN Lock else - ec_clr_bit(0x3b, 3); + ec_clr_bit(0x3b, 3); //Undo +} + +static void fn_lock_swap(int on) +{ + if (on) + ec_clr_bit(0x09, 3); // T440p/X250 invert FN Lock + else + ec_set_bit(0x09, 3); // Undo + }
static void h8_log_ec_version(void) @@ -337,6 +346,12 @@ f1_to_f12_as_primary(val); }
+ if (CONFIG(H8_SWAP_FN_LOCK)) { + if (get_option(&val, "fn_lock_swap") != CB_SUCCESS) + val = 1; + fn_lock_swap(val); + } + if (get_option(&val, "first_battery") != CB_SUCCESS) val = PRIMARY_BATTERY; h8_charge_priority(val); diff --git a/src/mainboard/lenovo/t440p/cmos.default b/src/mainboard/lenovo/t440p/cmos.default index bb8626d..b5ae6e5 100644 --- a/src/mainboard/lenovo/t440p/cmos.default +++ b/src/mainboard/lenovo/t440p/cmos.default @@ -6,7 +6,8 @@ first_battery=Primary wlan=Enable fn_ctrl_swap=Disable -f1_to_f12_as_primary=Enable +f1_to_f12_as_primary=Disable +fn_lock_swap=Enable sticky_fn=Disable trackpoint=Enable backlight=Keyboard diff --git a/src/mainboard/lenovo/t440p/cmos.layout b/src/mainboard/lenovo/t440p/cmos.layout index 464d242..e48d93a 100644 --- a/src/mainboard/lenovo/t440p/cmos.layout +++ b/src/mainboard/lenovo/t440p/cmos.layout @@ -30,6 +30,7 @@ 419 2 e 13 usb_always_on 422 2 e 10 backlight 424 1 e 1 f1_to_f12_as_primary +425 1 e 1 fn_lock_swap
# coreboot config options: northbridge 435 1 e 1 enable_dual_graphics