Commit aa39d53f authored by Hans de Goede's avatar Hans de Goede Committed by Greg Kroah-Hartman

ACPI / LPSS: Make acpi_lpss_find_device() also find PCI devices

[ Upstream commit 1e30124a ]

On some Cherry Trail systems the GPU ACPI fwnode has power-resources which
point to the PMIC, which is connected over one of the LPSS I2C controllers.

To get the suspend/resume ordering correct for this we need to be able to
add device-links between the GPU and the I2c controller. The GPU is a PCI
device, so this requires acpi_lpss_find_device() to also work on PCI devs.
Tested-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 9372a40b
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/pci.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/platform_data/clk-lpss.h> #include <linux/platform_data/clk-lpss.h>
#include <linux/platform_data/x86/pmc_atom.h> #include <linux/platform_data/x86/pmc_atom.h>
...@@ -512,12 +513,18 @@ static int match_hid_uid(struct device *dev, void *data) ...@@ -512,12 +513,18 @@ static int match_hid_uid(struct device *dev, void *data)
static struct device *acpi_lpss_find_device(const char *hid, const char *uid) static struct device *acpi_lpss_find_device(const char *hid, const char *uid)
{ {
struct device *dev;
struct hid_uid data = { struct hid_uid data = {
.hid = hid, .hid = hid,
.uid = uid, .uid = uid,
}; };
return bus_find_device(&platform_bus_type, NULL, &data, match_hid_uid); dev = bus_find_device(&platform_bus_type, NULL, &data, match_hid_uid);
if (dev)
return dev;
return bus_find_device(&pci_bus_type, NULL, &data, match_hid_uid);
} }
static bool acpi_lpss_dep(struct acpi_device *adev, acpi_handle handle) static bool acpi_lpss_dep(struct acpi_device *adev, acpi_handle handle)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment