aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2016-11-21 09:21:27 -0500
committerJiri Kosina <jkosina@suse.cz>2016-11-28 08:42:53 -0500
commit00f7fea5da4986af93457b625a379d5e3ee51754 (patch)
treec24e7a64e28ed9968eca8cfb0c1b1221a6963533
parent71af01a8c85ad89449209594133bdfdfaa9f1e2a (diff)
HID: i2c-hid: force the IRQ level trigger only when not set
Instead of forcing the level trigger of the IRQ, we can count on ACPI or OF to set it up for us. The first release of the HID over I2C specification mentioned that the level trigger needed to be active low. In the latest version of the specification, there is no such explicit mention, so it's better to not assume one. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index ce518795cb30..8d53efe04dad 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -22,6 +22,7 @@
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/input.h> 24#include <linux/input.h>
25#include <linux/irq.h>
25#include <linux/delay.h> 26#include <linux/delay.h>
26#include <linux/slab.h> 27#include <linux/slab.h>
27#include <linux/pm.h> 28#include <linux/pm.h>
@@ -858,13 +859,16 @@ static struct hid_ll_driver i2c_hid_ll_driver = {
858static int i2c_hid_init_irq(struct i2c_client *client) 859static int i2c_hid_init_irq(struct i2c_client *client)
859{ 860{
860 struct i2c_hid *ihid = i2c_get_clientdata(client); 861 struct i2c_hid *ihid = i2c_get_clientdata(client);
862 unsigned long irqflags = 0;
861 int ret; 863 int ret;
862 864
863 dev_dbg(&client->dev, "Requesting IRQ: %d\n", client->irq); 865 dev_dbg(&client->dev, "Requesting IRQ: %d\n", client->irq);
864 866
867 if (!irq_get_trigger_type(client->irq))
868 irqflags = IRQF_TRIGGER_LOW;
869
865 ret = request_threaded_irq(client->irq, NULL, i2c_hid_irq, 870 ret = request_threaded_irq(client->irq, NULL, i2c_hid_irq,
866 IRQF_TRIGGER_LOW | IRQF_ONESHOT, 871 irqflags | IRQF_ONESHOT, client->name, ihid);
867 client->name, ihid);
868 if (ret < 0) { 872 if (ret < 0) {
869 dev_warn(&client->dev, 873 dev_warn(&client->dev,
870 "Could not register for %s interrupt, irq = %d," 874 "Could not register for %s interrupt, irq = %d,"