]> git.dujemihanovic.xyz Git - linux.git/commitdiff
Input: cros_ec_keyb - add 3 buttons for monitor function
authorjoewu (吳仲振) <joewu@msi.com>
Fri, 20 Jan 2023 17:17:02 +0000 (09:17 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 20 Jan 2023 17:29:08 +0000 (09:29 -0800)
Add 3 extra buttons: 'brightness up', 'brightness down'
and 'screen lock' to support monitor manipulating function.

Signed-off-by: Joe Wu <joewu@msi.com>
Link: https://lore.kernel.org/r/e23628e2cb464d238eb1c33a9e1e516b@msi.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/cros_ec_keyb.c
include/linux/platform_data/cros_ec_commands.h

index 6f435125ec03e29645fc43ed269a7c867e2487dc..e7ecfca838df4076f6b2301fb5496e5976593b99 100644 (file)
@@ -100,6 +100,21 @@ static const struct cros_ec_bs_map cros_ec_keyb_bs[] = {
                .code           = KEY_VOLUMEDOWN,
                .bit            = EC_MKBP_VOL_DOWN,
        },
+       {
+               .ev_type        = EV_KEY,
+               .code           = KEY_BRIGHTNESSUP,
+               .bit            = EC_MKBP_BRI_UP,
+       },
+       {
+               .ev_type        = EV_KEY,
+               .code           = KEY_BRIGHTNESSDOWN,
+               .bit            = EC_MKBP_BRI_DOWN,
+       },
+       {
+               .ev_type        = EV_KEY,
+               .code           = KEY_SCREENLOCK,
+               .bit            = EC_MKBP_SCREEN_LOCK,
+       },
 
        /* Switches */
        {
index 5744a2d746aabd6735a81b3ea5cae0e387752e57..a2073ed43972b346f85a0f534f6de0f85e729bc4 100644 (file)
@@ -3471,6 +3471,9 @@ struct ec_response_get_next_event_v1 {
 #define EC_MKBP_VOL_UP         1
 #define EC_MKBP_VOL_DOWN       2
 #define EC_MKBP_RECOVERY       3
+#define EC_MKBP_BRI_UP         4
+#define EC_MKBP_BRI_DOWN       5
+#define EC_MKBP_SCREEN_LOCK    6
 
 /* Switches */
 #define EC_MKBP_LID_OPEN       0