local/pci: pcie-designware: add callback function to check whether power is enabled...
authorJaehoon Chung <jh80.chung@samsung.com>
Thu, 16 Apr 2015 06:51:54 +0000 (15:51 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:44:36 +0000 (13:44 +0900)
Add callback function to check whether wifi power is on or not.
This patch is workaround code for exynos5433 wifi.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/pci/host/pcie-designware.c
drivers/pci/host/pcie-designware.h

index 7c775c9..b32975f 100644 (file)
@@ -676,6 +676,13 @@ static int dw_pcie_wr_other_conf(struct pcie_port *pp, struct pci_bus *bus,
 static int dw_pcie_valid_config(struct pcie_port *pp,
                                struct pci_bus *bus, int dev)
 {
+
+       /* Workaround */
+       if (pp->ops->power_enabled) {
+               if (!pp->ops->power_enabled(pp))
+                       return 0;
+       }
+
        /* If there is no link, then there is no device */
        if (bus->number != pp->root_bus_nr) {
                if (!dw_pcie_link_up(pp))
index 97ed547..1332d3e 100644 (file)
@@ -75,6 +75,7 @@ struct pcie_host_ops {
        u32 (*get_msi_data)(struct pcie_port *pp, int pos);
        void (*scan_bus)(struct pcie_port *pp);
        int (*msi_host_init)(struct pcie_port *pp, struct msi_controller *chip);
+       int (*power_enabled)(struct pcie_port *pp);
 };
 
 int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val);