gpio: Expose the gpiochip_irq_re[ql]res helpers
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2071835 Tested: This is one of a series of patch sets to enable Arm SystemReady IR support in the kernel for NXP i.MX8 platforms. This set updates GPIO support. It has been tested via simple boot tests and by using the kernel GPIO tools to verify pins are being identified and can be used. commit 704f08753b6dcd0e08c1953af0b2c7f3fac87111 Author: Marc Zyngier <maz@kernel.org> Date: Tue Apr 19 15:18:38 2022 +0100 gpio: Expose the gpiochip_irq_re[ql]res helpers 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. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220419141846.598305-3-maz@kernel.org (cherry picked from commit 704f08753b6dcd0e08c1953af0b2c7f3fac87111) Signed-off-by: Al Stone <ahs3@redhat.com>
This commit is contained in:
parent
4dade4d93e
commit
268b611f51
|
@ -1427,19 +1427,21 @@ static int gpiochip_to_irq(struct gpio_chip *gc, unsigned int offset)
|
|||
return irq_create_mapping(domain, offset);
|
||||
}
|
||||
|
||||
static int gpiochip_irq_reqres(struct irq_data *d)
|
||||
int gpiochip_irq_reqres(struct irq_data *d)
|
||||
{
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
|
||||
return gpiochip_reqres_irq(gc, d->hwirq);
|
||||
}
|
||||
EXPORT_SYMBOL(gpiochip_irq_reqres);
|
||||
|
||||
static void gpiochip_irq_relres(struct irq_data *d)
|
||||
void gpiochip_irq_relres(struct irq_data *d)
|
||||
{
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
|
||||
gpiochip_relres_irq(gc, d->hwirq);
|
||||
}
|
||||
EXPORT_SYMBOL(gpiochip_irq_relres);
|
||||
|
||||
static void gpiochip_irq_mask(struct irq_data *d)
|
||||
{
|
||||
|
|
|
@ -589,6 +589,10 @@ void gpiochip_relres_irq(struct gpio_chip *gc, unsigned int offset);
|
|||
void gpiochip_disable_irq(struct gpio_chip *gc, unsigned int offset);
|
||||
void gpiochip_enable_irq(struct gpio_chip *gc, unsigned int offset);
|
||||
|
||||
/* irq_data versions of the above */
|
||||
int gpiochip_irq_reqres(struct irq_data *data);
|
||||
void gpiochip_irq_relres(struct irq_data *data);
|
||||
|
||||
/* Line status inquiry for drivers */
|
||||
bool gpiochip_line_is_open_drain(struct gpio_chip *gc, unsigned int offset);
|
||||
bool gpiochip_line_is_open_source(struct gpio_chip *gc, unsigned int offset);
|
||||
|
|
Loading…
Reference in New Issue