Commit 4a878a06 authored by Maxime Ripard's avatar Maxime Ripard Committed by Willy Tarreau

Input: tca8418 - use the interrupt trigger from the device tree

commit 259b77ef upstream.

The TCA8418 might be used using different interrupt triggers on various
boards. This is not working so far because the current code forces a
falling edge trigger.

The device tree already provides a trigger type, so let's use whatever it
sets up, and since we can be loaded without DT, keep the old behaviour for
the non-DT case.
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 840c242b
...@@ -274,6 +274,7 @@ static int tca8418_keypad_probe(struct i2c_client *client, ...@@ -274,6 +274,7 @@ static int tca8418_keypad_probe(struct i2c_client *client,
bool irq_is_gpio = false; bool irq_is_gpio = false;
int irq; int irq;
int error, row_shift, max_keys; int error, row_shift, max_keys;
unsigned long trigger = 0;
/* Copy the platform data */ /* Copy the platform data */
if (pdata) { if (pdata) {
...@@ -286,6 +287,7 @@ static int tca8418_keypad_probe(struct i2c_client *client, ...@@ -286,6 +287,7 @@ static int tca8418_keypad_probe(struct i2c_client *client,
cols = pdata->cols; cols = pdata->cols;
rep = pdata->rep; rep = pdata->rep;
irq_is_gpio = pdata->irq_is_gpio; irq_is_gpio = pdata->irq_is_gpio;
trigger = IRQF_TRIGGER_FALLING;
} else { } else {
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
int err; int err;
...@@ -360,9 +362,7 @@ static int tca8418_keypad_probe(struct i2c_client *client, ...@@ -360,9 +362,7 @@ static int tca8418_keypad_probe(struct i2c_client *client,
irq = gpio_to_irq(irq); irq = gpio_to_irq(irq);
error = devm_request_threaded_irq(dev, irq, NULL, tca8418_irq_handler, error = devm_request_threaded_irq(dev, irq, NULL, tca8418_irq_handler,
IRQF_TRIGGER_FALLING | trigger | IRQF_SHARED | IRQF_ONESHOT,
IRQF_SHARED |
IRQF_ONESHOT,
client->name, keypad_data); client->name, keypad_data);
if (error) { if (error) {
dev_err(dev, "Unable to claim irq %d; error %d\n", dev_err(dev, "Unable to claim irq %d; error %d\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment