Lines Matching refs:plat_priv
160 struct cnss_plat_data *plat_priv) in cnss_set_plat_priv() argument
165 if (plat_priv) { in cnss_set_plat_priv()
166 plat_priv->plat_idx = env_count; in cnss_set_plat_priv()
167 plat_env[plat_priv->plat_idx] = plat_priv; in cnss_set_plat_priv()
201 static void cnss_clear_plat_priv(struct cnss_plat_data *plat_priv) in cnss_clear_plat_priv() argument
203 cnss_pr_dbg("Clear plat_priv at %d", plat_priv->plat_idx); in cnss_clear_plat_priv()
204 plat_env[plat_priv->plat_idx] = NULL; in cnss_clear_plat_priv()
208 static int cnss_set_device_name(struct cnss_plat_data *plat_priv) in cnss_set_device_name() argument
210 snprintf(plat_priv->device_name, sizeof(plat_priv->device_name), in cnss_set_device_name()
211 "wlan_%d", plat_priv->plat_idx); in cnss_set_device_name()
245 cnss_get_qrtr_node_id(struct cnss_plat_data *plat_priv) in cnss_get_qrtr_node_id() argument
247 return of_property_read_u32(plat_priv->dev_node, in cnss_get_qrtr_node_id()
248 "qcom,qrtr_node_id", &plat_priv->qrtr_node_id); in cnss_get_qrtr_node_id()
251 void cnss_get_qrtr_info(struct cnss_plat_data *plat_priv) in cnss_get_qrtr_info() argument
255 ret = cnss_get_qrtr_node_id(plat_priv); in cnss_get_qrtr_info()
258 plat_priv->qrtr_node_id = 0; in cnss_get_qrtr_info()
259 plat_priv->wlfw_service_instance_id = 0; in cnss_get_qrtr_info()
261 plat_priv->wlfw_service_instance_id = plat_priv->qrtr_node_id + in cnss_get_qrtr_info()
264 plat_priv->wlfw_service_instance_id); in cnss_get_qrtr_info()
269 cnss_get_pld_bus_ops_name(struct cnss_plat_data *plat_priv) in cnss_get_pld_bus_ops_name() argument
271 return of_property_read_string(plat_priv->plat_dev->dev.of_node, in cnss_get_pld_bus_ops_name()
273 &plat_priv->pld_bus_ops_name); in cnss_get_pld_bus_ops_name()
282 struct cnss_plat_data *plat_priv) in cnss_set_plat_priv() argument
284 plat_env = plat_priv; in cnss_set_plat_priv()
292 static void cnss_clear_plat_priv(struct cnss_plat_data *plat_priv) in cnss_clear_plat_priv() argument
297 static int cnss_set_device_name(struct cnss_plat_data *plat_priv) in cnss_set_device_name() argument
299 snprintf(plat_priv->device_name, sizeof(plat_priv->device_name), in cnss_set_device_name()
314 void cnss_get_qrtr_info(struct cnss_plat_data *plat_priv) in cnss_get_qrtr_info() argument
319 cnss_get_pld_bus_ops_name(struct cnss_plat_data *plat_priv) in cnss_get_pld_bus_ops_name() argument
325 void cnss_get_sleep_clk_supported(struct cnss_plat_data *plat_priv) in cnss_get_sleep_clk_supported() argument
327 plat_priv->sleep_clk = of_property_read_bool(plat_priv->dev_node, in cnss_get_sleep_clk_supported()
330 plat_priv->sleep_clk); in cnss_get_sleep_clk_supported()
333 void cnss_get_bwscal_info(struct cnss_plat_data *plat_priv) in cnss_get_bwscal_info() argument
335 plat_priv->no_bwscale = of_property_read_bool(plat_priv->dev_node, in cnss_get_bwscal_info()
340 cnss_get_rc_num(struct cnss_plat_data *plat_priv) in cnss_get_rc_num() argument
342 return of_property_read_u32(plat_priv->plat_dev->dev.of_node, in cnss_get_rc_num()
343 "qcom,wlan-rc-num", &plat_priv->rc_num); in cnss_get_rc_num()
360 struct cnss_plat_data *plat_priv; in cnss_get_mem_seg_count() local
362 plat_priv = cnss_get_plat_priv(NULL); in cnss_get_mem_seg_count()
363 if (!plat_priv) in cnss_get_mem_seg_count()
368 *seg = plat_priv->fw_mem_seg_len; in cnss_get_mem_seg_count()
371 *seg = plat_priv->qdss_mem_seg_len; in cnss_get_mem_seg_count()
387 struct cnss_plat_data *plat_priv; in cnss_get_wifi_kobj() local
389 plat_priv = cnss_get_plat_priv(NULL); in cnss_get_wifi_kobj()
390 if (!plat_priv) in cnss_get_wifi_kobj()
393 return plat_priv->wifi_kobj; in cnss_get_wifi_kobj()
409 struct cnss_plat_data *plat_priv; in cnss_get_mem_segment_info() local
412 plat_priv = cnss_get_plat_priv(NULL); in cnss_get_mem_segment_info()
413 if (!plat_priv) in cnss_get_mem_segment_info()
418 if (segment_count > plat_priv->fw_mem_seg_len) in cnss_get_mem_segment_info()
419 segment_count = plat_priv->fw_mem_seg_len; in cnss_get_mem_segment_info()
421 segment[i].size = plat_priv->fw_mem[i].size; in cnss_get_mem_segment_info()
422 segment[i].va = plat_priv->fw_mem[i].va; in cnss_get_mem_segment_info()
423 segment[i].pa = plat_priv->fw_mem[i].pa; in cnss_get_mem_segment_info()
427 if (segment_count > plat_priv->qdss_mem_seg_len) in cnss_get_mem_segment_info()
428 segment_count = plat_priv->qdss_mem_seg_len; in cnss_get_mem_segment_info()
430 segment[i].size = plat_priv->qdss_mem[i].size; in cnss_get_mem_segment_info()
431 segment[i].va = plat_priv->qdss_mem[i].va; in cnss_get_mem_segment_info()
432 segment[i].pa = plat_priv->qdss_mem[i].pa; in cnss_get_mem_segment_info()
443 static int cnss_get_audio_iommu_domain(struct cnss_plat_data *plat_priv) in cnss_get_audio_iommu_domain() argument
462 plat_priv->audio_iommu_domain = in cnss_get_audio_iommu_domain()
465 if (!plat_priv->audio_iommu_domain) { in cnss_get_audio_iommu_domain()
475 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_get_audio_shared_iommu_group_cap() local
480 if (!plat_priv) in cnss_get_audio_shared_iommu_group_cap()
508 plat_priv->is_audio_shared_iommu_group = true; in cnss_get_audio_shared_iommu_group_cap()
514 return plat_priv->is_audio_shared_iommu_group; in cnss_get_audio_shared_iommu_group_cap()
518 int cnss_set_feature_list(struct cnss_plat_data *plat_priv, in cnss_set_feature_list() argument
521 if (unlikely(!plat_priv || feature >= CNSS_MAX_FEATURE_V01)) in cnss_set_feature_list()
524 plat_priv->feature_list |= 1 << feature; in cnss_set_feature_list()
528 int cnss_clear_feature_list(struct cnss_plat_data *plat_priv, in cnss_clear_feature_list() argument
531 if (unlikely(!plat_priv || feature >= CNSS_MAX_FEATURE_V01)) in cnss_clear_feature_list()
534 plat_priv->feature_list &= ~(1 << feature); in cnss_clear_feature_list()
538 int cnss_get_feature_list(struct cnss_plat_data *plat_priv, in cnss_get_feature_list() argument
541 if (unlikely(!plat_priv)) in cnss_get_feature_list()
544 *feature_list = plat_priv->feature_list; in cnss_get_feature_list()
548 size_t cnss_get_platform_name(struct cnss_plat_data *plat_priv, in cnss_get_platform_name() argument
551 if (unlikely(!plat_priv || !buf || !buf_len)) in cnss_get_platform_name()
554 if (of_property_read_bool(plat_priv->plat_dev->dev.of_node, in cnss_get_platform_name()
577 void cnss_pm_stay_awake(struct cnss_plat_data *plat_priv) in cnss_pm_stay_awake() argument
579 if (atomic_inc_return(&plat_priv->pm_count) != 1) in cnss_pm_stay_awake()
583 plat_priv->driver_state, in cnss_pm_stay_awake()
584 atomic_read(&plat_priv->pm_count)); in cnss_pm_stay_awake()
585 pm_stay_awake(&plat_priv->plat_dev->dev); in cnss_pm_stay_awake()
588 void cnss_pm_relax(struct cnss_plat_data *plat_priv) in cnss_pm_relax() argument
590 int r = atomic_dec_return(&plat_priv->pm_count); in cnss_pm_relax()
598 plat_priv->driver_state, in cnss_pm_relax()
599 atomic_read(&plat_priv->pm_count)); in cnss_pm_relax()
600 pm_relax(&plat_priv->plat_dev->dev); in cnss_pm_relax()
628 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_get_platform_cap() local
630 if (!plat_priv) in cnss_get_platform_cap()
636 *cap = plat_priv->cap; in cnss_get_platform_cap()
652 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_get_fw_cap() local
655 if (!plat_priv) in cnss_get_fw_cap()
658 if (!plat_priv->fw_caps) in cnss_get_fw_cap()
663 is_supported = !!(plat_priv->fw_caps & in cnss_get_fw_cap()
667 is_supported = !!(plat_priv->fw_caps & in cnss_get_fw_cap()
688 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_audio_is_direct_link_supported() local
691 if (!plat_priv) { in cnss_audio_is_direct_link_supported()
696 if (cnss_get_audio_iommu_domain(plat_priv) == 0) in cnss_audio_is_direct_link_supported()
706 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_request_pm_qos() local
708 if (!plat_priv) in cnss_request_pm_qos()
711 cpu_latency_qos_add_request(&plat_priv->qos_request, qos_val); in cnss_request_pm_qos()
717 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_remove_pm_qos() local
719 if (!plat_priv) in cnss_remove_pm_qos()
722 cpu_latency_qos_remove_request(&plat_priv->qos_request); in cnss_remove_pm_qos()
732 struct cnss_plat_data *plat_priv; in cnss_wlan_enable() local
739 plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_wlan_enable()
740 if (!plat_priv) in cnss_wlan_enable()
743 if (plat_priv->device_id == QCA6174_DEVICE_ID) in cnss_wlan_enable()
746 if (test_bit(QMI_BYPASS, &plat_priv->ctrl_params.quirks)) in cnss_wlan_enable()
760 if (plat_priv->device_id == QCN7605_DEVICE_ID) in cnss_wlan_enable()
763 ret = cnss_wlfw_wlan_cfg_send_sync(plat_priv, config, host_version); in cnss_wlan_enable()
768 ret = cnss_wlfw_wlan_mode_send_sync(plat_priv, mode); in cnss_wlan_enable()
777 struct cnss_plat_data *plat_priv; in cnss_wlan_disable() local
784 plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_wlan_disable()
785 if (!plat_priv) in cnss_wlan_disable()
788 if (plat_priv->device_id == QCA6174_DEVICE_ID) in cnss_wlan_disable()
791 if (test_bit(QMI_BYPASS, &plat_priv->ctrl_params.quirks)) in cnss_wlan_disable()
794 ret = cnss_wlfw_wlan_mode_send_sync(plat_priv, CNSS_OFF); in cnss_wlan_disable()
795 cnss_bus_free_qdss_mem(plat_priv); in cnss_wlan_disable()
818 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_audio_smmu_map() local
821 if (!plat_priv) in cnss_audio_smmu_map()
824 if (!plat_priv->audio_iommu_domain) in cnss_audio_smmu_map()
827 if (plat_priv->is_audio_shared_iommu_group) in cnss_audio_smmu_map()
837 return cnss_iommu_map(plat_priv->audio_iommu_domain, iova, paddr, in cnss_audio_smmu_map()
845 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_audio_smmu_unmap() local
848 if (!plat_priv || !plat_priv->audio_iommu_domain || in cnss_audio_smmu_unmap()
849 plat_priv->is_audio_shared_iommu_group) in cnss_audio_smmu_unmap()
858 iommu_unmap(plat_priv->audio_iommu_domain, iova, in cnss_audio_smmu_unmap()
866 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_get_fw_lpass_shared_mem() local
869 if (!plat_priv) in cnss_get_fw_lpass_shared_mem()
872 for (i = 0; i < plat_priv->fw_mem_seg_len; i++) { in cnss_get_fw_lpass_shared_mem()
873 if (plat_priv->fw_mem[i].type == in cnss_get_fw_lpass_shared_mem()
875 *iova = plat_priv->fw_mem[i].pa; in cnss_get_fw_lpass_shared_mem()
876 *size = plat_priv->fw_mem[i].size; in cnss_get_fw_lpass_shared_mem()
888 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_athdiag_read() local
891 if (!plat_priv) { in cnss_athdiag_read()
896 if (plat_priv->device_id == QCA6174_DEVICE_ID) in cnss_athdiag_read()
899 if (!test_bit(CNSS_FW_READY, &plat_priv->driver_state)) { in cnss_athdiag_read()
901 plat_priv->driver_state); in cnss_athdiag_read()
906 ret = cnss_wlfw_athdiag_read_send_sync(plat_priv, offset, mem_type, in cnss_athdiag_read()
917 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_athdiag_write() local
920 if (!plat_priv) { in cnss_athdiag_write()
925 if (plat_priv->device_id == QCA6174_DEVICE_ID) in cnss_athdiag_write()
928 if (!test_bit(CNSS_FW_READY, &plat_priv->driver_state)) { in cnss_athdiag_write()
930 plat_priv->driver_state); in cnss_athdiag_write()
935 ret = cnss_wlfw_athdiag_write_send_sync(plat_priv, offset, mem_type, in cnss_athdiag_write()
945 struct cnss_plat_data *plat_priv; in cnss_set_fw_log_mode() local
952 plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_set_fw_log_mode()
953 if (!plat_priv) in cnss_set_fw_log_mode()
956 if (plat_priv->device_id == QCA6174_DEVICE_ID) in cnss_set_fw_log_mode()
959 return cnss_wlfw_ini_send_sync(plat_priv, fw_log_mode); in cnss_set_fw_log_mode()
965 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_set_pcie_gen_speed() local
967 if (!plat_priv) in cnss_set_pcie_gen_speed()
970 if (!plat_priv->fw_pcie_gen_switch) { in cnss_set_pcie_gen_speed()
980 plat_priv->pcie_gen_speed = pcie_gen_speed; in cnss_set_pcie_gen_speed()
985 static bool cnss_is_aux_support_enabled(struct cnss_plat_data *plat_priv) in cnss_is_aux_support_enabled() argument
987 switch (plat_priv->device_id) { in cnss_is_aux_support_enabled()
989 if (!plat_priv->fw_aux_uc_support) { in cnss_is_aux_support_enabled()
1002 static int cnss_fw_mem_ready_hdlr(struct cnss_plat_data *plat_priv) in cnss_fw_mem_ready_hdlr() argument
1006 if (!plat_priv) in cnss_fw_mem_ready_hdlr()
1009 set_bit(CNSS_FW_MEM_READY, &plat_priv->driver_state); in cnss_fw_mem_ready_hdlr()
1011 ret = cnss_wlfw_tgt_cap_send_sync(plat_priv); in cnss_fw_mem_ready_hdlr()
1015 cnss_bus_load_tme_patch(plat_priv); in cnss_fw_mem_ready_hdlr()
1017 cnss_wlfw_tme_patch_dnld_send_sync(plat_priv, in cnss_fw_mem_ready_hdlr()
1020 if (plat_priv->hds_enabled) in cnss_fw_mem_ready_hdlr()
1021 cnss_wlfw_bdf_dnld_send_sync(plat_priv, CNSS_BDF_HDS); in cnss_fw_mem_ready_hdlr()
1023 cnss_wlfw_bdf_dnld_send_sync(plat_priv, CNSS_BDF_REGDB); in cnss_fw_mem_ready_hdlr()
1025 if (plat_priv->device_id == QCN7605_DEVICE_ID) in cnss_fw_mem_ready_hdlr()
1026 plat_priv->ctrl_params.bdf_type = CNSS_BDF_BIN; in cnss_fw_mem_ready_hdlr()
1028 ret = cnss_wlfw_bdf_dnld_send_sync(plat_priv, in cnss_fw_mem_ready_hdlr()
1029 plat_priv->ctrl_params.bdf_type); in cnss_fw_mem_ready_hdlr()
1033 if (plat_priv->device_id == QCN7605_DEVICE_ID) in cnss_fw_mem_ready_hdlr()
1036 ret = cnss_bus_load_m3(plat_priv); in cnss_fw_mem_ready_hdlr()
1040 ret = cnss_wlfw_m3_dnld_send_sync(plat_priv); in cnss_fw_mem_ready_hdlr()
1044 if (cnss_is_aux_support_enabled(plat_priv)) { in cnss_fw_mem_ready_hdlr()
1045 ret = cnss_bus_load_aux(plat_priv); in cnss_fw_mem_ready_hdlr()
1049 ret = cnss_wlfw_aux_dnld_send_sync(plat_priv); in cnss_fw_mem_ready_hdlr()
1054 cnss_wlfw_qdss_dnld_send_sync(plat_priv); in cnss_fw_mem_ready_hdlr()
1061 static int cnss_request_antenna_sharing(struct cnss_plat_data *plat_priv) in cnss_request_antenna_sharing() argument
1065 if (!plat_priv->antenna) { in cnss_request_antenna_sharing()
1066 ret = cnss_wlfw_antenna_switch_send_sync(plat_priv); in cnss_request_antenna_sharing()
1071 if (test_bit(CNSS_COEX_CONNECTED, &plat_priv->driver_state)) { in cnss_request_antenna_sharing()
1072 ret = coex_antenna_switch_to_wlan_send_sync_msg(plat_priv); in cnss_request_antenna_sharing()
1077 ret = cnss_wlfw_antenna_grant_send_sync(plat_priv); in cnss_request_antenna_sharing()
1087 static void cnss_release_antenna_sharing(struct cnss_plat_data *plat_priv) in cnss_release_antenna_sharing() argument
1089 if (test_bit(CNSS_COEX_CONNECTED, &plat_priv->driver_state)) in cnss_release_antenna_sharing()
1090 coex_antenna_switch_to_mdm_send_sync_msg(plat_priv); in cnss_release_antenna_sharing()
1093 static int cnss_setup_dms_mac(struct cnss_plat_data *plat_priv) in cnss_setup_dms_mac() argument
1099 ret = cnss_qmi_get_dms_mac(plat_priv); in cnss_setup_dms_mac()
1100 if (ret == 0 && plat_priv->dms.mac_valid) in cnss_setup_dms_mac()
1106 if (plat_priv->use_nv_mac) { in cnss_setup_dms_mac()
1117 if (plat_priv->dms.mac_valid) in cnss_setup_dms_mac()
1120 ret = cnss_qmi_get_dms_mac(plat_priv); in cnss_setup_dms_mac()
1125 if (!plat_priv->dms.mac_valid) { in cnss_setup_dms_mac()
1132 if (plat_priv->dms.mac_valid) in cnss_setup_dms_mac()
1134 cnss_wlfw_wlan_mac_req_send_sync(plat_priv, plat_priv->dms.mac, in cnss_setup_dms_mac()
1135 ARRAY_SIZE(plat_priv->dms.mac)); in cnss_setup_dms_mac()
1140 static int cnss_cal_db_mem_update(struct cnss_plat_data *plat_priv, in cnss_cal_db_mem_update() argument
1144 u32 timeout = cnss_get_timeout(plat_priv, in cnss_cal_db_mem_update()
1152 if (!plat_priv->cbc_file_download) { in cnss_cal_db_mem_update()
1160 if (!test_bit(CNSS_DAEMON_CONNECTED, &plat_priv->driver_state)) { in cnss_cal_db_mem_update()
1162 ret = wait_for_completion_timeout(&plat_priv->daemon_connected, in cnss_cal_db_mem_update()
1170 if (!plat_priv->cal_mem->va) { in cnss_cal_db_mem_update()
1180 plat_priv->cal_mem->va, in cnss_cal_db_mem_update()
1186 plat_priv->cal_mem->va, in cnss_cal_db_mem_update()
1203 static int cnss_cal_mem_upload_to_file(struct cnss_plat_data *plat_priv) in cnss_cal_mem_upload_to_file() argument
1205 if (plat_priv->cal_file_size > plat_priv->cal_mem->size) { in cnss_cal_mem_upload_to_file()
1209 return cnss_cal_db_mem_update(plat_priv, CNSS_CAL_DB_UPLOAD, in cnss_cal_mem_upload_to_file()
1210 &plat_priv->cal_file_size); in cnss_cal_mem_upload_to_file()
1213 static int cnss_cal_file_download_to_mem(struct cnss_plat_data *plat_priv, in cnss_cal_file_download_to_mem() argument
1220 *cal_file_size = plat_priv->cal_mem->size; in cnss_cal_file_download_to_mem()
1221 return cnss_cal_db_mem_update(plat_priv, CNSS_CAL_DB_DOWNLOAD, in cnss_cal_file_download_to_mem()
1225 static int cnss_fw_ready_hdlr(struct cnss_plat_data *plat_priv) in cnss_fw_ready_hdlr() argument
1230 if (!plat_priv) in cnss_fw_ready_hdlr()
1233 if (test_bit(CNSS_IN_REBOOT, &plat_priv->driver_state)) { in cnss_fw_ready_hdlr()
1239 del_timer(&plat_priv->fw_boot_timer); in cnss_fw_ready_hdlr()
1240 set_bit(CNSS_FW_READY, &plat_priv->driver_state); in cnss_fw_ready_hdlr()
1241 clear_bit(CNSS_DEV_ERR_NOTIFY, &plat_priv->driver_state); in cnss_fw_ready_hdlr()
1243 cnss_wlfw_send_pcie_gen_speed_sync(plat_priv); in cnss_fw_ready_hdlr()
1244 cnss_send_subsys_restart_level_msg(plat_priv); in cnss_fw_ready_hdlr()
1246 if (test_bit(CNSS_FW_BOOT_RECOVERY, &plat_priv->driver_state)) { in cnss_fw_ready_hdlr()
1247 clear_bit(CNSS_FW_BOOT_RECOVERY, &plat_priv->driver_state); in cnss_fw_ready_hdlr()
1248 clear_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state); in cnss_fw_ready_hdlr()
1251 if (test_bit(ENABLE_WALTEST, &plat_priv->ctrl_params.quirks)) { in cnss_fw_ready_hdlr()
1252 ret = cnss_wlfw_wlan_mode_send_sync(plat_priv, in cnss_fw_ready_hdlr()
1254 } else if (test_bit(CNSS_IN_COLD_BOOT_CAL, &plat_priv->driver_state)) { in cnss_fw_ready_hdlr()
1255 cnss_request_antenna_sharing(plat_priv); in cnss_fw_ready_hdlr()
1256 cnss_cal_file_download_to_mem(plat_priv, &cal_file_size); in cnss_fw_ready_hdlr()
1257 cnss_wlfw_cal_report_req_send_sync(plat_priv, cal_file_size); in cnss_fw_ready_hdlr()
1258 plat_priv->cal_time = jiffies; in cnss_fw_ready_hdlr()
1259 ret = cnss_wlfw_wlan_mode_send_sync(plat_priv, in cnss_fw_ready_hdlr()
1262 ret = cnss_setup_dms_mac(plat_priv); in cnss_fw_ready_hdlr()
1263 ret = cnss_bus_call_driver_probe(plat_priv); in cnss_fw_ready_hdlr()
1266 if (ret && test_bit(CNSS_DEV_ERR_NOTIFY, &plat_priv->driver_state)) in cnss_fw_ready_hdlr()
1271 cnss_vreg_unvote_type(plat_priv, CNSS_VREG_PRIM); in cnss_fw_ready_hdlr()
1276 cnss_bus_dev_shutdown(plat_priv); in cnss_fw_ready_hdlr()
1278 clear_bit(CNSS_FW_READY, &plat_priv->driver_state); in cnss_fw_ready_hdlr()
1279 clear_bit(CNSS_FW_MEM_READY, &plat_priv->driver_state); in cnss_fw_ready_hdlr()
1337 int cnss_driver_event_post(struct cnss_plat_data *plat_priv, in cnss_driver_event_post() argument
1346 if (!plat_priv) in cnss_driver_event_post()
1351 flags ? "-sync" : "", plat_priv->driver_state, flags); in cnss_driver_event_post()
1365 cnss_pm_stay_awake(plat_priv); in cnss_driver_event_post()
1373 spin_lock_irqsave(&plat_priv->event_lock, irq_flags); in cnss_driver_event_post()
1374 list_add_tail(&event->list, &plat_priv->event_list); in cnss_driver_event_post()
1375 spin_unlock_irqrestore(&plat_priv->event_lock, irq_flags); in cnss_driver_event_post()
1377 queue_work(plat_priv->event_wq, &plat_priv->event_work); in cnss_driver_event_post()
1391 plat_priv->driver_state, ret, event->ret); in cnss_driver_event_post()
1392 spin_lock_irqsave(&plat_priv->event_lock, irq_flags); in cnss_driver_event_post()
1395 spin_unlock_irqrestore(&plat_priv->event_lock, irq_flags); in cnss_driver_event_post()
1399 spin_unlock_irqrestore(&plat_priv->event_lock, irq_flags); in cnss_driver_event_post()
1405 cnss_pm_relax(plat_priv); in cnss_driver_event_post()
1416 unsigned int cnss_get_timeout(struct cnss_plat_data *plat_priv, in cnss_get_timeout() argument
1419 unsigned int qmi_timeout = cnss_get_qmi_timeout(plat_priv); in cnss_get_timeout()
1454 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_get_boot_timeout() local
1456 if (!plat_priv) { in cnss_get_boot_timeout()
1461 return cnss_get_timeout(plat_priv, CNSS_TIMEOUT_QMI); in cnss_get_boot_timeout()
1468 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_power_up() local
1471 if (!plat_priv) { in cnss_power_up()
1478 ret = cnss_driver_event_post(plat_priv, in cnss_power_up()
1484 if (plat_priv->device_id == QCA6174_DEVICE_ID) in cnss_power_up()
1487 timeout = cnss_get_timeout(plat_priv, CNSS_TIMEOUT_POWER_UP); in cnss_power_up()
1489 reinit_completion(&plat_priv->power_up_complete); in cnss_power_up()
1490 ret = wait_for_completion_timeout(&plat_priv->power_up_complete, in cnss_power_up()
1508 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_power_down() local
1510 if (!plat_priv) { in cnss_power_down()
1517 return cnss_driver_event_post(plat_priv, in cnss_power_down()
1525 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_idle_restart() local
1529 if (!plat_priv) { in cnss_idle_restart()
1534 if (!mutex_trylock(&plat_priv->driver_ops_lock)) { in cnss_idle_restart()
1541 reinit_completion(&plat_priv->power_up_complete); in cnss_idle_restart()
1543 if (test_bit(CNSS_IN_REBOOT, &plat_priv->driver_state)) { in cnss_idle_restart()
1549 ret = cnss_driver_event_post(plat_priv, in cnss_idle_restart()
1552 if (ret == -EINTR && plat_priv->device_id != QCA6174_DEVICE_ID) in cnss_idle_restart()
1557 if (plat_priv->device_id == QCA6174_DEVICE_ID) { in cnss_idle_restart()
1558 ret = cnss_bus_call_driver_probe(plat_priv); in cnss_idle_restart()
1562 timeout = cnss_get_timeout(plat_priv, CNSS_TIMEOUT_IDLE_RESTART); in cnss_idle_restart()
1563 ret = wait_for_completion_timeout(&plat_priv->power_up_complete, in cnss_idle_restart()
1565 if (plat_priv->power_up_error) { in cnss_idle_restart()
1566 ret = plat_priv->power_up_error; in cnss_idle_restart()
1567 clear_bit(CNSS_DRIVER_IDLE_RESTART, &plat_priv->driver_state); in cnss_idle_restart()
1569 plat_priv->power_up_error); in cnss_idle_restart()
1585 if (test_bit(CNSS_IN_REBOOT, &plat_priv->driver_state)) { in cnss_idle_restart()
1587 del_timer(&plat_priv->fw_boot_timer); in cnss_idle_restart()
1597 if (test_bit(DISABLE_DRV, &plat_priv->ctrl_params.quirks)) { in cnss_idle_restart()
1599 cnss_bus_disable_mhi_satellite_cfg(plat_priv); in cnss_idle_restart()
1602 mutex_unlock(&plat_priv->driver_ops_lock); in cnss_idle_restart()
1606 mutex_unlock(&plat_priv->driver_ops_lock); in cnss_idle_restart()
1613 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_idle_shutdown() local
1615 if (!plat_priv) { in cnss_idle_shutdown()
1620 if (test_bit(CNSS_IN_SUSPEND_RESUME, &plat_priv->driver_state)) { in cnss_idle_shutdown()
1627 if (test_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state) || in cnss_idle_shutdown()
1628 test_bit(CNSS_DEV_ERR_NOTIFY, &plat_priv->driver_state)) { in cnss_idle_shutdown()
1633 return cnss_driver_event_post(plat_priv, in cnss_idle_shutdown()
1639 static int cnss_get_resources(struct cnss_plat_data *plat_priv) in cnss_get_resources() argument
1643 ret = cnss_get_vreg_type(plat_priv, CNSS_VREG_PRIM); in cnss_get_resources()
1649 ret = cnss_get_clk(plat_priv); in cnss_get_resources()
1655 ret = cnss_get_pinctrl(plat_priv); in cnss_get_resources()
1664 cnss_put_clk(plat_priv); in cnss_get_resources()
1666 cnss_put_vreg_type(plat_priv, CNSS_VREG_PRIM); in cnss_get_resources()
1671 static void cnss_put_resources(struct cnss_plat_data *plat_priv) in cnss_put_resources() argument
1673 cnss_put_clk(plat_priv); in cnss_put_resources()
1674 cnss_put_vreg_type(plat_priv, CNSS_VREG_PRIM); in cnss_put_resources()
1682 struct cnss_plat_data *plat_priv = in cnss_modem_notifier_nb() local
1688 if (!plat_priv) in cnss_modem_notifier_nb()
1691 esoc_info = &plat_priv->esoc_info; in cnss_modem_notifier_nb()
1700 if (!cnss_bus_call_driver_modem_status(plat_priv, in cnss_modem_notifier_nb()
1707 static int cnss_register_esoc(struct cnss_plat_data *plat_priv) in cnss_register_esoc() argument
1715 dev = &plat_priv->plat_dev->dev; in cnss_register_esoc()
1716 esoc_info = &plat_priv->esoc_info; in cnss_register_esoc()
1740 plat_priv->modem_nb.notifier_call = cnss_modem_notifier_nb; in cnss_register_esoc()
1745 "modem", &plat_priv->modem_nb); in cnss_register_esoc()
1761 static void cnss_unregister_esoc(struct cnss_plat_data *plat_priv) in cnss_unregister_esoc() argument
1766 dev = &plat_priv->plat_dev->dev; in cnss_unregister_esoc()
1767 esoc_info = &plat_priv->esoc_info; in cnss_unregister_esoc()
1772 &plat_priv->modem_nb); in cnss_unregister_esoc()
1777 static inline int cnss_register_esoc(struct cnss_plat_data *plat_priv) in cnss_register_esoc() argument
1782 static inline void cnss_unregister_esoc(struct cnss_plat_data *plat_priv) {} in cnss_unregister_esoc() argument
1785 int cnss_enable_dev_sol_irq(struct cnss_plat_data *plat_priv) in cnss_enable_dev_sol_irq() argument
1787 struct cnss_sol_gpio *sol_gpio = &plat_priv->sol_gpio; in cnss_enable_dev_sol_irq()
1801 int cnss_disable_dev_sol_irq(struct cnss_plat_data *plat_priv) in cnss_disable_dev_sol_irq() argument
1803 struct cnss_sol_gpio *sol_gpio = &plat_priv->sol_gpio; in cnss_disable_dev_sol_irq()
1817 int cnss_get_dev_sol_value(struct cnss_plat_data *plat_priv) in cnss_get_dev_sol_value() argument
1819 struct cnss_sol_gpio *sol_gpio = &plat_priv->sol_gpio; in cnss_get_dev_sol_value()
1829 struct cnss_plat_data *plat_priv = data; in cnss_dev_sol_handler() local
1830 struct cnss_sol_gpio *sol_gpio = &plat_priv->sol_gpio; in cnss_dev_sol_handler()
1832 if (test_bit(CNSS_POWER_OFF, &plat_priv->driver_state)) { in cnss_dev_sol_handler()
1840 cnss_get_dev_sol_value(plat_priv)); in cnss_dev_sol_handler()
1843 cnss_pm_stay_awake(plat_priv); in cnss_dev_sol_handler()
1844 cnss_pm_relax(plat_priv); in cnss_dev_sol_handler()
1847 cnss_bus_handle_dev_sol_irq(plat_priv); in cnss_dev_sol_handler()
1852 static int cnss_init_dev_sol_gpio(struct cnss_plat_data *plat_priv) in cnss_init_dev_sol_gpio() argument
1854 struct device *dev = &plat_priv->plat_dev->dev; in cnss_init_dev_sol_gpio()
1855 struct cnss_sol_gpio *sol_gpio = &plat_priv->sol_gpio; in cnss_init_dev_sol_gpio()
1877 IRQF_TRIGGER_FALLING, "wlan_dev_sol_irq", plat_priv); in cnss_init_dev_sol_gpio()
1891 static void cnss_deinit_dev_sol_gpio(struct cnss_plat_data *plat_priv) in cnss_deinit_dev_sol_gpio() argument
1893 struct cnss_sol_gpio *sol_gpio = &plat_priv->sol_gpio; in cnss_deinit_dev_sol_gpio()
1898 free_irq(sol_gpio->dev_sol_irq, plat_priv); in cnss_deinit_dev_sol_gpio()
1902 int cnss_set_host_sol_value(struct cnss_plat_data *plat_priv, int value) in cnss_set_host_sol_value() argument
1904 struct cnss_sol_gpio *sol_gpio = &plat_priv->sol_gpio; in cnss_set_host_sol_value()
1916 int cnss_get_host_sol_value(struct cnss_plat_data *plat_priv) in cnss_get_host_sol_value() argument
1918 struct cnss_sol_gpio *sol_gpio = &plat_priv->sol_gpio; in cnss_get_host_sol_value()
1926 static int cnss_init_host_sol_gpio(struct cnss_plat_data *plat_priv) in cnss_init_host_sol_gpio() argument
1928 struct device *dev = &plat_priv->plat_dev->dev; in cnss_init_host_sol_gpio()
1929 struct cnss_sol_gpio *sol_gpio = &plat_priv->sol_gpio; in cnss_init_host_sol_gpio()
1955 static void cnss_deinit_host_sol_gpio(struct cnss_plat_data *plat_priv) in cnss_deinit_host_sol_gpio() argument
1957 struct cnss_sol_gpio *sol_gpio = &plat_priv->sol_gpio; in cnss_deinit_host_sol_gpio()
1965 static int cnss_init_sol_gpio(struct cnss_plat_data *plat_priv) in cnss_init_sol_gpio() argument
1969 ret = cnss_init_dev_sol_gpio(plat_priv); in cnss_init_sol_gpio()
1973 ret = cnss_init_host_sol_gpio(plat_priv); in cnss_init_sol_gpio()
1980 cnss_deinit_dev_sol_gpio(plat_priv); in cnss_init_sol_gpio()
1985 static void cnss_deinit_sol_gpio(struct cnss_plat_data *plat_priv) in cnss_deinit_sol_gpio() argument
1987 cnss_deinit_host_sol_gpio(plat_priv); in cnss_deinit_sol_gpio()
1988 cnss_deinit_dev_sol_gpio(plat_priv); in cnss_deinit_sol_gpio()
1994 struct cnss_plat_data *plat_priv; in cnss_subsys_powerup() local
2002 plat_priv = dev_get_drvdata(subsys_desc->dev); in cnss_subsys_powerup()
2003 if (!plat_priv) { in cnss_subsys_powerup()
2008 if (!plat_priv->driver_state) { in cnss_subsys_powerup()
2013 ret = cnss_bus_dev_powerup(plat_priv); in cnss_subsys_powerup()
2015 __pm_relax(plat_priv->recovery_ws); in cnss_subsys_powerup()
2022 struct cnss_plat_data *plat_priv; in cnss_subsys_shutdown() local
2029 plat_priv = dev_get_drvdata(subsys_desc->dev); in cnss_subsys_shutdown()
2030 if (!plat_priv) { in cnss_subsys_shutdown()
2035 if (!plat_priv->driver_state) { in cnss_subsys_shutdown()
2040 return cnss_bus_dev_shutdown(plat_priv); in cnss_subsys_shutdown()
2045 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_device_crashed() local
2048 if (!plat_priv) in cnss_device_crashed()
2051 subsys_info = &plat_priv->subsys_info; in cnss_device_crashed()
2053 set_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state); in cnss_device_crashed()
2062 struct cnss_plat_data *plat_priv = dev_get_drvdata(subsys_desc->dev); in cnss_subsys_crash_shutdown() local
2064 if (!plat_priv) { in cnss_subsys_crash_shutdown()
2069 cnss_bus_dev_crash_shutdown(plat_priv); in cnss_subsys_crash_shutdown()
2075 struct cnss_plat_data *plat_priv = dev_get_drvdata(subsys_desc->dev); in cnss_subsys_ramdump() local
2077 if (!plat_priv) { in cnss_subsys_ramdump()
2085 return cnss_bus_dev_ramdump(plat_priv); in cnss_subsys_ramdump()
2092 void cnss_recovery_handler(struct cnss_plat_data *plat_priv) in cnss_recovery_handler() argument
2096 set_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state); in cnss_recovery_handler()
2098 if (!plat_priv->recovery_enabled) in cnss_recovery_handler()
2101 cnss_bus_dev_shutdown(plat_priv); in cnss_recovery_handler()
2102 cnss_bus_dev_ramdump(plat_priv); in cnss_recovery_handler()
2108 if (!test_bit(CNSS_DRIVER_REGISTER, &plat_priv->driver_state) || in cnss_recovery_handler()
2109 !test_bit(CNSS_DRIVER_REGISTERED, &plat_priv->driver_state)) { in cnss_recovery_handler()
2111 plat_priv->driver_state); in cnss_recovery_handler()
2117 ret = cnss_bus_dev_powerup(plat_priv); in cnss_recovery_handler()
2119 __pm_relax(plat_priv->recovery_ws); in cnss_recovery_handler()
2120 clear_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state); in cnss_recovery_handler()
2128 struct cnss_plat_data *plat_priv = in cnss_recovery_work_handler() local
2131 cnss_recovery_handler(plat_priv); in cnss_recovery_work_handler()
2136 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_device_crashed() local
2138 if (!plat_priv) in cnss_device_crashed()
2141 set_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state); in cnss_device_crashed()
2142 schedule_work(&plat_priv->recovery_work); in cnss_device_crashed()
2149 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_get_virt_ramdump_mem() local
2152 if (!plat_priv) in cnss_get_virt_ramdump_mem()
2155 ramdump_info = &plat_priv->ramdump_info; in cnss_get_virt_ramdump_mem()
2178 static int cnss_do_recovery(struct cnss_plat_data *plat_priv, in cnss_do_recovery() argument
2183 plat_priv->recovery_count++; in cnss_do_recovery()
2185 if (plat_priv->device_id == QCA6174_DEVICE_ID) in cnss_do_recovery()
2188 if (test_bit(SKIP_RECOVERY, &plat_priv->ctrl_params.quirks)) { in cnss_do_recovery()
2198 pm_wakeup_ws_event(plat_priv->recovery_ws, in cnss_do_recovery()
2199 cnss_get_timeout(plat_priv, CNSS_TIMEOUT_RECOVERY), in cnss_do_recovery()
2204 if (!cnss_bus_check_link_status(plat_priv)) { in cnss_do_recovery()
2209 &plat_priv->ctrl_params.quirks)) in cnss_do_recovery()
2211 if (!cnss_bus_recover_link_down(plat_priv)) { in cnss_do_recovery()
2216 &plat_priv->driver_state); in cnss_do_recovery()
2221 cnss_bus_collect_dump_info(plat_priv, false); in cnss_do_recovery()
2231 cnss_bus_device_crashed(plat_priv); in cnss_do_recovery()
2237 cnss_bus_dev_shutdown(plat_priv); in cnss_do_recovery()
2239 if (test_bit(LINK_DOWN_SELF_RECOVERY, &plat_priv->ctrl_params.quirks)) in cnss_do_recovery()
2241 &plat_priv->ctrl_params.quirks); in cnss_do_recovery()
2248 if (!test_bit(CNSS_DRIVER_REGISTER, &plat_priv->driver_state) || in cnss_do_recovery()
2249 !test_bit(CNSS_DRIVER_REGISTERED, &plat_priv->driver_state)) { in cnss_do_recovery()
2251 plat_priv->driver_state); in cnss_do_recovery()
2255 ret = cnss_bus_dev_powerup(plat_priv); in cnss_do_recovery()
2257 clear_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state); in cnss_do_recovery()
2262 static int cnss_driver_recovery_hdlr(struct cnss_plat_data *plat_priv, in cnss_driver_recovery_hdlr() argument
2272 if (!plat_priv->driver_state) { in cnss_driver_recovery_hdlr()
2278 if (test_bit(CNSS_IN_REBOOT, &plat_priv->driver_state)) { in cnss_driver_recovery_hdlr()
2284 if (test_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state)) { in cnss_driver_recovery_hdlr()
2291 if (test_bit(CNSS_DRIVER_UNLOADING, &plat_priv->driver_state) || in cnss_driver_recovery_hdlr()
2292 test_bit(CNSS_DRIVER_IDLE_SHUTDOWN, &plat_priv->driver_state)) { in cnss_driver_recovery_hdlr()
2298 switch (plat_priv->device_id) { in cnss_driver_recovery_hdlr()
2300 if (test_bit(CNSS_DRIVER_LOADING, &plat_priv->driver_state) || in cnss_driver_recovery_hdlr()
2302 &plat_priv->driver_state)) { in cnss_driver_recovery_hdlr()
2309 if (!test_bit(CNSS_FW_READY, &plat_priv->driver_state)) { in cnss_driver_recovery_hdlr()
2311 &plat_priv->driver_state); in cnss_driver_recovery_hdlr()
2316 set_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state); in cnss_driver_recovery_hdlr()
2317 ret = cnss_do_recovery(plat_priv, recovery_data->reason); in cnss_driver_recovery_hdlr()
2335 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_schedule_recovery() local
2339 if (!test_bit(CNSS_DEV_ERR_NOTIFY, &plat_priv->driver_state)) in cnss_schedule_recovery()
2340 cnss_bus_update_status(plat_priv, CNSS_FW_DOWN); in cnss_schedule_recovery()
2342 if (test_bit(CNSS_DRIVER_UNLOADING, &plat_priv->driver_state) || in cnss_schedule_recovery()
2343 test_bit(CNSS_DRIVER_IDLE_SHUTDOWN, &plat_priv->driver_state)) { in cnss_schedule_recovery()
2356 cnss_driver_event_post(plat_priv, in cnss_schedule_recovery()
2364 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_force_fw_assert() local
2366 if (!plat_priv) { in cnss_force_fw_assert()
2371 if (plat_priv->device_id == QCA6174_DEVICE_ID) { in cnss_force_fw_assert()
2376 if (cnss_bus_is_device_down(plat_priv)) { in cnss_force_fw_assert()
2381 if (test_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state)) { in cnss_force_fw_assert()
2387 cnss_driver_event_post(plat_priv, in cnss_force_fw_assert()
2391 cnss_bus_force_fw_assert_hdlr(plat_priv); in cnss_force_fw_assert()
2399 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_force_collect_rddm() local
2403 if (!plat_priv) { in cnss_force_collect_rddm()
2408 if (plat_priv->device_id == QCA6174_DEVICE_ID) { in cnss_force_collect_rddm()
2413 if (cnss_bus_is_device_down(plat_priv)) { in cnss_force_collect_rddm()
2418 if (test_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state)) { in cnss_force_collect_rddm()
2423 if (test_bit(CNSS_DRIVER_LOADING, &plat_priv->driver_state) || in cnss_force_collect_rddm()
2424 test_bit(CNSS_DRIVER_UNLOADING, &plat_priv->driver_state) || in cnss_force_collect_rddm()
2425 test_bit(CNSS_DRIVER_IDLE_RESTART, &plat_priv->driver_state) || in cnss_force_collect_rddm()
2426 test_bit(CNSS_DRIVER_IDLE_SHUTDOWN, &plat_priv->driver_state)) { in cnss_force_collect_rddm()
2431 ret = cnss_bus_force_fw_assert_hdlr(plat_priv); in cnss_force_collect_rddm()
2436 reinit_completion(&plat_priv->rddm_complete); in cnss_force_collect_rddm()
2437 timeout = cnss_get_timeout(plat_priv, CNSS_TIMEOUT_RDDM); in cnss_force_collect_rddm()
2438 ret = wait_for_completion_timeout(&plat_priv->rddm_complete, in cnss_force_collect_rddm()
2454 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_qmi_send_get() local
2456 if (!test_bit(CNSS_QMI_WLFW_CONNECTED, &plat_priv->driver_state)) in cnss_qmi_send_get()
2459 return cnss_bus_qmi_send_get(plat_priv); in cnss_qmi_send_get()
2465 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_qmi_send_put() local
2467 if (!test_bit(CNSS_QMI_WLFW_CONNECTED, &plat_priv->driver_state)) in cnss_qmi_send_put()
2470 return cnss_bus_qmi_send_put(plat_priv); in cnss_qmi_send_put()
2478 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_qmi_send() local
2481 if (!plat_priv) in cnss_qmi_send()
2484 if (!test_bit(CNSS_QMI_WLFW_CONNECTED, &plat_priv->driver_state)) in cnss_qmi_send()
2487 plat_priv->get_info_cb = cb; in cnss_qmi_send()
2488 plat_priv->get_info_cb_ctx = cb_ctx; in cnss_qmi_send()
2490 ret = cnss_wlfw_get_info_send_sync(plat_priv, type, cmd, cmd_len); in cnss_qmi_send()
2492 plat_priv->get_info_cb = NULL; in cnss_qmi_send()
2493 plat_priv->get_info_cb_ctx = NULL; in cnss_qmi_send()
2504 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_register_driver_async_data_cb() local
2506 if (!plat_priv) in cnss_register_driver_async_data_cb()
2509 if (!test_bit(CNSS_QMI_WLFW_CONNECTED, &plat_priv->driver_state)) in cnss_register_driver_async_data_cb()
2512 plat_priv->get_driver_async_data_cb = cb; in cnss_register_driver_async_data_cb()
2513 plat_priv->get_driver_async_data_ctx = cb_ctx; in cnss_register_driver_async_data_cb()
2519 static int cnss_cold_boot_cal_start_hdlr(struct cnss_plat_data *plat_priv) in cnss_cold_boot_cal_start_hdlr() argument
2524 if (test_bit(CNSS_COLD_BOOT_CAL_DONE, &plat_priv->driver_state)) { in cnss_cold_boot_cal_start_hdlr()
2527 } else if (test_bit(CNSS_IN_COLD_BOOT_CAL, &plat_priv->driver_state)) { in cnss_cold_boot_cal_start_hdlr()
2530 } else if (test_bit(CNSS_WLAN_HW_DISABLED, &plat_priv->driver_state)) { in cnss_cold_boot_cal_start_hdlr()
2535 if (test_bit(CNSS_DRIVER_LOADING, &plat_priv->driver_state) || in cnss_cold_boot_cal_start_hdlr()
2536 test_bit(CNSS_DRIVER_PROBED, &plat_priv->driver_state) || in cnss_cold_boot_cal_start_hdlr()
2537 test_bit(CNSS_FW_READY, &plat_priv->driver_state)) { in cnss_cold_boot_cal_start_hdlr()
2544 if (test_bit(CNSS_PCI_PROBE_DONE, &plat_priv->driver_state)) in cnss_cold_boot_cal_start_hdlr()
2556 switch (plat_priv->device_id) { in cnss_cold_boot_cal_start_hdlr()
2566 plat_priv->device_id); in cnss_cold_boot_cal_start_hdlr()
2571 set_bit(CNSS_IN_COLD_BOOT_CAL, &plat_priv->driver_state); in cnss_cold_boot_cal_start_hdlr()
2572 if (test_bit(CNSS_DRIVER_REGISTER, &plat_priv->driver_state)) { in cnss_cold_boot_cal_start_hdlr()
2573 timeout = cnss_get_timeout(plat_priv, in cnss_cold_boot_cal_start_hdlr()
2577 if (cancel_delayed_work_sync(&plat_priv->wlan_reg_driver_work)) in cnss_cold_boot_cal_start_hdlr()
2578 schedule_delayed_work(&plat_priv->wlan_reg_driver_work, in cnss_cold_boot_cal_start_hdlr()
2581 reinit_completion(&plat_priv->cal_complete); in cnss_cold_boot_cal_start_hdlr()
2582 ret = cnss_bus_dev_powerup(plat_priv); in cnss_cold_boot_cal_start_hdlr()
2585 complete(&plat_priv->cal_complete); in cnss_cold_boot_cal_start_hdlr()
2586 clear_bit(CNSS_IN_COLD_BOOT_CAL, &plat_priv->driver_state); in cnss_cold_boot_cal_start_hdlr()
2590 plat_priv->cal_done = CNSS_CAL_FAILURE; in cnss_cold_boot_cal_start_hdlr()
2591 set_bit(CNSS_COLD_BOOT_CAL_DONE, &plat_priv->driver_state); in cnss_cold_boot_cal_start_hdlr()
2593 if (plat_priv->device_id == QCA6174_DEVICE_ID || in cnss_cold_boot_cal_start_hdlr()
2594 plat_priv->device_id == QCN7605_DEVICE_ID) { in cnss_cold_boot_cal_start_hdlr()
2595 if (!test_bit(CNSS_DRIVER_REGISTER, &plat_priv->driver_state)) in cnss_cold_boot_cal_start_hdlr()
2600 if (cancel_delayed_work_sync(&plat_priv->wlan_reg_driver_work)) in cnss_cold_boot_cal_start_hdlr()
2601 schedule_delayed_work(&plat_priv->wlan_reg_driver_work, in cnss_cold_boot_cal_start_hdlr()
2610 static int cnss_cold_boot_cal_done_hdlr(struct cnss_plat_data *plat_priv, in cnss_cold_boot_cal_done_hdlr() argument
2615 if (!test_bit(CNSS_IN_COLD_BOOT_CAL, &plat_priv->driver_state) || in cnss_cold_boot_cal_done_hdlr()
2616 test_bit(CNSS_COLD_BOOT_CAL_DONE, &plat_priv->driver_state)) in cnss_cold_boot_cal_done_hdlr()
2622 plat_priv->cal_done = true; in cnss_cold_boot_cal_done_hdlr()
2635 cnss_wlfw_wlan_mode_send_sync(plat_priv, CNSS_OFF); in cnss_cold_boot_cal_done_hdlr()
2636 cnss_bus_free_qdss_mem(plat_priv); in cnss_cold_boot_cal_done_hdlr()
2637 cnss_release_antenna_sharing(plat_priv); in cnss_cold_boot_cal_done_hdlr()
2639 if (plat_priv->device_id == QCN7605_DEVICE_ID) in cnss_cold_boot_cal_done_hdlr()
2642 cnss_bus_dev_shutdown(plat_priv); in cnss_cold_boot_cal_done_hdlr()
2646 complete(&plat_priv->cal_complete); in cnss_cold_boot_cal_done_hdlr()
2647 clear_bit(CNSS_IN_COLD_BOOT_CAL, &plat_priv->driver_state); in cnss_cold_boot_cal_done_hdlr()
2648 set_bit(CNSS_COLD_BOOT_CAL_DONE, &plat_priv->driver_state); in cnss_cold_boot_cal_done_hdlr()
2651 cnss_cal_mem_upload_to_file(plat_priv); in cnss_cold_boot_cal_done_hdlr()
2652 if (!test_bit(CNSS_DRIVER_REGISTER, &plat_priv->driver_state)) in cnss_cold_boot_cal_done_hdlr()
2656 if (cancel_delayed_work_sync(&plat_priv->wlan_reg_driver_work)) in cnss_cold_boot_cal_done_hdlr()
2657 schedule_delayed_work(&plat_priv->wlan_reg_driver_work, in cnss_cold_boot_cal_done_hdlr()
2665 static int cnss_power_up_hdlr(struct cnss_plat_data *plat_priv) in cnss_power_up_hdlr() argument
2669 ret = cnss_bus_dev_powerup(plat_priv); in cnss_power_up_hdlr()
2671 clear_bit(CNSS_DRIVER_IDLE_RESTART, &plat_priv->driver_state); in cnss_power_up_hdlr()
2676 static int cnss_power_down_hdlr(struct cnss_plat_data *plat_priv) in cnss_power_down_hdlr() argument
2678 cnss_bus_dev_shutdown(plat_priv); in cnss_power_down_hdlr()
2683 static int cnss_qdss_trace_req_mem_hdlr(struct cnss_plat_data *plat_priv) in cnss_qdss_trace_req_mem_hdlr() argument
2687 ret = cnss_bus_alloc_qdss_mem(plat_priv); in cnss_qdss_trace_req_mem_hdlr()
2691 return cnss_wlfw_qdss_trace_mem_info_send_sync(plat_priv); in cnss_qdss_trace_req_mem_hdlr()
2724 static int cnss_fw_mem_file_save_hdlr(struct cnss_plat_data *plat_priv, in cnss_fw_mem_file_save_hdlr() argument
2735 if (!plat_priv->fw_mem_seg_len) in cnss_fw_mem_file_save_hdlr()
2738 fw_mem_seg = plat_priv->fw_mem; in cnss_fw_mem_file_save_hdlr()
2739 fw_mem_seg_len = plat_priv->fw_mem_seg_len; in cnss_fw_mem_file_save_hdlr()
2742 if (!plat_priv->qdss_mem_seg_len) in cnss_fw_mem_file_save_hdlr()
2745 fw_mem_seg = plat_priv->qdss_mem; in cnss_fw_mem_file_save_hdlr()
2746 fw_mem_seg_len = plat_priv->qdss_mem_seg_len; in cnss_fw_mem_file_save_hdlr()
2782 static int cnss_qdss_trace_free_hdlr(struct cnss_plat_data *plat_priv) in cnss_qdss_trace_free_hdlr() argument
2784 cnss_bus_free_qdss_mem(plat_priv); in cnss_qdss_trace_free_hdlr()
2789 static int cnss_qdss_trace_req_data_hdlr(struct cnss_plat_data *plat_priv, in cnss_qdss_trace_req_data_hdlr() argument
2795 if (!plat_priv) in cnss_qdss_trace_req_data_hdlr()
2798 ret = cnss_wlfw_qdss_data_send_sync(plat_priv, event_data->file_name, in cnss_qdss_trace_req_data_hdlr()
2807 struct cnss_plat_data *plat_priv = in cnss_driver_event_work() local
2813 if (!plat_priv) { in cnss_driver_event_work()
2818 cnss_pm_stay_awake(plat_priv); in cnss_driver_event_work()
2820 spin_lock_irqsave(&plat_priv->event_lock, flags); in cnss_driver_event_work()
2822 while (!list_empty(&plat_priv->event_list)) { in cnss_driver_event_work()
2823 event = list_first_entry(&plat_priv->event_list, in cnss_driver_event_work()
2826 spin_unlock_irqrestore(&plat_priv->event_lock, flags); in cnss_driver_event_work()
2831 plat_priv->driver_state); in cnss_driver_event_work()
2835 ret = cnss_wlfw_server_arrive(plat_priv, event->data); in cnss_driver_event_work()
2838 ret = cnss_wlfw_server_exit(plat_priv); in cnss_driver_event_work()
2841 ret = cnss_bus_alloc_fw_mem(plat_priv); in cnss_driver_event_work()
2844 ret = cnss_wlfw_respond_mem_send_sync(plat_priv); in cnss_driver_event_work()
2847 ret = cnss_fw_mem_ready_hdlr(plat_priv); in cnss_driver_event_work()
2850 ret = cnss_fw_ready_hdlr(plat_priv); in cnss_driver_event_work()
2853 ret = cnss_cold_boot_cal_start_hdlr(plat_priv); in cnss_driver_event_work()
2856 ret = cnss_cold_boot_cal_done_hdlr(plat_priv, in cnss_driver_event_work()
2860 ret = cnss_bus_register_driver_hdlr(plat_priv, in cnss_driver_event_work()
2864 ret = cnss_bus_unregister_driver_hdlr(plat_priv); in cnss_driver_event_work()
2867 ret = cnss_driver_recovery_hdlr(plat_priv, in cnss_driver_event_work()
2871 ret = cnss_bus_force_fw_assert_hdlr(plat_priv); in cnss_driver_event_work()
2875 &plat_priv->driver_state); in cnss_driver_event_work()
2878 ret = cnss_power_up_hdlr(plat_priv); in cnss_driver_event_work()
2882 &plat_priv->driver_state); in cnss_driver_event_work()
2885 ret = cnss_power_down_hdlr(plat_priv); in cnss_driver_event_work()
2888 ret = cnss_process_wfc_call_ind_event(plat_priv, in cnss_driver_event_work()
2892 ret = cnss_process_twt_cfg_ind_event(plat_priv, in cnss_driver_event_work()
2896 ret = cnss_qdss_trace_req_mem_hdlr(plat_priv); in cnss_driver_event_work()
2899 ret = cnss_fw_mem_file_save_hdlr(plat_priv, in cnss_driver_event_work()
2903 ret = cnss_qdss_trace_free_hdlr(plat_priv); in cnss_driver_event_work()
2906 ret = cnss_qdss_trace_req_data_hdlr(plat_priv, in cnss_driver_event_work()
2913 spin_lock_irqsave(&plat_priv->event_lock, flags); in cnss_driver_event_work()
2917 spin_lock_irqsave(&plat_priv->event_lock, flags); in cnss_driver_event_work()
2923 spin_unlock_irqrestore(&plat_priv->event_lock, flags); in cnss_driver_event_work()
2927 spin_lock_irqsave(&plat_priv->event_lock, flags); in cnss_driver_event_work()
2929 spin_unlock_irqrestore(&plat_priv->event_lock, flags); in cnss_driver_event_work()
2931 cnss_pm_relax(plat_priv); in cnss_driver_event_work()
2935 int cnss_register_subsys(struct cnss_plat_data *plat_priv) in cnss_register_subsys() argument
2940 subsys_info = &plat_priv->subsys_info; in cnss_register_subsys()
2942 subsys_info->subsys_desc.name = plat_priv->device_name; in cnss_register_subsys()
2948 subsys_info->subsys_desc.dev = &plat_priv->plat_dev->dev; in cnss_register_subsys()
2977 void cnss_unregister_subsys(struct cnss_plat_data *plat_priv) in cnss_unregister_subsys() argument
2981 subsys_info = &plat_priv->subsys_info; in cnss_unregister_subsys()
2986 static void *cnss_create_ramdump_device(struct cnss_plat_data *plat_priv) in cnss_create_ramdump_device() argument
2988 struct cnss_subsys_info *subsys_info = &plat_priv->subsys_info; in cnss_create_ramdump_device()
2994 static void cnss_destroy_ramdump_device(struct cnss_plat_data *plat_priv, in cnss_destroy_ramdump_device() argument
3000 int cnss_do_ramdump(struct cnss_plat_data *plat_priv) in cnss_do_ramdump() argument
3002 struct cnss_ramdump_info *ramdump_info = &plat_priv->ramdump_info; in cnss_do_ramdump()
3012 int cnss_do_elf_ramdump(struct cnss_plat_data *plat_priv) in cnss_do_elf_ramdump() argument
3014 struct cnss_ramdump_info_v2 *info_v2 = &plat_priv->ramdump_info_v2; in cnss_do_elf_ramdump()
3050 meta_info.chipset = plat_priv->device_id; in cnss_do_elf_ramdump()
3066 struct cnss_plat_data *plat_priv = in cnss_panic_handler() local
3069 cnss_bus_dev_crash_shutdown(plat_priv); in cnss_panic_handler()
3074 int cnss_register_subsys(struct cnss_plat_data *plat_priv) in cnss_register_subsys() argument
3078 if (!plat_priv) in cnss_register_subsys()
3081 plat_priv->panic_nb.notifier_call = cnss_panic_handler; in cnss_register_subsys()
3083 &plat_priv->panic_nb); in cnss_register_subsys()
3092 void cnss_unregister_subsys(struct cnss_plat_data *plat_priv) in cnss_unregister_subsys() argument
3097 &plat_priv->panic_nb); in cnss_unregister_subsys()
3103 static void *cnss_create_ramdump_device(struct cnss_plat_data *plat_priv) in cnss_create_ramdump_device() argument
3105 return &plat_priv->plat_dev->dev; in cnss_create_ramdump_device()
3108 static void cnss_destroy_ramdump_device(struct cnss_plat_data *plat_priv, in cnss_destroy_ramdump_device() argument
3115 int cnss_do_ramdump(struct cnss_plat_data *plat_priv) in cnss_do_ramdump() argument
3117 struct cnss_ramdump_info *ramdump_info = &plat_priv->ramdump_info; in cnss_do_ramdump()
3134 int cnss_do_ramdump(struct cnss_plat_data *plat_priv) in cnss_do_ramdump() argument
3326 int cnss_do_elf_ramdump(struct cnss_plat_data *plat_priv) in cnss_do_elf_ramdump() argument
3328 struct cnss_ramdump_info_v2 *info_v2 = &plat_priv->ramdump_info_v2; in cnss_do_elf_ramdump()
3377 meta_info.chipset = plat_priv->device_id; in cnss_do_elf_ramdump()
3408 int cnss_do_host_ramdump(struct cnss_plat_data *plat_priv, in cnss_do_host_ramdump() argument
3598 meta_info.chipset = plat_priv->device_id; in cnss_do_host_ramdump()
3623 static int cnss_init_dump_entry(struct cnss_plat_data *plat_priv) in cnss_init_dump_entry() argument
3628 ramdump_info = &plat_priv->ramdump_info; in cnss_init_dump_entry()
3642 static int cnss_register_ramdump_v1(struct cnss_plat_data *plat_priv) in cnss_register_ramdump_v1() argument
3649 dev = &plat_priv->plat_dev->dev; in cnss_register_ramdump_v1()
3650 ramdump_info = &plat_priv->ramdump_info; in cnss_register_ramdump_v1()
3652 if (plat_priv->dt_type != CNSS_DTT_MULTIEXCHG) { in cnss_register_ramdump_v1()
3658 ret = of_property_read_u32(plat_priv->dev_node, in cnss_register_ramdump_v1()
3680 ret = cnss_init_dump_entry(plat_priv); in cnss_register_ramdump_v1()
3686 ramdump_info->ramdump_dev = cnss_create_ramdump_device(plat_priv); in cnss_register_ramdump_v1()
3701 static void cnss_unregister_ramdump_v1(struct cnss_plat_data *plat_priv) in cnss_unregister_ramdump_v1() argument
3706 dev = &plat_priv->plat_dev->dev; in cnss_unregister_ramdump_v1()
3707 ramdump_info = &plat_priv->ramdump_info; in cnss_unregister_ramdump_v1()
3710 cnss_destroy_ramdump_device(plat_priv, in cnss_unregister_ramdump_v1()
3733 static int cnss_register_ramdump_v2(struct cnss_plat_data *plat_priv) in cnss_register_ramdump_v2() argument
3739 struct device *dev = &plat_priv->plat_dev->dev; in cnss_register_ramdump_v2()
3742 info_v2 = &plat_priv->ramdump_info_v2; in cnss_register_ramdump_v2()
3745 if (plat_priv->dt_type != CNSS_DTT_MULTIEXCHG) { in cnss_register_ramdump_v2()
3751 ret = of_property_read_u32(plat_priv->dev_node, in cnss_register_ramdump_v2()
3782 info_v2->ramdump_dev = cnss_create_ramdump_device(plat_priv); in cnss_register_ramdump_v2()
3797 static void cnss_unregister_ramdump_v2(struct cnss_plat_data *plat_priv) in cnss_unregister_ramdump_v2() argument
3801 info_v2 = &plat_priv->ramdump_info_v2; in cnss_unregister_ramdump_v2()
3804 cnss_destroy_ramdump_device(plat_priv, info_v2->ramdump_dev); in cnss_unregister_ramdump_v2()
3811 int cnss_register_ramdump(struct cnss_plat_data *plat_priv) in cnss_register_ramdump() argument
3815 switch (plat_priv->device_id) { in cnss_register_ramdump()
3817 ret = cnss_register_ramdump_v1(plat_priv); in cnss_register_ramdump()
3826 ret = cnss_register_ramdump_v2(plat_priv); in cnss_register_ramdump()
3829 cnss_pr_err("Unknown device ID: 0x%lx\n", plat_priv->device_id); in cnss_register_ramdump()
3836 void cnss_unregister_ramdump(struct cnss_plat_data *plat_priv) in cnss_unregister_ramdump() argument
3838 switch (plat_priv->device_id) { in cnss_unregister_ramdump()
3840 cnss_unregister_ramdump_v1(plat_priv); in cnss_unregister_ramdump()
3849 cnss_unregister_ramdump_v2(plat_priv); in cnss_unregister_ramdump()
3852 cnss_pr_err("Unknown device ID: 0x%lx\n", plat_priv->device_id); in cnss_unregister_ramdump()
3857 int cnss_register_ramdump(struct cnss_plat_data *plat_priv) in cnss_register_ramdump() argument
3859 struct cnss_ramdump_info_v2 *info_v2 = &plat_priv->ramdump_info_v2; in cnss_register_ramdump()
3861 struct device *dev = &plat_priv->plat_dev->dev; in cnss_register_ramdump()
3886 void cnss_unregister_ramdump(struct cnss_plat_data *plat_priv) in cnss_unregister_ramdump() argument
3888 struct cnss_ramdump_info_v2 *info_v2 = &plat_priv->ramdump_info_v2; in cnss_unregister_ramdump()
3917 int cnss_minidump_add_region(struct cnss_plat_data *plat_priv, in cnss_minidump_add_region() argument
3957 int cnss_minidump_remove_region(struct cnss_plat_data *plat_priv, in cnss_minidump_remove_region() argument
3998 int cnss_minidump_add_region(struct cnss_plat_data *plat_priv, in cnss_minidump_add_region() argument
4024 int cnss_minidump_remove_region(struct cnss_plat_data *plat_priv, in cnss_minidump_remove_region() argument
4032 int cnss_request_firmware_direct(struct cnss_plat_data *plat_priv, in cnss_request_firmware_direct() argument
4038 &plat_priv->plat_dev->dev); in cnss_request_firmware_direct()
4041 &plat_priv->plat_dev->dev); in cnss_request_firmware_direct()
4054 static int cnss_register_bus_scale(struct cnss_plat_data *plat_priv) in cnss_register_bus_scale() argument
4059 struct device *dev = &plat_priv->plat_dev->dev; in cnss_register_bus_scale()
4061 INIT_LIST_HEAD(&plat_priv->icc.list_head); in cnss_register_bus_scale()
4064 &plat_priv->icc.path_count); in cnss_register_bus_scale()
4069 ret = of_property_read_u32(plat_priv->plat_dev->dev.of_node, in cnss_register_bus_scale()
4071 &plat_priv->icc.bus_bw_cfg_count); in cnss_register_bus_scale()
4076 cfg_arr_size = plat_priv->icc.path_count * in cnss_register_bus_scale()
4077 plat_priv->icc.bus_bw_cfg_count * CNSS_ICC_VOTE_MAX; in cnss_register_bus_scale()
4085 ret = of_property_read_u32_array(plat_priv->plat_dev->dev.of_node, in cnss_register_bus_scale()
4094 plat_priv->icc.path_count, plat_priv->icc.bus_bw_cfg_count); in cnss_register_bus_scale()
4096 for (idx = 0; idx < plat_priv->icc.path_count; idx++) { in cnss_register_bus_scale()
4110 of_icc_get(&plat_priv->plat_dev->dev, in cnss_register_bus_scale()
4123 devm_kcalloc(dev, plat_priv->icc.bus_bw_cfg_count, in cnss_register_bus_scale()
4132 for (i = 0, j = (idx * plat_priv->icc.bus_bw_cfg_count * in cnss_register_bus_scale()
4134 i < plat_priv->icc.bus_bw_cfg_count; in cnss_register_bus_scale()
4143 &plat_priv->icc.list_head); in cnss_register_bus_scale()
4149 &plat_priv->icc.list_head, list) { in cnss_register_bus_scale()
4154 memset(&plat_priv->icc, 0, sizeof(plat_priv->icc)); in cnss_register_bus_scale()
4158 static void cnss_unregister_bus_scale(struct cnss_plat_data *plat_priv) in cnss_unregister_bus_scale() argument
4163 &plat_priv->icc.list_head, list) { in cnss_unregister_bus_scale()
4168 memset(&plat_priv->icc, 0, sizeof(plat_priv->icc)); in cnss_unregister_bus_scale()
4171 static int cnss_register_bus_scale(struct cnss_plat_data *plat_priv) in cnss_register_bus_scale() argument
4176 static void cnss_unregister_bus_scale(struct cnss_plat_data *plat_priv) {} in cnss_unregister_bus_scale() argument
4181 struct cnss_plat_data *plat_priv = cb_ctx; in cnss_daemon_connection_update_cb() local
4183 if (!plat_priv) { in cnss_daemon_connection_update_cb()
4189 set_bit(CNSS_DAEMON_CONNECTED, &plat_priv->driver_state); in cnss_daemon_connection_update_cb()
4190 complete(&plat_priv->daemon_connected); in cnss_daemon_connection_update_cb()
4193 reinit_completion(&plat_priv->daemon_connected); in cnss_daemon_connection_update_cb()
4194 clear_bit(CNSS_DAEMON_CONNECTED, &plat_priv->driver_state); in cnss_daemon_connection_update_cb()
4202 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in enable_hds_store() local
4205 if (!plat_priv) in enable_hds_store()
4214 plat_priv->hds_enabled = true; in enable_hds_store()
4216 plat_priv->hds_enabled = false; in enable_hds_store()
4219 plat_priv->hds_enabled ? "Enable" : "Disable", count); in enable_hds_store()
4228 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in recovery_show() local
4233 if (!plat_priv) in recovery_show()
4245 plat_priv->recovery_enabled ? "Enabled" : "Disabled", in recovery_show()
4246 plat_priv->recovery_enabled); in recovery_show()
4251 plat_priv->recovery_pcss_enabled ? "Enabled" : "Disabled", in recovery_show()
4252 plat_priv->recovery_pcss_enabled); in recovery_show()
4284 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in time_sync_period_show() local
4287 plat_priv->ctrl_params.time_sync_period); in time_sync_period_show()
4296 uint32_t cnss_get_min_time_sync_period_by_vote(struct cnss_plat_data *plat_priv) in cnss_get_min_time_sync_period_by_vote() argument
4302 time_sync_period = plat_priv->ctrl_params.time_sync_period_vote[i]; in cnss_get_min_time_sync_period_by_vote()
4314 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in time_sync_period_store() local
4317 if (!plat_priv) in time_sync_period_store()
4329 plat_priv->ctrl_params.time_sync_period_vote[TIME_SYNC_VOTE_CNSS] = in time_sync_period_store()
4331 time_sync_period = cnss_get_min_time_sync_period_by_vote(plat_priv); in time_sync_period_store()
4338 cnss_bus_update_time_sync_period(plat_priv, time_sync_period); in time_sync_period_store()
4354 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_update_time_sync_period() local
4356 if (!plat_priv) in cnss_update_time_sync_period()
4364 plat_priv->ctrl_params.time_sync_period_vote[TIME_SYNC_VOTE_WLAN] = in cnss_update_time_sync_period()
4366 time_sync_period = cnss_get_min_time_sync_period_by_vote(plat_priv); in cnss_update_time_sync_period()
4373 cnss_bus_update_time_sync_period(plat_priv, time_sync_period); in cnss_update_time_sync_period()
4389 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_reset_time_sync_period() local
4392 if (!plat_priv) in cnss_reset_time_sync_period()
4398 plat_priv->ctrl_params.time_sync_period_vote[TIME_SYNC_VOTE_WLAN] = in cnss_reset_time_sync_period()
4400 time_sync_period = cnss_get_min_time_sync_period_by_vote(plat_priv); in cnss_reset_time_sync_period()
4407 cnss_bus_update_time_sync_period(plat_priv, time_sync_period); in cnss_reset_time_sync_period()
4417 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in recovery_store() local
4420 if (!plat_priv) in recovery_store()
4428 plat_priv->recovery_enabled = !!(recovery & CNSS_WLAN_RECOVERY); in recovery_store()
4429 plat_priv->recovery_pcss_enabled = !!(recovery & CNSS_PCSS_RECOVERY); in recovery_store()
4432 plat_priv->recovery_enabled ? "Enable" : "Disable", count); in recovery_store()
4434 plat_priv->recovery_pcss_enabled ? "Enable" : "Disable", count); in recovery_store()
4436 cnss_send_subsys_restart_level_msg(plat_priv); in recovery_store()
4444 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in shutdown_store() local
4447 if (plat_priv) { in shutdown_store()
4448 set_bit(CNSS_IN_REBOOT, &plat_priv->driver_state); in shutdown_store()
4449 cnss_bus_update_status(plat_priv, CNSS_SYS_REBOOT); in shutdown_store()
4450 del_timer(&plat_priv->fw_boot_timer); in shutdown_store()
4451 complete_all(&plat_priv->power_up_complete); in shutdown_store()
4452 complete_all(&plat_priv->cal_complete); in shutdown_store()
4464 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in fs_ready_store() local
4472 if (!plat_priv) { in fs_ready_store()
4477 if (test_bit(QMI_BYPASS, &plat_priv->ctrl_params.quirks)) { in fs_ready_store()
4482 set_bit(CNSS_FS_READY, &plat_priv->driver_state); in fs_ready_store()
4483 if (fs_ready == FILE_SYSTEM_READY && plat_priv->cbc_enabled) { in fs_ready_store()
4484 cnss_driver_event_post(plat_priv, in fs_ready_store()
4496 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in qdss_trace_start_store() local
4498 wlfw_qdss_trace_start(plat_priv); in qdss_trace_start_store()
4507 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in qdss_trace_stop_store() local
4513 wlfw_qdss_trace_stop(plat_priv, option); in qdss_trace_stop_store()
4522 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in qdss_conf_download_store() local
4524 cnss_wlfw_qdss_dnld_send_sync(plat_priv); in qdss_conf_download_store()
4533 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in tme_opt_file_download_store() local
4539 if (!test_bit(CNSS_FW_READY, &plat_priv->driver_state)) { in tme_opt_file_download_store()
4544 if (plat_priv->device_id == PEACH_DEVICE_ID && in tme_opt_file_download_store()
4545 cnss_bus_runtime_pm_get_sync(plat_priv) < 0) in tme_opt_file_download_store()
4549 cnss_bus_load_tme_opt_file(plat_priv, WLFW_TME_LITE_OEM_FUSE_FILE_V01); in tme_opt_file_download_store()
4550 cnss_wlfw_tme_opt_file_dnld_send_sync(plat_priv, WLFW_TME_LITE_OEM_FUSE_FILE_V01); in tme_opt_file_download_store()
4552 cnss_bus_load_tme_opt_file(plat_priv, WLFW_TME_LITE_RPR_FILE_V01); in tme_opt_file_download_store()
4553 cnss_wlfw_tme_opt_file_dnld_send_sync(plat_priv, WLFW_TME_LITE_RPR_FILE_V01); in tme_opt_file_download_store()
4555 cnss_bus_load_tme_opt_file(plat_priv, WLFW_TME_LITE_DPR_FILE_V01); in tme_opt_file_download_store()
4556 cnss_wlfw_tme_opt_file_dnld_send_sync(plat_priv, WLFW_TME_LITE_DPR_FILE_V01); in tme_opt_file_download_store()
4562 if (plat_priv->device_id == PEACH_DEVICE_ID) in tme_opt_file_download_store()
4563 cnss_bus_runtime_pm_put(plat_priv); in tme_opt_file_download_store()
4571 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in hw_trace_override_store() local
4577 plat_priv->hw_trc_override = tmp; in hw_trace_override_store()
4586 struct cnss_plat_data *plat_priv = dev_get_drvdata(dev); in charger_mode_store() local
4592 plat_priv->charger_mode = tmp; in charger_mode_store()
4628 static int cnss_create_sysfs_link(struct cnss_plat_data *plat_priv) in cnss_create_sysfs_link() argument
4630 struct device *dev = &plat_priv->plat_dev->dev; in cnss_create_sysfs_link()
4637 CNSS_FS_NAME "_%d", plat_priv->plat_idx); in cnss_create_sysfs_link()
4639 "shutdown_wlan_%d", plat_priv->plat_idx); in cnss_create_sysfs_link()
4669 static void cnss_remove_sysfs_link(struct cnss_plat_data *plat_priv) in cnss_remove_sysfs_link() argument
4676 CNSS_FS_NAME "_%d", plat_priv->plat_idx); in cnss_remove_sysfs_link()
4678 "shutdown_wlan_%d", plat_priv->plat_idx); in cnss_remove_sysfs_link()
4689 static int cnss_create_sysfs(struct cnss_plat_data *plat_priv) in cnss_create_sysfs() argument
4693 ret = devm_device_add_group(&plat_priv->plat_dev->dev, in cnss_create_sysfs()
4701 cnss_create_sysfs_link(plat_priv); in cnss_create_sysfs()
4727 static void cnss_remove_sysfs(struct cnss_plat_data *plat_priv) in cnss_remove_sysfs() argument
4729 cnss_remove_sysfs_link(plat_priv); in cnss_remove_sysfs()
4730 WARN_ON(devres_release(&plat_priv->plat_dev->dev, in cnss_remove_sysfs()
4735 static void cnss_remove_sysfs(struct cnss_plat_data *plat_priv) in cnss_remove_sysfs() argument
4737 cnss_remove_sysfs_link(plat_priv); in cnss_remove_sysfs()
4738 devm_device_remove_group(&plat_priv->plat_dev->dev, &cnss_attr_group); in cnss_remove_sysfs()
4742 static int cnss_event_work_init(struct cnss_plat_data *plat_priv) in cnss_event_work_init() argument
4744 spin_lock_init(&plat_priv->event_lock); in cnss_event_work_init()
4745 plat_priv->event_wq = alloc_workqueue("cnss_driver_event", in cnss_event_work_init()
4747 if (!plat_priv->event_wq) { in cnss_event_work_init()
4752 INIT_WORK(&plat_priv->event_work, cnss_driver_event_work); in cnss_event_work_init()
4753 INIT_LIST_HEAD(&plat_priv->event_list); in cnss_event_work_init()
4758 static void cnss_event_work_deinit(struct cnss_plat_data *plat_priv) in cnss_event_work_deinit() argument
4760 destroy_workqueue(plat_priv->event_wq); in cnss_event_work_deinit()
4767 struct cnss_plat_data *plat_priv = in cnss_reboot_notifier() local
4770 set_bit(CNSS_IN_REBOOT, &plat_priv->driver_state); in cnss_reboot_notifier()
4771 cnss_bus_update_status(plat_priv, CNSS_SYS_REBOOT); in cnss_reboot_notifier()
4772 del_timer(&plat_priv->fw_boot_timer); in cnss_reboot_notifier()
4773 complete_all(&plat_priv->power_up_complete); in cnss_reboot_notifier()
4774 complete_all(&plat_priv->cal_complete); in cnss_reboot_notifier()
4782 int cnss_wlan_hw_disable_check(struct cnss_plat_data *plat_priv) in cnss_wlan_hw_disable_check() argument
4790 if (plat_priv->sec_peri_feature_disable) in cnss_wlan_hw_disable_check()
4801 plat_priv->sec_peri_feature_disable = true; in cnss_wlan_hw_disable_check()
4808 &plat_priv->driver_state); in cnss_wlan_hw_disable_check()
4811 &plat_priv->driver_state); in cnss_wlan_hw_disable_check()
4816 int cnss_wlan_hw_disable_check(struct cnss_plat_data *plat_priv) in cnss_wlan_hw_disable_check() argument
4828 if (plat_priv->sec_peri_feature_disable) in cnss_wlan_hw_disable_check()
4842 plat_priv->sec_peri_feature_disable = true; in cnss_wlan_hw_disable_check()
4857 plat_priv->sec_peri_feature_disable = true; in cnss_wlan_hw_disable_check()
4865 &plat_priv->driver_state); in cnss_wlan_hw_disable_check()
4868 &plat_priv->driver_state); in cnss_wlan_hw_disable_check()
4883 int cnss_wlan_hw_disable_check(struct cnss_plat_data *plat_priv) in cnss_wlan_hw_disable_check() argument
4890 static void cnss_sram_dump_init(struct cnss_plat_data *plat_priv) in cnss_sram_dump_init() argument
4894 static void cnss_sram_dump_init(struct cnss_plat_data *plat_priv) in cnss_sram_dump_init() argument
4896 if (plat_priv->device_id == QCA6490_DEVICE_ID && in cnss_sram_dump_init()
4898 plat_priv->sram_dump = kcalloc(SRAM_DUMP_SIZE, 1, GFP_KERNEL); in cnss_sram_dump_init()
4920 static int cnss_misc_init(struct cnss_plat_data *plat_priv) in cnss_misc_init() argument
4924 ret = cnss_init_sol_gpio(plat_priv); in cnss_misc_init()
4928 timer_setup(&plat_priv->fw_boot_timer, in cnss_misc_init()
4931 ret = device_init_wakeup(&plat_priv->plat_dev->dev, true); in cnss_misc_init()
4936 INIT_WORK(&plat_priv->recovery_work, cnss_recovery_work_handler); in cnss_misc_init()
4937 init_completion(&plat_priv->power_up_complete); in cnss_misc_init()
4938 init_completion(&plat_priv->cal_complete); in cnss_misc_init()
4939 init_completion(&plat_priv->rddm_complete); in cnss_misc_init()
4940 init_completion(&plat_priv->recovery_complete); in cnss_misc_init()
4941 init_completion(&plat_priv->daemon_connected); in cnss_misc_init()
4942 mutex_init(&plat_priv->dev_lock); in cnss_misc_init()
4943 mutex_init(&plat_priv->driver_ops_lock); in cnss_misc_init()
4945 plat_priv->reboot_nb.notifier_call = cnss_reboot_notifier; in cnss_misc_init()
4946 ret = register_reboot_notifier(&plat_priv->reboot_nb); in cnss_misc_init()
4951 plat_priv->recovery_ws = in cnss_misc_init()
4952 wakeup_source_register(&plat_priv->plat_dev->dev, in cnss_misc_init()
4954 if (!plat_priv->recovery_ws) in cnss_misc_init()
4959 plat_priv); in cnss_misc_init()
4964 cnss_sram_dump_init(plat_priv); in cnss_misc_init()
4966 if (of_property_read_bool(plat_priv->plat_dev->dev.of_node, in cnss_misc_init()
4968 cnss_set_feature_list(plat_priv, CNSS_RC_EP_ULTRASHORT_CHANNEL_V01); in cnss_misc_init()
4969 if (plat_priv->device_id == PEACH_DEVICE_ID) in cnss_misc_init()
4970 cnss_set_feature_list(plat_priv, CNSS_AUX_UC_SUPPORT_V01); in cnss_misc_init()
4976 static void cnss_sram_dump_deinit(struct cnss_plat_data *plat_priv) in cnss_sram_dump_deinit() argument
4980 static void cnss_sram_dump_deinit(struct cnss_plat_data *plat_priv) in cnss_sram_dump_deinit() argument
4982 if (plat_priv->device_id == QCA6490_DEVICE_ID && in cnss_sram_dump_deinit()
4984 kfree(plat_priv->sram_dump); in cnss_sram_dump_deinit()
4988 static void cnss_misc_deinit(struct cnss_plat_data *plat_priv) in cnss_misc_deinit() argument
4991 plat_priv); in cnss_misc_deinit()
4992 complete_all(&plat_priv->recovery_complete); in cnss_misc_deinit()
4993 complete_all(&plat_priv->rddm_complete); in cnss_misc_deinit()
4994 complete_all(&plat_priv->cal_complete); in cnss_misc_deinit()
4995 complete_all(&plat_priv->power_up_complete); in cnss_misc_deinit()
4996 complete_all(&plat_priv->daemon_connected); in cnss_misc_deinit()
4997 device_init_wakeup(&plat_priv->plat_dev->dev, false); in cnss_misc_deinit()
4998 unregister_reboot_notifier(&plat_priv->reboot_nb); in cnss_misc_deinit()
4999 del_timer(&plat_priv->fw_boot_timer); in cnss_misc_deinit()
5000 wakeup_source_unregister(plat_priv->recovery_ws); in cnss_misc_deinit()
5001 cnss_deinit_sol_gpio(plat_priv); in cnss_misc_deinit()
5002 cnss_sram_dump_deinit(plat_priv); in cnss_misc_deinit()
5003 kfree(plat_priv->on_chip_pmic_board_ids); in cnss_misc_deinit()
5006 static void cnss_init_time_sync_period_default(struct cnss_plat_data *plat_priv) in cnss_init_time_sync_period_default() argument
5008 plat_priv->ctrl_params.time_sync_period_vote[TIME_SYNC_VOTE_WLAN] = in cnss_init_time_sync_period_default()
5010 plat_priv->ctrl_params.time_sync_period_vote[TIME_SYNC_VOTE_CNSS] = in cnss_init_time_sync_period_default()
5014 static void cnss_init_control_params(struct cnss_plat_data *plat_priv) in cnss_init_control_params() argument
5016 plat_priv->ctrl_params.quirks = CNSS_QUIRKS_DEFAULT; in cnss_init_control_params()
5018 plat_priv->cbc_enabled = !IS_ENABLED(CONFIG_CNSS_EMULATION) && in cnss_init_control_params()
5019 of_property_read_bool(plat_priv->plat_dev->dev.of_node, in cnss_init_control_params()
5022 plat_priv->ctrl_params.mhi_timeout = CNSS_MHI_TIMEOUT_DEFAULT; in cnss_init_control_params()
5023 plat_priv->ctrl_params.mhi_m2_timeout = CNSS_MHI_M2_TIMEOUT_DEFAULT; in cnss_init_control_params()
5024 plat_priv->ctrl_params.qmi_timeout = CNSS_QMI_TIMEOUT_DEFAULT; in cnss_init_control_params()
5025 plat_priv->ctrl_params.bdf_type = CNSS_BDF_TYPE_DEFAULT; in cnss_init_control_params()
5026 plat_priv->ctrl_params.time_sync_period = CNSS_TIME_SYNC_PERIOD_DEFAULT; in cnss_init_control_params()
5027 cnss_init_time_sync_period_default(plat_priv); in cnss_init_control_params()
5031 plat_priv->adsp_pc_enabled = true; in cnss_init_control_params()
5034 static void cnss_get_pm_domain_info(struct cnss_plat_data *plat_priv) in cnss_get_pm_domain_info() argument
5036 struct device *dev = &plat_priv->plat_dev->dev; in cnss_get_pm_domain_info()
5038 plat_priv->use_pm_domain = in cnss_get_pm_domain_info()
5041 cnss_pr_dbg("use-pm-domain is %d\n", plat_priv->use_pm_domain); in cnss_get_pm_domain_info()
5044 static void cnss_get_wlaon_pwr_ctrl_info(struct cnss_plat_data *plat_priv) in cnss_get_wlaon_pwr_ctrl_info() argument
5046 struct device *dev = &plat_priv->plat_dev->dev; in cnss_get_wlaon_pwr_ctrl_info()
5048 plat_priv->set_wlaon_pwr_ctrl = in cnss_get_wlaon_pwr_ctrl_info()
5052 plat_priv->set_wlaon_pwr_ctrl); in cnss_get_wlaon_pwr_ctrl_info()
5055 static bool cnss_use_fw_path_with_prefix(struct cnss_plat_data *plat_priv) in cnss_use_fw_path_with_prefix() argument
5057 return (of_property_read_bool(plat_priv->plat_dev->dev.of_node, in cnss_use_fw_path_with_prefix()
5059 of_property_read_bool(plat_priv->plat_dev->dev.of_node, in cnss_use_fw_path_with_prefix()
5061 of_property_read_bool(plat_priv->plat_dev->dev.of_node, in cnss_use_fw_path_with_prefix()
5107 cnss_use_nv_mac(struct cnss_plat_data *plat_priv) in cnss_use_nv_mac() argument
5109 return of_property_read_bool(plat_priv->plat_dev->dev.of_node, in cnss_use_nv_mac()
5113 static int cnss_get_dev_cfg_node(struct cnss_plat_data *plat_priv) in cnss_get_dev_cfg_node() argument
5121 if (plat_priv->dt_type != CNSS_DTT_CONVERGED) in cnss_get_dev_cfg_node()
5125 ret = cnss_get_wlan_sw_ctrl(plat_priv); in cnss_get_dev_cfg_node()
5131 device_identifier_gpio = plat_priv->pinctrl_info.wlan_sw_ctrl_gpio; in cnss_get_dev_cfg_node()
5136 for_each_available_child_of_node(plat_priv->plat_dev->dev.of_node, in cnss_get_dev_cfg_node()
5157 plat_priv->plat_dev->dev.of_node = child; in cnss_get_dev_cfg_node()
5158 plat_priv->device_id = QCA6490_DEVICE_ID; in cnss_get_dev_cfg_node()
5164 plat_priv->plat_dev->dev.of_node = child; in cnss_get_dev_cfg_node()
5165 plat_priv->device_id = KIWI_DEVICE_ID; in cnss_get_dev_cfg_node()
5178 cnss_dt_type(struct cnss_plat_data *plat_priv) in cnss_dt_type() argument
5181 plat_priv->plat_dev->dev.of_node, "qcom,converged-dt"); in cnss_dt_type()
5188 plat_priv->plat_dev->dev.of_node, "qcom,multi-wlan-exchg"); in cnss_dt_type()
5195 static int cnss_wlan_device_init(struct cnss_plat_data *plat_priv) in cnss_wlan_device_init() argument
5200 if (test_bit(SKIP_DEVICE_BOOT, &plat_priv->ctrl_params.quirks)) in cnss_wlan_device_init()
5204 ret = cnss_power_on_device(plat_priv, true); in cnss_wlan_device_init()
5208 ret = cnss_bus_init(plat_priv); in cnss_wlan_device_init()
5212 cnss_power_off_device(plat_priv); in cnss_wlan_device_init()
5222 cnss_power_off_device(plat_priv); in cnss_wlan_device_init()
5229 struct cnss_plat_data *plat_priv; in cnss_wlan_hw_enable() local
5233 plat_priv = cnss_get_first_plat_priv(NULL); in cnss_wlan_hw_enable()
5235 plat_priv = cnss_get_plat_priv(NULL); in cnss_wlan_hw_enable()
5237 if (!plat_priv) in cnss_wlan_hw_enable()
5240 clear_bit(CNSS_WLAN_HW_DISABLED, &plat_priv->driver_state); in cnss_wlan_hw_enable()
5242 if (test_bit(CNSS_PCI_PROBE_DONE, &plat_priv->driver_state)) in cnss_wlan_hw_enable()
5244 ret = cnss_wlan_device_init(plat_priv); in cnss_wlan_hw_enable()
5246 if (!test_bit(CNSS_WLAN_HW_DISABLED, &plat_priv->driver_state)) in cnss_wlan_hw_enable()
5251 if (test_bit(CNSS_FS_READY, &plat_priv->driver_state)) in cnss_wlan_hw_enable()
5252 cnss_driver_event_post(plat_priv, in cnss_wlan_hw_enable()
5257 if (plat_priv->driver_ops) in cnss_wlan_hw_enable()
5258 ret = cnss_wlan_register_driver(plat_priv->driver_ops); in cnss_wlan_hw_enable()
5266 struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev); in cnss_set_wfc_mode() local
5269 if (!plat_priv) in cnss_set_wfc_mode()
5273 if (test_bit(CNSS_IMS_CONNECTED, &plat_priv->driver_state)) { in cnss_set_wfc_mode()
5278 ret = cnss_wlfw_send_host_wfc_call_status(plat_priv, cfg); in cnss_set_wfc_mode()
5320 struct cnss_plat_data *plat_priv = cnss_get_plat_priv(NULL); in cnss_tcdev_set_cur_state() local
5336 mutex_lock(&plat_priv->tcdev_lock); in cnss_tcdev_set_cur_state()
5337 ret = cnss_bus_set_therm_cdev_state(plat_priv, in cnss_tcdev_set_cur_state()
5342 mutex_unlock(&plat_priv->tcdev_lock); in cnss_tcdev_set_cur_state()
5476 struct cnss_plat_data *plat_priv; in cnss_probe() local
5499 plat_priv = devm_kzalloc(&plat_dev->dev, sizeof(*plat_priv), in cnss_probe()
5501 if (!plat_priv) { in cnss_probe()
5506 plat_priv->plat_dev = plat_dev; in cnss_probe()
5507 plat_priv->dev_node = NULL; in cnss_probe()
5508 plat_priv->device_id = device_id->driver_data; in cnss_probe()
5509 plat_priv->dt_type = cnss_dt_type(plat_priv); in cnss_probe()
5511 plat_priv->dt_type); in cnss_probe()
5513 plat_priv->use_fw_path_with_prefix = in cnss_probe()
5514 cnss_use_fw_path_with_prefix(plat_priv); in cnss_probe()
5516 ret = cnss_get_dev_cfg_node(plat_priv); in cnss_probe()
5522 cnss_initialize_mem_pool(plat_priv->device_id); in cnss_probe()
5524 ret = cnss_get_pld_bus_ops_name(plat_priv); in cnss_probe()
5529 ret = cnss_get_rc_num(plat_priv); in cnss_probe()
5534 cnss_pr_dbg("rc_num=%d\n", plat_priv->rc_num); in cnss_probe()
5536 plat_priv->bus_type = cnss_get_bus_type(plat_priv); in cnss_probe()
5537 plat_priv->use_nv_mac = cnss_use_nv_mac(plat_priv); in cnss_probe()
5538 cnss_set_plat_priv(plat_dev, plat_priv); in cnss_probe()
5539 cnss_set_device_name(plat_priv); in cnss_probe()
5540 platform_set_drvdata(plat_dev, plat_priv); in cnss_probe()
5541 INIT_LIST_HEAD(&plat_priv->vreg_list); in cnss_probe()
5542 INIT_LIST_HEAD(&plat_priv->clk_list); in cnss_probe()
5544 cnss_get_pm_domain_info(plat_priv); in cnss_probe()
5545 cnss_get_wlaon_pwr_ctrl_info(plat_priv); in cnss_probe()
5546 cnss_power_misc_params_init(plat_priv); in cnss_probe()
5547 cnss_get_tcs_info(plat_priv); in cnss_probe()
5548 cnss_get_cpr_info(plat_priv); in cnss_probe()
5549 cnss_aop_interface_init(plat_priv); in cnss_probe()
5550 cnss_init_control_params(plat_priv); in cnss_probe()
5552 ret = cnss_get_resources(plat_priv); in cnss_probe()
5556 ret = cnss_register_esoc(plat_priv); in cnss_probe()
5560 ret = cnss_register_bus_scale(plat_priv); in cnss_probe()
5564 ret = cnss_create_sysfs(plat_priv); in cnss_probe()
5568 ret = cnss_event_work_init(plat_priv); in cnss_probe()
5572 ret = cnss_dms_init(plat_priv); in cnss_probe()
5576 ret = cnss_debugfs_create(plat_priv); in cnss_probe()
5580 ret = cnss_misc_init(plat_priv); in cnss_probe()
5584 ret = cnss_wlan_hw_disable_check(plat_priv); in cnss_probe()
5591 if (!test_bit(CNSS_WLAN_HW_DISABLED, &plat_priv->driver_state)) { in cnss_probe()
5592 ret = cnss_wlan_device_init(plat_priv); in cnss_probe()
5598 cnss_register_coex_service(plat_priv); in cnss_probe()
5599 cnss_register_ims_service(plat_priv); in cnss_probe()
5601 mutex_init(&plat_priv->tcdev_lock); in cnss_probe()
5602 INIT_LIST_HEAD(&plat_priv->cnss_tcdev_list); in cnss_probe()
5609 cnss_misc_deinit(plat_priv); in cnss_probe()
5611 cnss_debugfs_destroy(plat_priv); in cnss_probe()
5613 cnss_dms_deinit(plat_priv); in cnss_probe()
5615 cnss_event_work_deinit(plat_priv); in cnss_probe()
5617 cnss_remove_sysfs(plat_priv); in cnss_probe()
5619 cnss_unregister_bus_scale(plat_priv); in cnss_probe()
5621 cnss_unregister_esoc(plat_priv); in cnss_probe()
5623 cnss_put_resources(plat_priv); in cnss_probe()
5625 cnss_aop_interface_deinit(plat_priv); in cnss_probe()
5629 cnss_clear_plat_priv(plat_priv); in cnss_probe()
5636 struct cnss_plat_data *plat_priv = platform_get_drvdata(plat_dev); in cnss_remove() local
5638 plat_priv->audio_iommu_domain = NULL; in cnss_remove()
5640 cnss_unregister_ims_service(plat_priv); in cnss_remove()
5641 cnss_unregister_coex_service(plat_priv); in cnss_remove()
5642 cnss_bus_deinit(plat_priv); in cnss_remove()
5643 cnss_misc_deinit(plat_priv); in cnss_remove()
5644 cnss_debugfs_destroy(plat_priv); in cnss_remove()
5645 cnss_dms_deinit(plat_priv); in cnss_remove()
5646 cnss_qmi_deinit(plat_priv); in cnss_remove()
5647 cnss_event_work_deinit(plat_priv); in cnss_remove()
5649 cnss_remove_sysfs(plat_priv); in cnss_remove()
5650 cnss_unregister_bus_scale(plat_priv); in cnss_remove()
5651 cnss_unregister_esoc(plat_priv); in cnss_remove()
5652 cnss_put_resources(plat_priv); in cnss_remove()
5653 cnss_aop_interface_deinit(plat_priv); in cnss_remove()
5656 cnss_clear_plat_priv(plat_priv); in cnss_remove()