]> asedeno.scripts.mit.edu Git - linux.git/commit
pinctrl: sh-pfc: Add new non-GPIO helper macros
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 21 Mar 2019 17:58:51 +0000 (18:58 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 4 Jun 2019 09:19:00 +0000 (11:19 +0200)
commit4818f448986dd8d0e28b648be5f99c3f29abe6bf
treeccd86123d208fd694667067b05feed67e110b955
parentdd1f760bffcee2c567509033461dbcb01117b359
pinctrl: sh-pfc: Add new non-GPIO helper macros

Add new macros for describing pins without GPIO functionality:
  - NOGP_ALL() expands to a list of PIN_id values, to be used for
    generating symbolic enum values,
  - PINMUX_NOGP_ALL() expands to a list of sh_pfc_pin entries, to
    list all pins and their capabilities.
Both macros depend on an SoC-specific CPU_ALL_NOGP() macro, to be
provided by each individual SoC pin control driver.

The new macros offer two advantages over the existing SH_PFC_PIN_NAMED()
and SH_PFC_PIN_NAMED_CFG() macros:
  1. They do not rely on PIN_NUMBER() macros and physical pin numbering,
     hence do not suffer from pin numbering confusion among different
     SoC/SiP packages.
  2. They are similar in spirit to the existing scheme for handling pins
     with GPIO functionality.

Note that internal to the driver, non-GPIO pins use a sequential
numbering scheme which starts after the highest GPIO pin number in use.
This value is calculated automatically, using two new helper macros, for
systems with either 32-port bank (GP port style) or linear (PORT style)
pin space.  Sample expansion:

    GP_LAST = sizeof(union {
char dummy[0] __attribute__((deprecated, deprecated));
char GP_0_0[(0 * 32) + 0] __attribute__((deprecated, deprecated));
char GP_0_1[(0 * 32) + 1] __attribute__((deprecated, deprecated));
...
char GP_7_3[(7 * 32) + 3] __attribute__((deprecated, deprecated));
    })

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
drivers/pinctrl/sh-pfc/sh_pfc.h