From 49ea182ae38ff522a6fa114ced12d88414717189 Mon Sep 17 00:00:00 2001 From: Arun Kumar Khandavalli Date: Tue, 11 Aug 2020 17:46:16 +0530 Subject: [PATCH] qcacmn: Add thermal mitigation support for moselle For older targets thermal mitigation is supported for the apps. In moselle there is a new processor wpps on which firmware runs, this commit adds the support for the thermal client wpps. Change-Id: Ia212cd08c000ab11d4079cc701634dd919447ae9 CRs-Fixed: 2757932 --- wmi/inc/wmi_unified_param.h | 5 +++++ wmi/src/wmi_unified_tlv.c | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 3a8468ed0855..ba30b3a29ebf 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -2893,6 +2893,8 @@ typedef struct { * @dc: DC * @dc_per_event: DC per event * @num_thermal_conf: Number of thermal configurations to be sent + * @client_id: Thermal client id either apps or wpps + * @priority: Priority of apps/wpps * @tt_level_config: TT level config params */ struct thermal_mitigation_params { @@ -2901,6 +2903,8 @@ struct thermal_mitigation_params { uint32_t dc; uint32_t dc_per_event; uint8_t num_thermal_conf; + uint8_t client_id; + uint8_t priority; tt_level_config levelconf[THERMAL_LEVELS]; }; @@ -5221,6 +5225,7 @@ typedef enum { wmi_service_cfr_ta_ra_as_fp_support, wmi_service_cfr_capture_count_support, wmi_service_ll_stats_per_chan_rx_tx_time, + wmi_service_thermal_multi_client_support, wmi_services_max, } wmi_conv_service_ids; #define WMI_SERVICE_UNAVAILABLE 0xFFFF diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index a5b7e69caf20..150458e7c3e7 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -6754,6 +6754,22 @@ extract_pdev_sscan_fft_bin_index_tlv( } #endif /* WLAN_CONV_SPECTRAL_ENABLE */ +#ifdef FEATURE_WPSS_THERMAL_MITIGATION +static inline void +wmi_fill_client_id_priority(wmi_therm_throt_config_request_fixed_param *tt_conf, + struct thermal_mitigation_params *param) +{ + tt_conf->client_id = param->client_id; + tt_conf->priority = param->priority; +} +#else +static inline void +wmi_fill_client_id_priority(wmi_therm_throt_config_request_fixed_param *tt_conf, + struct thermal_mitigation_params *param) +{ +} +#endif + /** * send_thermal_mitigation_param_cmd_tlv() - configure thermal mitigation params * @param wmi_handle : handle to WMI. @@ -6795,7 +6811,7 @@ static QDF_STATUS send_thermal_mitigation_param_cmd_tlv( tt_conf->dc = param->dc; tt_conf->dc_per_event = param->dc_per_event; tt_conf->therm_throt_levels = param->num_thermal_conf; - + wmi_fill_client_id_priority(tt_conf, param); buf_ptr = (uint8_t *) ++tt_conf; /* init TLV params */ WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, @@ -14756,6 +14772,8 @@ static void populate_tlv_service(uint32_t *wmi_service) WMI_SERVICE_CFR_CAPTURE_COUNT_SUPPORT; wmi_service[wmi_service_ll_stats_per_chan_rx_tx_time] = WMI_SERVICE_LL_STATS_PER_CHAN_RX_TX_TIME_SUPPORT; + wmi_service[wmi_service_thermal_multi_client_support] = + WMI_SERVICE_THERMAL_MULTI_CLIENT_SUPPORT; } /**