Lines Matching +full:dual +full:- +full:radio
1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
3 * Copyright (C) 2024-2025 Intel Corporation
24 const struct ct_kill_notif *notif = (const void *)pkt->data; in iwl_mld_handle_ct_kill_notif()
27 "CT Kill notification: temp = %d, DTS = 0x%x, Scheme 0x%x - Enter CT Kill\n", in iwl_mld_handle_ct_kill_notif()
28 le16_to_cpu(notif->temperature), notif->dts, in iwl_mld_handle_ct_kill_notif()
29 notif->scheme); in iwl_mld_handle_ct_kill_notif()
33 wiphy_delayed_work_queue(mld->wiphy, &mld->ct_kill_exit_wk, in iwl_mld_handle_ct_kill_notif()
50 (const void *)pkt->data; in iwl_mld_handle_temp_notif()
54 temp = le32_to_cpu(notif->temp); in iwl_mld_handle_temp_notif()
60 ths_crossed = le32_to_cpu(notif->threshold_idx); in iwl_mld_handle_temp_notif()
76 if (mld->tzone) in iwl_mld_handle_temp_notif()
77 thermal_zone_device_update(mld->tzone, THERMAL_TRIP_VIOLATED); in iwl_mld_handle_temp_notif()
91 lockdep_assert_wiphy(mld->wiphy); in iwl_mld_get_temp()
104 ret = -EIO; in iwl_mld_get_temp()
108 resp = (const void *)cmd.resp_pkt->data; in iwl_mld_get_temp()
109 *temp = le32_to_cpu(resp->temp); in iwl_mld_get_temp()
122 return ((s16)le16_to_cpu(*(const __le16 *)a) - in compare_temps()
135 if (trip->temperature == THERMAL_TEMP_INVALID) in iwl_trip_temp_iter()
138 twd->thresholds[twd->count++] = in iwl_trip_temp_iter()
139 cpu_to_le16((s16)(trip->temperature / 1000)); in iwl_trip_temp_iter()
154 if (!mld->tzone) in iwl_mld_config_temp_report_ths()
163 for_each_thermal_trip(mld->tzone, iwl_trip_temp_iter, &twd); in iwl_mld_config_temp_report_ths()
172 lockdep_assert_wiphy(mld->wiphy); in iwl_mld_config_temp_report_ths()
192 wiphy_lock(mld->wiphy); in iwl_mld_tzone_get_temp()
194 if (!mld->fw_status.running) { in iwl_mld_tzone_get_temp()
208 wiphy_unlock(mld->wiphy); in iwl_mld_tzone_get_temp()
219 wiphy_lock(mld->wiphy); in iwl_mld_tzone_set_trip_temp()
221 if (!mld->fw_status.running) { in iwl_mld_tzone_set_trip_temp()
222 ret = -EIO; in iwl_mld_tzone_set_trip_temp()
227 ret = -EINVAL; in iwl_mld_tzone_set_trip_temp()
233 wiphy_unlock(mld->wiphy); in iwl_mld_tzone_set_trip_temp()
248 [0 ... IWL_MAX_DTS_TRIPS - 1] = { in iwl_mld_thermal_zone_register()
258 mld->tzone = in iwl_mld_thermal_zone_register()
263 if (IS_ERR(mld->tzone)) { in iwl_mld_thermal_zone_register()
266 PTR_ERR(mld->tzone)); in iwl_mld_thermal_zone_register()
267 mld->tzone = NULL; in iwl_mld_thermal_zone_register()
271 ret = thermal_zone_device_enable(mld->tzone); in iwl_mld_thermal_zone_register()
274 thermal_zone_device_unregister(mld->tzone); in iwl_mld_thermal_zone_register()
288 lockdep_assert_wiphy(mld->wiphy); in iwl_mld_config_ctdp()
293 budget = ((mld->power_budget_mw - IWL_MLD_MIN_CTDP_BUDGET_MW) * in iwl_mld_config_ctdp()
294 (IWL_MLD_NUM_CTDP_STEPS - 1 - state)) / in iwl_mld_config_ctdp()
295 (IWL_MLD_NUM_CTDP_STEPS - 1) + in iwl_mld_config_ctdp()
308 mld->cooling_dev.cur_state = state; in iwl_mld_config_ctdp()
316 *state = IWL_MLD_NUM_CTDP_STEPS - 1; in iwl_mld_tcool_get_max_state()
324 struct iwl_mld *mld = (struct iwl_mld *)(cdev->devdata); in iwl_mld_tcool_get_cur_state()
326 *state = mld->cooling_dev.cur_state; in iwl_mld_tcool_get_cur_state()
334 struct iwl_mld *mld = (struct iwl_mld *)(cdev->devdata); in iwl_mld_tcool_set_cur_state()
337 wiphy_lock(mld->wiphy); in iwl_mld_tcool_set_cur_state()
339 if (!mld->fw_status.running) { in iwl_mld_tcool_set_cur_state()
340 ret = -EIO; in iwl_mld_tcool_set_cur_state()
345 ret = -EINVAL; in iwl_mld_tcool_set_cur_state()
352 wiphy_unlock(mld->wiphy); in iwl_mld_tcool_set_cur_state()
368 mld->cooling_dev.cdev = in iwl_mld_cooling_device_register()
373 if (IS_ERR(mld->cooling_dev.cdev)) { in iwl_mld_cooling_device_register()
376 PTR_ERR(mld->cooling_dev.cdev)); in iwl_mld_cooling_device_register()
377 mld->cooling_dev.cdev = NULL; in iwl_mld_cooling_device_register()
384 if (!mld->tzone) in iwl_mld_thermal_zone_unregister()
388 if (mld->tzone) { in iwl_mld_thermal_zone_unregister()
389 thermal_zone_device_unregister(mld->tzone); in iwl_mld_thermal_zone_unregister()
390 mld->tzone = NULL; in iwl_mld_thermal_zone_unregister()
396 if (!mld->cooling_dev.cdev) in iwl_mld_cooling_device_unregister()
400 if (mld->cooling_dev.cdev) { in iwl_mld_cooling_device_unregister()
401 thermal_cooling_device_unregister(mld->cooling_dev.cdev); in iwl_mld_cooling_device_unregister()
402 mld->cooling_dev.cdev = NULL; in iwl_mld_cooling_device_unregister()
412 switch (CSR_HW_RFID_TYPE(mld->trans->info.hw_rf_id)) { in iwl_mld_ctdp_get_max_budget()
414 /* dual-radio devices have a higher budget */ in iwl_mld_ctdp_get_max_budget()
415 if (CSR_HW_RFID_IS_CDB(mld->trans->info.hw_rf_id)) in iwl_mld_ctdp_get_max_budget()
430 iwl_bios_get_pwr_limit(&mld->fwrt, &bios_power_budget); in iwl_mld_ctdp_get_max_budget()
444 lockdep_assert_not_held(&mld->wiphy->mtx); in iwl_mld_thermal_initialize()
446 wiphy_delayed_work_init(&mld->ct_kill_exit_wk, iwl_mld_exit_ctkill); in iwl_mld_thermal_initialize()
448 mld->power_budget_mw = iwl_mld_ctdp_get_max_budget(mld); in iwl_mld_thermal_initialize()
449 IWL_DEBUG_TEMP(mld, "cTDP power budget: %d mW\n", mld->power_budget_mw); in iwl_mld_thermal_initialize()
459 wiphy_lock(mld->wiphy); in iwl_mld_thermal_exit()
460 wiphy_delayed_work_cancel(mld->wiphy, &mld->ct_kill_exit_wk); in iwl_mld_thermal_exit()
461 wiphy_unlock(mld->wiphy); in iwl_mld_thermal_exit()