From: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
To: "Eugeniy.Paltsev@synopsys.com" <Eugeniy.Paltsev@synopsys.com>,
"linus.walleij@linaro.org" <linus.walleij@linaro.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"Alexey.Brodkin@synopsys.com" <Alexey.Brodkin@synopsys.com>,
"Vineet.Gupta1@synopsys.com" <Vineet.Gupta1@synopsys.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"mark.rutland@arm.com" <mark.rutland@arm.com>
Subject: Re: [PATCH v2 2/2] dt-bindings: Document the Synopsys GPIO via CREG bindings
Date: Thu, 30 Aug 2018 18:16:06 +0000 [thread overview]
Message-ID: <1535652965.4465.84.camel@synopsys.com> (raw)
In-Reply-To: <CACRpkdbQryY-R+14GvYAEkLH+7Tr4Pvb6YohWouTwug7qEGbDA@mail.gmail.com>
On Thu, 2018-08-30 at 10:43 +0200, Linus Walleij wrote:
> On Tue, Aug 28, 2018 at 1:27 PM Eugeniy Paltsev
> <Eugeniy.Paltsev@synopsys.com> wrote:
>
> > +++ b/Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt
> > @@ -0,0 +1,49 @@
> > +GPIO via CREG (Control REGisers) driver
[snip]
> > +- snps,ngpios: Number of GPIO pins.
>
> Use the existing ngpios attribute for this, see gpio.txt
Ok
> > +- snps,bit-per-line: Number of bits per each gpio line (see picture).
> > + Array the size of "snps,ngpios"
> > +- snps,shift: Shift (in bits) of the each GPIO field from the previous one in
> > + register (see picture). Array the size of "snps,ngpios"
> > +- snps,on-val: Value should be set in corresponding field to set
> > + output to "1" (see picture). Array the size of "snps,ngpios"
> > +- snps,off-val: Value should be set in corresponding field to set
> > + output to "0" (see picture). Array the size of "snps,ngpios"
>
> Move this into a lookup table in the driver instead, and match
> the lookup table to the compatible string. The format of the
> register is known for a certain compatible, right?
Actually I really don't want to hardcode this values into lookup table as I going to use
this driver on 3 already upstreamed platforms and at least one upcoming.
They all have such CREG pseudo-'GPIOs' differently mapped with different IO lines number,
different enable/disable value, etc...
Is it really a problem to have this values configured via device tree?
If we read them from DT we are able to use this generic and configurable driver to handle
both existing and upcoming platforms without the need of patching the driver on every new
platform upstreaming.
>
> Yours,
> Linus Walleij
--
Eugeniy Paltsev
next prev parent reply other threads:[~2018-08-30 18:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-28 11:27 [PATCH v2 0/2] GPIO: add single-register GPIO via CREG driver Eugeniy Paltsev
2018-08-28 11:27 ` [PATCH v2 1/2] GPIO: add single-register gpio via creg driver Eugeniy Paltsev
2018-08-28 18:15 ` Randy Dunlap
2018-08-30 12:14 ` Eugeniy Paltsev
2018-08-28 11:27 ` [PATCH v2 2/2] dt-bindings: Document the Synopsys GPIO via CREG bindings Eugeniy Paltsev
2018-08-29 1:02 ` Rob Herring
2018-08-30 13:12 ` Eugeniy Paltsev
2018-08-30 8:43 ` Linus Walleij
2018-08-30 18:16 ` Eugeniy Paltsev [this message]
2018-09-05 9:34 ` 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=1535652965.4465.84.camel@synopsys.com \
--to=eugeniy.paltsev@synopsys.com \
--cc=Alexey.Brodkin@synopsys.com \
--cc=Vineet.Gupta1@synopsys.com \
--cc=devicetree@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@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).