Message ID | 20221202105800.653982-1-linux@rasmusvillemoes.dk |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp763937wrr; Fri, 2 Dec 2022 02:59:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Oqm6wifduZwU4hJTyyBOBuPIqCH3I5vf3wfyhjAuAlRP3XOVJ0/NfYCTPjqbqUi8MX0SE X-Received: by 2002:a17:906:90c9:b0:7b2:b783:f26b with SMTP id v9-20020a17090690c900b007b2b783f26bmr56527976ejw.406.1669978783158; Fri, 02 Dec 2022 02:59:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669978783; cv=none; d=google.com; s=arc-20160816; b=WebsxaU+T5R/Q4by1mJcJ0LPyZyDBdzBt6HMILWQqg/eWsilgAPlQAhRUzjqPGJmIn 4I7q+NEgFsD92p0bqTIFuG1EuAgLvv5PW/102rbnTWKb21dfFbGl2hItL74jKdxhZhpG xqQmPYUDoiZAhIdeybzrMN3NM6Yxu7EGlXIpO4tN+F7PphcholCJ7o4zFoyVgfsH8mI2 ymMEkHGfpTLRQ9U7Dd/e1fWF3pyTzDO8otlZToiAS7l0hV0P1ZIyCAsNswidN0+bmYOd MWpE0kDGs4a6chByCuGmdLkpiTuJUCS8nJSq0bOJ69QQc/5yx3Px+2uPQtra3FFz2inL p64A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=asePIDAduz3wjwHekIjxIWyoaIECGFH8vErA/u3bLN4=; b=xPG85KE9OCrO63TTdgxgiHygHxkLHV8PgDI1ls2GZkGY0fmagnd6ZZ3v4UxlNBDHaV sYhH3+KQKeTAam4q8Z5EQjK4hj1E4fmcu/PEtkuiEIo3dd7Fpvbdh3/+3AgKObRZGc0F mwPz7pYDr6VKFyk92ozh7c2af4cE9IjvhZGuEe6wdfU3N1Q256ZZ8jGG0ouvhK7OH8W7 bxVa4+7kVMK7WehypadPl3db0YuJherLMqTq0JcRtxV0JTeqjxOF+pM3XbCp/sdBBlNf Jh43KNiEk3zBKgQc7YsA+N3B9mEI/eNOEWAOzUdIERuWzuF6Aw708WIUvLm0tC56qxOM L5iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=bWhJrmXj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r21-20020a170906705500b0079744630e4asi582241ejj.780.2022.12.02.02.59.19; Fri, 02 Dec 2022 02:59:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=bWhJrmXj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232312AbiLBK6R (ORCPT <rfc822;lhua1029@gmail.com> + 99 others); Fri, 2 Dec 2022 05:58:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231929AbiLBK6O (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 2 Dec 2022 05:58:14 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CB40716DD for <linux-kernel@vger.kernel.org>; Fri, 2 Dec 2022 02:58:12 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id c1so6839447lfi.7 for <linux-kernel@vger.kernel.org>; Fri, 02 Dec 2022 02:58:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=asePIDAduz3wjwHekIjxIWyoaIECGFH8vErA/u3bLN4=; b=bWhJrmXjdq55NOaGcwX/Atz3vFl/oz3eIvphok+SzkjhWZydkEk9JsO4pC/rGw+HYG QfdTuTpMRYZ1UnLUhZhmULmAksl2y3p2hSV8ijlP/U58/H0R5fn5WeXxpnDVSq31K/5E Kvnnijeqp+AfgnM5QnHt/scqsVOJL/T7KmJgY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=asePIDAduz3wjwHekIjxIWyoaIECGFH8vErA/u3bLN4=; b=mxfPxhrW6NbJg9WAptjPxh+vKwPiUyLWHduTvTv9m10bKpj3INfXa2AQMYJ6SxmLWY DKGPk5QjjLk5+dbBoYztyaVMeog5O5W1KhkUKtVJtc7QPVcwjZv1XEJE4ouLM4NctbRg 4H6rI8dnO4QgyPkyALyC8Ua7w7blLGZRTAg6d/l2Jxwk+nQs4U2KJxn00tJSpF0HUeSP hm+dJxDpXbzYyGM87DDmPzEG3VBi/Ij79QytQEqdyR5aePnD99h1fm0YIidc/7E5MCcQ gVqe/g0oTziQA5Hv7VSSISwr+ZO01TOfJ/Pq0NZTY2/hg3a5SIiQmUL4M3fUA5xoOG3+ oq7A== X-Gm-Message-State: ANoB5pmpC1E/ESezkqXTIoiAv+33SEjuMUUghksTWXfdwDDKWqdX1Q+p 2YNvuoLq/Jp1wt1KwvxQJsI9Nw== X-Received: by 2002:a05:6512:b8d:b0:4b4:ec87:ef9d with SMTP id b13-20020a0565120b8d00b004b4ec87ef9dmr15987504lfv.70.1669978690303; Fri, 02 Dec 2022 02:58:10 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id dw8-20020a0565122c8800b004998d9ccb62sm982682lfb.99.2022.12.02.02.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 02:58:09 -0800 (PST) From: Rasmus Villemoes <linux@rasmusvillemoes.dk> To: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>, Oliver Graute <oliver.graute@kococonnector.com>, Rasmus Villemoes <linux@rasmusvillemoes.dk>, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: edt-ft5x06 - always do msleep(300) during initialization Date: Fri, 2 Dec 2022 11:57:59 +0100 Message-Id: <20221202105800.653982-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751099672324628029?= X-GMAIL-MSGID: =?utf-8?q?1751099672324628029?= |
Series |
Input: edt-ft5x06 - always do msleep(300) during initialization
|
|
Commit Message
Rasmus Villemoes
Dec. 2, 2022, 10:57 a.m. UTC
We have a board with an FT5446, which is close enough to a
FT5506 (i.e. it also supports up to 10 touch points and has similar
register layout) for this driver to work. However, on our board the
iovcc and vcc regulators are indeed controllable (so not always-on),
but there is no reset or wakeup gpio hooked up.
Without a large enough delay between the regulator_enable() calls and
edt_ft5x06_ts_identify(), the first edt_ft5x06_ts_readwrite() call
fails with -ENXIO and thus the device fails to probe. So
unconditionally do an mdelay(300) instead of only when a reset-gpio is
present.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
drivers/input/touchscreen/edt-ft5x06.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
+ Mark Hi Rasmus, On Fri, Dec 02, 2022 at 11:57:59AM +0100, Rasmus Villemoes wrote: > We have a board with an FT5446, which is close enough to a > FT5506 (i.e. it also supports up to 10 touch points and has similar > register layout) for this driver to work. However, on our board the > iovcc and vcc regulators are indeed controllable (so not always-on), > but there is no reset or wakeup gpio hooked up. > > Without a large enough delay between the regulator_enable() calls and > edt_ft5x06_ts_identify(), the first edt_ft5x06_ts_readwrite() call > fails with -ENXIO and thus the device fails to probe. So > unconditionally do an mdelay(300) instead of only when a reset-gpio is > present. > > Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> This is just my $.02, but it does not seem we are on the correct path here. 300 ms sounds more like bulk capacitor charge time rather than anything to do with this specific IC; is that a reasonable assumption? Normally, we want to do the following: 1. Enable regulator 2. Wait for voltage rail to stabilize (RC time constant) 3. Wait for any applicable POR delay (IC datasheet) 4. Deassert reset 5. Wait for any applicable reset delay (IC datasheet) 6. Start communication Here we are dealing with step (2), which is board dependent. Some may require more time (larger bulk capacitance), same may require less or none at all (e.g. voltage rail enabled by default and stable by the time the kernel starts). I think the right solution is to introduce a variant of regulator_enable() which does not return until a delay passes, where that delay is specified in the regulator's child node. Unless something like this exists? > --- > drivers/input/touchscreen/edt-ft5x06.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c > index 9ac1378610bc..8bafa123083c 100644 > --- a/drivers/input/touchscreen/edt-ft5x06.c > +++ b/drivers/input/touchscreen/edt-ft5x06.c > @@ -1239,8 +1239,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, > if (tsdata->reset_gpio) { > usleep_range(5000, 6000); > gpiod_set_value_cansleep(tsdata->reset_gpio, 0); > - msleep(300); > } > + msleep(300); > > input = devm_input_allocate_device(&client->dev); > if (!input) { > -- > 2.37.2 > Kind regards, Jeff LaBundy
Hi Jeff, On Fri, Dec 02, 2022 at 12:23:50PM -0600, Jeff LaBundy wrote: > + Mark > > Hi Rasmus, > > On Fri, Dec 02, 2022 at 11:57:59AM +0100, Rasmus Villemoes wrote: > > We have a board with an FT5446, which is close enough to a > > FT5506 (i.e. it also supports up to 10 touch points and has similar > > register layout) for this driver to work. However, on our board the > > iovcc and vcc regulators are indeed controllable (so not always-on), > > but there is no reset or wakeup gpio hooked up. > > > > Without a large enough delay between the regulator_enable() calls and > > edt_ft5x06_ts_identify(), the first edt_ft5x06_ts_readwrite() call > > fails with -ENXIO and thus the device fails to probe. So > > unconditionally do an mdelay(300) instead of only when a reset-gpio is > > present. > > > > Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> > > This is just my $.02, but it does not seem we are on the correct path > here. 300 ms sounds more like bulk capacitor charge time rather than > anything to do with this specific IC; is that a reasonable assumption? > > Normally, we want to do the following: > > 1. Enable regulator > 2. Wait for voltage rail to stabilize (RC time constant) > 3. Wait for any applicable POR delay (IC datasheet) > 4. Deassert reset > 5. Wait for any applicable reset delay (IC datasheet) > 6. Start communication > > Here we are dealing with step (2), which is board dependent. Some may > require more time (larger bulk capacitance), same may require less or > none at all (e.g. voltage rail enabled by default and stable by the > time the kernel starts). > > I think the right solution is to introduce a variant of regulator_enable() > which does not return until a delay passes, where that delay is specified > in the regulator's child node. Unless something like this exists? regulator_enable() (via regulator_do_enable() already does this: /* Allow the regulator to ramp; it would be useful to extend * this for bulk operations so that the regulators can ramp * together. */ trace_regulator_enable_delay(rdev_get_name(rdev)); ... but I wonder if here we are still dealing with some form of 5 even in the absence of reset gpio being actually wired up (how is the chip's reset pin actually wired in this system)? It would be good if we had something like regulator_get_enabled_time() to know actual time when regulator was enabled (and for always on or stub regulators we might use the boot time as "on" time), so that we do not wait unnecessarily in case the regulator was turned on long time ago or was never turned off... Thanks.
On Fri, Dec 02, 2022 at 12:23:50PM -0600, Jeff LaBundy wrote: > I think the right solution is to introduce a variant of regulator_enable() > which does not return until a delay passes, where that delay is specified > in the regulator's child node. Unless something like this exists? regulator_enable() does not return until the regulator is ready, if it returns earlier that is a bug in the driver for the regulator or how it is configured on the board.
On 02/12/2022 19.23, Jeff LaBundy wrote: > + Mark > > Hi Rasmus, > > On Fri, Dec 02, 2022 at 11:57:59AM +0100, Rasmus Villemoes wrote: >> We have a board with an FT5446, which is close enough to a >> FT5506 (i.e. it also supports up to 10 touch points and has similar >> register layout) for this driver to work. However, on our board the >> iovcc and vcc regulators are indeed controllable (so not always-on), >> but there is no reset or wakeup gpio hooked up. >> >> Without a large enough delay between the regulator_enable() calls and >> edt_ft5x06_ts_identify(), the first edt_ft5x06_ts_readwrite() call >> fails with -ENXIO and thus the device fails to probe. So >> unconditionally do an mdelay(300) instead of only when a reset-gpio is >> present. >> >> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> > > This is just my $.02, but it does not seem we are on the correct path > here. 300 ms sounds more like bulk capacitor charge time rather than > anything to do with this specific IC; is that a reasonable assumption? > > Normally, we want to do the following: > > 1. Enable regulator > 2. Wait for voltage rail to stabilize (RC time constant) > 3. Wait for any applicable POR delay (IC datasheet) > 4. Deassert reset > 5. Wait for any applicable reset delay (IC datasheet) > 6. Start communication > > Here we are dealing with step (2), Nope, we are really essentially dealing with step 5, even if there's no reset gpio that we've flipped around. The data sheet says to wait 200 ms (and I don't know why the driver does 300, perhaps there's some other chip in the family with that value, or perhaps it was just a belt-and-suspenders choice) after releasing reset. It's just that "releasing reset" is, in my case, effectively happens at the same time as the regulators are enabled. I also played around with some smaller values. As I wrote, with no delay, I would get -ENXIO, but with both 50 and 100, the chip would "respond", but the values were essentially garbage (and not reproducible from one boot to the next). So even if it's a rather long time, it most definitely is a hard requirement to wait that long - perhaps we could make it 200, but I'd rather not reduce that time when I don't know if other variants have that 300 as a requirement. Even if we could interrogate the regulator and ask it if "are you actually always-on", I'd rather not make the delay conditional on that; we cannot know if it has been on for 300+ ms, and since the device does respond, but not correctly, we could end up with probing and initializing the device, but in a wrong state. That's a recipe for impossible debugging (add a single printk somewhere earlier and the timing changes so that suddenly it gets initialized correctly...). Rasmus
Hi Rasmus, On Mon, Dec 05, 2022 at 09:59:08AM +0100, Rasmus Villemoes wrote: > On 02/12/2022 19.23, Jeff LaBundy wrote: > > + Mark > > > > Hi Rasmus, > > > > On Fri, Dec 02, 2022 at 11:57:59AM +0100, Rasmus Villemoes wrote: > >> We have a board with an FT5446, which is close enough to a > >> FT5506 (i.e. it also supports up to 10 touch points and has similar > >> register layout) for this driver to work. However, on our board the > >> iovcc and vcc regulators are indeed controllable (so not always-on), > >> but there is no reset or wakeup gpio hooked up. > >> > >> Without a large enough delay between the regulator_enable() calls and > >> edt_ft5x06_ts_identify(), the first edt_ft5x06_ts_readwrite() call > >> fails with -ENXIO and thus the device fails to probe. So > >> unconditionally do an mdelay(300) instead of only when a reset-gpio is > >> present. > >> > >> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> > > > > This is just my $.02, but it does not seem we are on the correct path > > here. 300 ms sounds more like bulk capacitor charge time rather than > > anything to do with this specific IC; is that a reasonable assumption? > > > > Normally, we want to do the following: > > > > 1. Enable regulator > > 2. Wait for voltage rail to stabilize (RC time constant) > > 3. Wait for any applicable POR delay (IC datasheet) > > 4. Deassert reset > > 5. Wait for any applicable reset delay (IC datasheet) > > 6. Start communication > > > > Here we are dealing with step (2), > > Nope, we are really essentially dealing with step 5, even if there's no > reset gpio that we've flipped around. The data sheet says to wait 200 ms > (and I don't know why the driver does 300, perhaps there's some other > chip in the family with that value, or perhaps it was just a > belt-and-suspenders choice) after releasing reset. It's just that > "releasing reset" is, in my case, effectively happens at the same time > as the regulators are enabled. > > I also played around with some smaller values. As I wrote, with no > delay, I would get -ENXIO, but with both 50 and 100, the chip would > "respond", but the values were essentially garbage (and not reproducible > from one boot to the next). So even if it's a rather long time, it most > definitely is a hard requirement to wait that long - perhaps we could > make it 200, but I'd rather not reduce that time when I don't know if > other variants have that 300 as a requirement. > > Even if we could interrogate the regulator and ask it if "are you > actually always-on", I'd rather not make the delay conditional on that; > we cannot know if it has been on for 300+ ms, and since the device does > respond, but not correctly, we could end up with probing and > initializing the device, but in a wrong state. That's a recipe for > impossible debugging (add a single printk somewhere earlier and the > timing changes so that suddenly it gets initialized correctly...). Thank you for these additional details, especially with my having taken us on a tangent :) Perhaps the controller requires so much time because it is loading firmware internally. Based on this information, the patch seems reasonable to me. Reviewed-by: Jeff LaBundy <jeff@labundy.com> That being said, I like Dmitry's idea but realize it's out of scope for this particular issue. > > Rasmus > Kind regards, Jeff LaBundy
On 06/12/2022 04.00, Jeff LaBundy wrote: > Hi Rasmus, > > On Mon, Dec 05, 2022 at 09:59:08AM +0100, Rasmus Villemoes wrote: >> On 02/12/2022 19.23, Jeff LaBundy wrote: >>> + Mark >>> >>> Hi Rasmus, >>> >>> On Fri, Dec 02, 2022 at 11:57:59AM +0100, Rasmus Villemoes wrote: >>>> We have a board with an FT5446, which is close enough to a >>>> FT5506 (i.e. it also supports up to 10 touch points and has similar >>>> register layout) for this driver to work. However, on our board the >>>> iovcc and vcc regulators are indeed controllable (so not always-on), >>>> but there is no reset or wakeup gpio hooked up. >>>> >>>> Without a large enough delay between the regulator_enable() calls and >>>> edt_ft5x06_ts_identify(), the first edt_ft5x06_ts_readwrite() call >>>> fails with -ENXIO and thus the device fails to probe. So >>>> unconditionally do an mdelay(300) instead of only when a reset-gpio is >>>> present. >>>> >>>> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> >>> >>> This is just my $.02, but it does not seem we are on the correct path >>> here. 300 ms sounds more like bulk capacitor charge time rather than >>> anything to do with this specific IC; is that a reasonable assumption? >>> >>> Normally, we want to do the following: >>> >>> 1. Enable regulator >>> 2. Wait for voltage rail to stabilize (RC time constant) >>> 3. Wait for any applicable POR delay (IC datasheet) >>> 4. Deassert reset >>> 5. Wait for any applicable reset delay (IC datasheet) >>> 6. Start communication >>> >>> Here we are dealing with step (2), >> >> Nope, we are really essentially dealing with step 5, even if there's no >> reset gpio that we've flipped around. The data sheet says to wait 200 ms >> (and I don't know why the driver does 300, perhaps there's some other >> chip in the family with that value, or perhaps it was just a >> belt-and-suspenders choice) after releasing reset. It's just that >> "releasing reset" is, in my case, effectively happens at the same time >> as the regulators are enabled. >> >> I also played around with some smaller values. As I wrote, with no >> delay, I would get -ENXIO, but with both 50 and 100, the chip would >> "respond", but the values were essentially garbage (and not reproducible >> from one boot to the next). So even if it's a rather long time, it most >> definitely is a hard requirement to wait that long - perhaps we could >> make it 200, but I'd rather not reduce that time when I don't know if >> other variants have that 300 as a requirement. >> >> Even if we could interrogate the regulator and ask it if "are you >> actually always-on", I'd rather not make the delay conditional on that; >> we cannot know if it has been on for 300+ ms, and since the device does >> respond, but not correctly, we could end up with probing and >> initializing the device, but in a wrong state. That's a recipe for >> impossible debugging (add a single printk somewhere earlier and the >> timing changes so that suddenly it gets initialized correctly...). > > Thank you for these additional details, especially with my having taken > us on a tangent :) Perhaps the controller requires so much time because > it is loading firmware internally. Based on this information, the patch > seems reasonable to me. > > Reviewed-by: Jeff LaBundy <jeff@labundy.com> Thanks. Dmitry, any chance this could get picked up? I don't see it in next-20221226. Rasmus
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 9ac1378610bc..8bafa123083c 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1239,8 +1239,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, if (tsdata->reset_gpio) { usleep_range(5000, 6000); gpiod_set_value_cansleep(tsdata->reset_gpio, 0); - msleep(300); } + msleep(300); input = devm_input_allocate_device(&client->dev); if (!input) {