linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthijs Kooijman <matthijs@stdin.nl>
To: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Matthijs Kooijman <matthijs@stdin.nl>
Subject: [PATCH] Input: ilitek_ts_i2c: Use gpiod_set_value_cansleep()
Date: Wed, 15 May 2024 16:49:44 +0200	[thread overview]
Message-ID: <20240515144943.678260-1-matthijs@stdin.nl> (raw)

Use gpiod_set_value_cansleep in the ilitek_reset function (called only
from ilitek_ts_i2c_probe and ilitek_resume).

Without this change, the driver may print a warning if the reset pin is
connected to a GPIO chip which can sleep (e.g. a GPIO expander):

WARNING: CPU: 1 PID: 578 at gpiod_set_value+0x5c/0xd0

This commit is modeled after commit 7c977019c53ed (leds: lp55xx: Use
gpiod_set_value_cansleep(), 2023-09-18)

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
---
 drivers/input/touchscreen/ilitek_ts_i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/ilitek_ts_i2c.c b/drivers/input/touchscreen/ilitek_ts_i2c.c
index fc4e39b6651a4..236c332de6cdc 100644
--- a/drivers/input/touchscreen/ilitek_ts_i2c.c
+++ b/drivers/input/touchscreen/ilitek_ts_i2c.c
@@ -391,9 +391,9 @@ static const struct ilitek_protocol_map ptl_func_map[] = {
 static void ilitek_reset(struct ilitek_ts_data *ts, int delay)
 {
 	if (ts->reset_gpio) {
-		gpiod_set_value(ts->reset_gpio, 1);
+		gpiod_set_value_cansleep(ts->reset_gpio, 1);
 		mdelay(10);
-		gpiod_set_value(ts->reset_gpio, 0);
+		gpiod_set_value_cansleep(ts->reset_gpio, 0);
 		mdelay(delay);
 	}
 }
-- 
2.40.1


             reply	other threads:[~2024-05-15 15:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 14:49 Matthijs Kooijman [this message]
2024-05-15 23:19 ` [PATCH] Input: ilitek_ts_i2c: Use gpiod_set_value_cansleep() Dmitry Torokhov

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=20240515144943.678260-1-matthijs@stdin.nl \
    --to=matthijs@stdin.nl \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.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).