summaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorJagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>2017-05-23 13:03:25 -0400
committerLinus Walleij <linus.walleij@linaro.org>2017-05-29 05:25:52 -0400
commit2a56e9195dfb59548cc8b32e8e8d0eef4b65f7eb (patch)
treef5d6a9a2f65908727102a065e9e41284c2e4ab3c /drivers/pnp
parent25e3ef894eef419ee239da42edc6c1f8a4f1cfb5 (diff)
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>
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 4b717c699313..d0358cfb316e 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -180,6 +180,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
180 struct pnp_dev *dev = data; 180 struct pnp_dev *dev = data;
181 struct acpi_resource_dma *dma; 181 struct acpi_resource_dma *dma;
182 struct acpi_resource_vendor_typed *vendor_typed; 182 struct acpi_resource_vendor_typed *vendor_typed;
183 struct acpi_resource_gpio *gpio;
183 struct resource_win win = {{0}, 0}; 184 struct resource_win win = {{0}, 0};
184 struct resource *r = &win.res; 185 struct resource *r = &win.res;
185 int i, flags; 186 int i, flags;
@@ -210,6 +211,21 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
210 } 211 }
211 } 212 }
212 return AE_OK; 213 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;
213 } else if (r->flags & IORESOURCE_DISABLED) { 229 } else if (r->flags & IORESOURCE_DISABLED) {
214 pnp_add_irq_resource(dev, 0, IORESOURCE_DISABLED); 230 pnp_add_irq_resource(dev, 0, IORESOURCE_DISABLED);
215 return AE_OK; 231 return AE_OK;