Commit 23526d94 authored by Dmitry Torokhov's avatar Dmitry Torokhov

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: default avatarDaniel Mack <zonque@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent e08d9afa
...@@ -64,7 +64,7 @@ struct cap1106_priv { ...@@ -64,7 +64,7 @@ struct cap1106_priv {
struct input_dev *idev; struct input_dev *idev;
/* config */ /* config */
unsigned int keycodes[CAP1106_NUM_CHN]; unsigned short keycodes[CAP1106_NUM_CHN];
}; };
static const struct reg_default cap1106_reg_defaults[] = { static const struct reg_default cap1106_reg_defaults[] = {
...@@ -272,6 +272,12 @@ static int cap1106_i2c_probe(struct i2c_client *i2c_client, ...@@ -272,6 +272,12 @@ static int cap1106_i2c_probe(struct i2c_client *i2c_client,
for (i = 0; i < CAP1106_NUM_CHN; i++) for (i = 0; i < CAP1106_NUM_CHN; i++)
__set_bit(priv->keycodes[i], priv->idev->keybit); __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.vendor = CAP1106_MANUFACTURER_ID;
priv->idev->id.product = CAP1106_PRODUCT_ID; priv->idev->id.product = CAP1106_PRODUCT_ID;
priv->idev->id.version = rev; priv->idev->id.version = rev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment