58 lines
2.0 KiB
Diff
58 lines
2.0 KiB
Diff
From c04eeec2d3c9d0706a19d1983883db433b9a94ec Mon Sep 17 00:00:00 2001
|
|
From: Ondrej Jirman <megous@megous.com>
|
|
Date: Mon, 18 Oct 2021 03:56:14 +0200
|
|
Subject: [PATCH 465/478] input: touchscreen: goodix: Respect IRQ flags from DT
|
|
when asked to
|
|
|
|
Sometimes the IRQ flags determined from toucschreen config don't
|
|
work well.
|
|
|
|
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
|
Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
|
|
---
|
|
drivers/input/touchscreen/goodix.c | 8 +++++++-
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
|
|
index 7cfef67c7..5b0a710ff 100644
|
|
--- a/drivers/input/touchscreen/goodix.c
|
|
+++ b/drivers/input/touchscreen/goodix.c
|
|
@@ -398,9 +398,13 @@ static void goodix_free_irq(struct goodix_ts_data *ts)
|
|
|
|
static int goodix_request_irq(struct goodix_ts_data *ts)
|
|
{
|
|
+ unsigned long irq_flags = ts->irq_flags;
|
|
+ if (ts->use_dt_irqflags)
|
|
+ irq_flags = IRQF_ONESHOT;
|
|
+
|
|
return devm_request_threaded_irq(&ts->client->dev, ts->client->irq,
|
|
NULL, goodix_ts_irq_handler,
|
|
- ts->irq_flags, ts->client->name, ts);
|
|
+ irq_flags, ts->client->name, ts);
|
|
}
|
|
|
|
static int goodix_check_cfg_8(struct goodix_ts_data *ts, const u8 *cfg, int len)
|
|
@@ -1184,6 +1188,7 @@ static int goodix_ts_probe(struct i2c_client *client,
|
|
if (!ts)
|
|
return -ENOMEM;
|
|
|
|
+ ts->use_dt_irqflags = of_property_read_bool(np, "use-dt-irq-flags");
|
|
ts->client = client;
|
|
i2c_set_clientdata(client, ts);
|
|
init_completion(&ts->firmware_loading_complete);
|
|
diff --git a/drivers/input/touchscreen/goodix.h b/drivers/input/touchscreen/goodix.h
|
|
index bd5d6abcc..83a7a687d 100644
|
|
--- a/drivers/input/touchscreen/goodix.h
|
|
+++ b/drivers/input/touchscreen/goodix.h
|
|
@@ -45,6 +45,7 @@ struct goodix_ts_data {
|
|
struct touchscreen_properties prop;
|
|
unsigned int max_touch_num;
|
|
unsigned int int_trigger_type;
|
|
+ bool use_dt_irqflags;
|
|
struct regulator *avdd28;
|
|
struct regulator *vddio;
|
|
struct gpio_desc *gpiod_int;
|
|
--
|
|
2.35.3
|
|
|