Commit d87fb091 authored by John Garry's avatar John Garry Committed by Bjorn Helgaas

ACPI / scan: Rename acpi_is_serial_bus_slave() for more general use

Currently the ACPI scan has special handling for serial bus slaves, in that
it makes it the responsibility of the slave device's parent to enumerate
the device.

To support other types of slave devices which require the same special
handling but where the bus is not strictly a serial bus, such as devices on
the HiSilicon LPC controller bus, rename acpi_is_serial_bus_slave() to
acpi_device_enumeration_by_parent(), so that the name can fit the wider
purpose.

Also rename the associated device flag acpi_device_flags.serial_bus_slave
to .enumeration_by_parent.
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent adf38bb0
...@@ -1524,7 +1524,7 @@ static int acpi_check_serial_bus_slave(struct acpi_resource *ares, void *data) ...@@ -1524,7 +1524,7 @@ static int acpi_check_serial_bus_slave(struct acpi_resource *ares, void *data)
return -1; return -1;
} }
static bool acpi_is_serial_bus_slave(struct acpi_device *device) static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
{ {
struct list_head resource_list; struct list_head resource_list;
bool is_serial_bus_slave = false; bool is_serial_bus_slave = false;
...@@ -1560,7 +1560,8 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, ...@@ -1560,7 +1560,8 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
acpi_bus_get_flags(device); acpi_bus_get_flags(device);
device->flags.match_driver = false; device->flags.match_driver = false;
device->flags.initialized = true; device->flags.initialized = true;
device->flags.serial_bus_slave = acpi_is_serial_bus_slave(device); device->flags.enumeration_by_parent =
acpi_device_enumeration_by_parent(device);
acpi_device_clear_enumerated(device); acpi_device_clear_enumerated(device);
device_initialize(&device->dev); device_initialize(&device->dev);
dev_set_uevent_suppress(&device->dev, true); dev_set_uevent_suppress(&device->dev, true);
...@@ -1858,10 +1859,10 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used, ...@@ -1858,10 +1859,10 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used,
static void acpi_default_enumeration(struct acpi_device *device) static void acpi_default_enumeration(struct acpi_device *device)
{ {
/* /*
* Do not enumerate SPI/I2C/UART slaves as they will be enumerated by * Do not enumerate devices with enumeration_by_parent flag set as
* their respective parents. * they will be enumerated by their respective parents.
*/ */
if (!device->flags.serial_bus_slave) { if (!device->flags.enumeration_by_parent) {
acpi_create_platform_device(device, NULL); acpi_create_platform_device(device, NULL);
acpi_device_set_enumerated(device); acpi_device_set_enumerated(device);
} else { } else {
...@@ -1958,7 +1959,7 @@ static void acpi_bus_attach(struct acpi_device *device) ...@@ -1958,7 +1959,7 @@ static void acpi_bus_attach(struct acpi_device *device)
return; return;
device->flags.match_driver = true; device->flags.match_driver = true;
if (ret > 0 && !device->flags.serial_bus_slave) { if (ret > 0 && !device->flags.enumeration_by_parent) {
acpi_device_set_enumerated(device); acpi_device_set_enumerated(device);
goto ok; goto ok;
} }
...@@ -1967,10 +1968,10 @@ static void acpi_bus_attach(struct acpi_device *device) ...@@ -1967,10 +1968,10 @@ static void acpi_bus_attach(struct acpi_device *device)
if (ret < 0) if (ret < 0)
return; return;
if (!device->pnp.type.platform_id && !device->flags.serial_bus_slave) if (device->pnp.type.platform_id || device->flags.enumeration_by_parent)
acpi_device_set_enumerated(device);
else
acpi_default_enumeration(device); acpi_default_enumeration(device);
else
acpi_device_set_enumerated(device);
ok: ok:
list_for_each_entry(child, &device->children, node) list_for_each_entry(child, &device->children, node)
......
...@@ -215,7 +215,7 @@ struct acpi_device_flags { ...@@ -215,7 +215,7 @@ struct acpi_device_flags {
u32 of_compatible_ok:1; u32 of_compatible_ok:1;
u32 coherent_dma:1; u32 coherent_dma:1;
u32 cca_seen:1; u32 cca_seen:1;
u32 serial_bus_slave:1; u32 enumeration_by_parent:1;
u32 reserved:19; u32 reserved:19;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment