From: Sascha Hauer <s.hauer@pengutronix.de>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
kernel@pengutronix.de
Subject: Re: [PATCH v3 1/2] gpio: Add gpio latch driver
Date: Thu, 22 Sep 2022 15:31:05 +0200 [thread overview]
Message-ID: <20220922133105.GN986@pengutronix.de> (raw)
In-Reply-To: <20220914140310.5ffrnsy63piegdyr@mobilestation>
On Wed, Sep 14, 2022 at 05:03:10PM +0300, Serge Semin wrote:
> > + unsigned int offset, bool val)
> > +{
> > + int latch = offset / priv->n_latched_gpios;
> > + int i;
> > +
> > + assign_bit(offset, priv->shadow, val);
> > +
>
> > + for (i = 0; i < priv->n_latched_gpios; i++)
> > + set(priv->latched_gpios->desc[i],
> > + test_bit(latch * priv->n_latched_gpios + i, priv->shadow));
>
> -> duration?
>
> > +
> > + set(priv->clk_gpios->desc[latch], 1);
>
> -> duration?
>
> > + set(priv->clk_gpios->desc[latch], 0);
>
> I am pretty much sure there must be some duration between the actions
> above *. See for instance the tw and (tsu + th) timing requirements in
> the next edge-triggered flip-flops:
> https://www.ti.com/lit/ds/symlink/sn74lv74a.pdf?ts=1663163389954&ref_url=https%253A%252F%252Fwww.google.com%252F
>
> The durations are normally small (ns or a bit smaller) but still need
> to be added anyway.
>
> Note since the durations are device-specific an additional DT-property array
> with durations should be added too.
Do you think a fixed udelay(1) would be enough for now? Bigger delays
shouldn't be needed and smaller delays expand to udelay(1) anyway on
architectures not providing an architecture specific ndelay().
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2022-09-22 13:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-14 7:13 [PATCH v3 0/2] gpio: Add gpio-latch driver Sascha Hauer
2022-09-14 7:13 ` [PATCH v3 1/2] gpio: Add gpio latch driver Sascha Hauer
2022-09-14 14:03 ` Serge Semin
2022-09-22 13:31 ` Sascha Hauer [this message]
2022-09-25 15:30 ` Serge Semin
2022-10-04 7:27 ` Linus Walleij
2022-09-18 14:56 ` Linus Walleij
2022-09-14 7:13 ` [PATCH v3 2/2] dt-bindings: gpio: Add gpio-latch binding document Sascha Hauer
2022-09-14 15:05 ` Rob Herring
2022-09-18 14:57 ` 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=20220922133105.GN986@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=brgl@bgdev.pl \
--cc=devicetree@vger.kernel.org \
--cc=fancer.lancer@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@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).