diff mbox series

cros_ec_keyb: Add 3 buttons for monitor function

Message ID 20221222021542.11706-1-joewu@msi.corp-partner.google.com (mailing list archive)
State Superseded
Headers show
Series cros_ec_keyb: Add 3 buttons for monitor function | expand

Commit Message

Joe Wu Dec. 22, 2022, 2:15 a.m. UTC
From: Joe Wu <joewu@msi.com>

Add 3 extra buttons: 'brightness up', 'brightness down'
and 'screen lock' to support monitor manipulating function.

Signed-off-by: Joe Wu <joewu@msi.com>
---

 drivers/input/keyboard/cros_ec_keyb.c          | 15 +++++++++++++++
 include/linux/platform_data/cros_ec_commands.h |  3 +++
 2 files changed, 18 insertions(+)

Comments

Greg Kroah-Hartman Dec. 22, 2022, 6:07 a.m. UTC | #1
On Thu, Dec 22, 2022 at 10:15:42AM +0800, Joe Wu wrote:
> --- 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

You forgot to use tabs :(
Greg Kroah-Hartman Dec. 22, 2022, 6:08 a.m. UTC | #2
On Thu, Dec 22, 2022 at 10:15:42AM +0800, Joe Wu wrote:
> From: Joe Wu <joewu@msi.com>

Does not match the "From:" line on your email, why?

thanks,

greg k-h
joewu(吳仲振) Dec. 22, 2022, 6:34 a.m. UTC | #3
Hi Greg,

I'll fix it. Thanks.

-----Original Message-----
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 
Sent: Thursday, December 22, 2022 2:08 PM
To: Joe Wu <joewu@msi.corp-partner.google.com>
Cc: LKML <linux-kernel@vger.kernel.org>; Furquan Shaikh <furquan@chromium.org>; Daisuke Nojiri <dnojiri@chromium.org>; Dmitry Torokhov <dmitry.torokhov@gmail.com>; Benson Leung <bleung@chromium.org>; Derek Huang <derekhuang@google.com>; Dustin L . Howett <dustin@howett.net>; joewu(吳仲振) <joewu@msi.com>; Guenter Roeck <groeck@chromium.org>; linux-input@vger.kernel.org; Xiang wangx <wangxiang@cdjrlc.com>; Gustavo A . R . Silva <gustavoars@kernel.org>; Prashant Malani <pmalani@chromium.org>; Douglas Anderson <dianders@chromium.org>; Tzung-Bi Shih <tzungbi@kernel.org>; chrome-platform@lists.linux.dev; Stephen Boyd <swboyd@chromium.org>; Jonathan Cameron <Jonathan.Cameron@huawei.com>; Sebastian Reichel <sebastian.reichel@collabora.com>; Tinghan Shen <tinghan.shen@mediatek.com>
Subject: Re: [PATCH] cros_ec_keyb: Add 3 buttons for monitor function

On Thu, Dec 22, 2022 at 10:15:42AM +0800, Joe Wu wrote:
> --- 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

You forgot to use tabs :(


*****CONFIDENTIAL INFORMATION*****

This email is intended only for the use of the person or entity to whom it is
addressed and contains information that may be subject to and/or may be
restricted from disclosure by contract or applicable law. If you are not the 
intended recipient of this email, be advised that any disclosure, copy, 
distribution or use of the contents of this message is strictly prohibited. 
If you are not the intended recipient of this email, please notify the sender 
that you have received this in error by replying to this message. Then, 
please delete it from your system. Our Privacy Policy is available here 
https://www.msi.com/page/privacy-policy. Thank you.
diff mbox series

Patch

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