linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Brandt <Chris.Brandt@renesas.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: jacopo <jacopo@jmondi.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Rob Herring <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	Russell King <linux@armlinux.org.uk>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc
Date: Wed, 29 Mar 2017 14:09:33 +0000	[thread overview]
Message-ID: <SG2PR06MB116582E6A9D9F13F45B641B28A350@SG2PR06MB1165.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <CACRpkdb+k82OUbi1y1SNC09asHsNSqbtvCkYyT=1eqjpdMt_cg@mail.gmail.com>

On Wednesday, March 29, 2017, Linus Walleij:
> If you prefer to use preprocessor macros or whatever to make the bitmasks
> or how you want to organize the constants in your include files is not my
> concern, do whatever you seem fit, just pack it into a 32bit thing somehow
> which makes sense from a maintenance point of view.

OK, I think everyone agrees that a single 32-bit value is fine because macros
will also for good readability and maintenance.


> >> Not only because it will save use from having a loong list(*) of
> >> macros that has to be kept up to date when/if new RZ hardware will
> >> arrive, but also because of readability and simplicity for down-stream
> and BSP users.
> >> Speaking of which, I would like to know what does Chris think of this.
> >
> > The list of macros would be very long, especially against the
> > different packaging version of the RZ/A1 series. 11 ports, 16-pins for
> > each port, 8 different function options for each pin....2 different
> package/pin variations.
> >
> > And at the end of the day....there is no benefit for the user over
> > just using a macro.
> 
> I don't know who has this idea that you could not use macros, certainly
> not me. Some misunderstanding must be going on. For what I'm concerned you
> can write hex numbers in the pinmux = <0x12345678>;
> 
> > The reason for the "FLAGS" is to work around a quirky hardware design
> (in my opinion).
> 
> The flags I don't like at all, and think they should be converted to
> generic pin config because they have nothing to do with muxing.
> 
> But I will point that out in the specific patch adding them.

OK, I think I understand your issue a little better of mixing user-defined config
with generic pinmux.

>From our perspective, the FLAGS (BI_DIR, SWIO_IN, and SWIO_OUT ) were not really
optional when selecting what you want the pin to do....so we considered it part
of the pin-mux.

In the hardware manual, there are tables that say that for 'some' certain
pins/functions "just setting the pin to a function is not enough...you need to make
another register setting (that may or may not make sense), otherwise it's not going
to work".

So, trying to get the driver to be that smart across all the different pin/package
variations seems to be way too ugly (and a maintenance nightmare). Simply putting
that in the DT binding was much more cleaner.


As for how to pass this HW info into the driver, I'll move over to the other email
thread where you started to give some suggestions...


Chris

  reply	other threads:[~2017-03-29 14:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 16:14 [PATCH v2 0/7] Renesas RZ/A1 pin and gpio controller Jacopo Mondi
2017-03-20 16:14 ` [PATCH v2 1/7] pinctrl: " Jacopo Mondi
2017-03-22 10:26   ` Geert Uytterhoeven
2017-03-23 14:19     ` jacopo
2017-03-20 16:14 ` [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Jacopo Mondi
2017-03-22 10:33   ` Geert Uytterhoeven
2017-03-22 13:20     ` Geert Uytterhoeven
2017-03-22 15:36       ` jacopo
2017-03-22 15:49         ` Geert Uytterhoeven
2017-03-23 16:02     ` jacopo
2017-03-28  9:46       ` Linus Walleij
2017-03-28 14:38         ` jacopo
2017-03-29  2:30           ` Linus Walleij
2017-03-29  7:35             ` Geert Uytterhoeven
2017-03-29 10:15               ` Linus Walleij
2017-03-29 11:20                 ` Geert Uytterhoeven
2017-03-29 12:05                   ` jacopo
2017-03-29 12:38                     ` Chris Brandt
2017-03-29 13:10                       ` Linus Walleij
2017-03-29 14:09                         ` Chris Brandt [this message]
2017-03-29 13:04                   ` Linus Walleij
2017-03-20 16:14 ` [PATCH v2 3/7] arm: dts: dt-bindings: Add Renesas RZ pinctrl header Jacopo Mondi
2017-03-22 10:35   ` Geert Uytterhoeven
2017-03-20 16:14 ` [PATCH v2 4/7] arm: dts: r7s72100: Add pin controller node Jacopo Mondi
2017-03-22 13:12   ` Geert Uytterhoeven
2017-03-23 16:13     ` jacopo
2017-03-20 16:14 ` [PATCH v2 5/7] arm: dts: genmai: Add SCIF2 pin group Jacopo Mondi
2017-03-22 13:13   ` Geert Uytterhoeven
2017-03-20 16:14 ` [PATCH v2 6/7] arm: dts: genmai: Add RIIC2 " Jacopo Mondi
2017-03-22 13:17   ` Geert Uytterhoeven
2017-03-20 16:14 ` [PATCH v2 7/7] arm: dts: genmai: Add user led device nodes Jacopo Mondi
2017-03-22 13:23   ` Geert Uytterhoeven
2017-03-22 18:10 ` [PATCH v2 0/7] Renesas RZ/A1 pin and gpio controller Chris Brandt

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=SG2PR06MB116582E6A9D9F13F45B641B28A350@SG2PR06MB1165.apcprd06.prod.outlook.com \
    --to=chris.brandt@renesas.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=jacopo+renesas@jmondi.org \
    --cc=jacopo@jmondi.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --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).