Skip to content

Commit ea6f3af

Browse files
ardbiesheuvelrafaeljw
authored andcommitted
ACPI: GED: add support for _Exx / _Lxx handler methods
Per the ACPI spec, interrupts in the range [0, 255] may be handled in AML using individual methods whose naming is based on the format _Exx or _Lxx, where xx is the hex representation of the interrupt index. Add support for this missing feature to our ACPI GED driver. Cc: v4.9+ <[email protected]> # v4.9+ Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent a10660f commit ea6f3af

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

drivers/acpi/evged.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares,
7979
struct resource r;
8080
struct acpi_resource_irq *p = &ares->data.irq;
8181
struct acpi_resource_extended_irq *pext = &ares->data.extended_irq;
82+
char ev_name[5];
83+
u8 trigger;
8284

8385
if (ares->type == ACPI_RESOURCE_TYPE_END_TAG)
8486
return AE_OK;
@@ -87,14 +89,28 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares,
8789
dev_err(dev, "unable to parse IRQ resource\n");
8890
return AE_ERROR;
8991
}
90-
if (ares->type == ACPI_RESOURCE_TYPE_IRQ)
92+
if (ares->type == ACPI_RESOURCE_TYPE_IRQ) {
9193
gsi = p->interrupts[0];
92-
else
94+
trigger = p->triggering;
95+
} else {
9396
gsi = pext->interrupts[0];
97+
trigger = p->triggering;
98+
}
9499

95100
irq = r.start;
96101

97-
if (ACPI_FAILURE(acpi_get_handle(handle, "_EVT", &evt_handle))) {
102+
switch (gsi) {
103+
case 0 ... 255:
104+
sprintf(ev_name, "_%c%02hhX",
105+
trigger == ACPI_EDGE_SENSITIVE ? 'E' : 'L', gsi);
106+
107+
if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
108+
break;
109+
/* fall through */
110+
default:
111+
if (ACPI_SUCCESS(acpi_get_handle(handle, "_EVT", &evt_handle)))
112+
break;
113+
98114
dev_err(dev, "cannot locate _EVT method\n");
99115
return AE_ERROR;
100116
}

0 commit comments

Comments
 (0)