linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Input: ads7846 - set input device bus type and product ID
@ 2021-09-10  4:50 Dmitry Torokhov
  2021-09-10  4:50 ` [PATCH 2/3] Input: ads7846 - use input_set_capability() Dmitry Torokhov
  2021-09-10  4:50 ` [PATCH 3/3] Input: ads7846 - do not attempt IRQ workaround when deferring probe Dmitry Torokhov
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2021-09-10  4:50 UTC (permalink / raw)
  To: Daniel Mack, Marco Felsch; +Cc: linux-input, linux-kernel

Set input device's bus type as BUS_SPI and use model as product ID.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/ads7846.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index eaa8714ad19d..a018481e9d8b 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1304,6 +1304,9 @@ static int ads7846_probe(struct spi_device *spi)
 	input_dev->name = ts->name;
 	input_dev->phys = ts->phys;
 
+	input_dev->id.bustype = BUS_SPI;
+	input_dev->id.product = pdata->model;
+
 	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 	input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
 	input_set_abs_params(input_dev, ABS_X,
-- 
2.33.0.309.g3052b89438-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] Input: ads7846 - use input_set_capability()
  2021-09-10  4:50 [PATCH 1/3] Input: ads7846 - set input device bus type and product ID Dmitry Torokhov
@ 2021-09-10  4:50 ` Dmitry Torokhov
  2021-09-10  4:50 ` [PATCH 3/3] Input: ads7846 - do not attempt IRQ workaround when deferring probe Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2021-09-10  4:50 UTC (permalink / raw)
  To: Daniel Mack, Marco Felsch; +Cc: linux-input, linux-kernel

Instead of manipulating capability bits directly use
input_set_capability(). Also stop setting EV_ABS explicitly as
input_set_abs_params() does it for us.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/ads7846.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index a018481e9d8b..0f973351bc67 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1307,8 +1307,7 @@ static int ads7846_probe(struct spi_device *spi)
 	input_dev->id.bustype = BUS_SPI;
 	input_dev->id.product = pdata->model;
 
-	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-	input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
+	input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
 	input_set_abs_params(input_dev, ABS_X,
 			pdata->x_min ? : 0,
 			pdata->x_max ? : MAX_12BIT,
-- 
2.33.0.309.g3052b89438-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 3/3] Input: ads7846 - do not attempt IRQ workaround when deferring probe
  2021-09-10  4:50 [PATCH 1/3] Input: ads7846 - set input device bus type and product ID Dmitry Torokhov
  2021-09-10  4:50 ` [PATCH 2/3] Input: ads7846 - use input_set_capability() Dmitry Torokhov
@ 2021-09-10  4:50 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2021-09-10  4:50 UTC (permalink / raw)
  To: Daniel Mack, Marco Felsch; +Cc: linux-input, linux-kernel

When request_irq() returns -EPORBE_DEFER we should abort probe and try
again later instead of trying to engage IRQ trigger workaround.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/ads7846.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 0f973351bc67..a25a77dd9a32 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1361,7 +1361,7 @@ static int ads7846_probe(struct spi_device *spi)
 	err = devm_request_threaded_irq(dev, spi->irq,
 					ads7846_hard_irq, ads7846_irq,
 					irq_flags, dev->driver->name, ts);
-	if (err && !pdata->irq_flags) {
+	if (err && err != -EPROBE_DEFER && !pdata->irq_flags) {
 		dev_info(dev,
 			"trying pin change workaround on irq %d\n", spi->irq);
 		irq_flags |= IRQF_TRIGGER_RISING;
-- 
2.33.0.309.g3052b89438-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-10  4:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10  4:50 [PATCH 1/3] Input: ads7846 - set input device bus type and product ID Dmitry Torokhov
2021-09-10  4:50 ` [PATCH 2/3] Input: ads7846 - use input_set_capability() Dmitry Torokhov
2021-09-10  4:50 ` [PATCH 3/3] Input: ads7846 - do not attempt IRQ workaround when deferring probe Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).