aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sh-pfc/gpio.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2012-12-15 17:51:20 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-01-24 19:24:26 -0500
commit19bb7fe36950ff74ce322cc29f6f4e025999f1f0 (patch)
tree60bfaecf7af2940af44928131cba9054004105e6 /drivers/pinctrl/sh-pfc/gpio.c
parent6e54d8d252ed09ae148af6565971974af9a96e10 (diff)
sh-pfc: Support pinmux info in driver data instead of platform data
Pinmux information should be provided by the pinmux driver, not arch code. Make it possible to do so by supporting pinmux information passed through the driver_data field in the platform ID table. Platform data will remain supported until all arch code has been converted. Rename the sh_pfc_platform_data structure to sh_pfc_soc_info to reflect this. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Paul Mundt <lethal@linux-sh.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'drivers/pinctrl/sh-pfc/gpio.c')
-rw-r--r--drivers/pinctrl/sh-pfc/gpio.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c
index a0454f321710..3cbdfea1dec0 100644
--- a/drivers/pinctrl/sh-pfc/gpio.c
+++ b/drivers/pinctrl/sh-pfc/gpio.c
@@ -106,11 +106,11 @@ static int sh_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
106 if (pos <= 0 || !enum_id) 106 if (pos <= 0 || !enum_id)
107 break; 107 break;
108 108
109 for (i = 0; i < pfc->pdata->gpio_irq_size; i++) { 109 for (i = 0; i < pfc->info->gpio_irq_size; i++) {
110 enum_ids = pfc->pdata->gpio_irq[i].enum_ids; 110 enum_ids = pfc->info->gpio_irq[i].enum_ids;
111 for (k = 0; enum_ids[k]; k++) { 111 for (k = 0; enum_ids[k]; k++) {
112 if (enum_ids[k] == enum_id) 112 if (enum_ids[k] == enum_id)
113 return pfc->pdata->gpio_irq[i].irq; 113 return pfc->info->gpio_irq[i].irq;
114 } 114 }
115 } 115 }
116 } 116 }
@@ -131,12 +131,12 @@ static void sh_pfc_gpio_setup(struct sh_pfc_chip *chip)
131 gc->set = sh_gpio_set; 131 gc->set = sh_gpio_set;
132 gc->to_irq = sh_gpio_to_irq; 132 gc->to_irq = sh_gpio_to_irq;
133 133
134 WARN_ON(pfc->pdata->first_gpio != 0); /* needs testing */ 134 WARN_ON(pfc->info->first_gpio != 0); /* needs testing */
135 135
136 gc->label = pfc->pdata->name; 136 gc->label = pfc->info->name;
137 gc->owner = THIS_MODULE; 137 gc->owner = THIS_MODULE;
138 gc->base = pfc->pdata->first_gpio; 138 gc->base = pfc->info->first_gpio;
139 gc->ngpio = (pfc->pdata->last_gpio - pfc->pdata->first_gpio) + 1; 139 gc->ngpio = (pfc->info->last_gpio - pfc->info->first_gpio) + 1;
140} 140}
141 141
142int sh_pfc_register_gpiochip(struct sh_pfc *pfc) 142int sh_pfc_register_gpiochip(struct sh_pfc *pfc)
@@ -159,8 +159,8 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc)
159 pfc->gpio = chip; 159 pfc->gpio = chip;
160 160
161 pr_info("%s handling gpio %d -> %d\n", 161 pr_info("%s handling gpio %d -> %d\n",
162 pfc->pdata->name, pfc->pdata->first_gpio, 162 pfc->info->name, pfc->info->first_gpio,
163 pfc->pdata->last_gpio); 163 pfc->info->last_gpio);
164 164
165 return 0; 165 return 0;
166} 166}