]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/acpi/acpi_lpss.c
Merge tag 'microblaze-v5.5-rc1' of git://git.monstr.eu/linux-2.6-microblaze
[linux.git] / drivers / acpi / acpi_lpss.c
index 60bbc5090abec0a626d88dda38c3729b41cc2446..70f740b096847b6d0add9fca42b17ae6e6ba7133 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/acpi.h>
 #include <linux/clkdev.h>
 #include <linux/clk-provider.h>
+#include <linux/dmi.h>
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/mutex.h>
@@ -463,6 +464,18 @@ struct lpss_device_links {
        const char *consumer_hid;
        const char *consumer_uid;
        u32 flags;
+       const struct dmi_system_id *dep_missing_ids;
+};
+
+/* Please keep this list sorted alphabetically by vendor and model */
+static const struct dmi_system_id i2c1_dep_missing_dmi_ids[] = {
+       {
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "T200TA"),
+               },
+       },
+       {}
 };
 
 /*
@@ -473,36 +486,29 @@ struct lpss_device_links {
  * the supplier is not enumerated until after the consumer is probed.
  */
 static const struct lpss_device_links lpss_device_links[] = {
+       /* CHT External sdcard slot controller depends on PMIC I2C ctrl */
        {"808622C1", "7", "80860F14", "3", DL_FLAG_PM_RUNTIME},
+       /* CHT iGPU depends on PMIC I2C controller */
        {"808622C1", "7", "LNXVIDEO", NULL, DL_FLAG_PM_RUNTIME},
+       /* BYT iGPU depends on the Embedded Controller I2C controller (UID 1) */
+       {"80860F41", "1", "LNXVIDEO", NULL, DL_FLAG_PM_RUNTIME,
+        i2c1_dep_missing_dmi_ids},
+       /* BYT CR iGPU depends on PMIC I2C controller (UID 5 on CR) */
        {"80860F41", "5", "LNXVIDEO", NULL, DL_FLAG_PM_RUNTIME},
+       /* BYT iGPU depends on PMIC I2C controller (UID 7 on non CR) */
+       {"80860F41", "7", "LNXVIDEO", NULL, DL_FLAG_PM_RUNTIME},
 };
 
-static bool hid_uid_match(struct acpi_device *adev,
-                         const char *hid2, const char *uid2)
-{
-       const char *hid1 = acpi_device_hid(adev);
-       const char *uid1 = acpi_device_uid(adev);
-
-       if (strcmp(hid1, hid2))
-               return false;
-
-       if (!uid2)
-               return true;
-
-       return uid1 && !strcmp(uid1, uid2);
-}
-
 static bool acpi_lpss_is_supplier(struct acpi_device *adev,
                                  const struct lpss_device_links *link)
 {
-       return hid_uid_match(adev, link->supplier_hid, link->supplier_uid);
+       return acpi_dev_hid_uid_match(adev, link->supplier_hid, link->supplier_uid);
 }
 
 static bool acpi_lpss_is_consumer(struct acpi_device *adev,
                                  const struct lpss_device_links *link)
 {
-       return hid_uid_match(adev, link->consumer_hid, link->consumer_uid);
+       return acpi_dev_hid_uid_match(adev, link->consumer_hid, link->consumer_uid);
 }
 
 struct hid_uid {
@@ -518,7 +524,7 @@ static int match_hid_uid(struct device *dev, const void *data)
        if (!adev)
                return 0;
 
-       return hid_uid_match(adev, id->hid, id->uid);
+       return acpi_dev_hid_uid_match(adev, id->hid, id->uid);
 }
 
 static struct device *acpi_lpss_find_device(const char *hid, const char *uid)
@@ -570,7 +576,8 @@ static void acpi_lpss_link_consumer(struct device *dev1,
        if (!dev2)
                return;
 
-       if (acpi_lpss_dep(ACPI_COMPANION(dev2), ACPI_HANDLE(dev1)))
+       if ((link->dep_missing_ids && dmi_check_system(link->dep_missing_ids))
+           || acpi_lpss_dep(ACPI_COMPANION(dev2), ACPI_HANDLE(dev1)))
                device_link_add(dev2, dev1, link->flags);
 
        put_device(dev2);
@@ -585,7 +592,8 @@ static void acpi_lpss_link_supplier(struct device *dev1,
        if (!dev2)
                return;
 
-       if (acpi_lpss_dep(ACPI_COMPANION(dev1), ACPI_HANDLE(dev2)))
+       if ((link->dep_missing_ids && dmi_check_system(link->dep_missing_ids))
+           || acpi_lpss_dep(ACPI_COMPANION(dev1), ACPI_HANDLE(dev2)))
                device_link_add(dev1, dev2, link->flags);
 
        put_device(dev2);