aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sh-pfc
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2012-11-29 06:24:51 -0500
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-03-15 08:33:37 -0400
commitcaa5bac3b4749ae3dca1db33d648280197f91a56 (patch)
tree46c1f7982dc320299740395fe1b0af543d8a0fc2 /drivers/pinctrl/sh-pfc
parentd7a7ca5781fa2ac40319acc7125c487db5b26d91 (diff)
sh-pfc: Replace SoC info data and mark ranges with a number of pins
The data and mark ranges are only used to check whether a GPIO corresponds to a real pin or a function. As pins come first in the list of GPIOs and in the platform-specific GPIO enumerations, we can replace the data and mark ranges by a number of pins. Add an nr_pins field to struct sh_pfc_soc_info to store the number of pins implemented by the SoC, remove the data and mark range fields and introduce sh_pfc_gpio_is_pin() and sh_pfc_gpio_is_function() functions to replace range-based checks. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/sh-pfc')
-rw-r--r--drivers/pinctrl/sh-pfc/core.c27
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a7740.c5
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a7779.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7203.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7264.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7269.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7372.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh73a0.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7720.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7722.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7723.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7724.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7734.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7757.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7785.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh7786.c3
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-shx3.c3
-rw-r--r--drivers/pinctrl/sh-pfc/sh_pfc.h3
18 files changed, 36 insertions, 44 deletions
diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
index 1b86a906a97b..e7ad0d93fed4 100644
--- a/drivers/pinctrl/sh-pfc/core.c
+++ b/drivers/pinctrl/sh-pfc/core.c
@@ -89,6 +89,18 @@ static int sh_pfc_enum_in_range(pinmux_enum_t enum_id, struct pinmux_range *r)
89 return 1; 89 return 1;
90} 90}
91 91
92static bool sh_pfc_gpio_is_pin(struct sh_pfc *pfc, unsigned int gpio)
93{
94 return (gpio < pfc->info->nr_pins) &&
95 (pfc->info->gpios[gpio].enum_id != 0);
96}
97
98static bool sh_pfc_gpio_is_function(struct sh_pfc *pfc, unsigned int gpio)
99{
100 return (gpio >= pfc->info->nr_pins) && (gpio < pfc->info->nr_gpios) &&
101 (pfc->info->gpios[gpio].enum_id != 0);
102}
103
92static unsigned long sh_pfc_read_raw_reg(void __iomem *mapped_reg, 104static unsigned long sh_pfc_read_raw_reg(void __iomem *mapped_reg,
93 unsigned long reg_width) 105 unsigned long reg_width)
94{ 106{
@@ -226,7 +238,7 @@ static int sh_pfc_setup_data_reg(struct sh_pfc *pfc, unsigned gpio)
226 struct pinmux_data_reg *data_reg; 238 struct pinmux_data_reg *data_reg;
227 int k, n; 239 int k, n;
228 240
229 if (!sh_pfc_enum_in_range(gpiop->enum_id, &pfc->info->data)) 241 if (!sh_pfc_gpio_is_pin(pfc, gpio))
230 return -1; 242 return -1;
231 243
232 k = 0; 244 k = 0;
@@ -260,7 +272,7 @@ static void sh_pfc_setup_data_regs(struct sh_pfc *pfc)
260 struct pinmux_data_reg *drp; 272 struct pinmux_data_reg *drp;
261 int k; 273 int k;
262 274
263 for (k = 0; k < pfc->info->nr_gpios; k++) 275 for (k = 0; k < pfc->info->nr_pins; k++)
264 sh_pfc_setup_data_reg(pfc, k); 276 sh_pfc_setup_data_reg(pfc, k);
265 277
266 k = 0; 278 k = 0;
@@ -282,7 +294,7 @@ int sh_pfc_get_data_reg(struct sh_pfc *pfc, unsigned gpio,
282 struct pinmux_gpio *gpiop = &pfc->info->gpios[gpio]; 294 struct pinmux_gpio *gpiop = &pfc->info->gpios[gpio];
283 int k, n; 295 int k, n;
284 296
285 if (!sh_pfc_enum_in_range(gpiop->enum_id, &pfc->info->data)) 297 if (!sh_pfc_gpio_is_pin(pfc, gpio))
286 return -1; 298 return -1;
287 299
288 k = (gpiop->flags & PINMUX_FLAG_DREG) >> PINMUX_FLAG_DREG_SHIFT; 300 k = (gpiop->flags & PINMUX_FLAG_DREG) >> PINMUX_FLAG_DREG_SHIFT;
@@ -344,11 +356,10 @@ int sh_pfc_gpio_to_enum(struct sh_pfc *pfc, unsigned gpio, int pos,
344 pinmux_enum_t *data = pfc->info->gpio_data; 356 pinmux_enum_t *data = pfc->info->gpio_data;
345 int k; 357 int k;
346 358
347 if (!sh_pfc_enum_in_range(enum_id, &pfc->info->data)) { 359 if (!sh_pfc_gpio_is_pin(pfc, gpio) &&
348 if (!sh_pfc_enum_in_range(enum_id, &pfc->info->mark)) { 360 !sh_pfc_gpio_is_function(pfc, gpio)) {
349 pr_err("non data/mark enum_id for gpio %d\n", gpio); 361 pr_err("non data/mark enum_id for gpio %d\n", gpio);
350 return -1; 362 return -1;
351 }
352 } 363 }
353 364
354 if (pos) { 365 if (pos) {
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7740.c b/drivers/pinctrl/sh-pfc/pfc-r8a7740.c
index c189a86fe8d3..f1ef9f77dd83 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7740.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7740.c
@@ -2582,8 +2582,6 @@ static struct pinmux_irq pinmux_irqs[] = {
2582struct sh_pfc_soc_info r8a7740_pinmux_info = { 2582struct sh_pfc_soc_info r8a7740_pinmux_info = {
2583 .name = "r8a7740_pfc", 2583 .name = "r8a7740_pfc",
2584 .reserved_id = PINMUX_RESERVED, 2584 .reserved_id = PINMUX_RESERVED,
2585 .data = { PINMUX_DATA_BEGIN,
2586 PINMUX_DATA_END },
2587 .input = { PINMUX_INPUT_BEGIN, 2585 .input = { PINMUX_INPUT_BEGIN,
2588 PINMUX_INPUT_END }, 2586 PINMUX_INPUT_END },
2589 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, 2587 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN,
@@ -2592,12 +2590,11 @@ struct sh_pfc_soc_info r8a7740_pinmux_info = {
2592 PINMUX_INPUT_PULLDOWN_END }, 2590 PINMUX_INPUT_PULLDOWN_END },
2593 .output = { PINMUX_OUTPUT_BEGIN, 2591 .output = { PINMUX_OUTPUT_BEGIN,
2594 PINMUX_OUTPUT_END }, 2592 PINMUX_OUTPUT_END },
2595 .mark = { PINMUX_MARK_BEGIN,
2596 PINMUX_MARK_END },
2597 .function = { PINMUX_FUNCTION_BEGIN, 2593 .function = { PINMUX_FUNCTION_BEGIN,
2598 PINMUX_FUNCTION_END }, 2594 PINMUX_FUNCTION_END },
2599 2595
2600 .gpios = pinmux_gpios, 2596 .gpios = pinmux_gpios,
2597 .nr_pins = GPIO_PORT211 + 1,
2601 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 2598 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
2602 2599
2603 .cfg_regs = pinmux_config_regs, 2600 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7779.c b/drivers/pinctrl/sh-pfc/pfc-r8a7779.c
index 16ec97a31b38..c8018ce0e894 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7779.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7779.c
@@ -2606,13 +2606,12 @@ struct sh_pfc_soc_info r8a7779_pinmux_info = {
2606 .unlock_reg = 0xfffc0000, /* PMMR */ 2606 .unlock_reg = 0xfffc0000, /* PMMR */
2607 2607
2608 .reserved_id = PINMUX_RESERVED, 2608 .reserved_id = PINMUX_RESERVED,
2609 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2610 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 2609 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
2611 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 2610 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
2612 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2613 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 2611 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2614 2612
2615 .gpios = pinmux_gpios, 2613 .gpios = pinmux_gpios,
2614 .nr_pins = GPIO_GP_6_8 + 1,
2616 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 2615 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
2617 2616
2618 .cfg_regs = pinmux_config_regs, 2617 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7203.c b/drivers/pinctrl/sh-pfc/pfc-sh7203.c
index 6cc67017e8fe..07377e4920a3 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7203.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7203.c
@@ -1574,13 +1574,12 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
1574struct sh_pfc_soc_info sh7203_pinmux_info = { 1574struct sh_pfc_soc_info sh7203_pinmux_info = {
1575 .name = "sh7203_pfc", 1575 .name = "sh7203_pfc",
1576 .reserved_id = PINMUX_RESERVED, 1576 .reserved_id = PINMUX_RESERVED,
1577 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1578 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END, FORCE_IN }, 1577 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END, FORCE_IN },
1579 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END, FORCE_OUT }, 1578 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END, FORCE_OUT },
1580 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1581 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 1579 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1582 1580
1583 .gpios = pinmux_gpios, 1581 .gpios = pinmux_gpios,
1582 .nr_pins = GPIO_PF0 + 1,
1584 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 1583 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
1585 1584
1586 .cfg_regs = pinmux_config_regs, 1585 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7264.c b/drivers/pinctrl/sh-pfc/pfc-sh7264.c
index c2ecc65ff252..21b5899f32cb 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7264.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7264.c
@@ -2113,13 +2113,12 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
2113struct sh_pfc_soc_info sh7264_pinmux_info = { 2113struct sh_pfc_soc_info sh7264_pinmux_info = {
2114 .name = "sh7264_pfc", 2114 .name = "sh7264_pfc",
2115 .reserved_id = PINMUX_RESERVED, 2115 .reserved_id = PINMUX_RESERVED,
2116 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2117 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END, FORCE_IN }, 2116 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END, FORCE_IN },
2118 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END, FORCE_OUT }, 2117 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END, FORCE_OUT },
2119 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2120 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 2118 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2121 2119
2122 .gpios = pinmux_gpios, 2120 .gpios = pinmux_gpios,
2121 .nr_pins = GPIO_PK0 + 1,
2123 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 2122 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
2124 2123
2125 .cfg_regs = pinmux_config_regs, 2124 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7269.c b/drivers/pinctrl/sh-pfc/pfc-sh7269.c
index 2013f4fa24f2..b722de1e7b28 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7269.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7269.c
@@ -2816,13 +2816,12 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
2816struct sh_pfc_soc_info sh7269_pinmux_info = { 2816struct sh_pfc_soc_info sh7269_pinmux_info = {
2817 .name = "sh7269_pfc", 2817 .name = "sh7269_pfc",
2818 .reserved_id = PINMUX_RESERVED, 2818 .reserved_id = PINMUX_RESERVED,
2819 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2820 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END, FORCE_IN }, 2819 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END, FORCE_IN },
2821 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END, FORCE_OUT }, 2820 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END, FORCE_OUT },
2822 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2823 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 2821 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2824 2822
2825 .gpios = pinmux_gpios, 2823 .gpios = pinmux_gpios,
2824 .nr_pins = GPIO_PJ0 + 1,
2826 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 2825 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
2827 2826
2828 .cfg_regs = pinmux_config_regs, 2827 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7372.c b/drivers/pinctrl/sh-pfc/pfc-sh7372.c
index 332cf34a867f..0c56f579fc0f 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7372.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7372.c
@@ -1635,15 +1635,14 @@ static struct pinmux_irq pinmux_irqs[] = {
1635struct sh_pfc_soc_info sh7372_pinmux_info = { 1635struct sh_pfc_soc_info sh7372_pinmux_info = {
1636 .name = "sh7372_pfc", 1636 .name = "sh7372_pfc",
1637 .reserved_id = PINMUX_RESERVED, 1637 .reserved_id = PINMUX_RESERVED,
1638 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1639 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 1638 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1640 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END }, 1639 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1641 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END }, 1640 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
1642 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 1641 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1643 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1644 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 1642 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1645 1643
1646 .gpios = pinmux_gpios, 1644 .gpios = pinmux_gpios,
1645 .nr_pins = GPIO_PORT190 + 1,
1647 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 1646 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
1648 1647
1649 .cfg_regs = pinmux_config_regs, 1648 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh73a0.c b/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
index d5ee0f7680af..6573dbab7b27 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
@@ -2771,15 +2771,14 @@ static struct pinmux_irq pinmux_irqs[] = {
2771struct sh_pfc_soc_info sh73a0_pinmux_info = { 2771struct sh_pfc_soc_info sh73a0_pinmux_info = {
2772 .name = "sh73a0_pfc", 2772 .name = "sh73a0_pfc",
2773 .reserved_id = PINMUX_RESERVED, 2773 .reserved_id = PINMUX_RESERVED,
2774 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2775 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 2774 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
2776 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END }, 2775 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
2777 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END }, 2776 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
2778 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 2777 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
2779 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2780 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 2778 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2781 2779
2782 .gpios = pinmux_gpios, 2780 .gpios = pinmux_gpios,
2781 .nr_pins = GPIO_PORT309 + 1,
2783 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 2782 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
2784 2783
2785 .cfg_regs = pinmux_config_regs, 2784 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7720.c b/drivers/pinctrl/sh-pfc/pfc-sh7720.c
index 8646237e9dff..48771779946c 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7720.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7720.c
@@ -1216,14 +1216,13 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
1216struct sh_pfc_soc_info sh7720_pinmux_info = { 1216struct sh_pfc_soc_info sh7720_pinmux_info = {
1217 .name = "sh7720_pfc", 1217 .name = "sh7720_pfc",
1218 .reserved_id = PINMUX_RESERVED, 1218 .reserved_id = PINMUX_RESERVED,
1219 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1220 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 1219 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1221 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END }, 1220 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1222 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 1221 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1223 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1224 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 1222 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1225 1223
1226 .gpios = pinmux_gpios, 1224 .gpios = pinmux_gpios,
1225 .nr_pins = GPIO_PTV0 + 1,
1227 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 1226 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
1228 1227
1229 .cfg_regs = pinmux_config_regs, 1228 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7722.c b/drivers/pinctrl/sh-pfc/pfc-sh7722.c
index 194ae3de5a05..7cedac6e735d 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7722.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7722.c
@@ -1759,15 +1759,14 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
1759struct sh_pfc_soc_info sh7722_pinmux_info = { 1759struct sh_pfc_soc_info sh7722_pinmux_info = {
1760 .name = "sh7722_pfc", 1760 .name = "sh7722_pfc",
1761 .reserved_id = PINMUX_RESERVED, 1761 .reserved_id = PINMUX_RESERVED,
1762 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1763 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 1762 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1764 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END }, 1763 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
1765 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END }, 1764 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1766 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 1765 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1767 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1768 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 1766 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1769 1767
1770 .gpios = pinmux_gpios, 1768 .gpios = pinmux_gpios,
1769 .nr_pins = GPIO_PTZ1 + 1,
1771 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 1770 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
1772 1771
1773 .cfg_regs = pinmux_config_regs, 1772 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7723.c b/drivers/pinctrl/sh-pfc/pfc-sh7723.c
index f31aa4f6b165..160edf01c04b 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7723.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7723.c
@@ -1884,14 +1884,13 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
1884struct sh_pfc_soc_info sh7723_pinmux_info = { 1884struct sh_pfc_soc_info sh7723_pinmux_info = {
1885 .name = "sh7723_pfc", 1885 .name = "sh7723_pfc",
1886 .reserved_id = PINMUX_RESERVED, 1886 .reserved_id = PINMUX_RESERVED,
1887 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1888 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 1887 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1889 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END }, 1888 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1890 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 1889 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1891 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1892 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 1890 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1893 1891
1894 .gpios = pinmux_gpios, 1892 .gpios = pinmux_gpios,
1893 .nr_pins = GPIO_PTZ0 + 1,
1895 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 1894 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
1896 1895
1897 .cfg_regs = pinmux_config_regs, 1896 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7724.c b/drivers/pinctrl/sh-pfc/pfc-sh7724.c
index 64b69b709f0f..269f33d6eb0a 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7724.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7724.c
@@ -2206,14 +2206,13 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
2206struct sh_pfc_soc_info sh7724_pinmux_info = { 2206struct sh_pfc_soc_info sh7724_pinmux_info = {
2207 .name = "sh7724_pfc", 2207 .name = "sh7724_pfc",
2208 .reserved_id = PINMUX_RESERVED, 2208 .reserved_id = PINMUX_RESERVED,
2209 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2210 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 2209 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
2211 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END }, 2210 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
2212 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 2211 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
2213 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2214 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 2212 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2215 2213
2216 .gpios = pinmux_gpios, 2214 .gpios = pinmux_gpios,
2215 .nr_pins = GPIO_PTZ0 + 1,
2217 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 2216 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
2218 2217
2219 .cfg_regs = pinmux_config_regs, 2218 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7734.c b/drivers/pinctrl/sh-pfc/pfc-sh7734.c
index d67a572de822..be5cca66815e 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7734.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7734.c
@@ -2457,13 +2457,12 @@ struct sh_pfc_soc_info sh7734_pinmux_info = {
2457 .unlock_reg = 0xFFFC0000, 2457 .unlock_reg = 0xFFFC0000,
2458 2458
2459 .reserved_id = PINMUX_RESERVED, 2459 .reserved_id = PINMUX_RESERVED,
2460 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2461 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 2460 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
2462 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 2461 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
2463 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2464 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 2462 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2465 2463
2466 .gpios = pinmux_gpios, 2464 .gpios = pinmux_gpios,
2465 .nr_pins = GPIO_GP_5_11 + 1,
2467 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 2466 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
2468 2467
2469 .cfg_regs = pinmux_config_regs, 2468 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7757.c b/drivers/pinctrl/sh-pfc/pfc-sh7757.c
index 7fc1310faf9c..d95f5b8ae36f 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7757.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7757.c
@@ -2263,14 +2263,13 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
2263struct sh_pfc_soc_info sh7757_pinmux_info = { 2263struct sh_pfc_soc_info sh7757_pinmux_info = {
2264 .name = "sh7757_pfc", 2264 .name = "sh7757_pfc",
2265 .reserved_id = PINMUX_RESERVED, 2265 .reserved_id = PINMUX_RESERVED,
2266 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2267 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 2266 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
2268 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END }, 2267 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
2269 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 2268 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
2270 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2271 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 2269 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2272 2270
2273 .gpios = pinmux_gpios, 2271 .gpios = pinmux_gpios,
2272 .nr_pins = GPIO_PTZ7 + 1,
2274 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 2273 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
2275 2274
2276 .cfg_regs = pinmux_config_regs, 2275 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7785.c b/drivers/pinctrl/sh-pfc/pfc-sh7785.c
index 4bde4b56de58..0d4c6de2c0be 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7785.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7785.c
@@ -1285,14 +1285,13 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
1285struct sh_pfc_soc_info sh7785_pinmux_info = { 1285struct sh_pfc_soc_info sh7785_pinmux_info = {
1286 .name = "sh7785_pfc", 1286 .name = "sh7785_pfc",
1287 .reserved_id = PINMUX_RESERVED, 1287 .reserved_id = PINMUX_RESERVED,
1288 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1289 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 1288 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1290 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END }, 1289 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1291 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 1290 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1292 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1293 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 1291 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1294 1292
1295 .gpios = pinmux_gpios, 1293 .gpios = pinmux_gpios,
1294 .nr_pins = GPIO_PR0 + 1,
1296 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 1295 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
1297 1296
1298 .cfg_regs = pinmux_config_regs, 1297 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7786.c b/drivers/pinctrl/sh-pfc/pfc-sh7786.c
index 9a42d25312d9..2981d0be82a5 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7786.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7786.c
@@ -818,14 +818,13 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
818struct sh_pfc_soc_info sh7786_pinmux_info = { 818struct sh_pfc_soc_info sh7786_pinmux_info = {
819 .name = "sh7786_pfc", 819 .name = "sh7786_pfc",
820 .reserved_id = PINMUX_RESERVED, 820 .reserved_id = PINMUX_RESERVED,
821 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
822 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 821 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
823 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END }, 822 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
824 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 823 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
825 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
826 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 824 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
827 825
828 .gpios = pinmux_gpios, 826 .gpios = pinmux_gpios,
827 .nr_pins = GPIO_PJ0 + 1,
829 .nr_gpios = ARRAY_SIZE(pinmux_gpios), 828 .nr_gpios = ARRAY_SIZE(pinmux_gpios),
830 829
831 .cfg_regs = pinmux_config_regs, 830 .cfg_regs = pinmux_config_regs,
diff --git a/drivers/pinctrl/sh-pfc/pfc-shx3.c b/drivers/pinctrl/sh-pfc/pfc-shx3.c
index b23f5f9a8429..e985099b7777 100644
--- a/drivers/pinctrl/sh-pfc/pfc-shx3.c
+++ b/drivers/pinctrl/sh-pfc/pfc-shx3.c
@@ -565,14 +565,13 @@ static struct pinmux_data_reg shx3_pinmux_data_regs[] = {
565struct sh_pfc_soc_info shx3_pinmux_info = { 565struct sh_pfc_soc_info shx3_pinmux_info = {
566 .name = "shx3_pfc", 566 .name = "shx3_pfc",
567 .reserved_id = PINMUX_RESERVED, 567 .reserved_id = PINMUX_RESERVED,
568 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
569 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 568 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
570 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, 569 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN,
571 PINMUX_INPUT_PULLUP_END }, 570 PINMUX_INPUT_PULLUP_END },
572 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 571 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
573 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
574 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 572 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
575 .gpios = shx3_pinmux_gpios, 573 .gpios = shx3_pinmux_gpios,
574 .nr_pins = GPIO_PH0 + 1,
576 .nr_gpios = ARRAY_SIZE(shx3_pinmux_gpios), 575 .nr_gpios = ARRAY_SIZE(shx3_pinmux_gpios),
577 .gpio_data = shx3_pinmux_data, 576 .gpio_data = shx3_pinmux_data,
578 .gpio_data_size = ARRAY_SIZE(shx3_pinmux_data), 577 .gpio_data_size = ARRAY_SIZE(shx3_pinmux_data),
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
index 67fe91b051cb..c50fb51a7fac 100644
--- a/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -91,15 +91,14 @@ struct pinmux_range {
91struct sh_pfc_soc_info { 91struct sh_pfc_soc_info {
92 char *name; 92 char *name;
93 pinmux_enum_t reserved_id; 93 pinmux_enum_t reserved_id;
94 struct pinmux_range data;
95 struct pinmux_range input; 94 struct pinmux_range input;
96 struct pinmux_range input_pd; 95 struct pinmux_range input_pd;
97 struct pinmux_range input_pu; 96 struct pinmux_range input_pu;
98 struct pinmux_range output; 97 struct pinmux_range output;
99 struct pinmux_range mark;
100 struct pinmux_range function; 98 struct pinmux_range function;
101 99
102 struct pinmux_gpio *gpios; 100 struct pinmux_gpio *gpios;
101 unsigned int nr_pins;
103 unsigned int nr_gpios; 102 unsigned int nr_gpios;
104 103
105 struct pinmux_cfg_reg *cfg_regs; 104 struct pinmux_cfg_reg *cfg_regs;