diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2014-10-23 04:27:07 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-10-28 12:30:59 -0400 |
commit | e3a2e87893125bcd99bd7e1ddf9bfc421e492572 (patch) | |
tree | 725e03df58827c8eca35ffb787f43921c55046b2 | |
parent | ee2a9f7f06a5bff86cf3468fe74bf504640cf5e6 (diff) |
gpio: rename gpio_lock_as_irq to gpiochip_lock_as_irq
This function actually operates on a gpio_chip, so its prefix should
reflect that fact for consistency with other functions defined in
gpio/driver.h.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | Documentation/gpio/driver.txt | 4 | ||||
-rw-r--r-- | drivers/gpio/gpio-bcm-kona.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpio-dwapb.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpio-em.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpio-mcp23s08.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpio-omap.c | 2 | ||||
-rw-r--r-- | drivers/gpio/gpio-tegra.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpio-vr41xx.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpiolib-acpi.c | 6 | ||||
-rw-r--r-- | drivers/gpio/gpiolib-sysfs.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpiolib.c | 16 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-at91.c | 4 | ||||
-rw-r--r-- | drivers/pinctrl/samsung/pinctrl-exynos.c | 4 | ||||
-rw-r--r-- | drivers/pinctrl/sunxi/pinctrl-sunxi.c | 6 | ||||
-rw-r--r-- | include/linux/gpio.h | 7 | ||||
-rw-r--r-- | include/linux/gpio/driver.h | 4 |
16 files changed, 41 insertions, 40 deletions
diff --git a/Documentation/gpio/driver.txt b/Documentation/gpio/driver.txt index 31e0b5db55d8..90d0f6aba7a6 100644 --- a/Documentation/gpio/driver.txt +++ b/Documentation/gpio/driver.txt | |||
@@ -158,12 +158,12 @@ Locking IRQ usage | |||
158 | Input GPIOs can be used as IRQ signals. When this happens, a driver is requested | 158 | Input GPIOs can be used as IRQ signals. When this happens, a driver is requested |
159 | to mark the GPIO as being used as an IRQ: | 159 | to mark the GPIO as being used as an IRQ: |
160 | 160 | ||
161 | int gpio_lock_as_irq(struct gpio_chip *chip, unsigned int offset) | 161 | int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset) |
162 | 162 | ||
163 | This will prevent the use of non-irq related GPIO APIs until the GPIO IRQ lock | 163 | This will prevent the use of non-irq related GPIO APIs until the GPIO IRQ lock |
164 | is released: | 164 | is released: |
165 | 165 | ||
166 | void gpio_unlock_as_irq(struct gpio_chip *chip, unsigned int offset) | 166 | void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset) |
167 | 167 | ||
168 | When implementing an irqchip inside a GPIO driver, these two functions should | 168 | When implementing an irqchip inside a GPIO driver, these two functions should |
169 | typically be called in the .startup() and .shutdown() callbacks from the | 169 | typically be called in the .startup() and .shutdown() callbacks from the |
diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index de0801e9767a..56fb5ce47aa1 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c | |||
@@ -470,7 +470,7 @@ static int bcm_kona_gpio_irq_reqres(struct irq_data *d) | |||
470 | { | 470 | { |
471 | struct bcm_kona_gpio *kona_gpio = irq_data_get_irq_chip_data(d); | 471 | struct bcm_kona_gpio *kona_gpio = irq_data_get_irq_chip_data(d); |
472 | 472 | ||
473 | if (gpio_lock_as_irq(&kona_gpio->gpio_chip, d->hwirq)) { | 473 | if (gpiochip_lock_as_irq(&kona_gpio->gpio_chip, d->hwirq)) { |
474 | dev_err(kona_gpio->gpio_chip.dev, | 474 | dev_err(kona_gpio->gpio_chip.dev, |
475 | "unable to lock HW IRQ %lu for IRQ\n", | 475 | "unable to lock HW IRQ %lu for IRQ\n", |
476 | d->hwirq); | 476 | d->hwirq); |
@@ -483,7 +483,7 @@ static void bcm_kona_gpio_irq_relres(struct irq_data *d) | |||
483 | { | 483 | { |
484 | struct bcm_kona_gpio *kona_gpio = irq_data_get_irq_chip_data(d); | 484 | struct bcm_kona_gpio *kona_gpio = irq_data_get_irq_chip_data(d); |
485 | 485 | ||
486 | gpio_unlock_as_irq(&kona_gpio->gpio_chip, d->hwirq); | 486 | gpiochip_unlock_as_irq(&kona_gpio->gpio_chip, d->hwirq); |
487 | } | 487 | } |
488 | 488 | ||
489 | static struct irq_chip bcm_gpio_irq_chip = { | 489 | static struct irq_chip bcm_gpio_irq_chip = { |
diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index b43cd84b61f1..4beb37839392 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c | |||
@@ -194,7 +194,7 @@ static int dwapb_irq_reqres(struct irq_data *d) | |||
194 | struct dwapb_gpio *gpio = igc->private; | 194 | struct dwapb_gpio *gpio = igc->private; |
195 | struct bgpio_chip *bgc = &gpio->ports[0].bgc; | 195 | struct bgpio_chip *bgc = &gpio->ports[0].bgc; |
196 | 196 | ||
197 | if (gpio_lock_as_irq(&bgc->gc, irqd_to_hwirq(d))) { | 197 | if (gpiochip_lock_as_irq(&bgc->gc, irqd_to_hwirq(d))) { |
198 | dev_err(gpio->dev, "unable to lock HW IRQ %lu for IRQ\n", | 198 | dev_err(gpio->dev, "unable to lock HW IRQ %lu for IRQ\n", |
199 | irqd_to_hwirq(d)); | 199 | irqd_to_hwirq(d)); |
200 | return -EINVAL; | 200 | return -EINVAL; |
@@ -208,7 +208,7 @@ static void dwapb_irq_relres(struct irq_data *d) | |||
208 | struct dwapb_gpio *gpio = igc->private; | 208 | struct dwapb_gpio *gpio = igc->private; |
209 | struct bgpio_chip *bgc = &gpio->ports[0].bgc; | 209 | struct bgpio_chip *bgc = &gpio->ports[0].bgc; |
210 | 210 | ||
211 | gpio_unlock_as_irq(&bgc->gc, irqd_to_hwirq(d)); | 211 | gpiochip_unlock_as_irq(&bgc->gc, irqd_to_hwirq(d)); |
212 | } | 212 | } |
213 | 213 | ||
214 | static int dwapb_irq_set_type(struct irq_data *d, u32 type) | 214 | static int dwapb_irq_set_type(struct irq_data *d, u32 type) |
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c index fe49ec3cdb7d..21d34d4d473d 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c | |||
@@ -103,7 +103,7 @@ static int em_gio_irq_reqres(struct irq_data *d) | |||
103 | { | 103 | { |
104 | struct em_gio_priv *p = irq_data_get_irq_chip_data(d); | 104 | struct em_gio_priv *p = irq_data_get_irq_chip_data(d); |
105 | 105 | ||
106 | if (gpio_lock_as_irq(&p->gpio_chip, irqd_to_hwirq(d))) { | 106 | if (gpiochip_lock_as_irq(&p->gpio_chip, irqd_to_hwirq(d))) { |
107 | dev_err(p->gpio_chip.dev, | 107 | dev_err(p->gpio_chip.dev, |
108 | "unable to lock HW IRQ %lu for IRQ\n", | 108 | "unable to lock HW IRQ %lu for IRQ\n", |
109 | irqd_to_hwirq(d)); | 109 | irqd_to_hwirq(d)); |
@@ -116,7 +116,7 @@ static void em_gio_irq_relres(struct irq_data *d) | |||
116 | { | 116 | { |
117 | struct em_gio_priv *p = irq_data_get_irq_chip_data(d); | 117 | struct em_gio_priv *p = irq_data_get_irq_chip_data(d); |
118 | 118 | ||
119 | gpio_unlock_as_irq(&p->gpio_chip, irqd_to_hwirq(d)); | 119 | gpiochip_unlock_as_irq(&p->gpio_chip, irqd_to_hwirq(d)); |
120 | } | 120 | } |
121 | 121 | ||
122 | 122 | ||
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c index 8488e2fd307c..468d10d2ac1e 100644 --- a/drivers/gpio/gpio-mcp23s08.c +++ b/drivers/gpio/gpio-mcp23s08.c | |||
@@ -444,7 +444,7 @@ static int mcp23s08_irq_reqres(struct irq_data *data) | |||
444 | { | 444 | { |
445 | struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data); | 445 | struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data); |
446 | 446 | ||
447 | if (gpio_lock_as_irq(&mcp->chip, data->hwirq)) { | 447 | if (gpiochip_lock_as_irq(&mcp->chip, data->hwirq)) { |
448 | dev_err(mcp->chip.dev, | 448 | dev_err(mcp->chip.dev, |
449 | "unable to lock HW IRQ %lu for IRQ usage\n", | 449 | "unable to lock HW IRQ %lu for IRQ usage\n", |
450 | data->hwirq); | 450 | data->hwirq); |
@@ -458,7 +458,7 @@ static void mcp23s08_irq_relres(struct irq_data *data) | |||
458 | { | 458 | { |
459 | struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data); | 459 | struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data); |
460 | 460 | ||
461 | gpio_unlock_as_irq(&mcp->chip, data->hwirq); | 461 | gpiochip_unlock_as_irq(&mcp->chip, data->hwirq); |
462 | } | 462 | } |
463 | 463 | ||
464 | static struct irq_chip mcp23s08_irq_chip = { | 464 | static struct irq_chip mcp23s08_irq_chip = { |
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 415682f69214..a38686786e46 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -800,7 +800,7 @@ static void omap_gpio_irq_shutdown(struct irq_data *d) | |||
800 | unsigned offset = GPIO_INDEX(bank, gpio); | 800 | unsigned offset = GPIO_INDEX(bank, gpio); |
801 | 801 | ||
802 | spin_lock_irqsave(&bank->lock, flags); | 802 | spin_lock_irqsave(&bank->lock, flags); |
803 | gpio_unlock_as_irq(&bank->chip, offset); | 803 | gpiochip_unlock_as_irq(&bank->chip, offset); |
804 | bank->irq_usage &= ~(BIT(offset)); | 804 | bank->irq_usage &= ~(BIT(offset)); |
805 | omap_disable_gpio_module(bank, offset); | 805 | omap_disable_gpio_module(bank, offset); |
806 | omap_reset_gpio(bank, gpio); | 806 | omap_reset_gpio(bank, gpio); |
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 4e8fb8261a87..61bcfa93606d 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c | |||
@@ -233,7 +233,7 @@ static int tegra_gpio_irq_set_type(struct irq_data *d, unsigned int type) | |||
233 | return -EINVAL; | 233 | return -EINVAL; |
234 | } | 234 | } |
235 | 235 | ||
236 | ret = gpio_lock_as_irq(&tegra_gpio_chip, gpio); | 236 | ret = gpiochip_lock_as_irq(&tegra_gpio_chip, gpio); |
237 | if (ret) { | 237 | if (ret) { |
238 | dev_err(dev, "unable to lock Tegra GPIO %d as IRQ\n", gpio); | 238 | dev_err(dev, "unable to lock Tegra GPIO %d as IRQ\n", gpio); |
239 | return ret; | 239 | return ret; |
@@ -263,7 +263,7 @@ static void tegra_gpio_irq_shutdown(struct irq_data *d) | |||
263 | { | 263 | { |
264 | int gpio = d->hwirq; | 264 | int gpio = d->hwirq; |
265 | 265 | ||
266 | gpio_unlock_as_irq(&tegra_gpio_chip, gpio); | 266 | gpiochip_unlock_as_irq(&tegra_gpio_chip, gpio); |
267 | } | 267 | } |
268 | 268 | ||
269 | static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 269 | static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) |
diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c index dbf28fa03f67..cec55226143d 100644 --- a/drivers/gpio/gpio-vr41xx.c +++ b/drivers/gpio/gpio-vr41xx.c | |||
@@ -138,7 +138,7 @@ static void unmask_giuint_low(struct irq_data *d) | |||
138 | 138 | ||
139 | static unsigned int startup_giuint(struct irq_data *data) | 139 | static unsigned int startup_giuint(struct irq_data *data) |
140 | { | 140 | { |
141 | if (gpio_lock_as_irq(&vr41xx_gpio_chip, data->hwirq)) | 141 | if (gpiochip_lock_as_irq(&vr41xx_gpio_chip, data->hwirq)) |
142 | dev_err(vr41xx_gpio_chip.dev, | 142 | dev_err(vr41xx_gpio_chip.dev, |
143 | "unable to lock HW IRQ %lu for IRQ\n", | 143 | "unable to lock HW IRQ %lu for IRQ\n", |
144 | data->hwirq); | 144 | data->hwirq); |
@@ -150,7 +150,7 @@ static unsigned int startup_giuint(struct irq_data *data) | |||
150 | static void shutdown_giuint(struct irq_data *data) | 150 | static void shutdown_giuint(struct irq_data *data) |
151 | { | 151 | { |
152 | mask_giuint_low(data); | 152 | mask_giuint_low(data); |
153 | gpio_unlock_as_irq(&vr41xx_gpio_chip, data->hwirq); | 153 | gpiochip_unlock_as_irq(&vr41xx_gpio_chip, data->hwirq); |
154 | } | 154 | } |
155 | 155 | ||
156 | static struct irq_chip giuint_low_irq_chip = { | 156 | static struct irq_chip giuint_low_irq_chip = { |
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 05c6275da224..349a7552dd23 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c | |||
@@ -153,7 +153,7 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares, | |||
153 | 153 | ||
154 | gpiod_direction_input(desc); | 154 | gpiod_direction_input(desc); |
155 | 155 | ||
156 | ret = gpio_lock_as_irq(chip, pin); | 156 | ret = gpiochip_lock_as_irq(chip, pin); |
157 | if (ret) { | 157 | if (ret) { |
158 | dev_err(chip->dev, "Failed to lock GPIO as interrupt\n"); | 158 | dev_err(chip->dev, "Failed to lock GPIO as interrupt\n"); |
159 | goto fail_free_desc; | 159 | goto fail_free_desc; |
@@ -209,7 +209,7 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares, | |||
209 | fail_free_event: | 209 | fail_free_event: |
210 | kfree(event); | 210 | kfree(event); |
211 | fail_unlock_irq: | 211 | fail_unlock_irq: |
212 | gpio_unlock_as_irq(chip, pin); | 212 | gpiochip_unlock_as_irq(chip, pin); |
213 | fail_free_desc: | 213 | fail_free_desc: |
214 | gpiochip_free_own_desc(desc); | 214 | gpiochip_free_own_desc(desc); |
215 | 215 | ||
@@ -280,7 +280,7 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) | |||
280 | desc = event->desc; | 280 | desc = event->desc; |
281 | if (WARN_ON(IS_ERR(desc))) | 281 | if (WARN_ON(IS_ERR(desc))) |
282 | continue; | 282 | continue; |
283 | gpio_unlock_as_irq(chip, event->pin); | 283 | gpiochip_unlock_as_irq(chip, event->pin); |
284 | gpiochip_free_own_desc(desc); | 284 | gpiochip_free_own_desc(desc); |
285 | list_del(&event->node); | 285 | list_del(&event->node); |
286 | kfree(event); | 286 | kfree(event); |
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 5f2150b619a7..781fbed00fc3 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c | |||
@@ -161,7 +161,7 @@ static int gpio_setup_irq(struct gpio_desc *desc, struct device *dev, | |||
161 | desc->flags &= ~GPIO_TRIGGER_MASK; | 161 | desc->flags &= ~GPIO_TRIGGER_MASK; |
162 | 162 | ||
163 | if (!gpio_flags) { | 163 | if (!gpio_flags) { |
164 | gpio_unlock_as_irq(desc->chip, gpio_chip_hwgpio(desc)); | 164 | gpiochip_unlock_as_irq(desc->chip, gpio_chip_hwgpio(desc)); |
165 | ret = 0; | 165 | ret = 0; |
166 | goto free_id; | 166 | goto free_id; |
167 | } | 167 | } |
@@ -200,7 +200,7 @@ static int gpio_setup_irq(struct gpio_desc *desc, struct device *dev, | |||
200 | if (ret < 0) | 200 | if (ret < 0) |
201 | goto free_id; | 201 | goto free_id; |
202 | 202 | ||
203 | ret = gpio_lock_as_irq(desc->chip, gpio_chip_hwgpio(desc)); | 203 | ret = gpiochip_lock_as_irq(desc->chip, gpio_chip_hwgpio(desc)); |
204 | if (ret < 0) { | 204 | if (ret < 0) { |
205 | gpiod_warn(desc, "failed to flag the GPIO for IRQ\n"); | 205 | gpiod_warn(desc, "failed to flag the GPIO for IRQ\n"); |
206 | goto free_id; | 206 | goto free_id; |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index e8e98ca25ec7..50e18a4b3a9f 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -495,7 +495,7 @@ static int gpiochip_irq_reqres(struct irq_data *d) | |||
495 | { | 495 | { |
496 | struct gpio_chip *chip = irq_data_get_irq_chip_data(d); | 496 | struct gpio_chip *chip = irq_data_get_irq_chip_data(d); |
497 | 497 | ||
498 | if (gpio_lock_as_irq(chip, d->hwirq)) { | 498 | if (gpiochip_lock_as_irq(chip, d->hwirq)) { |
499 | chip_err(chip, | 499 | chip_err(chip, |
500 | "unable to lock HW IRQ %lu for IRQ\n", | 500 | "unable to lock HW IRQ %lu for IRQ\n", |
501 | d->hwirq); | 501 | d->hwirq); |
@@ -508,7 +508,7 @@ static void gpiochip_irq_relres(struct irq_data *d) | |||
508 | { | 508 | { |
509 | struct gpio_chip *chip = irq_data_get_irq_chip_data(d); | 509 | struct gpio_chip *chip = irq_data_get_irq_chip_data(d); |
510 | 510 | ||
511 | gpio_unlock_as_irq(chip, d->hwirq); | 511 | gpiochip_unlock_as_irq(chip, d->hwirq); |
512 | } | 512 | } |
513 | 513 | ||
514 | static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset) | 514 | static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset) |
@@ -1332,14 +1332,14 @@ int gpiod_to_irq(const struct gpio_desc *desc) | |||
1332 | EXPORT_SYMBOL_GPL(gpiod_to_irq); | 1332 | EXPORT_SYMBOL_GPL(gpiod_to_irq); |
1333 | 1333 | ||
1334 | /** | 1334 | /** |
1335 | * gpio_lock_as_irq() - lock a GPIO to be used as IRQ | 1335 | * gpiochip_lock_as_irq() - lock a GPIO to be used as IRQ |
1336 | * @chip: the chip the GPIO to lock belongs to | 1336 | * @chip: the chip the GPIO to lock belongs to |
1337 | * @offset: the offset of the GPIO to lock as IRQ | 1337 | * @offset: the offset of the GPIO to lock as IRQ |
1338 | * | 1338 | * |
1339 | * This is used directly by GPIO drivers that want to lock down | 1339 | * This is used directly by GPIO drivers that want to lock down |
1340 | * a certain GPIO line to be used for IRQs. | 1340 | * a certain GPIO line to be used for IRQs. |
1341 | */ | 1341 | */ |
1342 | int gpio_lock_as_irq(struct gpio_chip *chip, unsigned int offset) | 1342 | int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset) |
1343 | { | 1343 | { |
1344 | if (offset >= chip->ngpio) | 1344 | if (offset >= chip->ngpio) |
1345 | return -EINVAL; | 1345 | return -EINVAL; |
@@ -1354,24 +1354,24 @@ int gpio_lock_as_irq(struct gpio_chip *chip, unsigned int offset) | |||
1354 | set_bit(FLAG_USED_AS_IRQ, &chip->desc[offset].flags); | 1354 | set_bit(FLAG_USED_AS_IRQ, &chip->desc[offset].flags); |
1355 | return 0; | 1355 | return 0; |
1356 | } | 1356 | } |
1357 | EXPORT_SYMBOL_GPL(gpio_lock_as_irq); | 1357 | EXPORT_SYMBOL_GPL(gpiochip_lock_as_irq); |
1358 | 1358 | ||
1359 | /** | 1359 | /** |
1360 | * gpio_unlock_as_irq() - unlock a GPIO used as IRQ | 1360 | * gpiochip_unlock_as_irq() - unlock a GPIO used as IRQ |
1361 | * @chip: the chip the GPIO to lock belongs to | 1361 | * @chip: the chip the GPIO to lock belongs to |
1362 | * @offset: the offset of the GPIO to lock as IRQ | 1362 | * @offset: the offset of the GPIO to lock as IRQ |
1363 | * | 1363 | * |
1364 | * This is used directly by GPIO drivers that want to indicate | 1364 | * This is used directly by GPIO drivers that want to indicate |
1365 | * that a certain GPIO is no longer used exclusively for IRQ. | 1365 | * that a certain GPIO is no longer used exclusively for IRQ. |
1366 | */ | 1366 | */ |
1367 | void gpio_unlock_as_irq(struct gpio_chip *chip, unsigned int offset) | 1367 | void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset) |
1368 | { | 1368 | { |
1369 | if (offset >= chip->ngpio) | 1369 | if (offset >= chip->ngpio) |
1370 | return; | 1370 | return; |
1371 | 1371 | ||
1372 | clear_bit(FLAG_USED_AS_IRQ, &chip->desc[offset].flags); | 1372 | clear_bit(FLAG_USED_AS_IRQ, &chip->desc[offset].flags); |
1373 | } | 1373 | } |
1374 | EXPORT_SYMBOL_GPL(gpio_unlock_as_irq); | 1374 | EXPORT_SYMBOL_GPL(gpiochip_unlock_as_irq); |
1375 | 1375 | ||
1376 | /** | 1376 | /** |
1377 | * gpiod_get_raw_value_cansleep() - return a gpio's raw value | 1377 | * gpiod_get_raw_value_cansleep() - return a gpio's raw value |
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 354a81d40925..608671704522 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c | |||
@@ -1472,7 +1472,7 @@ static unsigned int gpio_irq_startup(struct irq_data *d) | |||
1472 | unsigned pin = d->hwirq; | 1472 | unsigned pin = d->hwirq; |
1473 | int ret; | 1473 | int ret; |
1474 | 1474 | ||
1475 | ret = gpio_lock_as_irq(&at91_gpio->chip, pin); | 1475 | ret = gpiochip_lock_as_irq(&at91_gpio->chip, pin); |
1476 | if (ret) { | 1476 | if (ret) { |
1477 | dev_err(at91_gpio->chip.dev, "unable to lock pind %lu IRQ\n", | 1477 | dev_err(at91_gpio->chip.dev, "unable to lock pind %lu IRQ\n", |
1478 | d->hwirq); | 1478 | d->hwirq); |
@@ -1488,7 +1488,7 @@ static void gpio_irq_shutdown(struct irq_data *d) | |||
1488 | unsigned pin = d->hwirq; | 1488 | unsigned pin = d->hwirq; |
1489 | 1489 | ||
1490 | gpio_irq_mask(d); | 1490 | gpio_irq_mask(d); |
1491 | gpio_unlock_as_irq(&at91_gpio->chip, pin); | 1491 | gpiochip_unlock_as_irq(&at91_gpio->chip, pin); |
1492 | } | 1492 | } |
1493 | 1493 | ||
1494 | #ifdef CONFIG_PM | 1494 | #ifdef CONFIG_PM |
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index d7154ed0b0eb..fa54a2d1c966 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c | |||
@@ -180,7 +180,7 @@ static int exynos_irq_request_resources(struct irq_data *irqd) | |||
180 | unsigned int con; | 180 | unsigned int con; |
181 | int ret; | 181 | int ret; |
182 | 182 | ||
183 | ret = gpio_lock_as_irq(&bank->gpio_chip, irqd->hwirq); | 183 | ret = gpiochip_lock_as_irq(&bank->gpio_chip, irqd->hwirq); |
184 | if (ret) { | 184 | if (ret) { |
185 | dev_err(bank->gpio_chip.dev, "unable to lock pin %s-%lu IRQ\n", | 185 | dev_err(bank->gpio_chip.dev, "unable to lock pin %s-%lu IRQ\n", |
186 | bank->name, irqd->hwirq); | 186 | bank->name, irqd->hwirq); |
@@ -233,7 +233,7 @@ static void exynos_irq_release_resources(struct irq_data *irqd) | |||
233 | 233 | ||
234 | spin_unlock_irqrestore(&bank->slock, flags); | 234 | spin_unlock_irqrestore(&bank->slock, flags); |
235 | 235 | ||
236 | gpio_unlock_as_irq(&bank->gpio_chip, irqd->hwirq); | 236 | gpiochip_unlock_as_irq(&bank->gpio_chip, irqd->hwirq); |
237 | } | 237 | } |
238 | 238 | ||
239 | /* | 239 | /* |
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index ef9d804e55de..3d0744337736 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c | |||
@@ -553,7 +553,7 @@ static int sunxi_pinctrl_irq_request_resources(struct irq_data *d) | |||
553 | if (!func) | 553 | if (!func) |
554 | return -EINVAL; | 554 | return -EINVAL; |
555 | 555 | ||
556 | ret = gpio_lock_as_irq(pctl->chip, | 556 | ret = gpiochip_lock_as_irq(pctl->chip, |
557 | pctl->irq_array[d->hwirq] - pctl->desc->pin_base); | 557 | pctl->irq_array[d->hwirq] - pctl->desc->pin_base); |
558 | if (ret) { | 558 | if (ret) { |
559 | dev_err(pctl->dev, "unable to lock HW IRQ %lu for IRQ\n", | 559 | dev_err(pctl->dev, "unable to lock HW IRQ %lu for IRQ\n", |
@@ -571,8 +571,8 @@ static void sunxi_pinctrl_irq_release_resources(struct irq_data *d) | |||
571 | { | 571 | { |
572 | struct sunxi_pinctrl *pctl = irq_data_get_irq_chip_data(d); | 572 | struct sunxi_pinctrl *pctl = irq_data_get_irq_chip_data(d); |
573 | 573 | ||
574 | gpio_unlock_as_irq(pctl->chip, | 574 | gpiochip_unlock_as_irq(pctl->chip, |
575 | pctl->irq_array[d->hwirq] - pctl->desc->pin_base); | 575 | pctl->irq_array[d->hwirq] - pctl->desc->pin_base); |
576 | } | 576 | } |
577 | 577 | ||
578 | static int sunxi_pinctrl_irq_set_type(struct irq_data *d, unsigned int type) | 578 | static int sunxi_pinctrl_irq_set_type(struct irq_data *d, unsigned int type) |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 85aa5d0b9357..ab81339a8590 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -216,14 +216,15 @@ static inline int gpio_to_irq(unsigned gpio) | |||
216 | return -EINVAL; | 216 | return -EINVAL; |
217 | } | 217 | } |
218 | 218 | ||
219 | static inline int gpio_lock_as_irq(struct gpio_chip *chip, unsigned int offset) | 219 | static inline int gpiochip_lock_as_irq(struct gpio_chip *chip, |
220 | unsigned int offset) | ||
220 | { | 221 | { |
221 | WARN_ON(1); | 222 | WARN_ON(1); |
222 | return -EINVAL; | 223 | return -EINVAL; |
223 | } | 224 | } |
224 | 225 | ||
225 | static inline void gpio_unlock_as_irq(struct gpio_chip *chip, | 226 | static inline void gpiochip_unlock_as_irq(struct gpio_chip *chip, |
226 | unsigned int offset) | 227 | unsigned int offset) |
227 | { | 228 | { |
228 | WARN_ON(1); | 229 | WARN_ON(1); |
229 | } | 230 | } |
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 249db3057e4d..ff200a75501e 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h | |||
@@ -149,8 +149,8 @@ extern struct gpio_chip *gpiochip_find(void *data, | |||
149 | int (*match)(struct gpio_chip *chip, void *data)); | 149 | int (*match)(struct gpio_chip *chip, void *data)); |
150 | 150 | ||
151 | /* lock/unlock as IRQ */ | 151 | /* lock/unlock as IRQ */ |
152 | int gpio_lock_as_irq(struct gpio_chip *chip, unsigned int offset); | 152 | int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset); |
153 | void gpio_unlock_as_irq(struct gpio_chip *chip, unsigned int offset); | 153 | void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset); |
154 | 154 | ||
155 | struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc); | 155 | struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc); |
156 | 156 | ||