about summary refs log tree commit diff
path: root/modules/hardware/t100ha/sdio.patch
blob: 3bfef26d3c1fc9fabdfb7a98b18189dd2b6b07f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Patch from https://github.com/hadess/rtl8723bs/issues/80#issuecomment-252259702

diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 159f7f1..2076427 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -50,8 +50,10 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev)
 	int count;
 
 	/* If the ACPI node already has a physical device attached, skip it. */
-	if (adev->physical_node_count)
-		return NULL;
+	if (adev->physical_node_count && !(
+	    !strcmp(acpi_device_hid(adev), "80860F14") &&
+	    !strcmp(adev->pnp.unique_id, "2")
+	)) return NULL;
 
 	if (!acpi_match_device_ids(adev, forbidden_id_list))
 		return ERR_PTR(-EINVAL);
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 458ffb7..2807f78 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -47,6 +47,7 @@
 #endif
 
 #include "sdhci.h"
+#include <linux/pci.h>
 
 enum {
 	SDHCI_ACPI_SD_CD		= BIT(0),
@@ -381,6 +382,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 	struct acpi_device *device, *child;
 	struct sdhci_acpi_host *c;
 	struct sdhci_host *host;
+	struct pci_dev *pcidev = NULL;
 	struct resource *iomem;
 	resource_size_t len;
 	const char *hid;
@@ -404,6 +406,12 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 	hid = acpi_device_hid(device);
 	uid = device->pnp.unique_id;
 
+	/* Workaround for CherryTrail x5-z8xxx: Make sure the SDIO controller
+	 * doesn't get added via PCI. */
+	if (!strcmp(hid, "80860F14") && !strcmp(uid, "1") &&
+	    (pcidev = pci_get_device(0x8086, 0x2280, NULL)) != NULL)
+		pci_stop_and_remove_bus_device(pcidev);
+
 	iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!iomem)
 		return -ENOMEM;