summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-09-12 10:11:09 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-09-27 17:34:00 -0700
commitf0bef75c593391198f2c9f855aae8e994a0e9293 (patch)
tree97d81d018689055355dd9b48b1c4ed14924aebfd
parent2e23b7a96372f855d4a006e82b183915e249e2ac (diff)
downloadtalos-op-linux-f0bef75c593391198f2c9f855aae8e994a0e9293.tar.gz
talos-op-linux-f0bef75c593391198f2c9f855aae8e994a0e9293.zip
Input: edt-ft5x06 - do not hardcode interrupt trigger type
Instead of hardcoding IRQ trigger type to IRQF_TRIGGER_FALLING, let's respect settings specified in device tree. To be compatible with older DTSes, if trigger type is not set up in DTS we'll set it to default (falling edge). Tested-by: Franklin S Cooper Jr <fcooper@ti.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt2
-rw-r--r--drivers/input/touchscreen/edt-ft5x06.c12
2 files changed, 10 insertions, 4 deletions
diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
index 9330d4d34cb9..bedd7ddc56aa 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
@@ -49,7 +49,7 @@ Example:
pinctrl-names = "default";
pinctrl-0 = <&edt_ft5x06_pins>;
interrupt-parent = <&gpio2>;
- interrupts = <5 0>;
+ interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
wake-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>;
};
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index ef8a7cddb017..7239c314c9e9 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/ratelimit.h>
+#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/i2c.h>
@@ -874,6 +875,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
{
struct edt_ft5x06_ts_data *tsdata;
struct input_dev *input;
+ unsigned long irq_flags;
int error;
char fw_version[EDT_NAME_LEN];
@@ -959,9 +961,13 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
input_set_drvdata(input, tsdata);
i2c_set_clientdata(client, tsdata);
- error = devm_request_threaded_irq(&client->dev, client->irq, NULL,
- edt_ft5x06_ts_isr,
- IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+ irq_flags = irq_get_trigger_type(client->irq);
+ if (irq_flags == IRQF_TRIGGER_NONE)
+ irq_flags = IRQF_TRIGGER_FALLING;
+ irq_flags |= IRQF_ONESHOT;
+
+ error = devm_request_threaded_irq(&client->dev, client->irq,
+ NULL, edt_ft5x06_ts_isr, irq_flags,
client->name, tsdata);
if (error) {
dev_err(&client->dev, "Unable to request touchscreen IRQ.\n");
OpenPOWER on IntegriCloud