[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221222021542.11706-1-joewu@msi.corp-partner.google.com>
Date: Thu, 22 Dec 2022 10:15:42 +0800
From: Joe Wu <joewu@....corp-partner.google.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Furquan Shaikh <furquan@...omium.org>,
Daisuke Nojiri <dnojiri@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Benson Leung <bleung@...omium.org>,
Derek Huang <derekhuang@...gle.com>,
"Dustin L . Howett" <dustin@...ett.net>, Joe Wu <joewu@....com>,
Guenter Roeck <groeck@...omium.org>,
linux-input@...r.kernel.org, Xiang wangx <wangxiang@...rlc.com>,
"Gustavo A . R . Silva" <gustavoars@...nel.org>,
Prashant Malani <pmalani@...omium.org>,
Douglas Anderson <dianders@...omium.org>,
Tzung-Bi Shih <tzungbi@...nel.org>,
chrome-platform@...ts.linux.dev,
Stephen Boyd <swboyd@...omium.org>,
Joe Wu <joewu@....corp-partner.google.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Sebastian Reichel <sebastian.reichel@...labora.com>,
Tinghan Shen <tinghan.shen@...iatek.com>
Subject: [PATCH] cros_ec_keyb: Add 3 buttons for monitor function
From: Joe Wu <joewu@....com>
Add 3 extra buttons: 'brightness up', 'brightness down'
and 'screen lock' to support monitor manipulating function.
Signed-off-by: Joe Wu <joewu@....com>
---
drivers/input/keyboard/cros_ec_keyb.c | 15 +++++++++++++++
include/linux/platform_data/cros_ec_commands.h | 3 +++
2 files changed, 18 insertions(+)
diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 6f435125ec03..e7ecfca838df 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -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 */
{
diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
index 5744a2d746aa..502f0397a402 100644
--- a/include/linux/platform_data/cros_ec_commands.h
+++ b/include/linux/platform_data/cros_ec_commands.h
@@ -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
--
2.17.1
Powered by blists - more mailing lists