[U-Boot] [PATCH 07/11] ARM: tegra: pinmux naming consistency fixes

Simon Glass
2014-03-14T20:15:04Z

Hi Stephen,

On 13 March 2014 11:42, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Clean up the naming of pinmux-related objects:
> * Refer to drive groups rather than pad groups to match the Linux kernel.
> * Ensure all pinmux API types are prefixed with pmux_, values (defines)
> are prefixed with PMUX_, and functions prefixed with pinmux_.
> * Modify a few type names to make their content clearer.
> * Minimal changes to SoC-specific .h/.c files are made so the code still
> compiles. A separate per-SoC change will be made immediately following,
> in order to keep individual patch size down.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Acked-by: Simon Glass <sjg@chromium.org>

A few comments below.

> ---
> arch/arm/cpu/tegra-common/pinmux-common.c | 122 +++++++++++----------
> arch/arm/cpu/tegra114-common/pinmux.c | 4 +-
> arch/arm/cpu/tegra124-common/pinmux.c | 4 +-
> arch/arm/cpu/tegra20-common/funcmux.c | 6 +-
> arch/arm/cpu/tegra20-common/pinmux.c | 4 +-
> arch/arm/cpu/tegra30-common/pinmux.c | 4 +-
> arch/arm/include/asm/arch-tegra/pinmux.h | 88 +++++++--------
> arch/arm/include/asm/arch-tegra114/pinmux.h | 8 +-
> arch/arm/include/asm/arch-tegra124/pinmux.h | 8 +-
> arch/arm/include/asm/arch-tegra20/pinmux.h | 2 +-
> arch/arm/include/asm/arch-tegra30/pinmux.h | 8 +-
> .../common/pinmux-config-tamonten-ng.h | 30 ++---
> board/avionic-design/common/tamonten-ng.c | 12 +-
> board/nvidia/cardhu/cardhu.c | 6 +-
> board/nvidia/cardhu/pinmux-config-cardhu.h | 30 ++---
> board/nvidia/dalmore/dalmore.c | 9 +-
> board/nvidia/dalmore/pinmux-config-dalmore.h | 40 +++----
> board/nvidia/venice2/pinmux-config-venice2.h | 40 +++----
> board/nvidia/venice2/venice2.c | 15 +--
> 19 files changed, 223 insertions(+), 217 deletions(-)
>

...

> diff --git a/arch/arm/cpu/tegra114-common/pinmux.c b/arch/arm/cpu/tegra114-common/pinmux.c
> index af8b7ca5fc79..efe5163084c1 100644
> --- a/arch/arm/cpu/tegra114-common/pinmux.c
> +++ b/arch/arm/cpu/tegra114-common/pinmux.c
> @@ -41,7 +41,7 @@
> #define PIN_RESERVED \
> PIN(NONE, NONE, INVALID, INVALID, INVALID, INVALID, NONE)
>
> -const struct tegra_pingroup_desc tegra114_pingroups[PINGRP_COUNT] = {
> +const struct pmux_pingrp_desc tegra114_pingroups[PMUX_PINGRP_COUNT] = {

Can some of these be static?

> /* NAME VDD f0 f1 f2 f3 */
> PINI(ULPI_DATA0, BB, SPI3, HSI, UARTA, ULPI),
> PINI(ULPI_DATA1, BB, SPI3, HSI, UARTA, ULPI),
> @@ -303,4 +303,4 @@ const struct tegra_pingroup_desc tegra114_pingroups[PINGRP_COUNT] = {
> PIN_RESERVED, /* Reserved by t114: 0x3404 */
> PINO(RESET_OUT_N, SYS, RSVD1, RSVD2, RSVD3, RESET_OUT_N),
> };
> -const struct tegra_pingroup_desc *tegra_soc_pingroups = tegra114_pingroups;
> +const struct pmux_pingrp_desc *tegra_soc_pingroups = tegra114_pingroups;

...

> diff --git a/arch/arm/include/asm/arch-tegra114/pinmux.h b/arch/arm/include/asm/arch-tegra114/pinmux.h
> index 00ef5423547d..070745933503 100644
> --- a/arch/arm/include/asm/arch-tegra114/pinmux.h
> +++ b/arch/arm/include/asm/arch-tegra114/pinmux.h
> @@ -202,10 +202,10 @@ enum pmux_pingrp {
> PINGRP_SDMMC3_CLK_LB_IN,
> PINGRP_SDMMC3_CLK_LB_OUT,
> PINGRP_RESET_OUT_N = PINGRP_SDMMC3_CLK_LB_OUT + 2,
> - PINGRP_COUNT,
> + PMUX_PINGRP_COUNT,

It seems odd that this doesn't match the others. Why not a PMUX_
prefix on all of them? Same comment in other cases below.

> };
>
> -enum pdrive_pingrp {
> +enum pmux_drvgrp {
> PDRIVE_PINGROUP_AO1 = 0, /* offset 0x868 */
> PDRIVE_PINGROUP_AO2,
> PDRIVE_PINGROUP_AT1,
> @@ -244,7 +244,7 @@ enum pdrive_pingrp {
> PDRIVE_PINGROUP_HVC,
> PDRIVE_PINGROUP_SDIO4,
> PDRIVE_PINGROUP_AO0,
> - PDRIVE_PINGROUP_COUNT,
> + PMUX_DRVGRP_COUNT,
> };
>
> /*
> @@ -378,7 +378,7 @@ enum pmux_func {
>
> #define TEGRA_PMX_HAS_PIN_IO_BIT_ETC
> #define TEGRA_PMX_HAS_RCV_SEL
> -#define TEGRA_PMX_HAS_PADGRPS
> +#define TEGRA_PMX_HAS_DRVGRPS
> #include <asm/arch-tegra/pinmux.h>
>
> #endif /* _TEGRA114_PINMUX_H_ */

Regards,
Simon