aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2014-10-23 04:27:07 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-10-28 12:30:59 -0400
commite3a2e87893125bcd99bd7e1ddf9bfc421e492572 (patch)
tree725e03df58827c8eca35ffb787f43921c55046b2 /drivers/gpio
parentee2a9f7f06a5bff86cf3468fe74bf504640cf5e6 (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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-bcm-kona.c4
-rw-r--r--drivers/gpio/gpio-dwapb.c4
-rw-r--r--drivers/gpio/gpio-em.c4
-rw-r--r--drivers/gpio/gpio-mcp23s08.c4
-rw-r--r--drivers/gpio/gpio-omap.c2
-rw-r--r--drivers/gpio/gpio-tegra.c4
-rw-r--r--drivers/gpio/gpio-vr41xx.c4
-rw-r--r--drivers/gpio/gpiolib-acpi.c6
-rw-r--r--drivers/gpio/gpiolib-sysfs.c4
-rw-r--r--drivers/gpio/gpiolib.c16
10 files changed, 26 insertions, 26 deletions
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
489static struct irq_chip bcm_gpio_irq_chip = { 489static 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
214static int dwapb_irq_set_type(struct irq_data *d, u32 type) 214static 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
464static struct irq_chip mcp23s08_irq_chip = { 464static 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
269static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) 269static 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
139static unsigned int startup_giuint(struct irq_data *data) 139static 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)
150static void shutdown_giuint(struct irq_data *data) 150static 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
156static struct irq_chip giuint_low_irq_chip = { 156static 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,
209fail_free_event: 209fail_free_event:
210 kfree(event); 210 kfree(event);
211fail_unlock_irq: 211fail_unlock_irq:
212 gpio_unlock_as_irq(chip, pin); 212 gpiochip_unlock_as_irq(chip, pin);
213fail_free_desc: 213fail_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
514static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset) 514static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset)
@@ -1332,14 +1332,14 @@ int gpiod_to_irq(const struct gpio_desc *desc)
1332EXPORT_SYMBOL_GPL(gpiod_to_irq); 1332EXPORT_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 */
1342int gpio_lock_as_irq(struct gpio_chip *chip, unsigned int offset) 1342int 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}
1357EXPORT_SYMBOL_GPL(gpio_lock_as_irq); 1357EXPORT_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 */
1367void gpio_unlock_as_irq(struct gpio_chip *chip, unsigned int offset) 1367void 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}
1374EXPORT_SYMBOL_GPL(gpio_unlock_as_irq); 1374EXPORT_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