Loading drivers/net/wireless/cnss/cnss_sdio.c +35 −34 Original line number Diff line number Diff line Loading @@ -10,6 +10,8 @@ * GNU General Public License for more details. */ #define pr_fmt(fmt) "cnss_sdio:%s:%d:: " fmt, __func__, __LINE__ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> Loading Loading @@ -156,7 +158,7 @@ void cnss_sdio_request_pm_qos_type(int latency_type, u32 qos_val) if (!cnss_pdata) return; pr_debug("%s: PM QoS value: %d\n", __func__, qos_val); pr_debug("PM QoS value: %d\n", qos_val); pm_qos_add_request(&cnss_pdata->qos_request, latency_type, qos_val); } EXPORT_SYMBOL(cnss_sdio_request_pm_qos_type); Loading Loading @@ -184,12 +186,12 @@ int cnss_sdio_request_bus_bandwidth(int bandwidth) bus_bandwidth->current_bandwidth_vote = bandwidth; } else { pr_debug( "%s: could not set bus bandwidth %d, ret = %d\n", __func__, bandwidth, ret); "could not set bus bandwidth %d, ret = %d\n", bandwidth, ret); } break; default: pr_debug("%s: Invalid request %d", __func__, bandwidth); pr_debug("Invalid request %d", bandwidth); ret = -EINVAL; } Loading @@ -201,7 +203,7 @@ void cnss_sdio_request_pm_qos(u32 qos_val) if (!cnss_pdata) return; pr_debug("%s: PM QoS value: %d\n", __func__, qos_val); pr_debug("PM QoS value: %d\n", qos_val); pm_qos_add_request( &cnss_pdata->qos_request, PM_QOS_CPU_DMA_LATENCY, qos_val); Loading @@ -214,7 +216,7 @@ void cnss_sdio_remove_pm_qos(void) return; pm_qos_remove_request(&cnss_pdata->qos_request); pr_debug("%s: PM QoS removed\n", __func__); pr_debug("PM QoS removed\n"); } EXPORT_SYMBOL(cnss_sdio_remove_pm_qos); Loading @@ -230,25 +232,25 @@ static int cnss_put_hw_resources(struct device *dev) info = &cnss_pdata->cnss_sdio_info; if (info->skip_wlan_en_toggle) { pr_debug("%s: HW doesn't support wlan toggling\n", __func__); pr_debug("HW doesn't support wlan toggling\n"); return 0; } host = info->host; if (!host) { pr_err("%s: MMC host is invalid\n", __func__); pr_err("MMC host is invalid\n"); return ret; } if (!cnss_pdata->regulator.wlan_vreg) { pr_debug("%s: wlan_vreg regulator is invalid\n", __func__); pr_debug("wlan_vreg regulator is invalid\n"); return 0; } ret = mmc_power_save_host(host); if (ret) { pr_err("%s: Failed to Power Save Host err:%d\n", __func__, pr_err("Failed to Power Save Host err:%d\n", ret); return ret; } Loading @@ -270,32 +272,31 @@ static int cnss_get_hw_resources(struct device *dev) info = &cnss_pdata->cnss_sdio_info; if (info->skip_wlan_en_toggle) { pr_debug("%s: HW doesn't support wlan toggling\n", __func__); pr_debug("HW doesn't support wlan toggling\n"); return 0; } host = info->host; if (!host) { pr_err("%s: MMC Host is Invalid; Enumeration Failed\n", __func__); pr_err("MMC Host is Invalid; Enumeration Failed\n"); return ret; } if (!cnss_pdata->regulator.wlan_vreg) { pr_debug("%s: wlan_vreg regulator is invalid\n", __func__); pr_debug("wlan_vreg regulator is invalid\n"); return 0; } ret = regulator_enable(cnss_pdata->regulator.wlan_vreg); if (ret) { pr_err("%s: Failed to enable wlan vreg\n", __func__); pr_err("Failed to enable wlan vreg\n"); return ret; } ret = mmc_power_restore_host(host); if (ret) { pr_err("%s: Failed to restore host power ret:%d\n", __func__, pr_err("Failed to restore host power ret:%d\n", ret); regulator_disable(cnss_pdata->regulator.wlan_vreg); } Loading Loading @@ -323,7 +324,7 @@ static int cnss_sdio_shutdown(const struct subsys_desc *subsys, bool force_stop) ret = cnss_put_hw_resources(cnss_info->dev); if (ret) pr_err("%s: Failed to put hw resources\n", __func__); pr_err("Failed to put hw resources\n"); return ret; } Loading @@ -348,13 +349,13 @@ static int cnss_sdio_powerup(const struct subsys_desc *subsys) ret = cnss_get_hw_resources(cnss_info->dev); if (ret) { pr_err("%s: Failed to power up HW\n", __func__); pr_err("Failed to power up HW\n"); return ret; } ret = wdrv->reinit(cnss_info->func, cnss_info->id); if (ret) pr_err("%s: wlan reinit error=%d\n", __func__, ret); pr_err("wlan reinit error=%d\n", ret); return ret; } Loading Loading @@ -395,7 +396,7 @@ static int cnss_sdio_ramdump(int enable, const struct subsys_desc *subsys) segment.size = ssr_info->ramdump_size; ret = do_ramdump(ssr_info->ramdump_dev, &segment, 1); if (ret) pr_err("%s: do_ramdump failed error=%d\n", __func__, ret); pr_err("do_ramdump failed error=%d\n", ret); return ret; } Loading Loading @@ -472,7 +473,7 @@ static int cnss_configure_dump_table(struct cnss_ssr_info *ssr_info) ret = msm_dump_data_register(MSM_DUMP_TABLE_APPS, &dump_entry); if (ret) pr_err("%s: Dump table setup failed: %d\n", __func__, ret); pr_err("Dump table setup failed: %d\n", ret); return ret; } Loading @@ -496,7 +497,7 @@ static int cnss_configure_ramdump(void) ret = of_property_read_string(dev->of_node, CNSS_SUBSYS_NAME_KEY, &name); if (ret) { pr_err("%s: cnss missing DT key '%s'\n", __func__, pr_err("cnss missing DT key '%s'\n", CNSS_SUBSYS_NAME_KEY); ret = -ENODEV; goto err_subsys_name_query; Loading Loading @@ -526,12 +527,12 @@ static int cnss_configure_ramdump(void) } } pr_info("%s: ramdump addr: %p, phys: %pa subsys:'%s'\n", __func__, pr_info("ramdump addr: %p, phys: %pa subsys:'%s'\n", ssr_info->ramdump_addr, &ssr_info->ramdump_phys, ssr_info->subsys_name); if (ssr_info->ramdump_size == 0) { pr_info("%s: CNSS ramdump will not be collected", __func__); pr_info("CNSS ramdump will not be collected"); return 0; } Loading @@ -545,8 +546,8 @@ static int cnss_configure_ramdump(void) dev); if (!ssr_info->ramdump_dev) { ret = -ENOMEM; pr_err("%s: ramdump dev create failed: error=%d\n", __func__, ret); pr_err("ramdump dev create failed: error=%d\n", ret); goto err_configure_dump_table; } Loading Loading @@ -682,7 +683,7 @@ static int cnss_sdio_wlan_inserted(struct sdio_func *func, cnss_put_hw_resources(cnss_pdata->cnss_sdio_info.dev); pr_info("%s: SDIO Device is Probed\n", __func__); pr_info("SDIO Device is Probed\n"); return 0; } Loading Loading @@ -835,7 +836,7 @@ int cnss_sdio_wlan_register_driver(struct cnss_sdio_wlan_driver *driver) dev = cnss_info->dev; if (cnss_info->wdrv) pr_debug("%s:wdrv already exists wdrv(%p)\n", __func__, pr_debug("wdrv already exists wdrv(%p)\n", cnss_info->wdrv); cnss_info->wdrv = driver; Loading @@ -845,20 +846,20 @@ int cnss_sdio_wlan_register_driver(struct cnss_sdio_wlan_driver *driver) error = cnss_get_hw_resources(dev); if (error) { pr_err("%s: Failed to restore power err:%d\n", __func__, error); pr_err("Failed to restore power err:%d\n", error); return error; } error = cnss_set_pinctrl_state(cnss_pdata, PINCTRL_ACTIVE); if (error) { pr_err("%s: Fail to set pinctrl to active state\n", __func__); pr_err("Fail to set pinctrl to active state\n"); goto put_hw; } error = driver->probe ? driver->probe(cnss_info->func, cnss_info->id) : error; if (error) { pr_err("%s: wlan probe failed error=%d\n", __func__, error); pr_err("wlan probe failed error=%d\n", error); goto pinctrl_sleep; } Loading Loading @@ -896,7 +897,7 @@ cnss_sdio_wlan_unregister_driver(struct cnss_sdio_wlan_driver *driver) cnss_info = &cnss_pdata->cnss_sdio_info; if (!cnss_info->wdrv) { pr_err("%s: driver not registered\n", __func__); pr_err("driver not registered\n"); return; } Loading Loading @@ -964,9 +965,9 @@ static int cnss_sdio_wlan_init(void) error = sdio_register_driver(&cnss_ar6k_driver); if (error) pr_err("%s: registered fail error=%d\n", __func__, error); pr_err("registered fail error=%d\n", error); else pr_debug("%s: registered succ\n", __func__); pr_debug("registered succ\n"); return error; } Loading Loading
drivers/net/wireless/cnss/cnss_sdio.c +35 −34 Original line number Diff line number Diff line Loading @@ -10,6 +10,8 @@ * GNU General Public License for more details. */ #define pr_fmt(fmt) "cnss_sdio:%s:%d:: " fmt, __func__, __LINE__ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> Loading Loading @@ -156,7 +158,7 @@ void cnss_sdio_request_pm_qos_type(int latency_type, u32 qos_val) if (!cnss_pdata) return; pr_debug("%s: PM QoS value: %d\n", __func__, qos_val); pr_debug("PM QoS value: %d\n", qos_val); pm_qos_add_request(&cnss_pdata->qos_request, latency_type, qos_val); } EXPORT_SYMBOL(cnss_sdio_request_pm_qos_type); Loading Loading @@ -184,12 +186,12 @@ int cnss_sdio_request_bus_bandwidth(int bandwidth) bus_bandwidth->current_bandwidth_vote = bandwidth; } else { pr_debug( "%s: could not set bus bandwidth %d, ret = %d\n", __func__, bandwidth, ret); "could not set bus bandwidth %d, ret = %d\n", bandwidth, ret); } break; default: pr_debug("%s: Invalid request %d", __func__, bandwidth); pr_debug("Invalid request %d", bandwidth); ret = -EINVAL; } Loading @@ -201,7 +203,7 @@ void cnss_sdio_request_pm_qos(u32 qos_val) if (!cnss_pdata) return; pr_debug("%s: PM QoS value: %d\n", __func__, qos_val); pr_debug("PM QoS value: %d\n", qos_val); pm_qos_add_request( &cnss_pdata->qos_request, PM_QOS_CPU_DMA_LATENCY, qos_val); Loading @@ -214,7 +216,7 @@ void cnss_sdio_remove_pm_qos(void) return; pm_qos_remove_request(&cnss_pdata->qos_request); pr_debug("%s: PM QoS removed\n", __func__); pr_debug("PM QoS removed\n"); } EXPORT_SYMBOL(cnss_sdio_remove_pm_qos); Loading @@ -230,25 +232,25 @@ static int cnss_put_hw_resources(struct device *dev) info = &cnss_pdata->cnss_sdio_info; if (info->skip_wlan_en_toggle) { pr_debug("%s: HW doesn't support wlan toggling\n", __func__); pr_debug("HW doesn't support wlan toggling\n"); return 0; } host = info->host; if (!host) { pr_err("%s: MMC host is invalid\n", __func__); pr_err("MMC host is invalid\n"); return ret; } if (!cnss_pdata->regulator.wlan_vreg) { pr_debug("%s: wlan_vreg regulator is invalid\n", __func__); pr_debug("wlan_vreg regulator is invalid\n"); return 0; } ret = mmc_power_save_host(host); if (ret) { pr_err("%s: Failed to Power Save Host err:%d\n", __func__, pr_err("Failed to Power Save Host err:%d\n", ret); return ret; } Loading @@ -270,32 +272,31 @@ static int cnss_get_hw_resources(struct device *dev) info = &cnss_pdata->cnss_sdio_info; if (info->skip_wlan_en_toggle) { pr_debug("%s: HW doesn't support wlan toggling\n", __func__); pr_debug("HW doesn't support wlan toggling\n"); return 0; } host = info->host; if (!host) { pr_err("%s: MMC Host is Invalid; Enumeration Failed\n", __func__); pr_err("MMC Host is Invalid; Enumeration Failed\n"); return ret; } if (!cnss_pdata->regulator.wlan_vreg) { pr_debug("%s: wlan_vreg regulator is invalid\n", __func__); pr_debug("wlan_vreg regulator is invalid\n"); return 0; } ret = regulator_enable(cnss_pdata->regulator.wlan_vreg); if (ret) { pr_err("%s: Failed to enable wlan vreg\n", __func__); pr_err("Failed to enable wlan vreg\n"); return ret; } ret = mmc_power_restore_host(host); if (ret) { pr_err("%s: Failed to restore host power ret:%d\n", __func__, pr_err("Failed to restore host power ret:%d\n", ret); regulator_disable(cnss_pdata->regulator.wlan_vreg); } Loading Loading @@ -323,7 +324,7 @@ static int cnss_sdio_shutdown(const struct subsys_desc *subsys, bool force_stop) ret = cnss_put_hw_resources(cnss_info->dev); if (ret) pr_err("%s: Failed to put hw resources\n", __func__); pr_err("Failed to put hw resources\n"); return ret; } Loading @@ -348,13 +349,13 @@ static int cnss_sdio_powerup(const struct subsys_desc *subsys) ret = cnss_get_hw_resources(cnss_info->dev); if (ret) { pr_err("%s: Failed to power up HW\n", __func__); pr_err("Failed to power up HW\n"); return ret; } ret = wdrv->reinit(cnss_info->func, cnss_info->id); if (ret) pr_err("%s: wlan reinit error=%d\n", __func__, ret); pr_err("wlan reinit error=%d\n", ret); return ret; } Loading Loading @@ -395,7 +396,7 @@ static int cnss_sdio_ramdump(int enable, const struct subsys_desc *subsys) segment.size = ssr_info->ramdump_size; ret = do_ramdump(ssr_info->ramdump_dev, &segment, 1); if (ret) pr_err("%s: do_ramdump failed error=%d\n", __func__, ret); pr_err("do_ramdump failed error=%d\n", ret); return ret; } Loading Loading @@ -472,7 +473,7 @@ static int cnss_configure_dump_table(struct cnss_ssr_info *ssr_info) ret = msm_dump_data_register(MSM_DUMP_TABLE_APPS, &dump_entry); if (ret) pr_err("%s: Dump table setup failed: %d\n", __func__, ret); pr_err("Dump table setup failed: %d\n", ret); return ret; } Loading @@ -496,7 +497,7 @@ static int cnss_configure_ramdump(void) ret = of_property_read_string(dev->of_node, CNSS_SUBSYS_NAME_KEY, &name); if (ret) { pr_err("%s: cnss missing DT key '%s'\n", __func__, pr_err("cnss missing DT key '%s'\n", CNSS_SUBSYS_NAME_KEY); ret = -ENODEV; goto err_subsys_name_query; Loading Loading @@ -526,12 +527,12 @@ static int cnss_configure_ramdump(void) } } pr_info("%s: ramdump addr: %p, phys: %pa subsys:'%s'\n", __func__, pr_info("ramdump addr: %p, phys: %pa subsys:'%s'\n", ssr_info->ramdump_addr, &ssr_info->ramdump_phys, ssr_info->subsys_name); if (ssr_info->ramdump_size == 0) { pr_info("%s: CNSS ramdump will not be collected", __func__); pr_info("CNSS ramdump will not be collected"); return 0; } Loading @@ -545,8 +546,8 @@ static int cnss_configure_ramdump(void) dev); if (!ssr_info->ramdump_dev) { ret = -ENOMEM; pr_err("%s: ramdump dev create failed: error=%d\n", __func__, ret); pr_err("ramdump dev create failed: error=%d\n", ret); goto err_configure_dump_table; } Loading Loading @@ -682,7 +683,7 @@ static int cnss_sdio_wlan_inserted(struct sdio_func *func, cnss_put_hw_resources(cnss_pdata->cnss_sdio_info.dev); pr_info("%s: SDIO Device is Probed\n", __func__); pr_info("SDIO Device is Probed\n"); return 0; } Loading Loading @@ -835,7 +836,7 @@ int cnss_sdio_wlan_register_driver(struct cnss_sdio_wlan_driver *driver) dev = cnss_info->dev; if (cnss_info->wdrv) pr_debug("%s:wdrv already exists wdrv(%p)\n", __func__, pr_debug("wdrv already exists wdrv(%p)\n", cnss_info->wdrv); cnss_info->wdrv = driver; Loading @@ -845,20 +846,20 @@ int cnss_sdio_wlan_register_driver(struct cnss_sdio_wlan_driver *driver) error = cnss_get_hw_resources(dev); if (error) { pr_err("%s: Failed to restore power err:%d\n", __func__, error); pr_err("Failed to restore power err:%d\n", error); return error; } error = cnss_set_pinctrl_state(cnss_pdata, PINCTRL_ACTIVE); if (error) { pr_err("%s: Fail to set pinctrl to active state\n", __func__); pr_err("Fail to set pinctrl to active state\n"); goto put_hw; } error = driver->probe ? driver->probe(cnss_info->func, cnss_info->id) : error; if (error) { pr_err("%s: wlan probe failed error=%d\n", __func__, error); pr_err("wlan probe failed error=%d\n", error); goto pinctrl_sleep; } Loading Loading @@ -896,7 +897,7 @@ cnss_sdio_wlan_unregister_driver(struct cnss_sdio_wlan_driver *driver) cnss_info = &cnss_pdata->cnss_sdio_info; if (!cnss_info->wdrv) { pr_err("%s: driver not registered\n", __func__); pr_err("driver not registered\n"); return; } Loading Loading @@ -964,9 +965,9 @@ static int cnss_sdio_wlan_init(void) error = sdio_register_driver(&cnss_ar6k_driver); if (error) pr_err("%s: registered fail error=%d\n", __func__, error); pr_err("registered fail error=%d\n", error); else pr_debug("%s: registered succ\n", __func__); pr_debug("registered succ\n"); return error; } Loading