From 44c44772ad4effec4fa605e1ebe1b1bfb727c7cc Mon Sep 17 00:00:00 2001 From: Yuanyuan Liu Date: Mon, 11 Apr 2016 11:11:27 -0700 Subject: qcacld-3.0: Add PM semaphore related APIs in PLD Add PM semaphore related APIs in PLD, which is being used in BMI. CRs-Fixed: 1010156 Change-Id: Ief52f7b078ea62cae18508b9e523e2a19f3519b3 --- core/pld/inc/pld_common.h | 2 ++ core/pld/src/pld_common.c | 40 ++++++++++++++++++++++++++++++++++++++++ core/pld/src/pld_pcie.h | 8 ++++++++ 3 files changed, 50 insertions(+) diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index 9345eaffe7e7..8f009c43441c 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -342,5 +342,7 @@ void pld_enable_irq(struct device *dev, unsigned int ce_id); void pld_disable_irq(struct device *dev, unsigned int ce_id); int pld_get_soc_info(struct device *dev, struct pld_soc_info *info); int pld_get_ce_id(struct device *dev, int irq); +void pld_lock_pm_sem(struct device *dev); +void pld_release_pm_sem(struct device *dev); #endif diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index 902c2108cb86..00d0e79368fc 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -1115,3 +1115,43 @@ int pld_get_ce_id(struct device *dev, int irq) return ret; } + +/** + * pld_lock_pm_sem() - Lock PM semaphore + * @dev: device + * + * Return: void + */ +void pld_lock_pm_sem(struct device *dev) +{ + switch (pld_get_bus_type(dev)) { + case PLD_BUS_TYPE_PCIE: + cnss_lock_pm_sem(); + break; + case PLD_BUS_TYPE_SNOC: + break; + default: + pr_err("Invalid device type\n"); + break; + } +} + +/** + * pld_release_pm_sem() - Release PM semaphore + * @dev: device + * + * Return: void + */ +void pld_release_pm_sem(struct device *dev) +{ + switch (pld_get_bus_type(dev)) { + case PLD_BUS_TYPE_PCIE: + cnss_release_pm_sem(); + break; + case PLD_BUS_TYPE_SNOC: + break; + default: + pr_err("Invalid device type\n"); + break; + } +} diff --git a/core/pld/src/pld_pcie.h b/core/pld/src/pld_pcie.h index 16d022b2a9ff..4e3191e4dfdf 100644 --- a/core/pld/src/pld_pcie.h +++ b/core/pld/src/pld_pcie.h @@ -179,6 +179,14 @@ static inline int cnss_auto_resume(void) { return 0; } +static void cnss_lock_pm_sem(void) +{ + return; +} +static void cnss_release_pm_sem(void) +{ + return; +} #else int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files, u32 target_type, u32 target_version); -- cgit v1.2.3