Thread (5 messages) flat view 5 messages, 3 authors, 2017-02-13
STALE3511d

[PATCH] input: cros_ec_keyb: Add Tablet Mode switch.

From: Enric Balletbo i Serra <hidden>
Date: 2017-01-27 11:01:14
Also in: lkml
Subsystem: input (keyboard, mouse, joystick, touchscreen) drivers, multifunction devices (mfd), the rest · Maintainers: Dmitry Torokhov, Lee Jones, Linus Torvalds

From: Gwendal Grignou <redacted>

Add switch to report tablet mode.

Signed-off-by: Gwendal Grignou <redacted>
Signed-off-by: Enric Balletbo Serra <redacted>
---

I should be included this patch in the following patch series but I missed the
patch and found later. Though it can be applied separetely.

 - [PATCH 1/2] mfd: cros-ec: Update cros_ec_commands.h for buttons and switches
 - [PATCH 2/2] input: cros_ec_keyb: Add non-matrix buttons and switches

 drivers/input/keyboard/cros_ec_keyb.c | 5 +++++
 include/linux/mfd/cros_ec_commands.h  | 1 +
 2 files changed, 6 insertions(+)
diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index ad74ebc..604c7ad 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -111,6 +111,11 @@ static const struct cros_ec_bs_map cros_ec_keyb_bs[] = {
 		.bit		= EC_MKBP_LID_OPEN,
 		.inverted	= true,
 	},
+	{
+		.ev_type	= EV_SW,
+		.code		= SW_TABLET_MODE,
+		.bit		= EC_MKBP_TABLET_MODE,
+	},
 };
 
 /*
diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h
index a01dde4..e793e9f 100644
--- a/include/linux/mfd/cros_ec_commands.h
+++ b/include/linux/mfd/cros_ec_commands.h
@@ -2094,6 +2094,7 @@ struct ec_response_get_next_event {
 
 /* Switches */
 #define EC_MKBP_LID_OPEN	0
+#define EC_MKBP_TABLET_MODE	1
 
 /*****************************************************************************/
 /* Temperature sensor commands */
-- 
2.9.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help