input: cros_ec_keyb: Add Tablet Mode switch
authorGwendal Grignou <gwendal@chromium.org>
Fri, 27 Jan 2017 10:52:35 +0000 (11:52 +0100)
committerLee Jones <lee.jones@linaro.org>
Mon, 13 Feb 2017 09:25:19 +0000 (09:25 +0000)
Add switch to report tablet mode.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Enric Balletbo Serra <enric.balletbo@collabora.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/input/keyboard/cros_ec_keyb.c
include/linux/mfd/cros_ec_commands.h

index ad74ebc..604c7ad 100644 (file)
@@ -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,
+       },
 };
 
 /*
index 004dcf3..da1c188 100644 (file)
@@ -2068,6 +2068,7 @@ struct ec_response_get_next_event {
 
 /* Switches */
 #define EC_MKBP_LID_OPEN       0
+#define EC_MKBP_TABLET_MODE    1
 
 /*****************************************************************************/
 /* Temperature sensor commands */