diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-07-15 15:10:54 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-07-29 09:17:49 -0400 |
commit | 4f82e3ee724f1712f9e84b8802e24ea096a6089f (patch) | |
tree | c62bf494510cc2fff9b8600e232384fc301d5354 /drivers/pinctrl/sh-pfc/pfc-sh73a0.c | |
parent | acac8ed5e2aa2c0d364d06f364fd9ed0dc27d28a (diff) |
sh-pfc: Support pins not associated with a GPIO port
Pins with selectable functions but without a GPIO port can't be named
PORT_# or GP_#_#. Add a SH_PFC_PIN_NAMED macro to declare such pins in
the pinmux pins array, naming them with the PIN_ prefix followed by the
pin physical position.
In order to make sure not to register those pins as GPIOs, add a
SH_PFC_PIN_CFG_NO_GPIO pin flag to denote pins without a GPIO port.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Diffstat (limited to 'drivers/pinctrl/sh-pfc/pfc-sh73a0.c')
-rw-r--r-- | drivers/pinctrl/sh-pfc/pfc-sh73a0.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh73a0.c b/drivers/pinctrl/sh-pfc/pfc-sh73a0.c index 1f4dbe45737a..6417be5514e2 100644 --- a/drivers/pinctrl/sh-pfc/pfc-sh73a0.c +++ b/drivers/pinctrl/sh-pfc/pfc-sh73a0.c | |||
@@ -1173,6 +1173,12 @@ static const u16 pinmux_data[] = { | |||
1173 | #define SH73A0_PIN_IO_PU_PD(pin) SH_PFC_PIN_CFG(pin, __IO | __PUD) | 1173 | #define SH73A0_PIN_IO_PU_PD(pin) SH_PFC_PIN_CFG(pin, __IO | __PUD) |
1174 | #define SH73A0_PIN_O(pin) SH_PFC_PIN_CFG(pin, __O) | 1174 | #define SH73A0_PIN_O(pin) SH_PFC_PIN_CFG(pin, __O) |
1175 | 1175 | ||
1176 | /* Pin numbers for pins without a corresponding GPIO port number are computed | ||
1177 | * from the row and column numbers with a 1000 offset to avoid collisions with | ||
1178 | * GPIO port numbers. | ||
1179 | */ | ||
1180 | #define PIN_NUMBER(row, col) (1000+((row)-1)*34+(col)-1) | ||
1181 | |||
1176 | static struct sh_pfc_pin pinmux_pins[] = { | 1182 | static struct sh_pfc_pin pinmux_pins[] = { |
1177 | /* Table 25-1 (I/O and Pull U/D) */ | 1183 | /* Table 25-1 (I/O and Pull U/D) */ |
1178 | SH73A0_PIN_I_PD(0), | 1184 | SH73A0_PIN_I_PD(0), |
@@ -1444,13 +1450,10 @@ static struct sh_pfc_pin pinmux_pins[] = { | |||
1444 | SH73A0_PIN_O(307), | 1450 | SH73A0_PIN_O(307), |
1445 | SH73A0_PIN_I_PU(308), | 1451 | SH73A0_PIN_I_PU(308), |
1446 | SH73A0_PIN_O(309), | 1452 | SH73A0_PIN_O(309), |
1447 | }; | ||
1448 | 1453 | ||
1449 | /* Pin numbers for pins without a corresponding GPIO port number are computed | 1454 | /* Pins not associated with a GPIO port */ |
1450 | * from the row and column numbers with a 1000 offset to avoid collisions with | 1455 | SH_PFC_PIN_NAMED(6, 26, F26), |
1451 | * GPIO port numbers. | 1456 | }; |
1452 | */ | ||
1453 | #define PIN_NUMBER(row, col) (1000+((row)-1)*34+(col)-1) | ||
1454 | 1457 | ||
1455 | /* - BSC -------------------------------------------------------------------- */ | 1458 | /* - BSC -------------------------------------------------------------------- */ |
1456 | static const unsigned int bsc_data_0_7_pins[] = { | 1459 | static const unsigned int bsc_data_0_7_pins[] = { |