Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1700950 > unrolled thread

[PATCH v4 4/5] ACPI / scan: Recognize Apple SPI and I2C slaves

Started byLukas Wunner <lukas@wunner.de>
First post2017-08-01 14:20 +0200
Last post2017-08-01 15:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v4 4/5] ACPI / scan: Recognize Apple SPI and I2C slaves Lukas Wunner <lukas@wunner.de> - 2017-08-01 14:20 +0200
    Re: [PATCH v4 4/5] ACPI / scan: Recognize Apple SPI and I2C slaves Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-08-01 15:40 +0200

#1700950 — [PATCH v4 4/5] ACPI / scan: Recognize Apple SPI and I2C slaves

FromLukas Wunner <lukas@wunner.de>
Date2017-08-01 14:20 +0200
Subject[PATCH v4 4/5] ACPI / scan: Recognize Apple SPI and I2C slaves
Message-ID<u9Ejv-3Ut-5@gated-at.bofh.it>
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.

Cc: Federico Lorenzi <florenzi@gmail.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reported-and-tested-by: Ronald Tschalär <ronald@innovation.ch>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
---
 drivers/acpi/scan.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 943536c9a2a8..71a067c412a1 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);
-- 
2.11.0

[toc] | [next] | [standalone]


#1701047

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-08-01 15:40 +0200
Message-ID<u9FyW-4zN-19@gated-at.bofh.it>
In reply to#1700950
On Tue, Aug 01, 2017 at 02:10:41PM +0200, Lukas Wunner wrote:
> 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.
> 
> Cc: Federico Lorenzi <florenzi@gmail.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web