diff options
author | Zhang Rui <rui.zhang@intel.com> | 2014-05-30 08:35:34 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-30 10:04:37 -0400 |
commit | 48459340b92b00ae1a75179f168ef20d3e61f264 (patch) | |
tree | 46ee03d1984eba3272131619977ac3f2751c1ab0 /drivers/acpi/acpi_platform.c | |
parent | d6ddaaac8f5c37ad84db3e6e019981f392389cf0 (diff) |
ACPI / scan: use platform bus type by default for _HID enumeration
Because of the growing demand for enumerating ACPI devices to
platform bus, change the code to enumerate ACPI device objects to
platform bus by default. Namely, create platform devices for the
ACPI device objects that
1. Have pnp.type.platform_id set (device objects with _HID currently).
2. Do not have a scan handler attached.
3. Are not SPI/I2C slave devices (that should be enumerated to the
appropriate buses bus by their parent).
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[rjw: Subject and changelog, rebase and code cleanup]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/acpi/acpi_platform.c')
-rw-r--r-- | drivers/acpi/acpi_platform.c | 44 |
1 files changed, 8 insertions, 36 deletions
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index 3bb89def2292..2bf9082f7523 100644 --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c | |||
@@ -22,25 +22,11 @@ | |||
22 | 22 | ||
23 | ACPI_MODULE_NAME("platform"); | 23 | ACPI_MODULE_NAME("platform"); |
24 | 24 | ||
25 | /* | 25 | static const struct acpi_device_id forbidden_id_list[] = { |
26 | * The following ACPI IDs are known to be suitable for representing as | 26 | {"PNP0000", 0}, /* PIC */ |
27 | * platform devices. | 27 | {"PNP0100", 0}, /* Timer */ |
28 | */ | 28 | {"PNP0200", 0}, /* AT DMA Controller */ |
29 | static const struct acpi_device_id acpi_platform_device_ids[] = { | 29 | {"", 0}, |
30 | |||
31 | { "PNP0D40" }, | ||
32 | { "VPC2004" }, | ||
33 | { "BCM4752" }, | ||
34 | { "LNV4752" }, | ||
35 | { "BCM2E1A" }, | ||
36 | { "BCM2E39" }, | ||
37 | { "BCM2E3D" }, | ||
38 | |||
39 | /* Intel Smart Sound Technology */ | ||
40 | { "INT33C8" }, | ||
41 | { "80860F28" }, | ||
42 | |||
43 | { } | ||
44 | }; | 30 | }; |
45 | 31 | ||
46 | /** | 32 | /** |
@@ -67,6 +53,9 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev) | |||
67 | if (adev->physical_node_count) | 53 | if (adev->physical_node_count) |
68 | return NULL; | 54 | return NULL; |
69 | 55 | ||
56 | if (!acpi_match_device_ids(adev, forbidden_id_list)) | ||
57 | return ERR_PTR(-EINVAL); | ||
58 | |||
70 | INIT_LIST_HEAD(&resource_list); | 59 | INIT_LIST_HEAD(&resource_list); |
71 | count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL); | 60 | count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL); |
72 | if (count < 0) { | 61 | if (count < 0) { |
@@ -124,20 +113,3 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev) | |||
124 | kfree(resources); | 113 | kfree(resources); |
125 | return pdev; | 114 | return pdev; |
126 | } | 115 | } |
127 | |||
128 | static int acpi_platform_attach(struct acpi_device *adev, | ||
129 | const struct acpi_device_id *id) | ||
130 | { | ||
131 | acpi_create_platform_device(adev); | ||
132 | return 1; | ||
133 | } | ||
134 | |||
135 | static struct acpi_scan_handler platform_handler = { | ||
136 | .ids = acpi_platform_device_ids, | ||
137 | .attach = acpi_platform_attach, | ||
138 | }; | ||
139 | |||
140 | void __init acpi_platform_init(void) | ||
141 | { | ||
142 | acpi_scan_add_handler(&platform_handler); | ||
143 | } | ||