Loading Documentation/devicetree/bindings/cnss/cnss-wlan.txt +5 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,10 @@ Required properties: - wlan-en-gpio: WLAN_EN GPIO signal specified by QCA6174 specifications - vdd-wlan-supply: phandle to the regulator device tree node Optional properties: - qcom,notify-modem-status: Boolean property to decide whether modem notification should be enabled or not in this platform Example: qcom,cnss@0d400000 { Loading @@ -25,4 +29,5 @@ Example: reg-names = "ramdump"; wlan-en-gpio = <&msmgpio 82 0>; vdd-wlan-supply = <&wlan_vreg>; qcom,notify-modem-status; }; drivers/net/wireless/cnss/cnss.c +33 −21 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ static struct cnss_data { uint32_t bus_client; void *subsys_handle; struct esoc_desc *esoc_desc; bool notify_modem_status; } *penv; static int cnss_wlan_vreg_set(struct cnss_wlan_vreg_info *vreg_info, bool state) Loading Loading @@ -523,7 +524,7 @@ again: } } if (penv->esoc_desc && pdev && wdrv->modem_status) if (penv->notify_modem_status && wdrv->modem_status) wdrv->modem_status(pdev, penv->modem_current_status); return ret; Loading Loading @@ -831,6 +832,9 @@ static int cnss_powerup(const struct subsys_desc *subsys) pr_err("%d: wdrv->reinit is invalid\n", __LINE__); goto err_pcie_link_up; } if (penv->notify_modem_status && wdrv->modem_status) wdrv->modem_status(pdev, penv->modem_current_status); } return ret; Loading Loading @@ -951,10 +955,15 @@ static int cnss_probe(struct platform_device *pdev) return -ENOMEM; penv->pldev = pdev; penv->esoc_desc = NULL; ret = of_property_read_string_index(dev->of_node, "esoc-names", 0, &client_desc); penv->notify_modem_status = of_property_read_bool(dev->of_node, "qcom,notify-modem-status"); if (penv->notify_modem_status) { ret = of_property_read_string_index(dev->of_node, "esoc-names", 0, &client_desc); if (ret) { pr_debug("%s: esoc-names is not defined in DT, SKIP\n", __func__); Loading @@ -967,6 +976,7 @@ static int cnss_probe(struct platform_device *pdev) } penv->esoc_desc = desc; } } penv->subsysdesc.name = "AR6320"; penv->subsysdesc.owner = THIS_MODULE; Loading @@ -983,12 +993,14 @@ static int cnss_probe(struct platform_device *pdev) penv->modem_current_status = 0; if (penv->esoc_desc) { if (penv->notify_modem_status) { penv->modem_notify_handler = subsys_notif_register_notifier(penv->esoc_desc->name, &mnb); subsys_notif_register_notifier(penv->esoc_desc ? penv->esoc_desc->name : "modem", &mnb); if (IS_ERR(penv->modem_notify_handler)) { ret = PTR_ERR(penv->modem_notify_handler); pr_err("%s: Register notifier Failed\n", __func__); goto err_notif_modem; } } Loading Loading @@ -1049,7 +1061,7 @@ err_get_wlan_res: err_ramdump_create: subsystem_put(penv->subsys_handle); if (penv->esoc_desc) if (penv->notify_modem_status) subsys_notif_unregister_notifier (penv->modem_notify_handler, &mnb); Loading Loading @@ -1112,12 +1124,12 @@ static void __exit cnss_exit(void) struct platform_device *pdev = penv->pldev; if (penv->ramdump_dev) destroy_ramdump_device(penv->ramdump_dev); if (penv->esoc_desc) { if (penv->notify_modem_status) subsys_notif_unregister_notifier(penv->modem_notify_handler, &mnb); devm_unregister_esoc_client(&pdev->dev, penv->esoc_desc); } subsys_unregister(penv->subsys); if (penv->esoc_desc) devm_unregister_esoc_client(&pdev->dev, penv->esoc_desc); platform_driver_unregister(&cnss_driver); } Loading Loading
Documentation/devicetree/bindings/cnss/cnss-wlan.txt +5 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,10 @@ Required properties: - wlan-en-gpio: WLAN_EN GPIO signal specified by QCA6174 specifications - vdd-wlan-supply: phandle to the regulator device tree node Optional properties: - qcom,notify-modem-status: Boolean property to decide whether modem notification should be enabled or not in this platform Example: qcom,cnss@0d400000 { Loading @@ -25,4 +29,5 @@ Example: reg-names = "ramdump"; wlan-en-gpio = <&msmgpio 82 0>; vdd-wlan-supply = <&wlan_vreg>; qcom,notify-modem-status; };
drivers/net/wireless/cnss/cnss.c +33 −21 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ static struct cnss_data { uint32_t bus_client; void *subsys_handle; struct esoc_desc *esoc_desc; bool notify_modem_status; } *penv; static int cnss_wlan_vreg_set(struct cnss_wlan_vreg_info *vreg_info, bool state) Loading Loading @@ -523,7 +524,7 @@ again: } } if (penv->esoc_desc && pdev && wdrv->modem_status) if (penv->notify_modem_status && wdrv->modem_status) wdrv->modem_status(pdev, penv->modem_current_status); return ret; Loading Loading @@ -831,6 +832,9 @@ static int cnss_powerup(const struct subsys_desc *subsys) pr_err("%d: wdrv->reinit is invalid\n", __LINE__); goto err_pcie_link_up; } if (penv->notify_modem_status && wdrv->modem_status) wdrv->modem_status(pdev, penv->modem_current_status); } return ret; Loading Loading @@ -951,10 +955,15 @@ static int cnss_probe(struct platform_device *pdev) return -ENOMEM; penv->pldev = pdev; penv->esoc_desc = NULL; ret = of_property_read_string_index(dev->of_node, "esoc-names", 0, &client_desc); penv->notify_modem_status = of_property_read_bool(dev->of_node, "qcom,notify-modem-status"); if (penv->notify_modem_status) { ret = of_property_read_string_index(dev->of_node, "esoc-names", 0, &client_desc); if (ret) { pr_debug("%s: esoc-names is not defined in DT, SKIP\n", __func__); Loading @@ -967,6 +976,7 @@ static int cnss_probe(struct platform_device *pdev) } penv->esoc_desc = desc; } } penv->subsysdesc.name = "AR6320"; penv->subsysdesc.owner = THIS_MODULE; Loading @@ -983,12 +993,14 @@ static int cnss_probe(struct platform_device *pdev) penv->modem_current_status = 0; if (penv->esoc_desc) { if (penv->notify_modem_status) { penv->modem_notify_handler = subsys_notif_register_notifier(penv->esoc_desc->name, &mnb); subsys_notif_register_notifier(penv->esoc_desc ? penv->esoc_desc->name : "modem", &mnb); if (IS_ERR(penv->modem_notify_handler)) { ret = PTR_ERR(penv->modem_notify_handler); pr_err("%s: Register notifier Failed\n", __func__); goto err_notif_modem; } } Loading Loading @@ -1049,7 +1061,7 @@ err_get_wlan_res: err_ramdump_create: subsystem_put(penv->subsys_handle); if (penv->esoc_desc) if (penv->notify_modem_status) subsys_notif_unregister_notifier (penv->modem_notify_handler, &mnb); Loading Loading @@ -1112,12 +1124,12 @@ static void __exit cnss_exit(void) struct platform_device *pdev = penv->pldev; if (penv->ramdump_dev) destroy_ramdump_device(penv->ramdump_dev); if (penv->esoc_desc) { if (penv->notify_modem_status) subsys_notif_unregister_notifier(penv->modem_notify_handler, &mnb); devm_unregister_esoc_client(&pdev->dev, penv->esoc_desc); } subsys_unregister(penv->subsys); if (penv->esoc_desc) devm_unregister_esoc_client(&pdev->dev, penv->esoc_desc); platform_driver_unregister(&cnss_driver); } Loading