From: Rob Herring <robh@kernel.org>
To: Li Yang <leoyang.li@nxp.com>
Cc: Pankaj Bansal <pankaj.bansal@nxp.com>,
Peter Rosin <peda@axentia.se>,
Frank Rowand <frowand.list@gmail.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] dt-bindings: add register based devices' mux controller DT bindings
Date: Tue, 26 Feb 2019 16:00:31 -0600 [thread overview]
Message-ID: <20190226220031.GA7919@bogus> (raw)
In-Reply-To: <CADRPPNSJ3Re+Ztfq_-a1D1xRJr3zxreG3irk4RBz6gibwbNNtA@mail.gmail.com>
On Tue, Feb 26, 2019 at 02:28:12PM -0600, Li Yang wrote:
> On Tue, Feb 26, 2019 at 1:54 PM Rob Herring <robh@kernel.org> wrote:
> >
> > On Sun, Feb 24, 2019 at 08:27:23AM +0000, Pankaj Bansal wrote:
> > > This adds device tree binding documentation for generic register based
> > > multiplexer controlled by a bitfields in a parent device's register range.
> > >
> > > Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
> > > ---
> > >
> > > Notes:
> > > V3:
> > > - Added the patch in series with the driver patch
> > > - Fixed the node value out of bitfield error
> > > - removed the "parent register r/w functions" line
> > > V2:
> > > - Removed syscon reference from txt file
> > > - Removed loading zeroes from hex numbers
> > > - Fixed the depth of dts nodes
> > > - fixed minor formatting errors
> > >
> > > .../devicetree/bindings/mux/reg-mux.txt | 83 ++++++++++++++++++
> > > 1 file changed, 83 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/mux/reg-mux.txt b/Documentation/devicetree/bindings/mux/reg-mux.txt
> > > new file mode 100644
> > > index 000000000000..8bea6129c113
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/mux/reg-mux.txt
> > > @@ -0,0 +1,83 @@
> > > +Generic register bitfield-based multiplexer controller bindings
> > > +
> > > +Define register bitfields to be used to control multiplexers. The parent
> > > +device tree node must be a device node to provide register r/w access.
> >
> > We generally avoid register bit level bindings like this...
> >
> > What happens when I need 8 or 16-bit accesses. Or some quirky encoding
> > of the bits. Or non-contiguous bit fields... It's an endless extending
> > of the binding to try to handle different cases.
>
> I think the intention here is to mimic the existing mmio-mux binding
> (Documentation/devicetree/bindings/mux/mmio-mux.txt) so that the
> existing mmio-mux driver can be extended to cover both MMIO and
> non-MMIO register based muxes. The bit-width of the register access
> will be taken care of by the regmap framework. It is probably true
> that this can not cover all the register based mux device if they do
> have quircky register layout, but I think it should be good enough to
> cover majority of the cases. If there are devices that cannot be
> covered by the generic binding and driver, they could create their own
> bindings and drivers.
Other than the somewhat misleading name, why not just reuse the existing
binding? Worst case, just add another compatible to it and renane the
file. That would have saved me reviewing the whole thing again...
But really, you should just be able to use what is there and determine
the type of access from the parent node (or I suppose regmap does that
for you).
Rob
next prev parent reply other threads:[~2019-02-26 22:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-24 8:27 [PATCH v3 1/2] dt-bindings: add register based devices' mux controller DT bindings Pankaj Bansal
2019-02-26 19:53 ` Rob Herring
2019-02-26 20:28 ` Li Yang
2019-02-26 22:00 ` Rob Herring [this message]
2019-02-27 8:30 ` Pankaj Bansal
2019-02-27 8:42 ` Peter Rosin
2019-02-27 8:46 ` Peter Rosin
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=20190226220031.GA7919@bogus \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=leoyang.li@nxp.com \
--cc=pankaj.bansal@nxp.com \
--cc=peda@axentia.se \
/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).