|
@@ -1550,7 +1550,7 @@ static void gpiochip_set_cascaded_irqchip(struct gpio_chip *gpiochip,
|
|
{
|
|
{
|
|
unsigned int offset;
|
|
unsigned int offset;
|
|
|
|
|
|
- if (!gpiochip->irqdomain) {
|
|
|
|
|
|
+ if (!gpiochip->irq.domain) {
|
|
chip_err(gpiochip, "called %s before setting up irqchip\n",
|
|
chip_err(gpiochip, "called %s before setting up irqchip\n",
|
|
__func__);
|
|
__func__);
|
|
return;
|
|
return;
|
|
@@ -1577,7 +1577,7 @@ static void gpiochip_set_cascaded_irqchip(struct gpio_chip *gpiochip,
|
|
for (offset = 0; offset < gpiochip->ngpio; offset++) {
|
|
for (offset = 0; offset < gpiochip->ngpio; offset++) {
|
|
if (!gpiochip_irqchip_irq_valid(gpiochip, offset))
|
|
if (!gpiochip_irqchip_irq_valid(gpiochip, offset))
|
|
continue;
|
|
continue;
|
|
- irq_set_parent(irq_find_mapping(gpiochip->irqdomain, offset),
|
|
|
|
|
|
+ irq_set_parent(irq_find_mapping(gpiochip->irq.domain, offset),
|
|
parent_irq);
|
|
parent_irq);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1708,7 +1708,7 @@ static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset)
|
|
{
|
|
{
|
|
if (!gpiochip_irqchip_irq_valid(chip, offset))
|
|
if (!gpiochip_irqchip_irq_valid(chip, offset))
|
|
return -ENXIO;
|
|
return -ENXIO;
|
|
- return irq_create_mapping(chip->irqdomain, offset);
|
|
|
|
|
|
+ return irq_create_mapping(chip->irq.domain, offset);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1719,7 +1719,7 @@ static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset)
|
|
*/
|
|
*/
|
|
static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
|
|
static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
|
|
{
|
|
{
|
|
- unsigned int offset;
|
|
|
|
|
|
+ unsigned int offset, irq;
|
|
|
|
|
|
acpi_gpiochip_free_interrupts(gpiochip);
|
|
acpi_gpiochip_free_interrupts(gpiochip);
|
|
|
|
|
|
@@ -1729,14 +1729,16 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
|
|
}
|
|
}
|
|
|
|
|
|
/* Remove all IRQ mappings and delete the domain */
|
|
/* Remove all IRQ mappings and delete the domain */
|
|
- if (gpiochip->irqdomain) {
|
|
|
|
|
|
+ if (gpiochip->irq.domain) {
|
|
for (offset = 0; offset < gpiochip->ngpio; offset++) {
|
|
for (offset = 0; offset < gpiochip->ngpio; offset++) {
|
|
if (!gpiochip_irqchip_irq_valid(gpiochip, offset))
|
|
if (!gpiochip_irqchip_irq_valid(gpiochip, offset))
|
|
continue;
|
|
continue;
|
|
- irq_dispose_mapping(
|
|
|
|
- irq_find_mapping(gpiochip->irqdomain, offset));
|
|
|
|
|
|
+
|
|
|
|
+ irq = irq_find_mapping(gpiochip->irq.domain, offset);
|
|
|
|
+ irq_dispose_mapping(irq);
|
|
}
|
|
}
|
|
- irq_domain_remove(gpiochip->irqdomain);
|
|
|
|
|
|
+
|
|
|
|
+ irq_domain_remove(gpiochip->irq.domain);
|
|
}
|
|
}
|
|
|
|
|
|
if (gpiochip->irq.chip) {
|
|
if (gpiochip->irq.chip) {
|
|
@@ -1822,10 +1824,10 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip,
|
|
gpiochip->irq_default_type = type;
|
|
gpiochip->irq_default_type = type;
|
|
gpiochip->to_irq = gpiochip_to_irq;
|
|
gpiochip->to_irq = gpiochip_to_irq;
|
|
gpiochip->lock_key = lock_key;
|
|
gpiochip->lock_key = lock_key;
|
|
- gpiochip->irqdomain = irq_domain_add_simple(of_node,
|
|
|
|
|
|
+ gpiochip->irq.domain = irq_domain_add_simple(of_node,
|
|
gpiochip->ngpio, first_irq,
|
|
gpiochip->ngpio, first_irq,
|
|
&gpiochip_domain_ops, gpiochip);
|
|
&gpiochip_domain_ops, gpiochip);
|
|
- if (!gpiochip->irqdomain) {
|
|
|
|
|
|
+ if (!gpiochip->irq.domain) {
|
|
gpiochip->irq.chip = NULL;
|
|
gpiochip->irq.chip = NULL;
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|