aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-11-21 02:48:09 -0500
committerLinus Walleij <linus.walleij@linaro.org>2012-11-21 04:07:48 -0500
commit316511c0134acec8f4ea730bd1897c7a1124a7c1 (patch)
tree810d6d4444f05b399edf588c16eea1ba188903eb /drivers/gpio/gpiolib.c
parent2e8b2eab94c35d83bb7da71c63b4695f32ddca88 (diff)
gpiolib: rename pin range arguments
To be crystal clear on what the arguments mean in this funtion dealing with both GPIO and PIN ranges with confusing naming, we now have gpio_offset and pin_offset and we are on the clear that these are offsets into the specific GPIO and pin controller respectively. The GPIO chip itself will of course keep track of the base offset into the global GPIO number space. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 317ff0440e29..26e27c1fecb1 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1191,13 +1191,13 @@ EXPORT_SYMBOL_GPL(gpiochip_find);
1191 * gpiochip_add_pin_range() - add a range for GPIO <-> pin mapping 1191 * gpiochip_add_pin_range() - add a range for GPIO <-> pin mapping
1192 * @chip: the gpiochip to add the range for 1192 * @chip: the gpiochip to add the range for
1193 * @pinctrl_name: the dev_name() of the pin controller to map to 1193 * @pinctrl_name: the dev_name() of the pin controller to map to
1194 * @offset: the start offset in the current gpio_chip number space 1194 * @gpio_offset: the start offset in the current gpio_chip number space
1195 * @pin_base: the start offset in the pin controller number space 1195 * @pin_offset: the start offset in the pin controller number space
1196 * @npins: the number of pins from the offset of each pin space (GPIO and 1196 * @npins: the number of pins from the offset of each pin space (GPIO and
1197 * pin controller) to accumulate in this range 1197 * pin controller) to accumulate in this range
1198 */ 1198 */
1199int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, 1199int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
1200 unsigned int offset, unsigned int pin_base, 1200 unsigned int gpio_offset, unsigned int pin_offset,
1201 unsigned int npins) 1201 unsigned int npins)
1202{ 1202{
1203 struct gpio_pin_range *pin_range; 1203 struct gpio_pin_range *pin_range;
@@ -1210,11 +1210,11 @@ int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
1210 } 1210 }
1211 1211
1212 /* Use local offset as range ID */ 1212 /* Use local offset as range ID */
1213 pin_range->range.id = offset; 1213 pin_range->range.id = gpio_offset;
1214 pin_range->range.gc = chip; 1214 pin_range->range.gc = chip;
1215 pin_range->range.name = chip->label; 1215 pin_range->range.name = chip->label;
1216 pin_range->range.base = chip->base + offset; 1216 pin_range->range.base = chip->base + gpio_offset;
1217 pin_range->range.pin_base = pin_base; 1217 pin_range->range.pin_base = pin_offset;
1218 pin_range->range.npins = npins; 1218 pin_range->range.npins = npins;
1219 pin_range->pctldev = pinctrl_find_and_add_gpio_range(pinctl_name, 1219 pin_range->pctldev = pinctrl_find_and_add_gpio_range(pinctl_name,
1220 &pin_range->range); 1220 &pin_range->range);
@@ -1224,9 +1224,10 @@ int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
1224 kfree(pin_range); 1224 kfree(pin_range);
1225 return PTR_ERR(pin_range->pctldev); 1225 return PTR_ERR(pin_range->pctldev);
1226 } 1226 }
1227 pr_debug("%s: GPIO chip: created GPIO range %d->%d ==> PIN %d->%d\n", 1227 pr_debug("GPIO chip %s: created GPIO range %d->%d ==> %s PIN %d->%d\n",
1228 chip->label, offset, offset + npins - 1, 1228 chip->label, gpio_offset, gpio_offset + npins - 1,
1229 pin_base, pin_base + npins - 1); 1229 pinctl_name,
1230 pin_offset, pin_offset + npins - 1);
1230 1231
1231 list_add_tail(&pin_range->node, &chip->pin_ranges); 1232 list_add_tail(&pin_range->node, &chip->pin_ranges);
1232 1233