summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKomal Seelam <kseelam@codeaurora.org>2016-09-26 17:08:34 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-10-18 00:45:40 -0700
commitc2fcc1e96c4719c07dcd7f54a043732d1c1252a6 (patch)
treedc63842d163f455c68723c979e5b37f15bd0ecc5
parentbe36affc944c0f113bf077bb5571caf6e6646d7d (diff)
qcacmn: Define Runtime PM init/exit API's in the driver
OPENSOURCE driver doesn't need PLD/CNSS platform layer interface to call the kernel API's. Define the Runtime PM init/exit API's in the bus interface layer. CRs-Fixed: 1072520 Change-Id: I81bd782e52095826510b3adfd02ca76f593bdb49
-rw-r--r--hif/src/pcie/if_pci.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c
index 19f184111095..3c7ca8e0a876 100644
--- a/hif/src/pcie/if_pci.c
+++ b/hif/src/pcie/if_pci.c
@@ -899,7 +899,6 @@ end:
#ifdef FEATURE_RUNTIME_PM
#define HIF_PCI_RUNTIME_PM_STATS(_s, _sc, _name) \
seq_printf(_s, "%30s: %u\n", #_name, _sc->pm_stats._name)
-
/**
* hif_pci_runtime_pm_warn() - Runtime PM Debugging API
* @sc: hif_pci_softc context
@@ -1042,7 +1041,6 @@ static int hif_pci_runtime_pm_open(struct inode *inode, struct file *file)
inode->i_private);
}
-#ifdef WLAN_OPEN_SOURCE
static const struct file_operations hif_pci_runtime_pm_fops = {
.owner = THIS_MODULE,
.open = hif_pci_runtime_pm_open,
@@ -1063,6 +1061,7 @@ static void hif_runtime_pm_debugfs_create(struct hif_pci_softc *sc)
S_IRUSR, NULL, sc,
&hif_pci_runtime_pm_fops);
}
+
/**
* hif_runtime_pm_debugfs_remove() - removes runtimepm debugfs entry
* @sc: pci context
@@ -1073,14 +1072,22 @@ static void hif_runtime_pm_debugfs_remove(struct hif_pci_softc *sc)
{
debugfs_remove(sc->pm_dentry);
}
-#else
-static inline void hif_runtime_pm_debugfs_create(struct hif_pci_softc *sc)
+
+static void hif_runtime_init(struct device *dev, int delay)
{
+ pm_runtime_set_autosuspend_delay(dev, delay);
+ pm_runtime_use_autosuspend(dev);
+ pm_runtime_allow(dev);
+ pm_runtime_mark_last_busy(dev);
+ pm_runtime_put_noidle(dev);
+ pm_suspend_ignore_children(dev, true);
}
-static inline void hif_runtime_pm_debugfs_remove(struct hif_pci_softc *sc)
+
+static void hif_runtime_exit(struct device *dev)
{
+ pm_runtime_get_noresume(dev);
+ pm_runtime_set_active(dev);
}
-#endif
static void hif_pm_runtime_lock_timeout_fn(unsigned long data);
@@ -1112,7 +1119,7 @@ static void hif_pm_runtime_start(struct hif_pci_softc *sc)
HIF_INFO("%s: Enabling RUNTIME PM, Delay: %d ms", __func__,
ol_sc->hif_config.runtime_pm_delay);
- pld_runtime_init(sc->dev, ol_sc->hif_config.runtime_pm_delay);
+ hif_runtime_init(sc->dev, ol_sc->hif_config.runtime_pm_delay);
qdf_atomic_set(&sc->pm_state, HIF_PM_RUNTIME_STATE_ON);
hif_runtime_pm_debugfs_create(sc);
}
@@ -1135,7 +1142,7 @@ static void hif_pm_runtime_stop(struct hif_pci_softc *sc)
if (mode == QDF_GLOBAL_FTM_MODE || QDF_IS_EPPING_ENABLED(mode))
return;
- pld_runtime_exit(sc->dev);
+ hif_runtime_exit(sc->dev);
hif_pm_runtime_resume(sc->dev);
qdf_atomic_set(&sc->pm_state, HIF_PM_RUNTIME_STATE_NONE);