From: Dmitry Torokhov Date: Mon, 21 Jul 2014 01:09:54 +0000 (-0700) Subject: Input: cap1106 - allow changing key mapping from userspace X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=23526d94977af1b006bb8d14639f2f33a444db7b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Input: cap1106 - allow changing key mapping from userspace Wire up support for EVIOC{G|S}KEYCODE to allow users change key mappings from userspace. Reviewed-by: Daniel Mack Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/keyboard/cap1106.c b/drivers/input/keyboard/cap1106.c index f7d7a0d4ab4e..180b184ab90f 100644 --- a/drivers/input/keyboard/cap1106.c +++ b/drivers/input/keyboard/cap1106.c @@ -64,7 +64,7 @@ struct cap1106_priv { struct input_dev *idev; /* config */ - unsigned int keycodes[CAP1106_NUM_CHN]; + unsigned short keycodes[CAP1106_NUM_CHN]; }; static const struct reg_default cap1106_reg_defaults[] = { @@ -272,6 +272,12 @@ static int cap1106_i2c_probe(struct i2c_client *i2c_client, for (i = 0; i < CAP1106_NUM_CHN; i++) __set_bit(priv->keycodes[i], priv->idev->keybit); + __clear_bit(KEY_RESERVED, priv->idev->keybit); + + priv->idev->keycode = priv->keycodes; + priv->idev->keycodesize = sizeof(priv->keycodes[0]); + priv->idev->keycodemax = ARRAY_SIZE(priv->keycodes); + priv->idev->id.vendor = CAP1106_MANUFACTURER_ID; priv->idev->id.product = CAP1106_PRODUCT_ID; priv->idev->id.version = rev;