]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/mfd/intel-lpss.c
UBUNTU: SAUCE: mfd: intel-lpss: add quirk for Dell XPS 13 7390 2-in-1
[mirror_ubuntu-bionic-kernel.git] / drivers / mfd / intel-lpss.c
index b5c4f8f974aa75882f6e64dc0d7a7b6ac193210c..94e6d675eac047b37ad0202772f718f48318eea6 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/clkdev.h>
 #include <linux/clk-provider.h>
 #include <linux/debugfs.h>
+#include <linux/dmi.h>
 #include <linux/idr.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
@@ -130,6 +131,17 @@ static const struct mfd_cell intel_lpss_spi_cell = {
 static DEFINE_IDA(intel_lpss_devid_ida);
 static struct dentry *intel_lpss_debugfs;
 
+static const struct dmi_system_id mtrr_large_wc_region[] = {
+       {
+               .ident = "Dell Computer Corporation",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 7390 2-in-1"),
+               },
+       },
+       { }
+};
+
 static int intel_lpss_request_dma_module(const char *name)
 {
        static bool intel_lpss_dma_requested;
@@ -397,8 +409,12 @@ int intel_lpss_probe(struct device *dev,
        if (!lpss)
                return -ENOMEM;
 
-       lpss->priv = devm_ioremap(dev, info->mem->start + LPSS_PRIV_OFFSET,
-                                 LPSS_PRIV_SIZE);
+       if (dmi_check_system(mtrr_large_wc_region))
+               lpss->priv = devm_ioremap_uc(dev, info->mem->start + LPSS_PRIV_OFFSET,
+                                            LPSS_PRIV_SIZE);
+       else
+               lpss->priv = devm_ioremap(dev, info->mem->start + LPSS_PRIV_OFFSET,
+                                         LPSS_PRIV_SIZE);
        if (!lpss->priv)
                return -ENOMEM;