From: Guenter Roeck <linux@roeck-us.net>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Chris Healy <cphealy@gmail.com>, Nick Dyer <nick@shmanahar.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH] Input: synaptics-rmi4 - Make interrupt support in I2C driver optional
Date: Sun, 2 Oct 2016 10:35:48 -0700 [thread overview]
Message-ID: <1475429748-5178-1-git-send-email-linux@roeck-us.net> (raw)
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
reply other threads:[~2016-10-02 17:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1475429748-5178-1-git-send-email-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=bjorn.andersson@linaro.org \
--cc=cphealy@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nick@shmanahar.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®