All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Thompson <daniel.thompson@linaro.org>
To: Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-gpio@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, afaerber@suse.de,
	devicetree@vger.kernel.org, bruherrera@gmail.com
Subject: Re: [PATCH 2/7] includes: dt-bindings: Add STM32F429 pinctrl DT bindings
Date: Thu, 15 Oct 2015 12:14:59 +0100	[thread overview]
Message-ID: <561F8AB3.9010103@linaro.org> (raw)
In-Reply-To: <1444853247-31114-3-git-send-email-mcoquelin.stm32@gmail.com>

On 14/10/15 21:07, 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..979e4eb
> --- /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 (STM32_PIN_NO(0) | STM32_PIN_GPIO)
> +#define STM32F429_PA0_FUNC_TIM2_CH1 TIM2_ETR (STM32_PIN_NO(0) | STM32_PIN_AF(1))

For the clock driver I was advised to get rid of this sort of "heroics" 
and expose raw numbers from the datasheet directly to DT bindings users.

Should the same logic apply to this *huge* collection of macros?

WARNING: multiple messages have this Message-ID (diff)
From: daniel.thompson@linaro.org (Daniel Thompson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/7] includes: dt-bindings: Add STM32F429 pinctrl DT bindings
Date: Thu, 15 Oct 2015 12:14:59 +0100	[thread overview]
Message-ID: <561F8AB3.9010103@linaro.org> (raw)
In-Reply-To: <1444853247-31114-3-git-send-email-mcoquelin.stm32@gmail.com>

On 14/10/15 21:07, 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..979e4eb
> --- /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 (STM32_PIN_NO(0) | STM32_PIN_GPIO)
> +#define STM32F429_PA0_FUNC_TIM2_CH1 TIM2_ETR (STM32_PIN_NO(0) | STM32_PIN_AF(1))

For the clock driver I was advised to get rid of this sort of "heroics" 
and expose raw numbers from the datasheet directly to DT bindings users.

Should the same logic apply to this *huge* collection of macros?

  reply	other threads:[~2015-10-15 11:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 20:07 [PATCH 0/7] Add STM32 pinctrl/GPIO driver Maxime Coquelin
2015-10-14 20:07 ` Maxime Coquelin
2015-10-14 20:07 ` [PATCH 1/7] ARM: Kconfig: Introduce MACH_STM32F429 flag Maxime Coquelin
2015-10-14 20:07   ` Maxime Coquelin
2015-10-14 20:07 ` [PATCH 2/7] includes: dt-bindings: Add STM32F429 pinctrl DT bindings Maxime Coquelin
2015-10-14 20:07   ` Maxime Coquelin
2015-10-15 11:14   ` Daniel Thompson [this message]
2015-10-15 11:14     ` Daniel Thompson
     [not found]     ` <561F8AB3.9010103-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-10-15 11:29       ` Maxime Coquelin
2015-10-15 11:29         ` Maxime Coquelin
2015-10-15 11:29         ` Maxime Coquelin
2015-10-15 11:55         ` Daniel Thompson
2015-10-15 11:55           ` Daniel Thompson
2015-10-14 20:07 ` [PATCH 3/7] Documentation: dt-bindings: Document STM32 pinctrl driver " Maxime Coquelin
2015-10-14 20:07   ` Maxime Coquelin
2015-10-14 20:07   ` Maxime Coquelin
2015-10-14 20:07 ` [PATCH 4/7] pinctrl: Add support STM32 MCUs Maxime Coquelin
2015-10-14 20:07   ` Maxime Coquelin
2015-10-14 20:07 ` [PATCH 5/7] ARM: mach-stm32: Select pinctrl Maxime Coquelin
2015-10-14 20:07   ` Maxime Coquelin
2015-10-15 19:42   ` Maxime Coquelin
2015-10-15 19:42     ` Maxime Coquelin
2015-10-14 20:07 ` [PATCH 6/7] ARM: dts: Add pinctrl node to STM32F429 Maxime Coquelin
2015-10-14 20:07   ` Maxime Coquelin
2015-10-14 20:07 ` [PATCH 7/7] ARM: dts: Add USART1 pin config to STM32F429 boards Maxime Coquelin
2015-10-14 20:07   ` Maxime Coquelin

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=561F8AB3.9010103@linaro.org \
    --to=daniel.thompson@linaro.org \
    --cc=afaerber@suse.de \
    --cc=bruherrera@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --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=mcoquelin.stm32@gmail.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.