Commit 64ff2c8e authored by Stephen Boyd's avatar Stephen Boyd Committed by Linus Walleij

gpiolib: Export gpiochip_irqchip_irq_valid() to drivers

Some pinctrl drivers can use the gpiochip irq valid information
to figure out if certain gpios are exposed to the kernel for
usage or not. Expose this API so we can use it in the
pinmux_ops::request ops.
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Acked-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 9961dbcd
......@@ -1501,7 +1501,7 @@ static void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip)
gpiochip->irq.valid_mask = NULL;
}
static bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gpiochip,
bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gpiochip,
unsigned int offset)
{
/* No mask means all valid */
......@@ -1509,6 +1509,7 @@ static bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gpiochip,
return true;
return test_bit(offset, gpiochip->irq.valid_mask);
}
EXPORT_SYMBOL_GPL(gpiochip_irqchip_irq_valid);
/**
* gpiochip_set_cascaded_irqchip() - connects a cascaded irqchip to a gpiochip
......
......@@ -431,6 +431,9 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip,
bool threaded,
struct lock_class_key *lock_key);
bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gpiochip,
unsigned int offset);
#ifdef CONFIG_LOCKDEP
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment