linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: synaptics-rmi4 - Make interrupt support in  I2C driver optional
@ 2016-10-02 17:35 Guenter Roeck
  0 siblings, 0 replies; only message in thread
From: Guenter Roeck @ 2016-10-02 17:35 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chris Healy, Nick Dyer, Bjorn Andersson, linux-kernel,
	linux-input, Guenter Roeck

While interrupt support is necessary for the touchscreen to work as input
device, it is sometimes convenient to be able to instantiate the I2C
transport driver without it, for example for testing and for debugging
functionality which does not rely on interrupt support.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Applies on top of the previously submitted patch fixing error handling.

 drivers/input/rmi4/rmi_i2c.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/input/rmi4/rmi_i2c.c b/drivers/input/rmi4/rmi_i2c.c
index 1ebc2c1debae..c1f5ed0bce0b 100644
--- a/drivers/input/rmi4/rmi_i2c.c
+++ b/drivers/input/rmi4/rmi_i2c.c
@@ -321,9 +321,14 @@ static int rmi_i2c_probe(struct i2c_client *client,
 	if (retval)
 		return retval;
 
-	retval = rmi_i2c_init_irq(client);
-	if (retval < 0)
-		return retval;
+	if (rmi_i2c->irq) {
+		retval = rmi_i2c_init_irq(client);
+		if (retval < 0)
+			return retval;
+	} else {
+		dev_warn(&client->dev,
+			 "No interrupt support, touchscreen will not report input events\n");
+	}
 
 	dev_info(&client->dev, "registered rmi i2c driver at %#04x.\n",
 			client->addr);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-02 17:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-02 17:35 [PATCH] Input: synaptics-rmi4 - Make interrupt support in I2C driver optional Guenter Roeck

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).