From: Linus Walleij <linus.walleij@linaro.org>
To: Ferruh Yigit <fery@cypress.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org
Cc: Henrik Rydberg <rydberg@bitmath.org>,
Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH] Input: cyttsp - Verbose error on soft reset
Date: Mon, 22 Mar 2021 23:13:49 +0100 [thread overview]
Message-ID: <20210322221349.1116666-1-linus.walleij@linaro.org> (raw)
The first thing the Cypress driver does when starting
up is to try a soft reset. This is the first point where
the driver SPI/I2C communication can fail, so put out some
nice debug text:
cyttsp-spi spi2.0: failed to send soft reset
Instead of just:
cyttsp-spi: probe of spi2.0 failed with error -5
This is more helpful.
Cc: Ferruh Yigit <fery@cypress.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/input/touchscreen/cyttsp_core.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c
index 73c854f35f33..b9772192b5ea 100644
--- a/drivers/input/touchscreen/cyttsp_core.c
+++ b/drivers/input/touchscreen/cyttsp_core.c
@@ -248,12 +248,16 @@ static int cyttsp_soft_reset(struct cyttsp *ts)
enable_irq(ts->irq);
retval = ttsp_send_command(ts, CY_SOFT_RESET_MODE);
- if (retval)
+ if (retval) {
+ dev_err(ts->dev, "failed to send soft reset\n");
goto out;
+ }
timeout = wait_for_completion_timeout(&ts->bl_ready,
msecs_to_jiffies(CY_DELAY_DFLT * CY_DELAY_MAX));
retval = timeout ? 0 : -EIO;
+ if (retval)
+ dev_err(ts->dev, "timeout waiting for soft reset\n");
out:
ts->state = CY_IDLE_STATE;
--
2.29.2
next reply other threads:[~2021-03-22 22:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 22:13 Linus Walleij [this message]
2021-03-23 3:57 ` [PATCH] Input: cyttsp - Verbose error on soft reset Dmitry Torokhov
2021-03-24 8:26 ` Linus Walleij
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=20210322221349.1116666-1-linus.walleij@linaro.org \
--to=linus.walleij@linaro.org \
--cc=dmitry.torokhov@gmail.com \
--cc=fery@cypress.com \
--cc=linux-input@vger.kernel.org \
--cc=rydberg@bitmath.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;
as well as URLs for NNTP newsgroup(s).