Commit 295494af authored by Octavian Purdila's avatar Octavian Purdila Committed by Linus Walleij

gpiolib: add irq_not_threaded flag to gpio_chip

Some GPIO chips (e.g. the DLN2 USB adapter) have blocking get/set
operation but do not need a threaded irq handler.
Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 4f51b913
...@@ -437,7 +437,7 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, ...@@ -437,7 +437,7 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
irq_set_lockdep_class(irq, &gpiochip_irq_lock_class); irq_set_lockdep_class(irq, &gpiochip_irq_lock_class);
irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler); irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler);
/* Chips that can sleep need nested thread handlers */ /* Chips that can sleep need nested thread handlers */
if (chip->can_sleep) if (chip->can_sleep && !chip->irq_not_threaded)
irq_set_nested_thread(irq, 1); irq_set_nested_thread(irq, 1);
#ifdef CONFIG_ARM #ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID); set_irq_flags(irq, IRQF_VALID);
......
...@@ -56,6 +56,8 @@ struct seq_file; ...@@ -56,6 +56,8 @@ struct seq_file;
* as the chip access may sleep when e.g. reading out the IRQ status * as the chip access may sleep when e.g. reading out the IRQ status
* registers. * registers.
* @exported: flags if the gpiochip is exported for use from sysfs. Private. * @exported: flags if the gpiochip is exported for use from sysfs. Private.
* @irq_not_threaded: flag must be set if @can_sleep is set but the
* IRQs don't need to be threaded
* *
* A gpio_chip can help platforms abstract various sources of GPIOs so * A gpio_chip can help platforms abstract various sources of GPIOs so
* they can all be accessed through a common programing interface. * they can all be accessed through a common programing interface.
...@@ -101,6 +103,7 @@ struct gpio_chip { ...@@ -101,6 +103,7 @@ struct gpio_chip {
struct gpio_desc *desc; struct gpio_desc *desc;
const char *const *names; const char *const *names;
bool can_sleep; bool can_sleep;
bool irq_not_threaded;
bool exported; bool exported;
#ifdef CONFIG_GPIOLIB_IRQCHIP #ifdef CONFIG_GPIOLIB_IRQCHIP
......
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