diff options
Diffstat (limited to 'drivers/gpio/gpio-lynxpoint.c')
-rw-r--r-- | drivers/gpio/gpio-lynxpoint.c | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-lynxpoint.c b/drivers/gpio/gpio-lynxpoint.c index a0804740a0b7..66b18535b5ae 100644 --- a/drivers/gpio/gpio-lynxpoint.c +++ b/drivers/gpio/gpio-lynxpoint.c | |||
@@ -301,6 +301,26 @@ static void lp_irq_disable(struct irq_data *d) | |||
301 | spin_unlock_irqrestore(&lg->lock, flags); | 301 | spin_unlock_irqrestore(&lg->lock, flags); |
302 | } | 302 | } |
303 | 303 | ||
304 | static unsigned int lp_irq_startup(struct irq_data *d) | ||
305 | { | ||
306 | struct lp_gpio *lg = irq_data_get_irq_chip_data(d); | ||
307 | |||
308 | if (gpio_lock_as_irq(&lg->chip, irqd_to_hwirq(d))) | ||
309 | dev_err(lg->chip.dev, | ||
310 | "unable to lock HW IRQ %lu for IRQ\n", | ||
311 | irqd_to_hwirq(d)); | ||
312 | lp_irq_enable(d); | ||
313 | return 0; | ||
314 | } | ||
315 | |||
316 | static void lp_irq_shutdown(struct irq_data *d) | ||
317 | { | ||
318 | struct lp_gpio *lg = irq_data_get_irq_chip_data(d); | ||
319 | |||
320 | lp_irq_disable(d); | ||
321 | gpio_unlock_as_irq(&lg->chip, irqd_to_hwirq(d)); | ||
322 | } | ||
323 | |||
304 | static struct irq_chip lp_irqchip = { | 324 | static struct irq_chip lp_irqchip = { |
305 | .name = "LP-GPIO", | 325 | .name = "LP-GPIO", |
306 | .irq_mask = lp_irq_mask, | 326 | .irq_mask = lp_irq_mask, |
@@ -308,6 +328,8 @@ static struct irq_chip lp_irqchip = { | |||
308 | .irq_enable = lp_irq_enable, | 328 | .irq_enable = lp_irq_enable, |
309 | .irq_disable = lp_irq_disable, | 329 | .irq_disable = lp_irq_disable, |
310 | .irq_set_type = lp_irq_type, | 330 | .irq_set_type = lp_irq_type, |
331 | .irq_startup = lp_irq_startup, | ||
332 | .irq_shutdown = lp_irq_shutdown, | ||
311 | .flags = IRQCHIP_SKIP_SET_WAKE, | 333 | .flags = IRQCHIP_SKIP_SET_WAKE, |
312 | }; | 334 | }; |
313 | 335 | ||
@@ -331,8 +353,7 @@ static int lp_gpio_irq_map(struct irq_domain *d, unsigned int irq, | |||
331 | { | 353 | { |
332 | struct lp_gpio *lg = d->host_data; | 354 | struct lp_gpio *lg = d->host_data; |
333 | 355 | ||
334 | irq_set_chip_and_handler_name(irq, &lp_irqchip, handle_simple_irq, | 356 | irq_set_chip_and_handler(irq, &lp_irqchip, handle_simple_irq); |
335 | "demux"); | ||
336 | irq_set_chip_data(irq, lg); | 357 | irq_set_chip_data(irq, lg); |
337 | irq_set_irq_type(irq, IRQ_TYPE_NONE); | 358 | irq_set_irq_type(irq, IRQ_TYPE_NONE); |
338 | 359 | ||
@@ -392,7 +413,7 @@ static int lp_gpio_probe(struct platform_device *pdev) | |||
392 | gc->set = lp_gpio_set; | 413 | gc->set = lp_gpio_set; |
393 | gc->base = -1; | 414 | gc->base = -1; |
394 | gc->ngpio = LP_NUM_GPIO; | 415 | gc->ngpio = LP_NUM_GPIO; |
395 | gc->can_sleep = 0; | 416 | gc->can_sleep = false; |
396 | gc->dev = dev; | 417 | gc->dev = dev; |
397 | 418 | ||
398 | /* set up interrupts */ | 419 | /* set up interrupts */ |
@@ -438,6 +459,7 @@ static const struct dev_pm_ops lp_gpio_pm_ops = { | |||
438 | 459 | ||
439 | static const struct acpi_device_id lynxpoint_gpio_acpi_match[] = { | 460 | static const struct acpi_device_id lynxpoint_gpio_acpi_match[] = { |
440 | { "INT33C7", 0 }, | 461 | { "INT33C7", 0 }, |
462 | { "INT3437", 0 }, | ||
441 | { } | 463 | { } |
442 | }; | 464 | }; |
443 | MODULE_DEVICE_TABLE(acpi, lynxpoint_gpio_acpi_match); | 465 | MODULE_DEVICE_TABLE(acpi, lynxpoint_gpio_acpi_match); |
@@ -469,4 +491,15 @@ static int __init lp_gpio_init(void) | |||
469 | return platform_driver_register(&lp_gpio_driver); | 491 | return platform_driver_register(&lp_gpio_driver); |
470 | } | 492 | } |
471 | 493 | ||
494 | static void __exit lp_gpio_exit(void) | ||
495 | { | ||
496 | platform_driver_unregister(&lp_gpio_driver); | ||
497 | } | ||
498 | |||
472 | subsys_initcall(lp_gpio_init); | 499 | subsys_initcall(lp_gpio_init); |
500 | module_exit(lp_gpio_exit); | ||
501 | |||
502 | MODULE_AUTHOR("Mathias Nyman (Intel)"); | ||
503 | MODULE_DESCRIPTION("GPIO interface for Intel Lynxpoint"); | ||
504 | MODULE_LICENSE("GPL"); | ||
505 | MODULE_ALIAS("platform:lp_gpio"); | ||