Skip to content

Commit 2a56e91

Browse files
Jagadish KrishnamoorthyLinus Walleij
authored andcommitted
PNP / ACPI: add support for GpioInt resource type
The PNP ACPI driver parses ACPI interrupt resource but not GpioInt resource. When the firmware passes GpioInt resource for IRQ the PNP ACPI driver ignores it and hence the interrupt for the particular driver will not work. One such example is 8042 keyboard which uses PNP driver for obtaining the interrupt resource. On Intel Braswell project GpioInt is used instead of interrupt resource and the keyboard driver fails to register interrupt. Fix the issue by parsing GpioInt resource type. Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> [Fixed a parenthesis coding style thing] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 25e3ef8 commit 2a56e91

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎drivers/pnp/pnpacpi/rsparser.c‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
180180
struct pnp_dev *dev = data;
181181
struct acpi_resource_dma *dma;
182182
struct acpi_resource_vendor_typed *vendor_typed;
183+
struct acpi_resource_gpio *gpio;
183184
struct resource_win win = {{0}, 0};
184185
struct resource *r = &win.res;
185186
int i, flags;
@@ -210,6 +211,21 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
210211
}
211212
}
212213
return AE_OK;
214+
} else if (acpi_gpio_get_irq_resource(res, &gpio)) {
215+
/*
216+
* If the resource is GpioInt() type then extract the IRQ
217+
* from GPIO resource and fill it into IRQ resource type.
218+
*/
219+
i = acpi_dev_gpio_irq_get(dev->data, 0);
220+
if (i >= 0) {
221+
flags = acpi_dev_irq_flags(gpio->triggering,
222+
gpio->polarity,
223+
gpio->sharable);
224+
} else {
225+
flags = IORESOURCE_DISABLED;
226+
}
227+
pnp_add_irq_resource(dev, i, flags);
228+
return AE_OK;
213229
} else if (r->flags & IORESOURCE_DISABLED) {
214230
pnp_add_irq_resource(dev, 0, IORESOURCE_DISABLED);
215231
return AE_OK;

0 commit comments

Comments
 (0)