[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1475429748-5178-1-git-send-email-linux@roeck-us.net>
Date: Sun, 2 Oct 2016 10:35:48 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Chris Healy <cphealy@...il.com>, Nick Dyer <nick@...anahar.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
Guenter Roeck <linux@...ck-us.net>
Subject: [PATCH] Input: synaptics-rmi4 - Make interrupt support in I2C driver optional
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@...ck-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
Powered by blists - more mailing lists