|
@@ -462,12 +462,6 @@ void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip,
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(gpiochip_set_chained_irqchip);
|
|
|
|
|
|
-/*
|
|
|
- * This lock class tells lockdep that GPIO irqs are in a different
|
|
|
- * category than their parents, so it won't report false recursion.
|
|
|
- */
|
|
|
-static struct lock_class_key gpiochip_irq_lock_class;
|
|
|
-
|
|
|
/**
|
|
|
* gpiochip_irq_map() - maps an IRQ into a GPIO irqchip
|
|
|
* @d: the irqdomain used by this irqchip
|
|
@@ -484,7 +478,11 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
|
|
|
struct gpio_chip *chip = d->host_data;
|
|
|
|
|
|
irq_set_chip_data(irq, chip);
|
|
|
- irq_set_lockdep_class(irq, &gpiochip_irq_lock_class);
|
|
|
+ /*
|
|
|
+ * This lock class tells lockdep that GPIO irqs are in a different
|
|
|
+ * category than their parents, so it won't report false recursion.
|
|
|
+ */
|
|
|
+ irq_set_lockdep_class(irq, chip->lock_key);
|
|
|
irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler);
|
|
|
/* Chips that can sleep need nested thread handlers */
|
|
|
if (chip->can_sleep && !chip->irq_not_threaded)
|
|
@@ -589,6 +587,7 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
|
|
|
* @handler: the irq handler to use (often a predefined irq core function)
|
|
|
* @type: the default type for IRQs on this irqchip, pass IRQ_TYPE_NONE
|
|
|
* to have the core avoid setting up any default type in the hardware.
|
|
|
+ * @lock_key: lockdep class
|
|
|
*
|
|
|
* This function closely associates a certain irqchip with a certain
|
|
|
* gpiochip, providing an irq domain to translate the local IRQs to
|
|
@@ -604,11 +603,12 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
|
|
|
* the pins on the gpiochip can generate a unique IRQ. Everything else
|
|
|
* need to be open coded.
|
|
|
*/
|
|
|
-int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
|
|
|
- struct irq_chip *irqchip,
|
|
|
- unsigned int first_irq,
|
|
|
- irq_flow_handler_t handler,
|
|
|
- unsigned int type)
|
|
|
+int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
|
|
|
+ struct irq_chip *irqchip,
|
|
|
+ unsigned int first_irq,
|
|
|
+ irq_flow_handler_t handler,
|
|
|
+ unsigned int type,
|
|
|
+ struct lock_class_key *lock_key)
|
|
|
{
|
|
|
struct device_node *of_node;
|
|
|
unsigned int offset;
|
|
@@ -634,6 +634,7 @@ int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
|
|
|
gpiochip->irq_handler = handler;
|
|
|
gpiochip->irq_default_type = type;
|
|
|
gpiochip->to_irq = gpiochip_to_irq;
|
|
|
+ gpiochip->lock_key = lock_key;
|
|
|
gpiochip->irqdomain = irq_domain_add_simple(of_node,
|
|
|
gpiochip->ngpio, first_irq,
|
|
|
&gpiochip_domain_ops, gpiochip);
|
|
@@ -671,7 +672,7 @@ int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
-EXPORT_SYMBOL_GPL(gpiochip_irqchip_add);
|
|
|
+EXPORT_SYMBOL_GPL(_gpiochip_irqchip_add);
|
|
|
|
|
|
#else /* CONFIG_GPIOLIB_IRQCHIP */
|
|
|
|