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 ad74ebce0cdd063411670962585213b4dfb71fa5..604c7ade8df2c697a484c85600a0453209a21e20 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 004dcf3560fb5d908a9bbab49f6da48184714d36..da1c188562bc90ff39b6c1a6e0d634cd7584fca3 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 */