mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxime Coquelin <mcoquelin.stm32@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Sascha Hauer" <kernel@pengutronix.de>,
	"Daniel Thompson" <daniel.thompson@linaro.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Bruno Herrera" <bruherrera@gmail.com>
Subject: Re: [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl DT bindings
Date: Fri, 6 Nov 2015 13:57:32 +0100	[thread overview]
Message-ID: <CALszF6B7928hpMDMH0_wmo-MakZX7sofO85aeBwv-aCLBHnrkA@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdashSEWL+KFgD+MmdoZwjXnsXpxy-MPmDciO9n87+6BBQ@mail.gmail.com>

2015-10-22 14:35 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
> 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.

Thinking again at it, I persist to believe have the defines makes it
easier to use.
With auto-completion, it makes it faster and less error prone to
select the right
alternate function without parsing the datasheet.

But as these defines are not actually used on driver side, maybe I
could just move
them to the dts directory?

Regards,
Maxime

  reply	other threads:[~2015-11-06 12:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-17 17:23 [PATCH v2 0/9] Add STM32 pinctrl/GPIO driver Maxime Coquelin
2015-10-17 17:23 ` [PATCH v2 1/9] ARM: Kconfig: Introduce MACH_STM32F429 flag Maxime Coquelin
2015-10-17 17:23 ` [PATCH v2 2/9] Documentation: dt-bindings: Document STM32 pinctrl driver DT bindings Maxime Coquelin
2015-10-17 17:23 ` [PATCH v2 3/9] includes: dt-bindings: Add STM32F429 pinctrl " Maxime Coquelin
2015-10-20 10:06   ` Daniel Thompson
2015-10-20 16:32     ` Maxime Coquelin
2015-10-22 12:35       ` Linus Walleij
2015-11-06 12:57         ` Maxime Coquelin [this message]
2015-11-17 11:00           ` Linus Walleij
2015-11-30 15:55             ` Maxime Coquelin
2015-10-17 17:23 ` [PATCH v2 4/9] pinctrl: Add support STM32 MCUs Maxime Coquelin
2015-12-01  9:53   ` Maxime Coquelin
2015-12-10 17:08     ` Linus Walleij
2015-12-11  8:20       ` Patrice Chotard
2015-12-11  8:26         ` Maxime Coquelin
2015-10-17 17:23 ` [PATCH v2 5/9] ARM: mach-stm32: Select pinctrl Maxime Coquelin
2015-10-26 13:37   ` Linus Walleij
2015-10-17 17:23 ` [PATCH v2 6/9] ARM: dts: Add pinctrl node to STM32F429 Maxime Coquelin
2015-10-17 17:23 ` [PATCH v2 7/9] ARM: dts: Add USART1 pin config to STM32F429 boards Maxime Coquelin
2015-10-26 13:38   ` Linus Walleij
2015-10-17 17:23 ` [PATCH v2 8/9] ARM: dts: Add leds support to STM32F429 Discovery board Maxime Coquelin
2015-10-26 13:41   ` Linus Walleij
2015-10-27 20:31     ` Maxime Coquelin
2015-10-27 21:37       ` Andreas Färber
2015-10-27 21:46         ` Linus Walleij
2015-10-27 21:52           ` Andreas Färber
2015-10-28  8:09             ` Daniel Thompson
2015-10-28 14:24               ` Maxime Coquelin
2015-10-17 17:23 ` [PATCH v2 9/9] ARM: config: Enable GPIO Led driver in stm32_defconfig Maxime Coquelin
2015-10-26 13:42   ` Linus Walleij

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=CALszF6B7928hpMDMH0_wmo-MakZX7sofO85aeBwv-aCLBHnrkA@mail.gmail.com \
    --to=mcoquelin.stm32@gmail.com \
    --cc=afaerber@suse.de \
    --cc=arnd@arndb.de \
    --cc=bruherrera@gmail.com \
    --cc=daniel.thompson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®