diff options
author | Robert Jarzmik <robert.jarzmik@free.fr> | 2018-07-02 01:37:52 -0400 |
---|---|---|
committer | Robert Jarzmik <robert.jarzmik@free.fr> | 2018-08-31 16:29:29 -0400 |
commit | 9f296fe2718efe558825471b5cdf0ca4d1bdd3c6 (patch) | |
tree | 67b00e1c6ed01093b3f2e4f7a0a277f64a2f6814 | |
parent | 8a1ecc01a473b75ab97be9b36f623e4551a6e9ae (diff) |
ARM: dts: pxa: add pincontrol helpers
Add 3 helpers so that pincontrol definitions for pxa25x and pxa27x are
easier, and can be easily converted from old mfp mach-pxa code to
devicetree.
An example of such conversion would be :
static unsigned long mioa701_pin_config[] = {
GPIO32_MMC_CLK,
GPIO92_MMC_DAT_0,
GPIO109_MMC_DAT_1,
GPIO110_MMC_DAT_2,
GPIO111_MMC_DAT_3,
GPIO112_MMC_CMD,
MIO_CFG_IN(GPIO78_SDIO_RO, AF0),
MIO_CFG_IN(GPIO15_SDIO_INSERT, AF0),
MIO_CFG_OUT(GPIO91_SDIO_EN, AF0, DRIVE_LOW),
};
into:
pinctrl_mmc_default: mmc-default {
PMMUX(sd-insert, 15, gpio_in);
PMMUX(mmclk, 32, MMCLK);
PMMUX(sd-ro, 78, gpio_in);
PMMUX_LPM_LOW(sd-enable, 91, gpio_out);
PMMUX(mmdat0, 92, MMDAT<0>);
PMMUX(mmdat1, 109, MMDAT<1>);
PMMUX(mmdat2, 110, MMDAT<2>);
PMMUX(mmdat3, 111, MMDAT<3>);
PMMUX(mmcmd, 112, MMCMD);
};
The third column of PMMUX*() helpers can be found in pincontrol muxing
functions, either in pinctrl-pxa27x.c (or pinctrl-pxa25x.c), or by
inspecting the pincontrol once booted in debugfs.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
-rw-r--r-- | arch/arm/boot/dts/pxa2xx.dtsi | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/pxa2xx.dtsi b/arch/arm/boot/dts/pxa2xx.dtsi index 242ca81306de..080d5c5169b5 100644 --- a/arch/arm/boot/dts/pxa2xx.dtsi +++ b/arch/arm/boot/dts/pxa2xx.dtsi | |||
@@ -9,6 +9,25 @@ | |||
9 | #include "skeleton.dtsi" | 9 | #include "skeleton.dtsi" |
10 | #include "dt-bindings/clock/pxa-clock.h" | 10 | #include "dt-bindings/clock/pxa-clock.h" |
11 | 11 | ||
12 | #define PMGROUP(pin) #pin | ||
13 | #define PMMUX(func, pin, af) \ | ||
14 | mux- ## func { \ | ||
15 | groups = PMGROUP(P ## pin); \ | ||
16 | function = #af; \ | ||
17 | } | ||
18 | #define PMMUX_LPM_LOW(func, pin, af) \ | ||
19 | mux- ## func { \ | ||
20 | groups = PMGROUP(P ## pin); \ | ||
21 | function = #af; \ | ||
22 | low-power-disable; \ | ||
23 | } | ||
24 | #define PMMUX_LPM_HIGH(func, pin, af) \ | ||
25 | mux- ## func { \ | ||
26 | groups = PMGROUP(P ## pin); \ | ||
27 | function = #af; \ | ||
28 | low-power-enable; \ | ||
29 | } | ||
30 | |||
12 | / { | 31 | / { |
13 | model = "Marvell PXA2xx family SoC"; | 32 | model = "Marvell PXA2xx family SoC"; |
14 | compatible = "marvell,pxa2xx"; | 33 | compatible = "marvell,pxa2xx"; |