summaryrefslogtreecommitdiff
path: root/core/pld/src/pld_common.c
diff options
context:
space:
mode:
authorAmar Singhal <asinghal@codeaurora.org>2017-06-07 14:57:31 -0700
committerAmar Singhal <asinghal@codeaurora.org>2017-06-09 15:29:24 -0700
commit47c5490cb3949176967fb3a5c682e68f71f44a85 (patch)
tree22dab2785751fa253411c9d2cd6d82b1eda4ec36 /core/pld/src/pld_common.c
parent009fe5ab0ffeb76303ecd944cdd9564dd0c0c250 (diff)
downloadqcacld-47c5490cb3949176967fb3a5c682e68f71f44a85.tar.gz
qcacld-3.0: Do not always reject core regulatory callback
Core regulatory callback can happan on driver reload also. User may set country 00 when wlan is off. In that case on driver re-registration core callback would happen. To avoid rejecting such a callback, save the driver reload state with the platform driver. CRs-Fixed: 2057997 Change-Id: I43b2ed8fe9c29ca98ce64273a1be049a2005c0c3
Diffstat (limited to 'core/pld/src/pld_common.c')
-rw-r--r--core/pld/src/pld_common.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c
index 610781fe9b..8e3045cc1d 100644
--- a/core/pld/src/pld_common.c
+++ b/core/pld/src/pld_common.c
@@ -1183,6 +1183,61 @@ void pld_disable_irq(struct device *dev, unsigned int ce_id)
}
/**
+ * pld_increment_driver_load_cnt() - Maintain driver load count
+ * @dev: device
+ *
+ * This function maintain a count which get increase whenever wiphy
+ * is registered
+ *
+ * Return: void
+ */
+void pld_increment_driver_load_cnt(struct device *dev)
+{
+ switch (pld_get_bus_type(dev)) {
+ case PLD_BUS_TYPE_PCIE:
+ pld_pcie_increment_driver_load_cnt();
+ break;
+ case PLD_BUS_TYPE_SNOC:
+ pld_snoc_increment_driver_load_cnt();
+ break;
+ case PLD_BUS_TYPE_SDIO:
+ break;
+ default:
+ pr_err("Invalid device type\n");
+ break;
+ }
+}
+
+/**
+ * pld_get_driver_load_cnt() - get driver load count
+ * @dev: device
+ *
+ * This function provide total wiphy registration count from starting
+ *
+ * Return: int
+ */
+int pld_get_driver_load_cnt(struct device *dev)
+{
+ int ret = 0;
+
+ switch (pld_get_bus_type(dev)) {
+ case PLD_BUS_TYPE_PCIE:
+ ret = pld_pcie_get_driver_load_cnt();
+ break;
+ case PLD_BUS_TYPE_SNOC:
+ ret = pld_snoc_get_driver_load_cnt();
+ break;
+ case PLD_BUS_TYPE_SDIO:
+ break;
+ default:
+ ret = -EINVAL;
+ break;
+ }
+
+ return ret;
+}
+
+/**
* pld_get_soc_info() - Get SOC information
* @dev: device
* @info: buffer to SOC information