ACPI / scan: Fix enumeration for special SPI and I2C devices
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Mon, 19 Jun 2017 12:53:01 +0000 (15:53 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 21 Jun 2017 21:14:55 +0000 (23:14 +0200)
commite4330d8bf669139a983255d1801733b64c2ae841
treeb471fa35f0548700aa201d99edc67b63b26acfc7
parent41f1830f5a7af77cf5c86359aba3cbd706687e52
ACPI / scan: Fix enumeration for special SPI and I2C devices

Commit f406270bf73d ("ACPI / scan: Set the visited flag for all
enumerated devices") caused that two group of special SPI or I2C
devices do not enumerate. SPI and I2C devices are expected to be
enumerated by the SPI and I2C subsystems but change caused that
acpi_bus_attach() marks those devices with acpi_device_set_enumerated().

First group of devices are matched using Device Tree compatible property
with special _HID "PRP0001". Those devices have matched scan handler,
acpi_scan_attach_handler() retuns 1 and acpi_bus_attach() marks them
with acpi_device_set_enumerated().

Second group of devices without valid _HID such as "LNXVIDEO" have
device->pnp.type.platform_id set to zero and change again marks them
with acpi_device_set_enumerated().

Fix this by flagging the SPI and I2C devices during struct acpi_device
object initialization time and let the code in acpi_bus_attach() to go
through the device_attach() and acpi_default_enumeration() path for all
SPI and I2C devices.

Fixes: f406270bf73d (ACPI / scan: Set the visited flag for all enumerated devices)
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: 4.11+ <stable@vger.kernel.org> # 4.11+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/scan.c
include/acpi/acpi_bus.h