summaryrefslogtreecommitdiff
path: root/src/ec/lenovo/h8/h8.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ec/lenovo/h8/h8.c')
-rw-r--r--src/ec/lenovo/h8/h8.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index 2b959ceea1..3a99b52dd8 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -86,6 +86,14 @@ static void h8_sticky_fn(int on)
ec_clr_bit(0x0, 3);
}
+static void f1_to_f12_as_primary(int on)
+{
+ if (on)
+ ec_set_bit(0x3b, 3);
+ else
+ ec_clr_bit(0x3b, 3);
+}
+
static void h8_log_ec_version(void)
{
char ecfw[17];
@@ -334,6 +342,12 @@ static void h8_enable(struct device *dev)
val = 0;
h8_sticky_fn(val);
+ if (CONFIG(H8_HAS_PRIMARY_FN_KEYS)) {
+ if (get_option(&val, "f1_to_f12_as_primary") != CB_SUCCESS)
+ val = 1;
+ f1_to_f12_as_primary(val);
+ }
+
if (get_option(&val, "first_battery") != CB_SUCCESS)
val = PRIMARY_BATTERY;
h8_charge_priority(val);