pinctrl: add pinctrl_add_gpio_ranges function
authorDong Aisheng <dong.aisheng@linaro.org>
Wed, 23 May 2012 13:22:41 +0000 (21:22 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 3 Jul 2012 19:51:08 +0000 (21:51 +0200)
Often GPIO ranges are added in batch, so create a special
function for that.

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/core.c
include/linux/pinctrl/pinctrl.h

index 902428dfb37e81a02371024ba7514a4942970b4a..fb7f3bebdc69dadec1451773c596c9b901821265 100644 (file)
@@ -332,6 +332,17 @@ void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
 }
 EXPORT_SYMBOL_GPL(pinctrl_add_gpio_range);
 
+void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev,
+                            struct pinctrl_gpio_range *ranges,
+                            unsigned nranges)
+{
+       int i;
+
+       for (i = 0; i < nranges; i++)
+               pinctrl_add_gpio_range(pctldev, &ranges[i]);
+}
+EXPORT_SYMBOL_GPL(pinctrl_add_gpio_ranges);
+
 /**
  * pinctrl_get_group_selector() - returns the group selector for a group
  * @pctldev: the pin controller handling the group
index 170a588a55b601f29ef34b05e4f25faea3c6849b..69393a662532a80072f8283d0bfc3d2832b62324 100644 (file)
@@ -131,6 +131,9 @@ extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
 extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin);
 extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
                                struct pinctrl_gpio_range *range);
+extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev,
+                               struct pinctrl_gpio_range *ranges,
+                               unsigned nranges);
 extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
 extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
 #else