linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cros_ec_keyb: Add 3 buttons for monitor function
@ 2022-12-22  6:39 Joe Wu
  2022-12-22  6:49 ` Greg Kroah-Hartman
  2023-01-20 11:26 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 20+ messages in thread
From: Joe Wu @ 2022-12-22  6:39 UTC (permalink / raw)
  To: LKML
  Cc: Xiang wangx, Stephen Boyd, Prashant Malani, linux-input,
	Dmitry Torokhov, chrome-platform, Benson Leung,
	Gustavo A . R . Silva, Guenter Roeck, Douglas Anderson,
	Greg Kroah-Hartman, Daisuke Nojiri, Derek Huang,
	Dustin L . Howett, Joe Wu, Furquan Shaikh, Jonathan Cameron,
	Lee Jones, Tzung-Bi Shih

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(+)

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..a2073ed43972 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


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [PATCH] cros_ec_keyb: Add 3 buttons for monitor function
@ 2022-12-22  2:15 Joe Wu
  2022-12-22  6:07 ` Greg Kroah-Hartman
  2022-12-22  6:08 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 20+ messages in thread
From: Joe Wu @ 2022-12-22  2:15 UTC (permalink / raw)
  To: LKML
  Cc: Furquan Shaikh, Daisuke Nojiri, Greg Kroah-Hartman,
	Dmitry Torokhov, Benson Leung, Derek Huang, Dustin L . Howett,
	Joe Wu, Guenter Roeck, linux-input, Xiang wangx,
	Gustavo A . R . Silva, Prashant Malani, Douglas Anderson,
	Tzung-Bi Shih, chrome-platform, Stephen Boyd, Joe Wu,
	Jonathan Cameron, Sebastian Reichel, Tinghan Shen

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(+)

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


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [PATCH] cros_ec_keyb: Add 3 buttons for monitor function
@ 2022-12-20  8:02 Joe Wu
  2022-12-21  7:28 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 20+ messages in thread
From: Joe Wu @ 2022-12-20  8:02 UTC (permalink / raw)
  To: LKML
  Cc: Tzung-Bi Shih, Dustin L . Howett, Benson Leung, Dmitry Torokhov,
	Xiang wangx, linux-input, Prashant Malani, Stephen Boyd,
	Douglas Anderson, Daisuke Nojiri, Furquan Shaikh,
	Gustavo A . R . Silva, Derek Huang, Joe Wu, chrome-platform,
	Guenter Roeck, Greg Kroah-Hartman, Jonathan Cameron,
	Tinghan Shen

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

Signed-off-by: Joe Wu <joewu@msi.corp-partner.google.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


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [PATCH] cros_ec_keyb: Add 3 buttons for monitor function
@ 2022-12-15  6:15 Joe Wu
  2022-12-15 22:01 ` Dmitry Torokhov
  2022-12-15 22:58 ` Prashant Malani
  0 siblings, 2 replies; 20+ messages in thread
From: Joe Wu @ 2022-12-15  6:15 UTC (permalink / raw)
  To: LKML
  Cc: Stephen Boyd, Xiang wangx, linux-input, Derek Huang, Joe Wu,
	Greg Kroah-Hartman, Benson Leung, Daisuke Nojiri,
	Prashant Malani, Furquan Shaikh, Tzung-Bi Shih, chrome-platform,
	Douglas Anderson, Dustin L . Howett, Dmitry Torokhov,
	Guenter Roeck, Gustavo A . R . Silva, Sebastian Reichel

This patch is to add extra 3 buttons: 'brightness up',
'brightness down' and 'leave PC(cros) mode' to support
monitor navigation function.

Signed-off-by: Joe Wu <joewu@msi.corp-partner.google.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 c14136b733a9..bf1cf0b782d2 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_F13,
+		.bit            = EC_MKBP_CROS_LEAVE,
+	},
 
 	/* Switches */
 	{
diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
index 5744a2d746aa..79218da8a8cb 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_CROS_LEAVE      6
 
 /* Switches */
 #define EC_MKBP_LID_OPEN	0
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-01-24  6:14 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22  6:39 [PATCH] cros_ec_keyb: Add 3 buttons for monitor function Joe Wu
2022-12-22  6:49 ` Greg Kroah-Hartman
2023-01-20 11:26 ` Greg Kroah-Hartman
2023-01-20 17:24   ` Dmitry Torokhov
2023-01-21  7:26     ` Greg Kroah-Hartman
2023-01-24  6:14       ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2022-12-22  2:15 Joe Wu
2022-12-22  6:07 ` Greg Kroah-Hartman
2022-12-22  6:34   ` joewu(吳仲振)
2022-12-22  6:08 ` Greg Kroah-Hartman
2022-12-20  8:02 Joe Wu
2022-12-21  7:28 ` Greg Kroah-Hartman
2022-12-22  1:50   ` joewu(吳仲振)
2022-12-22  5:51     ` Greg Kroah-Hartman
2022-12-15  6:15 Joe Wu
2022-12-15 22:01 ` Dmitry Torokhov
2022-12-16  1:36   ` joewu(吳仲振)
2022-12-16 19:19     ` Dmitry Torokhov
2022-12-15 22:58 ` Prashant Malani
2022-12-16  1:17   ` joewu(吳仲振)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).