diff options
author | Rob Herring <robh@kernel.org> | 2015-07-27 16:55:16 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-07-28 03:45:39 -0400 |
commit | 23393d49fb75ca97b179668aa86b7038c2dc0831 (patch) | |
tree | 0d82a2a27cf2b5a56384ee77b7231e1a50269ced /drivers | |
parent | d705073cdafa75286970dd30f722d0df584bae54 (diff) |
gpio: kill off set_irq_flags usage
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:
IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN
For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed as most platforms don't use probing.
There appears to be a great deal of blind copy and paste of this code.
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-gpio@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/gpio-adp5588.c | 10 | ||||
-rw-r--r-- | drivers/gpio/gpio-bcm-kona.c | 15 | ||||
-rw-r--r-- | drivers/gpio/gpio-davinci.c | 1 | ||||
-rw-r--r-- | drivers/gpio/gpio-em.c | 1 | ||||
-rw-r--r-- | drivers/gpio/gpio-ep93xx.c | 2 | ||||
-rw-r--r-- | drivers/gpio/gpio-grgpio.c | 8 | ||||
-rw-r--r-- | drivers/gpio/gpio-mcp23s08.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpio-msm-v2.c | 1 | ||||
-rw-r--r-- | drivers/gpio/gpio-pxa.c | 8 | ||||
-rw-r--r-- | drivers/gpio/gpio-sa1100.c | 2 | ||||
-rw-r--r-- | drivers/gpio/gpio-sta2x11.c | 2 | ||||
-rw-r--r-- | drivers/gpio/gpio-tegra.c | 1 | ||||
-rw-r--r-- | drivers/gpio/gpio-timberdale.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpiolib.c | 8 |
14 files changed, 10 insertions, 57 deletions
diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c index d3fe6a6776da..984186ee58a0 100644 --- a/drivers/gpio/gpio-adp5588.c +++ b/drivers/gpio/gpio-adp5588.c | |||
@@ -305,15 +305,7 @@ static int adp5588_irq_setup(struct adp5588_gpio *dev) | |||
305 | irq_set_chip_and_handler(irq, &adp5588_irq_chip, | 305 | irq_set_chip_and_handler(irq, &adp5588_irq_chip, |
306 | handle_level_irq); | 306 | handle_level_irq); |
307 | irq_set_nested_thread(irq, 1); | 307 | irq_set_nested_thread(irq, 1); |
308 | #ifdef CONFIG_ARM | 308 | irq_modify_status(irq, IRQ_NOREQUEST, IRQ_NOPROBE); |
309 | /* | ||
310 | * ARM needs us to explicitly flag the IRQ as VALID, | ||
311 | * once we do so, it will also set the noprobe. | ||
312 | */ | ||
313 | set_irq_flags(irq, IRQF_VALID); | ||
314 | #else | ||
315 | irq_set_noprobe(irq); | ||
316 | #endif | ||
317 | } | 309 | } |
318 | 310 | ||
319 | ret = request_threaded_irq(client->irq, | 311 | ret = request_threaded_irq(client->irq, |
diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index 109083f65248..31b90ac15204 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c | |||
@@ -525,11 +525,7 @@ static int bcm_kona_gpio_irq_map(struct irq_domain *d, unsigned int irq, | |||
525 | return ret; | 525 | return ret; |
526 | irq_set_lockdep_class(irq, &gpio_lock_class); | 526 | irq_set_lockdep_class(irq, &gpio_lock_class); |
527 | irq_set_chip_and_handler(irq, &bcm_gpio_irq_chip, handle_simple_irq); | 527 | irq_set_chip_and_handler(irq, &bcm_gpio_irq_chip, handle_simple_irq); |
528 | #ifdef CONFIG_ARM | ||
529 | set_irq_flags(irq, IRQF_VALID); | ||
530 | #else | ||
531 | irq_set_noprobe(irq); | 528 | irq_set_noprobe(irq); |
532 | #endif | ||
533 | 529 | ||
534 | return 0; | 530 | return 0; |
535 | } | 531 | } |
@@ -644,17 +640,6 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev) | |||
644 | dev_err(dev, "Couldn't add GPIO chip -- %d\n", ret); | 640 | dev_err(dev, "Couldn't add GPIO chip -- %d\n", ret); |
645 | goto err_irq_domain; | 641 | goto err_irq_domain; |
646 | } | 642 | } |
647 | for (i = 0; i < chip->ngpio; i++) { | ||
648 | int irq = bcm_kona_gpio_to_irq(chip, i); | ||
649 | irq_set_lockdep_class(irq, &gpio_lock_class); | ||
650 | irq_set_chip_and_handler(irq, &bcm_gpio_irq_chip, | ||
651 | handle_simple_irq); | ||
652 | #ifdef CONFIG_ARM | ||
653 | set_irq_flags(irq, IRQF_VALID); | ||
654 | #else | ||
655 | irq_set_noprobe(irq); | ||
656 | #endif | ||
657 | } | ||
658 | for (i = 0; i < kona_gpio->num_bank; i++) { | 643 | for (i = 0; i < kona_gpio->num_bank; i++) { |
659 | bank = &kona_gpio->banks[i]; | 644 | bank = &kona_gpio->banks[i]; |
660 | irq_set_chained_handler_and_data(bank->irq, | 645 | irq_set_chained_handler_and_data(bank->irq, |
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 7be269402baf..94b0ab709721 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c | |||
@@ -423,7 +423,6 @@ davinci_gpio_irq_map(struct irq_domain *d, unsigned int irq, | |||
423 | irq_set_irq_type(irq, IRQ_TYPE_NONE); | 423 | irq_set_irq_type(irq, IRQ_TYPE_NONE); |
424 | irq_set_chip_data(irq, (__force void *)g); | 424 | irq_set_chip_data(irq, (__force void *)g); |
425 | irq_set_handler_data(irq, (void *)__gpio_mask(hw)); | 425 | irq_set_handler_data(irq, (void *)__gpio_mask(hw)); |
426 | set_irq_flags(irq, IRQF_VALID); | ||
427 | 426 | ||
428 | return 0; | 427 | return 0; |
429 | } | 428 | } |
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c index a77f16c8d142..6bca1e125e12 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c | |||
@@ -261,7 +261,6 @@ static int em_gio_irq_domain_map(struct irq_domain *h, unsigned int irq, | |||
261 | 261 | ||
262 | irq_set_chip_data(irq, h->host_data); | 262 | irq_set_chip_data(irq, h->host_data); |
263 | irq_set_chip_and_handler(irq, &p->irq_chip, handle_level_irq); | 263 | irq_set_chip_and_handler(irq, &p->irq_chip, handle_level_irq); |
264 | set_irq_flags(irq, IRQF_VALID); /* kill me now */ | ||
265 | return 0; | 264 | return 0; |
266 | } | 265 | } |
267 | 266 | ||
diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c index dc0c40935940..9d90366ea259 100644 --- a/drivers/gpio/gpio-ep93xx.c +++ b/drivers/gpio/gpio-ep93xx.c | |||
@@ -236,7 +236,7 @@ static void ep93xx_gpio_init_irq(void) | |||
236 | gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) { | 236 | gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) { |
237 | irq_set_chip_and_handler(gpio_irq, &ep93xx_gpio_irq_chip, | 237 | irq_set_chip_and_handler(gpio_irq, &ep93xx_gpio_irq_chip, |
238 | handle_level_irq); | 238 | handle_level_irq); |
239 | set_irq_flags(gpio_irq, IRQF_VALID); | 239 | irq_clear_status_flags(gpio_irq, IRQ_NOREQUEST); |
240 | } | 240 | } |
241 | 241 | ||
242 | irq_set_chained_handler(IRQ_EP93XX_GPIO_AB, | 242 | irq_set_chained_handler(IRQ_EP93XX_GPIO_AB, |
diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c index 0a8f7617e72e..77053d61466e 100644 --- a/drivers/gpio/gpio-grgpio.c +++ b/drivers/gpio/gpio-grgpio.c | |||
@@ -281,12 +281,7 @@ static int grgpio_irq_map(struct irq_domain *d, unsigned int irq, | |||
281 | irq_set_chip_data(irq, priv); | 281 | irq_set_chip_data(irq, priv); |
282 | irq_set_chip_and_handler(irq, &grgpio_irq_chip, | 282 | irq_set_chip_and_handler(irq, &grgpio_irq_chip, |
283 | handle_simple_irq); | 283 | handle_simple_irq); |
284 | irq_clear_status_flags(irq, IRQ_NOREQUEST); | ||
285 | #ifdef CONFIG_ARM | ||
286 | set_irq_flags(irq, IRQF_VALID); | ||
287 | #else | ||
288 | irq_set_noprobe(irq); | 284 | irq_set_noprobe(irq); |
289 | #endif | ||
290 | 285 | ||
291 | return ret; | 286 | return ret; |
292 | } | 287 | } |
@@ -301,9 +296,6 @@ static void grgpio_irq_unmap(struct irq_domain *d, unsigned int irq) | |||
301 | int ngpio = priv->bgc.gc.ngpio; | 296 | int ngpio = priv->bgc.gc.ngpio; |
302 | int i; | 297 | int i; |
303 | 298 | ||
304 | #ifdef CONFIG_ARM | ||
305 | set_irq_flags(irq, 0); | ||
306 | #endif | ||
307 | irq_set_chip_and_handler(irq, NULL, NULL); | 299 | irq_set_chip_and_handler(irq, NULL, NULL); |
308 | irq_set_chip_data(irq, NULL); | 300 | irq_set_chip_data(irq, NULL); |
309 | 301 | ||
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c index 2fc7ff852d16..73db7ecd7ffd 100644 --- a/drivers/gpio/gpio-mcp23s08.c +++ b/drivers/gpio/gpio-mcp23s08.c | |||
@@ -507,11 +507,7 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp) | |||
507 | irq_set_chip_data(irq, mcp); | 507 | irq_set_chip_data(irq, mcp); |
508 | irq_set_chip(irq, &mcp23s08_irq_chip); | 508 | irq_set_chip(irq, &mcp23s08_irq_chip); |
509 | irq_set_nested_thread(irq, true); | 509 | irq_set_nested_thread(irq, true); |
510 | #ifdef CONFIG_ARM | ||
511 | set_irq_flags(irq, IRQF_VALID); | ||
512 | #else | ||
513 | irq_set_noprobe(irq); | 510 | irq_set_noprobe(irq); |
514 | #endif | ||
515 | } | 511 | } |
516 | return 0; | 512 | return 0; |
517 | } | 513 | } |
diff --git a/drivers/gpio/gpio-msm-v2.c b/drivers/gpio/gpio-msm-v2.c index 1f0fb19209bf..d2012cfb5571 100644 --- a/drivers/gpio/gpio-msm-v2.c +++ b/drivers/gpio/gpio-msm-v2.c | |||
@@ -355,7 +355,6 @@ static int msm_gpio_irq_domain_map(struct irq_domain *d, unsigned int irq, | |||
355 | irq_set_lockdep_class(irq, &msm_gpio_lock_class); | 355 | irq_set_lockdep_class(irq, &msm_gpio_lock_class); |
356 | irq_set_chip_and_handler(irq, &msm_gpio_irq_chip, | 356 | irq_set_chip_and_handler(irq, &msm_gpio_irq_chip, |
357 | handle_level_irq); | 357 | handle_level_irq); |
358 | set_irq_flags(irq, IRQF_VALID); | ||
359 | 358 | ||
360 | return 0; | 359 | return 0; |
361 | } | 360 | } |
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index cdbbcf0faf9d..55a11de3d5b7 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c | |||
@@ -524,7 +524,7 @@ static int pxa_irq_domain_map(struct irq_domain *d, unsigned int irq, | |||
524 | { | 524 | { |
525 | irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip, | 525 | irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip, |
526 | handle_edge_irq); | 526 | handle_edge_irq); |
527 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 527 | irq_set_noprobe(irq); |
528 | return 0; | 528 | return 0; |
529 | } | 529 | } |
530 | 530 | ||
@@ -643,20 +643,20 @@ static int pxa_gpio_probe(struct platform_device *pdev) | |||
643 | irq = gpio_to_irq(0); | 643 | irq = gpio_to_irq(0); |
644 | irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip, | 644 | irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip, |
645 | handle_edge_irq); | 645 | handle_edge_irq); |
646 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 646 | irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); |
647 | } | 647 | } |
648 | if (irq1 > 0) { | 648 | if (irq1 > 0) { |
649 | irq = gpio_to_irq(1); | 649 | irq = gpio_to_irq(1); |
650 | irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip, | 650 | irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip, |
651 | handle_edge_irq); | 651 | handle_edge_irq); |
652 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 652 | irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); |
653 | } | 653 | } |
654 | 654 | ||
655 | for (irq = gpio_to_irq(gpio_offset); | 655 | for (irq = gpio_to_irq(gpio_offset); |
656 | irq <= gpio_to_irq(pxa_last_gpio); irq++) { | 656 | irq <= gpio_to_irq(pxa_last_gpio); irq++) { |
657 | irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip, | 657 | irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip, |
658 | handle_edge_irq); | 658 | handle_edge_irq); |
659 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 659 | irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); |
660 | } | 660 | } |
661 | } | 661 | } |
662 | 662 | ||
diff --git a/drivers/gpio/gpio-sa1100.c b/drivers/gpio/gpio-sa1100.c index e847a4cf9326..67bd2f5d89e8 100644 --- a/drivers/gpio/gpio-sa1100.c +++ b/drivers/gpio/gpio-sa1100.c | |||
@@ -155,7 +155,7 @@ static int sa1100_gpio_irqdomain_map(struct irq_domain *d, | |||
155 | { | 155 | { |
156 | irq_set_chip_and_handler(irq, &sa1100_gpio_irq_chip, | 156 | irq_set_chip_and_handler(irq, &sa1100_gpio_irq_chip, |
157 | handle_edge_irq); | 157 | handle_edge_irq); |
158 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 158 | irq_set_noprobe(irq); |
159 | 159 | ||
160 | return 0; | 160 | return 0; |
161 | } | 161 | } |
diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c index 18579ac65b2b..55e47828ddfc 100644 --- a/drivers/gpio/gpio-sta2x11.c +++ b/drivers/gpio/gpio-sta2x11.c | |||
@@ -346,7 +346,7 @@ static void gsta_alloc_irq_chip(struct gsta_gpio *chip) | |||
346 | i = chip->irq_base + j; | 346 | i = chip->irq_base + j; |
347 | irq_set_chip_and_handler(i, &ct->chip, ct->handler); | 347 | irq_set_chip_and_handler(i, &ct->chip, ct->handler); |
348 | irq_set_chip_data(i, gc); | 348 | irq_set_chip_data(i, gc); |
349 | irq_modify_status(i, IRQ_NOREQUEST | IRQ_NOPROBE, 0); | 349 | irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE); |
350 | } | 350 | } |
351 | gc->irq_cnt = i - gc->irq_base; | 351 | gc->irq_cnt = i - gc->irq_base; |
352 | } | 352 | } |
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 530b27f9d66f..9b14aafb576d 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c | |||
@@ -507,7 +507,6 @@ static int tegra_gpio_probe(struct platform_device *pdev) | |||
507 | irq_set_chip_data(irq, bank); | 507 | irq_set_chip_data(irq, bank); |
508 | irq_set_chip_and_handler(irq, &tegra_gpio_irq_chip, | 508 | irq_set_chip_and_handler(irq, &tegra_gpio_irq_chip, |
509 | handle_simple_irq); | 509 | handle_simple_irq); |
510 | set_irq_flags(irq, IRQF_VALID); | ||
511 | } | 510 | } |
512 | 511 | ||
513 | for (i = 0; i < tegra_gpio_bank_count; i++) { | 512 | for (i = 0; i < tegra_gpio_bank_count; i++) { |
diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c index ac53ff0a8086..5a492054589f 100644 --- a/drivers/gpio/gpio-timberdale.c +++ b/drivers/gpio/gpio-timberdale.c | |||
@@ -295,9 +295,7 @@ static int timbgpio_probe(struct platform_device *pdev) | |||
295 | irq_set_chip_and_handler(tgpio->irq_base + i, | 295 | irq_set_chip_and_handler(tgpio->irq_base + i, |
296 | &timbgpio_irqchip, handle_simple_irq); | 296 | &timbgpio_irqchip, handle_simple_irq); |
297 | irq_set_chip_data(tgpio->irq_base + i, tgpio); | 297 | irq_set_chip_data(tgpio->irq_base + i, tgpio); |
298 | #ifdef CONFIG_ARM | 298 | irq_clear_status_flags(tgpio->irq_base + i, IRQ_NOREQUEST | IRQ_NOPROBE); |
299 | set_irq_flags(tgpio->irq_base + i, IRQF_VALID | IRQF_PROBE); | ||
300 | #endif | ||
301 | } | 299 | } |
302 | 300 | ||
303 | irq_set_chained_handler_and_data(irq, timbgpio_irq, tgpio); | 301 | irq_set_chained_handler_and_data(irq, timbgpio_irq, tgpio); |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index b7e24780683a..9312bbcb19b9 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -486,11 +486,8 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, | |||
486 | /* Chips that can sleep need nested thread handlers */ | 486 | /* Chips that can sleep need nested thread handlers */ |
487 | if (chip->can_sleep && !chip->irq_not_threaded) | 487 | if (chip->can_sleep && !chip->irq_not_threaded) |
488 | irq_set_nested_thread(irq, 1); | 488 | irq_set_nested_thread(irq, 1); |
489 | #ifdef CONFIG_ARM | ||
490 | set_irq_flags(irq, IRQF_VALID); | ||
491 | #else | ||
492 | irq_set_noprobe(irq); | 489 | irq_set_noprobe(irq); |
493 | #endif | 490 | |
494 | /* | 491 | /* |
495 | * No set-up of the hardware will happen if IRQ_TYPE_NONE | 492 | * No set-up of the hardware will happen if IRQ_TYPE_NONE |
496 | * is passed as default type. | 493 | * is passed as default type. |
@@ -505,9 +502,6 @@ static void gpiochip_irq_unmap(struct irq_domain *d, unsigned int irq) | |||
505 | { | 502 | { |
506 | struct gpio_chip *chip = d->host_data; | 503 | struct gpio_chip *chip = d->host_data; |
507 | 504 | ||
508 | #ifdef CONFIG_ARM | ||
509 | set_irq_flags(irq, 0); | ||
510 | #endif | ||
511 | if (chip->can_sleep) | 505 | if (chip->can_sleep) |
512 | irq_set_nested_thread(irq, 0); | 506 | irq_set_nested_thread(irq, 0); |
513 | irq_set_chip_and_handler(irq, NULL, NULL); | 507 | irq_set_chip_and_handler(irq, NULL, NULL); |