summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorUlrich Hecht <ulrich.hecht+renesas@gmail.com>2018-03-19 19:37:45 +0300
committerGeert Uytterhoeven <geert+renesas@glider.be>2018-03-21 20:25:48 +0300
commita6fff41f410bf030d5cd178154b8397536e714f9 (patch)
tree54ed2affa635d09fd251b69ac6118e205b52f672 /drivers/pinctrl
parenta5c2949ff7bd9e04be2cdd1b52af1acf9be82ba0 (diff)
downloadlinux-a6fff41f410bf030d5cd178154b8397536e714f9.tar.xz
pinctrl: sh-pfc: r8a77995: Deduplicate VIN4 pin definitions
Use union vin_data and VIN_DATA_PIN_GROUP() to reduce redundancies in pin definitions. Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a77995.c154
1 files changed, 36 insertions, 118 deletions
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77995.c b/drivers/pinctrl/sh-pfc/pfc-r8a77995.c
index 2a83a908a0f7..adade5b7ffbc 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a77995.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77995.c
@@ -1627,68 +1627,6 @@ static const unsigned int usb0_mux[] = {
};
/* - VIN4 ------------------------------------------------------------------- */
-static const unsigned int vin4_data8_pins[] = {
- RCAR_GP_PIN(2, 1), RCAR_GP_PIN(2, 2),
- RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 4),
- RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 6),
- RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8),
-};
-static const unsigned int vin4_data8_mux[] = {
- VI4_DATA0_MARK, VI4_DATA1_MARK,
- VI4_DATA2_MARK, VI4_DATA3_MARK,
- VI4_DATA4_MARK, VI4_DATA5_MARK,
- VI4_DATA6_MARK, VI4_DATA7_MARK,
-};
-static const unsigned int vin4_data10_pins[] = {
- RCAR_GP_PIN(2, 1), RCAR_GP_PIN(2, 2),
- RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 4),
- RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 6),
- RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8),
- RCAR_GP_PIN(2, 9), RCAR_GP_PIN(2, 10),
-};
-static const unsigned int vin4_data10_mux[] = {
- VI4_DATA0_MARK, VI4_DATA1_MARK,
- VI4_DATA2_MARK, VI4_DATA3_MARK,
- VI4_DATA4_MARK, VI4_DATA5_MARK,
- VI4_DATA6_MARK, VI4_DATA7_MARK,
- VI4_DATA8_MARK, VI4_DATA9_MARK,
-};
-static const unsigned int vin4_data12_pins[] = {
- RCAR_GP_PIN(2, 1), RCAR_GP_PIN(2, 2),
- RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 4),
- RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 6),
- RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8),
- RCAR_GP_PIN(2, 9), RCAR_GP_PIN(2, 10),
- RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 12),
-};
-static const unsigned int vin4_data12_mux[] = {
- VI4_DATA0_MARK, VI4_DATA1_MARK,
- VI4_DATA2_MARK, VI4_DATA3_MARK,
- VI4_DATA4_MARK, VI4_DATA5_MARK,
- VI4_DATA6_MARK, VI4_DATA7_MARK,
- VI4_DATA8_MARK, VI4_DATA9_MARK,
- VI4_DATA10_MARK, VI4_DATA11_MARK,
-};
-static const unsigned int vin4_data16_pins[] = {
- RCAR_GP_PIN(2, 1), RCAR_GP_PIN(2, 2),
- RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 4),
- RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 6),
- RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8),
- RCAR_GP_PIN(2, 9), RCAR_GP_PIN(2, 10),
- RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 12),
- RCAR_GP_PIN(2, 13), RCAR_GP_PIN(2, 14),
- RCAR_GP_PIN(2, 15), RCAR_GP_PIN(2, 16),
-};
-static const unsigned int vin4_data16_mux[] = {
- VI4_DATA0_MARK, VI4_DATA1_MARK,
- VI4_DATA2_MARK, VI4_DATA3_MARK,
- VI4_DATA4_MARK, VI4_DATA5_MARK,
- VI4_DATA6_MARK, VI4_DATA7_MARK,
- VI4_DATA8_MARK, VI4_DATA9_MARK,
- VI4_DATA10_MARK, VI4_DATA11_MARK,
- VI4_DATA12_MARK, VI4_DATA13_MARK,
- VI4_DATA14_MARK, VI4_DATA15_MARK,
-};
static const unsigned int vin4_data18_pins[] = {
RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 4),
RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 6),
@@ -1711,57 +1649,37 @@ static const unsigned int vin4_data18_mux[] = {
VI4_DATA20_MARK, VI4_DATA21_MARK,
VI4_DATA22_MARK, VI4_DATA23_MARK,
};
-static const unsigned int vin4_data20_pins[] = {
- RCAR_GP_PIN(2, 1), RCAR_GP_PIN(2, 2),
- RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 4),
- RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 6),
- RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8),
- RCAR_GP_PIN(2, 9), RCAR_GP_PIN(2, 10),
- RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 12),
- RCAR_GP_PIN(2, 13), RCAR_GP_PIN(2, 14),
- RCAR_GP_PIN(2, 15), RCAR_GP_PIN(2, 16),
- RCAR_GP_PIN(2, 17), RCAR_GP_PIN(2, 18),
- RCAR_GP_PIN(2, 19), RCAR_GP_PIN(2, 20),
-};
-static const unsigned int vin4_data20_mux[] = {
- VI4_DATA0_MARK, VI4_DATA1_MARK,
- VI4_DATA2_MARK, VI4_DATA3_MARK,
- VI4_DATA4_MARK, VI4_DATA5_MARK,
- VI4_DATA6_MARK, VI4_DATA7_MARK,
- VI4_DATA8_MARK, VI4_DATA9_MARK,
- VI4_DATA10_MARK, VI4_DATA11_MARK,
- VI4_DATA12_MARK, VI4_DATA13_MARK,
- VI4_DATA14_MARK, VI4_DATA15_MARK,
- VI4_DATA16_MARK, VI4_DATA17_MARK,
- VI4_DATA18_MARK, VI4_DATA19_MARK,
-};
-static const unsigned int vin4_data24_pins[] = {
- RCAR_GP_PIN(2, 1), RCAR_GP_PIN(2, 2),
- RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 4),
- RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 6),
- RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8),
- RCAR_GP_PIN(2, 9), RCAR_GP_PIN(2, 10),
- RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 12),
- RCAR_GP_PIN(2, 13), RCAR_GP_PIN(2, 14),
- RCAR_GP_PIN(2, 15), RCAR_GP_PIN(2, 16),
- RCAR_GP_PIN(2, 17), RCAR_GP_PIN(2, 18),
- RCAR_GP_PIN(2, 19), RCAR_GP_PIN(2, 20),
- RCAR_GP_PIN(2, 21), RCAR_GP_PIN(2, 22),
- RCAR_GP_PIN(2, 23), RCAR_GP_PIN(2, 24),
+static const union vin_data vin4_data_pins = {
+ .data24 = {
+ RCAR_GP_PIN(2, 1), RCAR_GP_PIN(2, 2),
+ RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 4),
+ RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 6),
+ RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8),
+ RCAR_GP_PIN(2, 9), RCAR_GP_PIN(2, 10),
+ RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 12),
+ RCAR_GP_PIN(2, 13), RCAR_GP_PIN(2, 14),
+ RCAR_GP_PIN(2, 15), RCAR_GP_PIN(2, 16),
+ RCAR_GP_PIN(2, 17), RCAR_GP_PIN(2, 18),
+ RCAR_GP_PIN(2, 19), RCAR_GP_PIN(2, 20),
+ RCAR_GP_PIN(2, 21), RCAR_GP_PIN(2, 22),
+ RCAR_GP_PIN(2, 23), RCAR_GP_PIN(2, 24),
+ },
};
-static const unsigned int vin4_data24_mux[] = {
- VI4_DATA0_MARK, VI4_DATA1_MARK,
- VI4_DATA2_MARK, VI4_DATA3_MARK,
- VI4_DATA4_MARK, VI4_DATA5_MARK,
- VI4_DATA6_MARK, VI4_DATA7_MARK,
- VI4_DATA8_MARK, VI4_DATA9_MARK,
- VI4_DATA10_MARK, VI4_DATA11_MARK,
- VI4_DATA12_MARK, VI4_DATA13_MARK,
- VI4_DATA14_MARK, VI4_DATA15_MARK,
- VI4_DATA16_MARK, VI4_DATA17_MARK,
- VI4_DATA18_MARK, VI4_DATA19_MARK,
- VI4_DATA20_MARK, VI4_DATA21_MARK,
- VI4_DATA22_MARK, VI4_DATA23_MARK,
+static const union vin_data vin4_data_mux = {
+ .data24 = {
+ VI4_DATA0_MARK, VI4_DATA1_MARK,
+ VI4_DATA2_MARK, VI4_DATA3_MARK,
+ VI4_DATA4_MARK, VI4_DATA5_MARK,
+ VI4_DATA6_MARK, VI4_DATA7_MARK,
+ VI4_DATA8_MARK, VI4_DATA9_MARK,
+ VI4_DATA10_MARK, VI4_DATA11_MARK,
+ VI4_DATA12_MARK, VI4_DATA13_MARK,
+ VI4_DATA14_MARK, VI4_DATA15_MARK,
+ VI4_DATA16_MARK, VI4_DATA17_MARK,
+ VI4_DATA18_MARK, VI4_DATA19_MARK,
+ VI4_DATA20_MARK, VI4_DATA21_MARK,
+ VI4_DATA22_MARK, VI4_DATA23_MARK,
+ },
};
static const unsigned int vin4_sync_pins[] = {
/* HSYNC#, VSYNC# */
@@ -1878,13 +1796,13 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
SH_PFC_PIN_GROUP(ssi4_ctrl_b),
SH_PFC_PIN_GROUP(ssi4_data_b),
SH_PFC_PIN_GROUP(usb0),
- SH_PFC_PIN_GROUP(vin4_data8),
- SH_PFC_PIN_GROUP(vin4_data10),
- SH_PFC_PIN_GROUP(vin4_data12),
- SH_PFC_PIN_GROUP(vin4_data16),
+ VIN_DATA_PIN_GROUP(vin4_data, 8),
+ VIN_DATA_PIN_GROUP(vin4_data, 10),
+ VIN_DATA_PIN_GROUP(vin4_data, 12),
+ VIN_DATA_PIN_GROUP(vin4_data, 16),
SH_PFC_PIN_GROUP(vin4_data18),
- SH_PFC_PIN_GROUP(vin4_data20),
- SH_PFC_PIN_GROUP(vin4_data24),
+ VIN_DATA_PIN_GROUP(vin4_data, 20),
+ VIN_DATA_PIN_GROUP(vin4_data, 24),
SH_PFC_PIN_GROUP(vin4_sync),
SH_PFC_PIN_GROUP(vin4_field),
SH_PFC_PIN_GROUP(vin4_clkenb),