All of lore.kernel.org
 help / color / mirror / Atom feed
From: jacopo <jacopo@jmondi.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Chris Brandt <chris.brandt@renesas.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:05:30 +0200	[thread overview]
Message-ID: <20170329120530.GB6247@w540> (raw)
In-Reply-To: <CAMuHMdX0OdZXYDOZvFutjfBFVd65C567_G+++kHygre4KK+jLg@mail.gmail.com>

Hi Geert, Linus

On Wed, Mar 29, 2017 at 01:20:39PM +0200, Geert Uytterhoeven wrote:
> Hi Linus,
> 
> On Wed, Mar 29, 2017 at 12:15 PM, Linus Walleij
> <linus.walleij@linaro.org> wrote:
> > On Wed, Mar 29, 2017 at 9:35 AM, Geert Uytterhoeven
> > <geert@linux-m68k.org> wrote:
> >>> See for example:
> >>> include/dt-bindings/pinctrl/mt65xx.h
> >>>
> >>> And how that is used in:
> >>> arch/arm/boot/dts/mt2701-pinfunc.h
> >>> arch/arm/boot/dts/mt2701-evb.dts
> >>>
> >>> The docs are here:
> >>> Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
> >>
> >> All of the above pack the information for a pin into a single 32-bit integer.
> >> Is that what you want us to use, too?
> >> Currently we use two integers: 1) pin index, and 2) function/flags combo.
> >
> > I don't really know what you need, sorry. But some kind of figure, yes.
> > I would say whatever makes sense. 16+16 bits makes sense in most
> > combinatorial spaces does it not? If you split 32 bits  in 16 bits for
> > pin and 16 bits for function, do you have more than 2^16 pins or 2^16
> > functions?
> >
> > If you really do we may need to go for u64 but ... really? Is there
> > a rational reason for that other than "we did it like this first"?
> >
> > I do not understand the notion of "flags" here. I hope that is not referring
> 
> Flags refers to BI_DIR, SWIO_IN, and SWIO_OUT, from
> https://patchwork.kernel.org/patch/9643047/
> 
> 32-bit should be enough to cover pins, function, and flags.
> 

Geert already replied, but to avoid any confusion I'll try to remove
from driver the use of "pin config" when referring to this three
flags, which are just additional informations the pin controller needs
to perform pin muxing properly. They're not related the standard pin
config properties (pull-up/down, bias etc.. actually our hardware does
not even support these natively)

> > to pin config, because I expect that to use the standard pin config
> > bindings outside of the pinmux value which should just define the
> > pin+function combo:
> >
> > node {
> >     pinmux = <PIN_NUMBER_PINMUX>;
> >     GENERIC_PINCONFIG;
> > };
> >
> > Example from Mediatek:
> >
> > i2c1_pins_a: i2c1@0 {
> >     pins {
> >         pinmux = <MT8135_PIN_195_SDA1__FUNC_SDA1>,
> >                         <MT8135_PIN_196_SCL1__FUNC_SCL1>;
> 
> If we follow this example, then we can list all combinations in
> include/dt-bindings/pinctrl/r7s72100-pinctrl.h, instead of creating the value
> by combining the bits using a macro where we need it in the DTS.
> 
> It's gonna be a long list, though...
> 

I'm strongly in favour of something like
    pinmux = <PIN(1, 4) | FUNC# | FLAGS>, .... ;

opposed to
    pinmux = <PIN1_4_FUNC#_FLAGS>, ... ;

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.

Is there any strong preference between the two for you Linus?

Thanks
   j

(*) 12 ports, 16 pins, 8 functions, 3 flags: you can do the math
yourselves and see this is going to be hard to maintain.

> >         bias-pull-up = <55>;
> >     };
> > };
> >
> > So this allows for a combine pin+function number but pull ups,
> > bias etc are not baked into the thing, they have to be added on
> > separately with the generic bindings, which is nice and very readable.
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

  reply	other threads:[~2017-03-29 12:05 UTC|newest]

Thread overview: 43+ 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
     [not found]   ` <1490026491-21742-2-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-03-22 10:26     ` Geert Uytterhoeven
2017-03-22 10:26       ` Geert Uytterhoeven
2017-03-23 14:19       ` jacopo
     [not found] ` <1490026491-21742-1-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-03-20 16:14   ` [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Jacopo Mondi
2017-03-20 16:14     ` Jacopo Mondi
2017-03-22 10:33     ` Geert Uytterhoeven
     [not found]       ` <CAMuHMdWT6vJNmMhYzMEqYRbuT=W=ZuND-WfG812LfH0r0AzM_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-22 13:20         ` Geert Uytterhoeven
2017-03-22 13:20           ` Geert Uytterhoeven
2017-03-22 15:36           ` jacopo
2017-03-22 15:49             ` Geert Uytterhoeven
2017-03-22 15:49               ` Geert Uytterhoeven
2017-03-23 16:02       ` jacopo
2017-03-28  9:46         ` Linus Walleij
     [not found]           ` <CACRpkdYmitsPvv_1bsb-EKkhcWqaKNsLBfxZgf8cjVvcqCpYXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-28 14:38             ` jacopo-AW8dsiIh9cEdnm+yROfE0A
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 [this message]
2017-03-29 12:38                         ` Chris Brandt
     [not found]                           ` <SG2PR06MB1165276F957CE63DBE0A55268A350-ESzmfEwOt/xoAsOJh7vwSm0DtJ1/0DrXvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-03-29 13:10                             ` Linus Walleij
2017-03-29 13:10                               ` Linus Walleij
2017-03-29 14:09                               ` Chris Brandt
2017-03-29 14:09                                 ` Chris Brandt
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
     [not found]   ` <1490026491-21742-4-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-03-22 10:35     ` Geert Uytterhoeven
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
     [not found]   ` <1490026491-21742-8-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-03-22 13:23     ` Geert Uytterhoeven
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
2017-03-22 18:10   ` 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=20170329120530.GB6247@w540 \
    --to=jacopo@jmondi.org \
    --cc=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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.