Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1611925

Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc
Date 2017-03-29 15:20 +0200
Message-ID <tqlG1-7mo-19@gated-at.bofh.it> (permalink)
References (7 earlier) <tqgmZ-3Eh-1@gated-at.bofh.it> <tqiRQ-5sN-17@gated-at.bofh.it> <tqjXA-67g-37@gated-at.bofh.it> <tqkAi-6FN-17@gated-at.bofh.it> <tql3k-6Rq-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Mar 29, 2017 at 2:38 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:

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

I don't know if you have seen the Mediatek things really.
include/dt-bindings/pinctrl/mt6397-pinfunc.h

Example:
#define MT6397_PIN_2_SRCLKEN_PERI__FUNC_GPIO2 (MTK_PIN_NO(2) | 0)

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.

>> 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.

Yours,
Linus Walleij

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Linus Walleij <linus.walleij@linaro.org> - 2017-03-28 11:50 +0200
  Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc jacopo@jmondi.org - 2017-03-28 16:50 +0200
    Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Linus Walleij <linus.walleij@linaro.org> - 2017-03-29 04:40 +0200
      Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Geert Uytterhoeven <geert@linux-m68k.org> - 2017-03-29 09:40 +0200
        Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Linus Walleij <linus.walleij@linaro.org> - 2017-03-29 12:20 +0200
          Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Geert Uytterhoeven <geert@linux-m68k.org> - 2017-03-29 13:30 +0200
            Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc jacopo <jacopo@jmondi.org> - 2017-03-29 14:10 +0200
              RE: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Chris Brandt <Chris.Brandt@renesas.com> - 2017-03-29 14:40 +0200
                Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Linus Walleij <linus.walleij@linaro.org> - 2017-03-29 15:20 +0200
                RE: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Chris Brandt <Chris.Brandt@renesas.com> - 2017-03-29 16:20 +0200
            Re: [PATCH v2 2/7] dt-bindings: pinctrl: Add RZ/A1 bindings doc Linus Walleij <linus.walleij@linaro.org> - 2017-03-29 15:10 +0200

csiph-web