diff options
author | Yue Ma <yuem@codeaurora.org> | 2017-10-30 11:31:08 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-11-03 10:28:20 -0700 |
commit | c10f99af82e8e374d0cd5f2d7829e40cafb7ac9f (patch) | |
tree | 707c32f3231b28355a2f952c431e790e55554fde /drivers/net | |
parent | f76f50c6720f0a83c2939abf9fdfd61106773502 (diff) |
cnss2: Add device pointer to all external APIs
Add device pointer to all external APIs so that platform driver is
able to support multiple devices/instances at the same time.
Change-Id: I09dfb146da30d3fd6514dc79dc31cd239a03afa8
Signed-off-by: Yue Ma <yuem@codeaurora.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/cnss2/main.c | 37 | ||||
-rw-r--r-- | drivers/net/wireless/cnss2/pci.c | 12 |
2 files changed, 26 insertions, 23 deletions
diff --git a/drivers/net/wireless/cnss2/main.c b/drivers/net/wireless/cnss2/main.c index 42b5bb97e6b1..1769fd4c3ac8 100644 --- a/drivers/net/wireless/cnss2/main.c +++ b/drivers/net/wireless/cnss2/main.c @@ -189,19 +189,20 @@ static void cnss_pm_relax(struct cnss_plat_data *plat_priv) pm_relax(&plat_priv->plat_dev->dev); } -void cnss_lock_pm_sem(void) +void cnss_lock_pm_sem(struct device *dev) { down_read(&cnss_pm_sem); } EXPORT_SYMBOL(cnss_lock_pm_sem); -void cnss_release_pm_sem(void) +void cnss_release_pm_sem(struct device *dev) { up_read(&cnss_pm_sem); } EXPORT_SYMBOL(cnss_release_pm_sem); -int cnss_get_fw_files_for_target(struct cnss_fw_files *pfw_files, +int cnss_get_fw_files_for_target(struct device *dev, + struct cnss_fw_files *pfw_files, u32 target_type, u32 target_version) { if (!pfw_files) @@ -223,10 +224,10 @@ int cnss_get_fw_files_for_target(struct cnss_fw_files *pfw_files, } EXPORT_SYMBOL(cnss_get_fw_files_for_target); -int cnss_request_bus_bandwidth(int bandwidth) +int cnss_request_bus_bandwidth(struct device *dev, int bandwidth) { int ret = 0; - struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL); + struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); struct cnss_bus_bw_info *bus_bw_info; if (!plat_priv) @@ -258,9 +259,9 @@ int cnss_request_bus_bandwidth(int bandwidth) } EXPORT_SYMBOL(cnss_request_bus_bandwidth); -int cnss_get_platform_cap(struct cnss_platform_cap *cap) +int cnss_get_platform_cap(struct device *dev, struct cnss_platform_cap *cap) { - struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL); + struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); if (!plat_priv) return -ENODEV; @@ -289,9 +290,9 @@ int cnss_get_soc_info(struct device *dev, struct cnss_soc_info *info) } EXPORT_SYMBOL(cnss_get_soc_info); -void cnss_request_pm_qos(u32 qos_val) +void cnss_request_pm_qos(struct device *dev, u32 qos_val) { - struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL); + struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); if (!plat_priv) return; @@ -301,9 +302,9 @@ void cnss_request_pm_qos(u32 qos_val) } EXPORT_SYMBOL(cnss_request_pm_qos); -void cnss_remove_pm_qos(void) +void cnss_remove_pm_qos(struct device *dev) { - struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL); + struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); if (!plat_priv) return; @@ -1037,7 +1038,8 @@ static int cnss_qca6174_shutdown(struct cnss_plat_data *plat_priv) cnss_driver_call_remove(plat_priv); - cnss_request_bus_bandwidth(CNSS_BUS_WIDTH_NONE); + cnss_request_bus_bandwidth(&plat_priv->plat_dev->dev, + CNSS_BUS_WIDTH_NONE); cnss_pci_set_monitor_wake_intr(pci_priv, false); cnss_pci_set_auto_suspended(pci_priv, 0); @@ -1143,7 +1145,8 @@ static int cnss_qca6290_shutdown(struct cnss_plat_data *plat_priv) cnss_driver_call_remove(plat_priv); - cnss_request_bus_bandwidth(CNSS_BUS_WIDTH_NONE); + cnss_request_bus_bandwidth(&plat_priv->plat_dev->dev, + CNSS_BUS_WIDTH_NONE); cnss_pci_set_monitor_wake_intr(pci_priv, false); cnss_pci_set_auto_suspended(pci_priv, 0); @@ -1340,9 +1343,9 @@ static int cnss_ramdump(int enable, const struct subsys_desc *subsys_desc) return ret; } -void *cnss_get_virt_ramdump_mem(unsigned long *size) +void *cnss_get_virt_ramdump_mem(struct device *dev, unsigned long *size) { - struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL); + struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); struct cnss_ramdump_info *ramdump_info; if (!plat_priv) @@ -1355,9 +1358,9 @@ void *cnss_get_virt_ramdump_mem(unsigned long *size) } EXPORT_SYMBOL(cnss_get_virt_ramdump_mem); -void cnss_device_crashed(void) +void cnss_device_crashed(struct device *dev) { - struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL); + struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); struct cnss_subsys_info *subsys_info; if (!plat_priv) diff --git a/drivers/net/wireless/cnss2/pci.c b/drivers/net/wireless/cnss2/pci.c index 2efc3aa63a75..8d34d74477eb 100644 --- a/drivers/net/wireless/cnss2/pci.c +++ b/drivers/net/wireless/cnss2/pci.c @@ -568,9 +568,9 @@ static int cnss_pci_runtime_idle(struct device *dev) return -EBUSY; } -int cnss_wlan_pm_control(bool vote) +int cnss_wlan_pm_control(struct device *dev, bool vote) { - struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL); + struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); struct cnss_pci_data *pci_priv; struct pci_dev *pci_dev; @@ -590,10 +590,10 @@ int cnss_wlan_pm_control(bool vote) } EXPORT_SYMBOL(cnss_wlan_pm_control); -int cnss_auto_suspend(void) +int cnss_auto_suspend(struct device *dev) { int ret = 0; - struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL); + struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); struct pci_dev *pci_dev; struct cnss_pci_data *pci_priv; struct cnss_bus_bw_info *bus_bw_info; @@ -648,10 +648,10 @@ out: } EXPORT_SYMBOL(cnss_auto_suspend); -int cnss_auto_resume(void) +int cnss_auto_resume(struct device *dev) { int ret = 0; - struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL); + struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); struct pci_dev *pci_dev; struct cnss_pci_data *pci_priv; struct cnss_bus_bw_info *bus_bw_info; |