aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 20:16:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 20:16:10 -0400
commitfc47912d9cda50ae6bd9ca30e97e8c03de5b7b60 (patch)
treed7da6ce3b23c1524e681ee33aa6e21d3c0586108 /drivers/input
parent06fe918e9f177dc2a0592b0ad40a6ce4920b2033 (diff)
parentdde3ada3d0069855eeb353707b2b0f946191cfd6 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: "A few drivers were updated with device tree bindings and others got a few small cleanups and fixes." Fix trivial conflict in drivers/input/keyboard/omap-keypad.c due to changes clashing with a whitespace cleanup. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (28 commits) Input: wacom - mark Intuos5 pad as in-prox when touching buttons Input: synaptics - adjust threshold for treating position values as negative Input: hgpk - use %*ph to dump small buffer Input: gpio_keys_polled - fix dt pdata->nbuttons Input: Add KD[GS]KBDIACRUC ioctls to the compatible list Input: omap-keypad - fixed formatting Input: tegra - move platform data header Input: wacom - add support for EMR on Cintiq 24HD touch Input: s3c2410_ts - make s3c_ts_pmops const Input: samsung-keypad - use of_get_child_count() helper Input: samsung-keypad - use of_match_ptr() Input: uinput - fix formatting Input: uinput - specify exact bit sizes on userspace APIs Input: uinput - mark failed submission requests as free Input: uinput - fix race that can block nonblocking read Input: uinput - return -EINVAL when read buffer size is too small Input: uinput - take event lock when fetching events from buffer Input: get rid of MATCH_BIT() macro Input: rotary-encoder - add DT bindings Input: rotary-encoder - constify platform data pointers ...
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/apm-power.c2
-rw-r--r--drivers/input/ff-core.c4
-rw-r--r--drivers/input/ff-memless.c14
-rw-r--r--drivers/input/input.c43
-rw-r--r--drivers/input/joydev.c2
-rw-r--r--drivers/input/keyboard/gpio_keys.c169
-rw-r--r--drivers/input/keyboard/gpio_keys_polled.c147
-rw-r--r--drivers/input/keyboard/omap-keypad.c6
-rw-r--r--drivers/input/keyboard/samsung-keypad.c10
-rw-r--r--drivers/input/keyboard/tegra-kbc.c2
-rw-r--r--drivers/input/misc/rotary_encoder.c140
-rw-r--r--drivers/input/misc/twl4030-pwrbutton.c1
-rw-r--r--drivers/input/misc/uinput.c197
-rw-r--r--drivers/input/mouse/hgpk.c9
-rw-r--r--drivers/input/mouse/synaptics.c31
-rw-r--r--drivers/input/mousedev.c9
-rw-r--r--drivers/input/sparse-keymap.c4
-rw-r--r--drivers/input/tablet/wacom_wac.c2
-rw-r--r--drivers/input/touchscreen/s3c2410_ts.c2
19 files changed, 520 insertions, 274 deletions
diff --git a/drivers/input/apm-power.c b/drivers/input/apm-power.c
index e90ee3d30613..650177a3c858 100644
--- a/drivers/input/apm-power.c
+++ b/drivers/input/apm-power.c
@@ -33,7 +33,7 @@ static void system_power_event(unsigned int keycode)
33} 33}
34 34
35static void apmpower_event(struct input_handle *handle, unsigned int type, 35static void apmpower_event(struct input_handle *handle, unsigned int type,
36 unsigned int code, int value) 36 unsigned int code, int value)
37{ 37{
38 /* only react on key down events */ 38 /* only react on key down events */
39 if (value != 1) 39 if (value != 1)
diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c
index 480eb9d9876a..f50f6dd92274 100644
--- a/drivers/input/ff-core.c
+++ b/drivers/input/ff-core.c
@@ -138,8 +138,8 @@ int input_ff_upload(struct input_dev *dev, struct ff_effect *effect,
138 138
139 if (effect->id == -1) { 139 if (effect->id == -1) {
140 for (id = 0; id < ff->max_effects; id++) 140 for (id = 0; id < ff->max_effects; id++)
141 if (!ff->effect_owners[id]) 141 if (!ff->effect_owners[id])
142 break; 142 break;
143 143
144 if (id >= ff->max_effects) { 144 if (id >= ff->max_effects) {
145 ret = -ENOSPC; 145 ret = -ENOSPC;
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index b107922514fb..74c0d8c6002a 100644
--- a/drivers/input/ff-memless.c
+++ b/drivers/input/ff-memless.c
@@ -72,12 +72,14 @@ static const struct ff_envelope *get_envelope(const struct ff_effect *effect)
72 static const struct ff_envelope empty_envelope; 72 static const struct ff_envelope empty_envelope;
73 73
74 switch (effect->type) { 74 switch (effect->type) {
75 case FF_PERIODIC: 75 case FF_PERIODIC:
76 return &effect->u.periodic.envelope; 76 return &effect->u.periodic.envelope;
77 case FF_CONSTANT: 77
78 return &effect->u.constant.envelope; 78 case FF_CONSTANT:
79 default: 79 return &effect->u.constant.envelope;
80 return &empty_envelope; 80
81 default:
82 return &empty_envelope;
81 } 83 }
82} 84}
83 85
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 5244f3d05b12..ace3f7c4226d 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -918,18 +918,10 @@ int input_set_keycode(struct input_dev *dev,
918} 918}
919EXPORT_SYMBOL(input_set_keycode); 919EXPORT_SYMBOL(input_set_keycode);
920 920
921#define MATCH_BIT(bit, max) \
922 for (i = 0; i < BITS_TO_LONGS(max); i++) \
923 if ((id->bit[i] & dev->bit[i]) != id->bit[i]) \
924 break; \
925 if (i != BITS_TO_LONGS(max)) \
926 continue;
927
928static const struct input_device_id *input_match_device(struct input_handler *handler, 921static const struct input_device_id *input_match_device(struct input_handler *handler,
929 struct input_dev *dev) 922 struct input_dev *dev)
930{ 923{
931 const struct input_device_id *id; 924 const struct input_device_id *id;
932 int i;
933 925
934 for (id = handler->id_table; id->flags || id->driver_info; id++) { 926 for (id = handler->id_table; id->flags || id->driver_info; id++) {
935 927
@@ -949,15 +941,32 @@ static const struct input_device_id *input_match_device(struct input_handler *ha
949 if (id->version != dev->id.version) 941 if (id->version != dev->id.version)
950 continue; 942 continue;
951 943
952 MATCH_BIT(evbit, EV_MAX); 944 if (!bitmap_subset(id->evbit, dev->evbit, EV_MAX))
953 MATCH_BIT(keybit, KEY_MAX); 945 continue;
954 MATCH_BIT(relbit, REL_MAX); 946
955 MATCH_BIT(absbit, ABS_MAX); 947 if (!bitmap_subset(id->keybit, dev->keybit, KEY_MAX))
956 MATCH_BIT(mscbit, MSC_MAX); 948 continue;
957 MATCH_BIT(ledbit, LED_MAX); 949
958 MATCH_BIT(sndbit, SND_MAX); 950 if (!bitmap_subset(id->relbit, dev->relbit, REL_MAX))
959 MATCH_BIT(ffbit, FF_MAX); 951 continue;
960 MATCH_BIT(swbit, SW_MAX); 952
953 if (!bitmap_subset(id->absbit, dev->absbit, ABS_MAX))
954 continue;
955
956 if (!bitmap_subset(id->mscbit, dev->mscbit, MSC_MAX))
957 continue;
958
959 if (!bitmap_subset(id->ledbit, dev->ledbit, LED_MAX))
960 continue;
961
962 if (!bitmap_subset(id->sndbit, dev->sndbit, SND_MAX))
963 continue;
964
965 if (!bitmap_subset(id->ffbit, dev->ffbit, FF_MAX))
966 continue;
967
968 if (!bitmap_subset(id->swbit, dev->swbit, SW_MAX))
969 continue;
961 970
962 if (!handler->match || handler->match(handler, dev)) 971 if (!handler->match || handler->match(handler, dev))
963 return id; 972 return id;
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 26043cc6a016..78f323ea1e4b 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -711,7 +711,7 @@ static long joydev_ioctl(struct file *file,
711 711
712 case JS_SET_ALL: 712 case JS_SET_ALL:
713 retval = copy_from_user(&joydev->glue, argp, 713 retval = copy_from_user(&joydev->glue, argp,
714 sizeof(joydev->glue)) ? -EFAULT: 0; 714 sizeof(joydev->glue)) ? -EFAULT : 0;
715 break; 715 break;
716 716
717 case JS_GET_ALL: 717 case JS_GET_ALL:
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index cbb1add43d5e..6a68041c261d 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -43,11 +43,9 @@ struct gpio_button_data {
43}; 43};
44 44
45struct gpio_keys_drvdata { 45struct gpio_keys_drvdata {
46 const struct gpio_keys_platform_data *pdata;
46 struct input_dev *input; 47 struct input_dev *input;
47 struct mutex disable_lock; 48 struct mutex disable_lock;
48 unsigned int n_buttons;
49 int (*enable)(struct device *dev);
50 void (*disable)(struct device *dev);
51 struct gpio_button_data data[0]; 49 struct gpio_button_data data[0];
52}; 50};
53 51
@@ -171,7 +169,7 @@ static ssize_t gpio_keys_attr_show_helper(struct gpio_keys_drvdata *ddata,
171 if (!bits) 169 if (!bits)
172 return -ENOMEM; 170 return -ENOMEM;
173 171
174 for (i = 0; i < ddata->n_buttons; i++) { 172 for (i = 0; i < ddata->pdata->nbuttons; i++) {
175 struct gpio_button_data *bdata = &ddata->data[i]; 173 struct gpio_button_data *bdata = &d