From aca0a4eb4e325914ddb22a8ed06fcb0222da2a26 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 30 May 2014 04:21:52 +0200 Subject: ACPI / scan: .match() callback for ACPI scan handlers Introduce a .match() callback for ACPI scan handlers to allow them to use more elaborate matching algorithms if necessary. That is needed for the upcoming PNP scan handler in particular. This change is based on a Zhang Rui's prototype. Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg --- include/acpi/acpi_bus.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/acpi/acpi_bus.h') diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 7417a16c8d86..c241c7594bbc 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -131,6 +131,7 @@ static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile( struct acpi_scan_handler { const struct acpi_device_id *ids; struct list_head list_node; + bool (*match)(char *idstr, const struct acpi_device_id **matchid); int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id); void (*detach)(struct acpi_device *dev); void (*bind)(struct device *phys_dev); -- cgit v1.2.3 From 549e68455c6706796d9d244364dfbf5c575bd1a5 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 30 May 2014 04:26:18 +0200 Subject: ACPI / scan: introduce platform_id device PNP type flag Only certain types of ACPI device objects can be enumerated as platform devices, so in order to distinguish them from the others introduce a new ACPI device PNP type flag, platform_id, and set it for devices with a valid _HID to start with. This change is based on a Zhang Rui's prototype. Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg --- drivers/acpi/scan.c | 4 +++- include/acpi/acpi_bus.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include/acpi/acpi_bus.h') diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 19d524c5c0c8..ebbd23c94ba2 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1797,8 +1797,10 @@ static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, return; } - if (info->valid & ACPI_VALID_HID) + if (info->valid & ACPI_VALID_HID) { acpi_add_id(pnp, info->hardware_id.string); + pnp->type.platform_id = 1; + } if (info->valid & ACPI_VALID_CID) { cid_list = &info->compatible_id_list; for (i = 0; i < cid_list->count; i++) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index c241c7594bbc..21477467441c 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -233,7 +233,8 @@ struct acpi_hardware_id { struct acpi_pnp_type { u32 hardware_id:1; u32 bus_address:1; - u32 reserved:30; + u32 platform_id:1; + u32 reserved:29; }; struct acpi_device_pnp { -- cgit v1.2.3