summaryrefslogtreecommitdiffstats
path: root/drivers/hid/i2c-hid
diff options
context:
space:
mode:
authorLinus Torvalds2015-02-24 17:25:44 +0100
committerLinus Torvalds2015-02-24 17:25:44 +0100
commitc4bbb39806cf4098d7a01a779b40171047004046 (patch)
treefe47522dd8a41b11d0548b6f55fbb77b62d22226 /drivers/hid/i2c-hid
parentLinux 4.0-rc1 (diff)
parentHID: microsoft: Add ID for NE7K wireless keyboard (diff)
downloadkernel-qcow2-linux-c4bbb39806cf4098d7a01a779b40171047004046.tar.gz
kernel-qcow2-linux-c4bbb39806cf4098d7a01a779b40171047004046.tar.xz
kernel-qcow2-linux-c4bbb39806cf4098d7a01a779b40171047004046.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID fixes from Jiri Kosina: - a few fixes to Sony driver (rmmod breakage, spinlock initialization), by Antonio Ospite, Frank Praznik and Jiri Kosina - fix for wMaxInputLength handling regression in i2c-hid, by Seth Forshee - IRQ safety spinlock fix in sensor hub driver, by Srinivas Pandruvada - IRQ level sensitivity fix to i2c-hid to be compliant with the spec, by Mika Westerberg - a couple device ID additions piggy-backing on top of that * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: microsoft: Add ID for NE7K wireless keyboard HID: i2c-hid: Limit reads to wMaxInputLength bytes for input events HID: sony: fix uninitialized per-controller spinlock HID: sony: initialize sony_dev_list_lock properly HID: sony: Fix a WARNING shown when rmmod-ing the driver HID: sensor-hub: correct dyn_callback_lock IRQ-safe change HID: hid-sensor-hub: Correct documentation HID: saitek: add USB ID for older R.A.T. 7 HID: i2c-hid: The interrupt should be level sensitive HID: wacom: Add missing ABS_MISC event and feature declaration for 27QHD
Diffstat (limited to 'drivers/hid/i2c-hid')
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index d43e967e7533..36053f33d6d9 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -370,7 +370,10 @@ static int i2c_hid_hwreset(struct i2c_client *client)
static void i2c_hid_get_input(struct i2c_hid *ihid)
{
int ret, ret_size;
- int size = ihid->bufsize;
+ int size = le16_to_cpu(ihid->hdesc.wMaxInputLength);
+
+ if (size > ihid->bufsize)
+ size = ihid->bufsize;
ret = i2c_master_recv(ihid->client, ihid->inbuf, size);
if (ret != size) {
@@ -785,7 +788,7 @@ static int i2c_hid_init_irq(struct i2c_client *client)
dev_dbg(&client->dev, "Requesting IRQ: %d\n", client->irq);
ret = request_threaded_irq(client->irq, NULL, i2c_hid_irq,
- IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+ IRQF_TRIGGER_LOW | IRQF_ONESHOT,
client->name, ihid);
if (ret < 0) {
dev_warn(&client->dev,