mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
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: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
9961dbcd22
commit
64ff2c8e46
@ -1501,14 +1501,15 @@ 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,
|
||||
unsigned int offset)
|
||||
bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gpiochip,
|
||||
unsigned int offset)
|
||||
{
|
||||
/* No mask means all valid */
|
||||
if (likely(!gpiochip->irq.valid_mask))
|
||||
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
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user