From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jeff LaBundy <jeff@labundy.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Oliver Graute <oliver.graute@kococonnector.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
broonie@kernel.org
Subject: Re: [PATCH] Input: edt-ft5x06 - always do msleep(300) during initialization
Date: Fri, 2 Dec 2022 12:34:10 -0800 [thread overview]
Message-ID: <Y4phQpK1Kwn5RC3u@google.com> (raw)
In-Reply-To: <Y4pCtm4J3HWhYl8/@nixie71>
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.
--
Dmitry
next prev parent reply other threads:[~2022-12-02 20:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-02 10:57 [PATCH] Input: edt-ft5x06 - always do msleep(300) during initialization Rasmus Villemoes
2022-12-02 18:23 ` Jeff LaBundy
2022-12-02 20:34 ` Dmitry Torokhov [this message]
2022-12-04 16:43 ` Mark Brown
2022-12-05 8:59 ` Rasmus Villemoes
2022-12-06 3:00 ` Jeff LaBundy
2023-01-03 10:54 ` Rasmus Villemoes
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=Y4phQpK1Kwn5RC3u@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=broonie@kernel.org \
--cc=dario.binacchi@amarulasolutions.com \
--cc=jeff@labundy.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=oliver.graute@kococonnector.com \
/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).