diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-09-24 14:04:57 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-10-15 11:21:43 +0200 |
commit | bb37fc2983d2d2cb3196a56eeb34ff79775b2e85 (patch) | |
tree | aa1ababef9b11adb05b9bf4b1067945ea42d79ea | |
parent | 5c8150220cfbac9a1a3a5ec97be12a011d1b6d6d (diff) | |
download | seabios-bb37fc2983d2d2cb3196a56eeb34ff79775b2e85.tar.gz |
dsdt: add _CID support
When looking for devices check both _HID (hardware id)
and _CID (compatible id).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | src/fw/dsdt_parser.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/fw/dsdt_parser.c b/src/fw/dsdt_parser.c index f6413c66..38f965a2 100644 --- a/src/fw/dsdt_parser.c +++ b/src/fw/dsdt_parser.c @@ -21,6 +21,7 @@ struct acpi_device { struct acpi_device *parent; char name[16]; u8 *hid_aml; + u8 *cid_aml; u8 *uid_aml; u8 *sta_aml; u8 *crs_data; @@ -427,6 +428,8 @@ static int parse_termobj(struct parse_state *s, offset += parse_termobj(s, ptr + offset); if (s->dev && strcmp(s->name, "_HID") == 0) s->dev->hid_aml = ptr; + if (s->dev && strcmp(s->name, "_CID") == 0) + s->dev->cid_aml = ptr; if (s->dev && strcmp(s->name, "_STA") == 0) s->dev->sta_aml = ptr; if (s->dev && strcmp(s->name, "_UID") == 0) @@ -537,12 +540,18 @@ static struct acpi_device *acpi_dsdt_find(struct acpi_device *prev, dev = container_of(node, struct acpi_device, node); if (!aml1 && !aml2) return dev; - if (!dev->hid_aml) - continue; - if (aml1 && memcmp(dev->hid_aml + 5, aml1, size1) == 0) - return dev; - if (aml2 && memcmp(dev->hid_aml + 5, aml2, size2) == 0) - return dev; + if (dev->hid_aml) { + if (aml1 && memcmp(dev->hid_aml + 5, aml1, size1) == 0) + return dev; + if (aml2 && memcmp(dev->hid_aml + 5, aml2, size2) == 0) + return dev; + } + if (dev->cid_aml) { + if (aml1 && memcmp(dev->cid_aml + 5, aml1, size1) == 0) + return dev; + if (aml2 && memcmp(dev->cid_aml + 5, aml2, size2) == 0) + return dev; + } } return NULL; } @@ -687,6 +696,8 @@ void acpi_dsdt_parse(void) dprintf(1, " %s", acpi_dsdt_name(dev)); if (dev->hid_aml) dprintf(1, ", hid"); + if (dev->cid_aml) + dprintf(1, ", cid"); if (dev->uid_aml) dprintf(1, ", uid %lld", acpi_dsdt_uid(dev)); if (dev->sta_aml) |