The GPIO subsystem has a couple of internal helpers to manage resources on behalf of the irqchip. Expose them so that GPIO drivers can use them directly.
Unified · Split
| @@ -1423,19 +1423,21 @@ static int gpiochip_to_irq(struct gpio_chip *gc, unsigned int offset) · 1422 unmodified lines | |||
| 1423 | return irq_create_mapping(domain, offset); | 1423 | return irq_create_mapping(domain, offset); |
| 1424 | } | 1424 | } |
| 1425 | 1425 | ||
| 1426 | static int gpiochip_irq_reqres(struct irq_data *d) | 1426 | int gpiochip_irq_reqres(struct irq_data *d) |
| 1427 | { | 1427 | { |
| 1428 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 1428 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
| 1429 | 1429 | ||
| 1430 | return gpiochip_reqres_irq(gc, d->hwirq); | 1430 | return gpiochip_reqres_irq(gc, d->hwirq); |
| 1431 | } | 1431 | } |
| 1432 | EXPORT_SYMBOL(gpiochip_irq_reqres); | ||
| 1432 | 1433 | ||
| 1433 | static void gpiochip_irq_relres(struct irq_data *d) | 1434 | void gpiochip_irq_relres(struct irq_data *d) |
| 1434 | { | 1435 | { |
| 1435 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 1436 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
| 1436 | 1437 | ||
| 1437 | gpiochip_relres_irq(gc, d->hwirq); | 1438 | gpiochip_relres_irq(gc, d->hwirq); |
| 1438 | } | 1439 | } |
| 1440 | EXPORT_SYMBOL(gpiochip_irq_relres); | ||
| 1439 | 1441 | ||
| 1440 | static void gpiochip_irq_mask(struct irq_data *d) | 1442 | static void gpiochip_irq_mask(struct irq_data *d) |
| 1441 | { | 1443 | { |
| @@ -579,6 +579,10 @@ void gpiochip_relres_irq(struct gpio_chip *gc, unsigned int offset); · 578 unmodified lines | |||
| 579 | void gpiochip_disable_irq(struct gpio_chip *gc, unsigned int offset); | 579 | void gpiochip_disable_irq(struct gpio_chip *gc, unsigned int offset); |
| 580 | void gpiochip_enable_irq(struct gpio_chip *gc, unsigned int offset); | 580 | void gpiochip_enable_irq(struct gpio_chip *gc, unsigned int offset); |
| 581 | 581 | ||
| 582 | /* irq_data versions of the above */ | ||
| 583 | int gpiochip_irq_reqres(struct irq_data *data); | ||
| 584 | void gpiochip_irq_relres(struct irq_data *data); | ||
| 585 | |||
| 582 | /* Line status inquiry for drivers */ | 586 | /* Line status inquiry for drivers */ |
| 583 | bool gpiochip_line_is_open_drain(struct gpio_chip *gc, unsigned int offset); | 587 | bool gpiochip_line_is_open_drain(struct gpio_chip *gc, unsigned int offset); |
| 584 | bool gpiochip_line_is_open_source(struct gpio_chip *gc, unsigned int offset); | 588 | bool gpiochip_line_is_open_source(struct gpio_chip *gc, unsigned int offset); |