diff options
Diffstat (limited to 'src/fw/dsdt_parser.c')
-rw-r--r-- | src/fw/dsdt_parser.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/fw/dsdt_parser.c b/src/fw/dsdt_parser.c index fee3c090..f6413c66 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 *uid_aml; u8 *sta_aml; u8 *crs_data; int crs_size; @@ -428,6 +429,8 @@ static int parse_termobj(struct parse_state *s, s->dev->hid_aml = ptr; if (s->dev && strcmp(s->name, "_STA") == 0) s->dev->sta_aml = ptr; + if (s->dev && strcmp(s->name, "_UID") == 0) + s->dev->uid_aml = ptr; break; case 0x0a: /* byte prefix */ offset++; @@ -599,6 +602,19 @@ char *acpi_dsdt_name(struct acpi_device *dev) return dev->name; } +u64 acpi_dsdt_uid(struct acpi_device *dev) +{ + int error = 0; + u64 value = 0; + + if (!CONFIG_ACPI_PARSE || !dev || !dev->uid_aml) + return 0; + parse_termarg_int(dev->uid_aml + 5, &error, &value); + if (error) + return 0; + return value; +} + int acpi_dsdt_find_io(struct acpi_device *dev, u64 *min, u64 *max) { if (!CONFIG_ACPI_PARSE || !dev || !dev->crs_data) @@ -671,6 +687,8 @@ void acpi_dsdt_parse(void) dprintf(1, " %s", acpi_dsdt_name(dev)); if (dev->hid_aml) dprintf(1, ", hid"); + if (dev->uid_aml) + dprintf(1, ", uid %lld", acpi_dsdt_uid(dev)); if (dev->sta_aml) dprintf(1, ", sta (0x%x)", dev->sta_aml[0]); if (dev->crs_data) |