1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (C) 2012-2014, 2019-2020 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
7 #ifndef __iwl_fw_api_phy_h__
8 #define __iwl_fw_api_phy_h__
11 * enum iwl_phy_ops_subcmd_ids - PHY group commands
13 enum iwl_phy_ops_subcmd_ids
{
15 * @CMD_DTS_MEASUREMENT_TRIGGER_WIDE:
16 * Uses either &struct iwl_dts_measurement_cmd or
17 * &struct iwl_ext_dts_measurement_cmd
19 CMD_DTS_MEASUREMENT_TRIGGER_WIDE
= 0x0,
22 * @CTDP_CONFIG_CMD: &struct iwl_mvm_ctdp_cmd
24 CTDP_CONFIG_CMD
= 0x03,
27 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
29 TEMP_REPORTING_THRESHOLDS_CMD
= 0x04,
32 * @GEO_TX_POWER_LIMIT: &struct iwl_geo_tx_power_profiles_cmd
34 GEO_TX_POWER_LIMIT
= 0x05,
37 * @PER_PLATFORM_ANT_GAIN_CMD: &struct iwl_ppag_table_cmd
39 PER_PLATFORM_ANT_GAIN_CMD
= 0x07,
42 * @CT_KILL_NOTIFICATION: &struct ct_kill_notif
44 CT_KILL_NOTIFICATION
= 0xFE,
47 * @DTS_MEASUREMENT_NOTIF_WIDE:
48 * &struct iwl_dts_measurement_notif_v1 or
49 * &struct iwl_dts_measurement_notif_v2
51 DTS_MEASUREMENT_NOTIF_WIDE
= 0xFF,
54 /* DTS measurements */
56 enum iwl_dts_measurement_flags
{
57 DTS_TRIGGER_CMD_FLAGS_TEMP
= BIT(0),
58 DTS_TRIGGER_CMD_FLAGS_VOLT
= BIT(1),
62 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
64 * @flags: indicates which measurements we want as specified in
65 * &enum iwl_dts_measurement_flags
67 struct iwl_dts_measurement_cmd
{
69 } __packed
; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
72 * enum iwl_dts_control_measurement_mode - DTS measurement type
73 * @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
74 * back (latest value. Not waiting for new value). Use automatic
75 * SW DTS configuration.
76 * @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
77 * trigger DTS reading and provide read back temperature read
79 * @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
80 * @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
81 * without measurement trigger.
83 enum iwl_dts_control_measurement_mode
{
87 DTS_DIRECT_WITHOUT_MEASURE
= 3,
91 * enum iwl_dts_used - DTS to use or used for measurement in the DTS request
93 * @DTS_USE_CHAIN_A: chain A
94 * @DTS_USE_CHAIN_B: chain B
95 * @DTS_USE_CHAIN_C: chain C
96 * @XTAL_TEMPERATURE: read temperature from xtal
103 XTAL_TEMPERATURE
= 4,
107 * enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
108 * @DTS_BIT6_MODE: bit 6 mode
109 * @DTS_BIT8_MODE: bit 8 mode
111 enum iwl_dts_bit_mode
{
117 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
118 * @control_mode: see &enum iwl_dts_control_measurement_mode
119 * @temperature: used when over write DTS mode is selected
120 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
121 * @avg_factor: average factor to DTS in request DTS read mode
122 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
123 * @step_duration: step duration for the DTS
125 struct iwl_ext_dts_measurement_cmd
{
131 __le32 step_duration
;
132 } __packed
; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
135 * struct iwl_dts_measurement_notif_v1 - measurements notification
137 * @temp: the measured temperature
138 * @voltage: the measured voltage
140 struct iwl_dts_measurement_notif_v1
{
143 } __packed
; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
146 * struct iwl_dts_measurement_notif_v2 - measurements notification
148 * @temp: the measured temperature
149 * @voltage: the measured voltage
150 * @threshold_idx: the trip index that was crossed
152 struct iwl_dts_measurement_notif_v2
{
155 __le32 threshold_idx
;
156 } __packed
; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
159 * struct iwl_dts_measurement_resp - measurements response
161 * @temp: the measured temperature
163 struct iwl_dts_measurement_resp
{
165 } __packed
; /* CMD_DTS_MEASUREMENT_RSP_API_S_VER_1 */
168 * struct ct_kill_notif - CT-kill entry notification
170 * @temperature: the current temperature in celsius
171 * @reserved: reserved
173 struct ct_kill_notif
{
176 } __packed
; /* GRP_PHY_CT_KILL_NTF */
179 * enum ctdp_cmd_operation - CTDP command operations
180 * @CTDP_CMD_OPERATION_START: update the current budget
181 * @CTDP_CMD_OPERATION_STOP: stop ctdp
182 * @CTDP_CMD_OPERATION_REPORT: get the average budget
184 enum iwl_mvm_ctdp_cmd_operation
{
185 CTDP_CMD_OPERATION_START
= 0x1,
186 CTDP_CMD_OPERATION_STOP
= 0x2,
187 CTDP_CMD_OPERATION_REPORT
= 0x4,
188 };/* CTDP_CMD_OPERATION_TYPE_E */
191 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
193 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
194 * @budget: the budget in milliwatt
195 * @window_size: defined in API but not used
197 struct iwl_mvm_ctdp_cmd
{
203 #define IWL_MAX_DTS_TRIPS 8
206 * struct temp_report_ths_cmd - set temperature thresholds
208 * @num_temps: number of temperature thresholds passed
209 * @thresholds: array with the thresholds to be configured
211 struct temp_report_ths_cmd
{
213 __le16 thresholds
[IWL_MAX_DTS_TRIPS
];
214 } __packed
; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
216 #endif /* __iwl_fw_api_phy_h__ */