diff options
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r-- | drivers/acpi/scan.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 81367edc8a10..e14e964bfe6d 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -1505,41 +1505,38 @@ static void acpi_init_coherency(struct acpi_device *adev) | |||
1505 | adev->flags.coherent_dma = cca; | 1505 | adev->flags.coherent_dma = cca; |
1506 | } | 1506 | } |
1507 | 1507 | ||
1508 | static int acpi_check_spi_i2c_slave(struct acpi_resource *ares, void *data) | 1508 | static int acpi_check_serial_bus_slave(struct acpi_resource *ares, void *data) |
1509 | { | 1509 | { |
1510 | bool *is_spi_i2c_slave_p = data; | 1510 | bool *is_serial_bus_slave_p = data; |
1511 | 1511 | ||
1512 | if (ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) | 1512 | if (ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) |
1513 | return 1; | 1513 | return 1; |
1514 | 1514 | ||
1515 | /* | 1515 | *is_serial_bus_slave_p = true; |
1516 | * devices that are connected to UART still need to be enumerated to | ||
1517 | * platform bus | ||
1518 | */ | ||
1519 | if (ares->data.common_serial_bus.type != ACPI_RESOURCE_SERIAL_TYPE_UART) | ||
1520 | *is_spi_i2c_slave_p = true; | ||
1521 | 1516 | ||
1522 | /* no need to do more checking */ | 1517 | /* no need to do more checking */ |
1523 | return -1; | 1518 | return -1; |
1524 | } | 1519 | } |
1525 | 1520 | ||
1526 | static bool acpi_is_spi_i2c_slave(struct acpi_device *device) | 1521 | static bool acpi_is_serial_bus_slave(struct acpi_device *device) |
1527 | { | 1522 | { |
1528 | struct list_head resource_list; | 1523 | struct list_head resource_list; |
1529 | bool is_spi_i2c_slave = false; | 1524 | bool is_serial_bus_slave = false; |
1530 | 1525 | ||
1531 | /* Macs use device properties in lieu of _CRS resources */ | 1526 | /* Macs use device properties in lieu of _CRS resources */ |
1532 | if (x86_apple_machine && | 1527 | if (x86_apple_machine && |
1533 | (fwnode_property_present(&device->fwnode, "spiSclkPeriod") || | 1528 | (fwnode_property_present(&device->fwnode, "spiSclkPeriod") || |
1534 | fwnode_property_present(&device->fwnode, "i2cAddress"))) | 1529 | fwnode_property_present(&device->fwnode, "i2cAddress") || |
1530 | fwnode_property_present(&device->fwnode, "baud"))) | ||
1535 | return true; | 1531 | return true; |
1536 | 1532 | ||
1537 | INIT_LIST_HEAD(&resource_list); | 1533 | INIT_LIST_HEAD(&resource_list); |
1538 | acpi_dev_get_resources(device, &resource_list, acpi_check_spi_i2c_slave, | 1534 | acpi_dev_get_resources(device, &resource_list, |
1539 | &is_spi_i2c_slave); | 1535 | acpi_check_serial_bus_slave, |
1536 | &is_serial_bus_slave); | ||
1540 | acpi_dev_free_resource_list(&resource_list); | 1537 | acpi_dev_free_resource_list(&resource_list); |
1541 | 1538 | ||
1542 | return is_spi_i2c_slave; | 1539 | return is_serial_bus_slave; |
1543 | } | 1540 | } |
1544 | 1541 | ||
1545 | void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, | 1542 | void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, |
@@ -1557,7 +1554,7 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, | |||
1557 | acpi_bus_get_flags(device); | 1554 | acpi_bus_get_flags(device); |
1558 | device->flags.match_driver = false; | 1555 | device->flags.match_driver = false; |
1559 | device->flags.initialized = true; | 1556 | device->flags.initialized = true; |
1560 | device->flags.spi_i2c_slave = acpi_is_spi_i2c_slave(device); | 1557 | device->flags.serial_bus_slave = acpi_is_serial_bus_slave(device); |
1561 | acpi_device_clear_enumerated(device); | 1558 | acpi_device_clear_enumerated(device); |
1562 | device_initialize(&device->dev); | 1559 | device_initialize(&device->dev); |
1563 | dev_set_uevent_suppress(&device->dev, true); | 1560 | dev_set_uevent_suppress(&device->dev, true); |
@@ -1841,10 +1838,10 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used, | |||
1841 | static void acpi_default_enumeration(struct acpi_device *device) | 1838 | static void acpi_default_enumeration(struct acpi_device *device) |
1842 | { | 1839 | { |
1843 | /* | 1840 | /* |
1844 | * Do not enumerate SPI/I2C slaves as they will be enumerated by their | 1841 | * Do not enumerate SPI/I2C/UART slaves as they will be enumerated by |
1845 | * respective parents. | 1842 | * their respective parents. |
1846 | */ | 1843 | */ |
1847 | if (!device->flags.spi_i2c_slave) { | 1844 | if (!device->flags.serial_bus_slave) { |
1848 | acpi_create_platform_device(device, NULL); | 1845 | acpi_create_platform_device(device, NULL); |
1849 | acpi_device_set_enumerated(device); | 1846 | acpi_device_set_enumerated(device); |
1850 | } else { | 1847 | } else { |
@@ -1941,7 +1938,7 @@ static void acpi_bus_attach(struct acpi_device *device) | |||
1941 | return; | 1938 | return; |
1942 | 1939 | ||
1943 | device->flags.match_driver = true; | 1940 | device->flags.match_driver = true; |
1944 | if (ret > 0 && !device->flags.spi_i2c_slave) { | 1941 | if (ret > 0 && !device->flags.serial_bus_slave) { |
1945 | acpi_device_set_enumerated(device); | 1942 | acpi_device_set_enumerated(device); |
1946 | goto ok; | 1943 | goto ok; |
1947 | } | 1944 | } |
@@ -1950,7 +1947,7 @@ static void acpi_bus_attach(struct acpi_device *device) | |||
1950 | if (ret < 0) | 1947 | if (ret < 0) |
1951 | return; | 1948 | return; |
1952 | 1949 | ||
1953 | if (!device->pnp.type.platform_id && !device->flags.spi_i2c_slave) | 1950 | if (!device->pnp.type.platform_id && !device->flags.serial_bus_slave) |
1954 | acpi_device_set_enumerated(device); | 1951 | acpi_device_set_enumerated(device); |
1955 | else | 1952 | else |
1956 | acpi_default_enumeration(device); | 1953 | acpi_default_enumeration(device); |