diff options
author | Dong Aisheng <dong.aisheng@linaro.org> | 2012-05-23 09:22:41 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-07-03 15:51:08 -0400 |
commit | 3e5e00b654997aa2c3998d30f7213b9611eb23d7 (patch) | |
tree | fc086243b83c88df75604165633fa62212921677 | |
parent | 5d589b092ab212bbcc27828167e1c036e7fc77d2 (diff) |
pinctrl: add pinctrl_add_gpio_ranges function
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>
-rw-r--r-- | drivers/pinctrl/core.c | 11 | ||||
-rw-r--r-- | include/linux/pinctrl/pinctrl.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 902428dfb37e..fb7f3bebdc69 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -332,6 +332,17 @@ void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev, | |||
332 | } | 332 | } |
333 | EXPORT_SYMBOL_GPL(pinctrl_add_gpio_range); | 333 | EXPORT_SYMBOL_GPL(pinctrl_add_gpio_range); |
334 | 334 | ||
335 | void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev, | ||
336 | struct pinctrl_gpio_range *ranges, | ||
337 | unsigned nranges) | ||
338 | { | ||
339 | int i; | ||
340 | |||
341 | for (i = 0; i < nranges; i++) | ||
342 | pinctrl_add_gpio_range(pctldev, &ranges[i]); | ||
343 | } | ||
344 | EXPORT_SYMBOL_GPL(pinctrl_add_gpio_ranges); | ||
345 | |||
335 | /** | 346 | /** |
336 | * pinctrl_get_group_selector() - returns the group selector for a group | 347 | * pinctrl_get_group_selector() - returns the group selector for a group |
337 | * @pctldev: the pin controller handling the group | 348 | * @pctldev: the pin controller handling the group |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 170a588a55b6..69393a662532 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
@@ -131,6 +131,9 @@ extern void pinctrl_unregister(struct pinctrl_dev *pctldev); | |||
131 | extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin); | 131 | extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin); |
132 | extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev, | 132 | extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev, |
133 | struct pinctrl_gpio_range *range); | 133 | struct pinctrl_gpio_range *range); |
134 | extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev, | ||
135 | struct pinctrl_gpio_range *ranges, | ||
136 | unsigned nranges); | ||
134 | extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); | 137 | extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); |
135 | extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); | 138 | extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); |
136 | #else | 139 | #else |