diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-07-20 21:09:54 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-08-08 12:17:22 -0400 |
commit | 23526d94977af1b006bb8d14639f2f33a444db7b (patch) | |
tree | 11c1fdd279972b3f50231aaa6bfc51f2d481fc38 /drivers/input/keyboard | |
parent | e08d9afa9345f9a0e13cfff1d116b3a9b10d9dcb (diff) |
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 <zonque@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/cap1106.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 { | |||
64 | struct input_dev *idev; | 64 | struct input_dev *idev; |
65 | 65 | ||
66 | /* config */ | 66 | /* config */ |
67 | unsigned int keycodes[CAP1106_NUM_CHN]; | 67 | unsigned short keycodes[CAP1106_NUM_CHN]; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static const struct reg_default cap1106_reg_defaults[] = { | 70 | static const struct reg_default cap1106_reg_defaults[] = { |
@@ -272,6 +272,12 @@ static int cap1106_i2c_probe(struct i2c_client *i2c_client, | |||
272 | for (i = 0; i < CAP1106_NUM_CHN; i++) | 272 | for (i = 0; i < CAP1106_NUM_CHN; i++) |
273 | __set_bit(priv->keycodes[i], priv->idev->keybit); | 273 | __set_bit(priv->keycodes[i], priv->idev->keybit); |
274 | 274 | ||
275 | __clear_bit(KEY_RESERVED, priv->idev->keybit); | ||
276 | |||
277 | priv->idev->keycode = priv->keycodes; | ||
278 | priv->idev->keycodesize = sizeof(priv->keycodes[0]); | ||
279 | priv->idev->keycodemax = ARRAY_SIZE(priv->keycodes); | ||
280 | |||
275 | priv->idev->id.vendor = CAP1106_MANUFACTURER_ID; | 281 | priv->idev->id.vendor = CAP1106_MANUFACTURER_ID; |
276 | priv->idev->id.product = CAP1106_PRODUCT_ID; | 282 | priv->idev->id.product = CAP1106_PRODUCT_ID; |
277 | priv->idev->id.version = rev; | 283 | priv->idev->id.version = rev; |