summaryrefslogtreecommitdiff
path: root/src/ec
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-01-11 10:55:31 +0100
committerVladimir Serbinenko <phcoder@gmail.com>2014-01-12 17:42:28 +0100
commit11a7c84f858812c2a02d9a2b96415f2cad93447e (patch)
treea2f5bb508b897a2904fd0ae6d8c55a218641e154 /src/ec
parentfc7090b249ddfc7d5332ca8bee0f322607643960 (diff)
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>
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 e44a2781f5..c67b3b3872 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -70,6 +70,14 @@ static void h8_fn_ctrl_swap(int on)
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)
{
char ecfw[17];
@@ -202,6 +210,10 @@ static void h8_enable(device_t dev)
val = 0;
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)
val = 1;