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


Groups > linux.kernel > #1251498 > unrolled thread

Re: [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl DT bindings

Started byDaniel Thompson <daniel.thompson@linaro.org>
First post2015-10-20 11:20 +0200
Last post2015-10-22 14:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl DT  bindings Daniel Thompson <daniel.thompson@linaro.org> - 2015-10-20 11:20 +0200
    Re: [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl DT bindings Maxime Coquelin <mcoquelin.stm32@gmail.com> - 2015-10-20 18:40 +0200
      Re: [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl DT bindings Linus Walleij <linus.walleij@linaro.org> - 2015-10-22 14:40 +0200

#1251498 — Re: [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl DT bindings

FromDaniel Thompson <daniel.thompson@linaro.org>
Date2015-10-20 11:20 +0200
SubjectRe: [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl DT bindings
Message-ID<qlBfm-7L2-55@gated-at.bofh.it>
On 17/10/15 18:23, Maxime Coquelin wrote:
> Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> ---
>   include/dt-bindings/pinctrl/pinctrl-stm32.h     |   12 +
>   include/dt-bindings/pinctrl/stm32f429-pinfunc.h | 1241 +++++++++++++++++++++++
>   2 files changed, 1253 insertions(+)
>   create mode 100644 include/dt-bindings/pinctrl/pinctrl-stm32.h
>   create mode 100644 include/dt-bindings/pinctrl/stm32f429-pinfunc.h
>
> diff --git a/include/dt-bindings/pinctrl/pinctrl-stm32.h b/include/dt-bindings/pinctrl/pinctrl-stm32.h
> new file mode 100644
> index 0000000..a2e7222
> --- /dev/null
> +++ b/include/dt-bindings/pinctrl/pinctrl-stm32.h
> @@ -0,0 +1,12 @@
> +#ifndef _DT_BINDINGS_PINCTRL_STM32_H
> +#define _DT_BINDINGS_PINCTRL_STM32_H
> +
> +#define STM32_PIN_NO(x) ((x) << 8)
> +#define STM32_GET_PIN_NO(x) ((x) >> 8)
> +#define STM32_GET_PIN_FUNC(x) ((x) & 0xff)
> +
> +#define STM32_PIN_GPIO		0
> +#define STM32_PIN_AF(x)		((x) + 1)
> +#define STM32_PIN_ANALOG	(STM32_PIN_AF(15) + 1)
> +
> +#endif /* _DT_BINDINGS_PINCTRL_STM32_H */
> diff --git a/include/dt-bindings/pinctrl/stm32f429-pinfunc.h b/include/dt-bindings/pinctrl/stm32f429-pinfunc.h
> new file mode 100644
> index 0000000..9dd5fd0
> --- /dev/null
> +++ b/include/dt-bindings/pinctrl/stm32f429-pinfunc.h
> @@ -0,0 +1,1241 @@
> +#ifndef _DT_BINDINGS_STM32F429_PINFUNC_H
> +#define _DT_BINDINGS_STM32F429_PINFUNC_H
> +
> +#include <dt-bindings/pinctrl/pinctrl-stm32.h>
> +
> +#define STM32F429_PA0_FUNC_GPIO 0x0
> +#define STM32F429_PA0_FUNC_TIM2_CH1_TIM2_ETR 0x2

Did you expand these out after my feedback (instead of things like: 
STM32_PIN_NO(0) | STM32_PIN_AF(1) )?

If so I must have been somewhat unclear.

I suggesting that, like with the clock driver, there is no need to the 
STM32F429_PAXX_FUNC_YYY macros at all.

Given the way you can enumerate pin config options in stm32f429.dtsi 
then I think stm32f429.dtsi is the only file that will ever include this 
header? If so then why not just plug the values directly into the pinmux 
fields. Its not duplicative and is easier to map back to data sheets.

~~~
#define PIN_NO(x) ...
#define PIN_AF(x) ...

usart1_pins_a: usart1@0 {
				pins1 {
					pinmux = PIN_NO(9) | PIN_AF(7);
					bias-disable;
					drive-push-pull;
					slew-rate = <0>;
				};
                                 ...
			};
~~~

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1251871 — Re: [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl DT bindings

FromMaxime Coquelin <mcoquelin.stm32@gmail.com>
Date2015-10-20 18:40 +0200
SubjectRe: [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl DT bindings
Message-ID<qlI78-Ns-29@gated-at.bofh.it>
In reply to#1251498
2015-10-20 12:06 GMT+02:00 Daniel Thompson <daniel.thompson@linaro.org>:
> On 17/10/15 18:23, Maxime Coquelin wrote:
>>
>> Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
>> ---
>>   include/dt-bindings/pinctrl/pinctrl-stm32.h     |   12 +
>>   include/dt-bindings/pinctrl/stm32f429-pinfunc.h | 1241
>> +++++++++++++++++++++++
>>   2 files changed, 1253 insertions(+)
>>   create mode 100644 include/dt-bindings/pinctrl/pinctrl-stm32.h
>>   create mode 100644 include/dt-bindings/pinctrl/stm32f429-pinfunc.h
>>
>> diff --git a/include/dt-bindings/pinctrl/pinctrl-stm32.h
>> b/include/dt-bindings/pinctrl/pinctrl-stm32.h
>> new file mode 100644
>> index 0000000..a2e7222
>> --- /dev/null
>> +++ b/include/dt-bindings/pinctrl/pinctrl-stm32.h
>> @@ -0,0 +1,12 @@
>> +#ifndef _DT_BINDINGS_PINCTRL_STM32_H
>> +#define _DT_BINDINGS_PINCTRL_STM32_H
>> +
>> +#define STM32_PIN_NO(x) ((x) << 8)
>> +#define STM32_GET_PIN_NO(x) ((x) >> 8)
>> +#define STM32_GET_PIN_FUNC(x) ((x) & 0xff)
>> +
>> +#define STM32_PIN_GPIO         0
>> +#define STM32_PIN_AF(x)                ((x) + 1)
>> +#define STM32_PIN_ANALOG       (STM32_PIN_AF(15) + 1)
>> +
>> +#endif /* _DT_BINDINGS_PINCTRL_STM32_H */
>> diff --git a/include/dt-bindings/pinctrl/stm32f429-pinfunc.h
>> b/include/dt-bindings/pinctrl/stm32f429-pinfunc.h
>> new file mode 100644
>> index 0000000..9dd5fd0
>> --- /dev/null
>> +++ b/include/dt-bindings/pinctrl/stm32f429-pinfunc.h
>> @@ -0,0 +1,1241 @@
>> +#ifndef _DT_BINDINGS_STM32F429_PINFUNC_H
>> +#define _DT_BINDINGS_STM32F429_PINFUNC_H
>> +
>> +#include <dt-bindings/pinctrl/pinctrl-stm32.h>
>> +
>> +#define STM32F429_PA0_FUNC_GPIO 0x0
>> +#define STM32F429_PA0_FUNC_TIM2_CH1_TIM2_ETR 0x2
>
>
> Did you expand these out after my feedback (instead of things like:
> STM32_PIN_NO(0) | STM32_PIN_AF(1) )?
Yes.

>
> If so I must have been somewhat unclear.
Most likely I didn't understood what you meant!

>
> I suggesting that, like with the clock driver, there is no need to the
> STM32F429_PAXX_FUNC_YYY macros at all.
>
> Given the way you can enumerate pin config options in stm32f429.dtsi then I
> think stm32f429.dtsi is the only file that will ever include this header? If
> so then why not just plug the values directly into the pinmux fields. Its
> not duplicative and is easier to map back to data sheets.
>
> ~~~
> #define PIN_NO(x) ...
> #define PIN_AF(x) ...
>
> usart1_pins_a: usart1@0 {
>                                 pins1 {
>                                         pinmux = PIN_NO(9) | PIN_AF(7);
>                                         bias-disable;
>                                         drive-push-pull;
>                                         slew-rate = <0>;
>                                 };
>                                 ...
>                         };
> ~~~

The advantage with the defines is that you can see easily which pin we
are talking about.
Moreover, the defines are generated from the datasheet, so it is
painless to generate them.
And it will be consistent with Mediatek implementation, on which I
heavily inspired.

Linus, what is your view?

Thanks,
Maxime
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1253768 — Re: [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl DT bindings

FromLinus Walleij <linus.walleij@linaro.org>
Date2015-10-22 14:40 +0200
SubjectRe: [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl DT bindings
Message-ID<qmnjY-2vq-27@gated-at.bofh.it>
In reply to#1251871
On Tue, Oct 20, 2015 at 6:32 PM, Maxime Coquelin
<mcoquelin.stm32@gmail.com> wrote:
> 2015-10-20 12:06 GMT+02:00 Daniel Thompson <daniel.thompson@linaro.org>:
>> On 17/10/15 18:23, Maxime Coquelin wrote:

>> I suggesting that, like with the clock driver, there is no need to the
>> STM32F429_PAXX_FUNC_YYY macros at all.
>>
>> Given the way you can enumerate pin config options in stm32f429.dtsi then I
>> think stm32f429.dtsi is the only file that will ever include this header? If
>> so then why not just plug the values directly into the pinmux fields. Its
>> not duplicative and is easier to map back to data sheets.
>>
>> ~~~
>> #define PIN_NO(x) ...
>> #define PIN_AF(x) ...
>>
>> usart1_pins_a: usart1@0 {
>>                                 pins1 {
>>                                         pinmux = PIN_NO(9) | PIN_AF(7);
>>                                         bias-disable;
>>                                         drive-push-pull;
>>                                         slew-rate = <0>;
>>                                 };
>>                                 ...
>>                         };
>> ~~~
>
> The advantage with the defines is that you can see easily which pin we
> are talking about.
> Moreover, the defines are generated from the datasheet, so it is
> painless to generate them.
> And it will be consistent with Mediatek implementation, on which I
> heavily inspired.
>
> Linus, what is your view?

I have no strong view of this at all.

I would ask the opinion of other people doing numbered muxes
to see what is generally best for everyone to use,
Sascha Hauer specifically, or the Mediatek people.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web