summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2017-08-01 14:10:41 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-08-03 23:26:22 +0200
commitca9ef3ab68d3530ac93d4254f9e47724ea51758d (patch)
treeba03933cd6a052c836c7cd26f0f2dfd0693a9ac1 /drivers/acpi
parent899596e090ea21918c55cbccea594be840af44ea (diff)
downloadop-kernel-dev-ca9ef3ab68d3530ac93d4254f9e47724ea51758d.zip
op-kernel-dev-ca9ef3ab68d3530ac93d4254f9e47724ea51758d.tar.gz
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 <ronald@innovation.ch> Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/scan.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 3389729..55fd248 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -13,6 +13,7 @@
#include <linux/dmi.h>
#include <linux/nls.h>
#include <linux/dma-mapping.h>
+#include <linux/platform_data/x86/apple.h>
#include <asm/pgtable.h>
@@ -1452,6 +1453,12 @@ static bool acpi_is_spi_i2c_slave(struct acpi_device *device)
struct list_head resource_list;
bool is_spi_i2c_slave = false;
+ /* Macs use device properties in lieu of _CRS resources */
+ if (x86_apple_machine &&
+ (fwnode_property_present(&device->fwnode, "spiSclkPeriod") ||
+ fwnode_property_present(&device->fwnode, "i2cAddress")))
+ return true;
+
INIT_LIST_HEAD(&resource_list);
acpi_dev_get_resources(device, &resource_list, acpi_check_spi_i2c_slave,
&is_spi_i2c_slave);
OpenPOWER on IntegriCloud