[PATCH 01/05 v2] pinctrl: sh-pfc: Rework _GP_GPIO, introduce _GP_GPIO32

From: Magnus Damm
Date: Mon Dec 16 2013 - 21:37:13 EST


From: Magnus Damm <damm@xxxxxxxxxxxxx>

Rework _GP_GPIO to take banksize as argument, introduce
_GP_GPIO32 for SoCs with 32-bit GPIO banks.

Signed-off-by: Magnus Damm <damm@xxxxxxxxxxxxx>
---

Developed on top of renesas git tag renesas-devel-v3.13-rc3-20131214v2

drivers/pinctrl/sh-pfc/sh_pfc.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

--- 0001/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ work/drivers/pinctrl/sh-pfc/sh_pfc.h 2013-12-16 19:35:12.000000000 +0900
@@ -214,13 +214,14 @@ struct sh_pfc_soc_info {
#define GP_ALL(str) CPU_ALL_PORT(_GP_ALL, str)

/* PINMUX_GPIO_GP_ALL - Expand to a list of sh_pfc_pin entries */
-#define _GP_GPIO(bank, _pin, _name, sfx) \
- [(bank * 32) + _pin] = { \
- .pin = (bank * 32) + _pin, \
+#define _GP_GPIO(banksize, bank, _pin, _name, sfx) \
+ [(bank * banksize) + _pin] = { \
+ .pin = (bank * banksize) + _pin, \
.name = __stringify(_name), \
.enum_id = _name##_DATA, \
}
-#define PINMUX_GPIO_GP_ALL() CPU_ALL_PORT(_GP_GPIO, unused)
+#define _GP_GPIO32(bank, _pin, _name, sfx) _GP_GPIO(32, bank, _pin, _name, sfx)
+#define PINMUX_GPIO_GP_ALL() CPU_ALL_PORT(_GP_GPIO32, unused)

/* PINMUX_DATA_GP_ALL - Expand to a list of name_DATA, name_FN marks */
#define _GP_DATA(bank, pin, name, sfx) PINMUX_DATA(name##_DATA, name##_FN)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/