aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@stericsson.com>2012-10-08 10:50:24 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-10-28 16:16:15 -0400
commit1d853ca5bae2f728f0e7e1afa98b3a160020af4a (patch)
tree11f9914748e50864c2dfb89f8e7d5e7974ec4b67 /drivers/pinctrl
parentf64228ee23975d3703121a3d27dac488c3c813e9 (diff)
pinctrl/nomadik: allow to support several ranges per GPIO bank
With DB8500 the number of GPIO chips = number GPIO bank = number of GPIO ranges. With DB8540, a new GPIO range configuration is used, some GPIO banks can have several GPIO ranges. For example, DB8540 GPIO bank0 (GPIO0 to GPIO32) have 2 GPIO ranges: - GPIO0 to GPIO17 : routed - GPIO18 to GPIO21 : hole - GPIO22 to GPIO28 : routed - GPIO29 to GPIO32 : hole Previously, during nmk_pinctrl_probe(), all GPIO ranges were parsed, as GPIO ranges are larger than the number of GPIO chips, a warning occurs. This commit allows each bank to have several GPIO ranges. Signed-off-by: Patrice Chotard <patrice.chotard@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/pinctrl-nomadik.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
index f5c0da1f3b3..e30eb34189b 100644
--- a/drivers/pinctrl/pinctrl-nomadik.c
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -1843,11 +1843,11 @@ static int __devinit nmk_pinctrl_probe(struct platform_device *pdev)
1843 * need this to proceed. 1843 * need this to proceed.
1844 */ 1844 */
1845 for (i = 0; i < npct->soc->gpio_num_ranges; i++) { 1845 for (i = 0; i < npct->soc->gpio_num_ranges; i++) {
1846 if (!nmk_gpio_chips[i]) { 1846 if (!nmk_gpio_chips[npct->soc->gpio_ranges[i].id]) {
1847 dev_warn(&pdev->dev, "GPIO chip %d not registered yet\n", i); 1847 dev_warn(&pdev->dev, "GPIO chip %d not registered yet\n", i);
1848 return -EPROBE_DEFER; 1848 return -EPROBE_DEFER;
1849 } 1849 }
1850 npct->soc->gpio_ranges[i].gc = &nmk_gpio_chips[i]->chip; 1850 npct->soc->gpio_ranges[i].gc = &nmk_gpio_chips[npct->soc->gpio_ranges[i].id]->chip;
1851 } 1851 }
1852 1852
1853 nmk_pinctrl_desc.pins = npct->soc->pins; 1853 nmk_pinctrl_desc.pins = npct->soc->pins;