ec/lenovo/h8: Implement sticky Fn option.
Useful for accessibility. Sticky modifier (sticky Fn) is a behaviour of modifier key when you don't have to hold it pressed to achieve the result. E.g. with normal Fn brightness up is: <Press Fn> <Press Home> <Despress Home> <Depress Fn> With sticky Fn you can do: <Press Fn> <Depress Fn> <Press Home> <Despress Home> Change-Id: I4da5adcea02428d936023891de08684cae77c44e Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/4661 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
parent
fc7090b249
commit
11a7c84f85
|
@ -70,6 +70,14 @@ static void h8_fn_ctrl_swap(int on)
|
||||||
ec_clr_bit(0xce, 4);
|
ec_clr_bit(0xce, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void h8_sticky_fn(int on)
|
||||||
|
{
|
||||||
|
if (on)
|
||||||
|
ec_set_bit(0x0, 3);
|
||||||
|
else
|
||||||
|
ec_clr_bit(0x0, 3);
|
||||||
|
}
|
||||||
|
|
||||||
static void h8_log_ec_version(void)
|
static void h8_log_ec_version(void)
|
||||||
{
|
{
|
||||||
char ecfw[17];
|
char ecfw[17];
|
||||||
|
@ -202,6 +210,10 @@ static void h8_enable(device_t dev)
|
||||||
val = 0;
|
val = 0;
|
||||||
h8_fn_ctrl_swap(val);
|
h8_fn_ctrl_swap(val);
|
||||||
|
|
||||||
|
if (get_option(&val, "sticky_fn") != CB_SUCCESS)
|
||||||
|
val = 0;
|
||||||
|
h8_sticky_fn(val);
|
||||||
|
|
||||||
if (get_option(&val, "first_battery") != CB_SUCCESS)
|
if (get_option(&val, "first_battery") != CB_SUCCESS)
|
||||||
val = 1;
|
val = 1;
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,7 @@ entries
|
||||||
1064 8 h 0 volume
|
1064 8 h 0 volume
|
||||||
1072 1 e 9 first_battery
|
1072 1 e 9 first_battery
|
||||||
1074 1 e 1 fn_ctrl_swap
|
1074 1 e 1 fn_ctrl_swap
|
||||||
|
1075 1 e 1 sticky_fn
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
|
|
||||||
enumerations
|
enumerations
|
||||||
|
|
|
@ -10,3 +10,4 @@ bluetooth=Enable
|
||||||
wwan=Enable
|
wwan=Enable
|
||||||
touchpad=Enable
|
touchpad=Enable
|
||||||
fn_ctrl_swap=Disable
|
fn_ctrl_swap=Disable
|
||||||
|
sticky_fn=Disable
|
||||||
|
|
|
@ -91,6 +91,7 @@ entries
|
||||||
413 1 e 1 wwan
|
413 1 e 1 wwan
|
||||||
414 1 e 1 touchpad
|
414 1 e 1 touchpad
|
||||||
417 1 e 1 fn_ctrl_swap
|
417 1 e 1 fn_ctrl_swap
|
||||||
|
418 1 e 1 sticky_fn
|
||||||
#419 565 r 0 unused
|
#419 565 r 0 unused
|
||||||
|
|
||||||
# coreboot config options: check sums
|
# coreboot config options: check sums
|
||||||
|
|
|
@ -13,3 +13,4 @@ tft_brightness=0xff
|
||||||
first_battery=Primary
|
first_battery=Primary
|
||||||
bluetooth=Enable
|
bluetooth=Enable
|
||||||
fn_ctrl_swap=Disable
|
fn_ctrl_swap=Disable
|
||||||
|
sticky_fn=Disable
|
||||||
|
|
|
@ -113,6 +113,7 @@ entries
|
||||||
1081 1 e 1 bluetooth
|
1081 1 e 1 bluetooth
|
||||||
1082 1 e 1 wwan
|
1082 1 e 1 wwan
|
||||||
1085 1 e 1 fn_ctrl_swap
|
1085 1 e 1 fn_ctrl_swap
|
||||||
|
1086 1 e 1 sticky_fn
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
|
|
||||||
enumerations
|
enumerations
|
||||||
|
|
Loading…
Reference in New Issue