Skip to content

Commit ca9ef3a

Browse files
l1krafaeljw
authored andcommitted
ACPI / scan: Recognize Apple SPI and I2C slaves
SPI and I2C slaves are enumerated by their respective parents rather than the ACPI core. They are recognized by presence of _CRS resources, which however are missing on Macs. Check for presence of device properties instead. Reported-and-tested-by: Ronald Tschalär <[email protected]> Signed-off-by: Lukas Wunner <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 899596e commit ca9ef3a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/acpi/scan.c

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/dmi.h>
1414
#include <linux/nls.h>
1515
#include <linux/dma-mapping.h>
16+
#include <linux/platform_data/x86/apple.h>
1617

1718
#include <asm/pgtable.h>
1819

@@ -1452,6 +1453,12 @@ static bool acpi_is_spi_i2c_slave(struct acpi_device *device)
14521453
struct list_head resource_list;
14531454
bool is_spi_i2c_slave = false;
14541455

1456+
/* Macs use device properties in lieu of _CRS resources */
1457+
if (x86_apple_machine &&
1458+
(fwnode_property_present(&device->fwnode, "spiSclkPeriod") ||
1459+
fwnode_property_present(&device->fwnode, "i2cAddress")))
1460+
return true;
1461+
14551462
INIT_LIST_HEAD(&resource_list);
14561463
acpi_dev_get_resources(device, &resource_list, acpi_check_spi_i2c_slave,
14571464
&is_spi_i2c_slave);

0 commit comments

Comments
 (0)