linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: pxa: add pincontrol helpers
@ 2018-08-30 19:59 Robert Jarzmik
  2018-08-31 20:30 ` Robert Jarzmik
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Jarzmik @ 2018-08-30 19:59 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Rob Herring, Mark Rutland
  Cc: linux-arm-kernel, devicetree, linux-kernel

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>
---
 arch/arm/boot/dts/pxa2xx.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/pxa2xx.dtsi b/arch/arm/boot/dts/pxa2xx.dtsi
index a520b4c14ea9..81312a9813f6 100644
--- a/arch/arm/boot/dts/pxa2xx.dtsi
+++ b/arch/arm/boot/dts/pxa2xx.dtsi
@@ -9,6 +9,25 @@
 #include "skeleton.dtsi"
 #include "dt-bindings/clock/pxa-clock.h"
 
+#define PMGROUP(pin) #pin
+#define PMMUX(func, pin, af)			\
+	mux- ## func {				\
+		groups = PMGROUP(P ## pin);	\
+		function = #af;			\
+	}
+#define PMMUX_LPM_LOW(func, pin, af)		\
+	mux- ## func {				\
+		groups = PMGROUP(P ## pin);	\
+		function = #af;			\
+		low-power-disable;		\
+	}
+#define PMMUX_LPM_HIGH(func, pin, af)		\
+	mux- ## func {				\
+		groups = PMGROUP(P ## pin);	\
+		function = #af;			\
+		low-power-enable;		\
+	}
+
 / {
 	model = "Marvell PXA2xx family SoC";
 	compatible = "marvell,pxa2xx";
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: dts: pxa: add pincontrol helpers
  2018-08-30 19:59 [PATCH] ARM: dts: pxa: add pincontrol helpers Robert Jarzmik
@ 2018-08-31 20:30 ` Robert Jarzmik
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Jarzmik @ 2018-08-31 20:30 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Haojian Zhuang, Rob Herring, Mark Rutland, linux-arm-kernel,
	devicetree, linux-kernel

Robert Jarzmik <robert.jarzmik@free.fr> writes:

> 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.

As this is exactly the same patch sent out for review July the 7th, queued to
pxa/dt.

--
Robert

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-31 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-30 19:59 [PATCH] ARM: dts: pxa: add pincontrol helpers Robert Jarzmik
2018-08-31 20:30 ` Robert Jarzmik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).