Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Documentation: wmi: Improve and update alienware-wmi documentation

Use tables to describe method operations instead of using pseudo-code.
Drop unknown method descriptions to avoid redundancy. Drop GPIO section
as it is currently irrelevant to this driver. Update Thermal_Information
method documentation. Add one more helpful developer to the kudos section.

Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Link: https://lore.kernel.org/r/20250329-hwm-v7-10-a14ea39d8a94@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Kurt Borja and committed by
Ilpo Järvinen
a56d188a b028fb49

+117 -266
+117 -266
Documentation/wmi/devices/alienware-wmi.rst
··· 11 11 models. Throughout these models, two implementations have been identified. The 12 12 first one, used by older systems, deals with HDMI, brightness, RGB, amplifier 13 13 and deep sleep control. The second one used by newer systems deals primarily 14 - with thermal, overclocking, and GPIO control. 14 + with thermal control and overclocking. 15 15 16 16 It is suspected that the latter is used by Alienware Command Center (AWCC) to 17 17 manage manufacturer predefined thermal profiles. The alienware-wmi driver ··· 69 69 [WmiMethodId(164), Implemented, read, write, Description("Tobii Camera Power Off.")] void TobiiCameraPowerOff([out] uint32 argr); 70 70 }; 71 71 72 - Some of these methods get quite intricate so we will describe them using 73 - pseudo-code that vaguely resembles the original ASL code. 74 - 75 72 Methods not described in the following document have unknown behavior. 76 73 77 74 Argument Structure ··· 84 87 Thermal Methods 85 88 =============== 86 89 90 + WMI method GetFanSensors([in] uint32 arg2, [out] uint32 argr) 91 + ------------------------------------------------------------- 92 + 93 + +--------------------+------------------------------------+--------------------+ 94 + | Operation (Byte 0) | Description | Arguments | 95 + +====================+====================================+====================+ 96 + | 0x01 | Get the number of temperature | - Byte 1: Fan ID | 97 + | | sensors related with a fan ID | | 98 + +--------------------+------------------------------------+--------------------+ 99 + | 0x02 | Get the temperature sensor IDs | - Byte 1: Fan ID | 100 + | | related to a fan sensor ID | - Byte 2: Index | 101 + +--------------------+------------------------------------+--------------------+ 102 + 87 103 WMI method Thermal_Information([in] uint32 arg2, [out] uint32 argr) 88 104 ------------------------------------------------------------------- 89 105 90 - :: 91 - 92 - if BYTE_0(arg2) == 0x01: 93 - argr = 1 94 - 95 - if BYTE_0(arg2) == 0x02: 96 - argr = SYSTEM_DESCRIPTION 97 - 98 - if BYTE_0(arg2) == 0x03: 99 - if BYTE_1(arg2) == 0x00: 100 - argr = FAN_ID_0 101 - 102 - if BYTE_1(arg2) == 0x01: 103 - argr = FAN_ID_1 104 - 105 - if BYTE_1(arg2) == 0x02: 106 - argr = FAN_ID_2 107 - 108 - if BYTE_1(arg2) == 0x03: 109 - argr = FAN_ID_3 110 - 111 - if BYTE_1(arg2) == 0x04: 112 - argr = SENSOR_ID_CPU | 0x0100 113 - 114 - if BYTE_1(arg2) == 0x05: 115 - argr = SENSOR_ID_GPU | 0x0100 116 - 117 - if BYTE_1(arg2) == 0x06: 118 - argr = THERMAL_MODE_QUIET_ID 119 - 120 - if BYTE_1(arg2) == 0x07: 121 - argr = THERMAL_MODE_BALANCED_ID 122 - 123 - if BYTE_1(arg2) == 0x08: 124 - argr = THERMAL_MODE_BALANCED_PERFORMANCE_ID 125 - 126 - if BYTE_1(arg2) == 0x09: 127 - argr = THERMAL_MODE_PERFORMANCE_ID 128 - 129 - if BYTE_1(arg2) == 0x0A: 130 - argr = THERMAL_MODE_LOW_POWER_ID 131 - 132 - if BYTE_1(arg2) == 0x0B: 133 - argr = THERMAL_MODE_GMODE_ID 134 - 135 - else: 136 - argr = 0xFFFFFFFF 137 - 138 - if BYTE_0(arg2) == 0x04: 139 - if is_valid_sensor(BYTE_1(arg2)): 140 - argr = SENSOR_TEMP_C 141 - else: 142 - argr = 0xFFFFFFFF 143 - 144 - if BYTE_0(arg2) == 0x05: 145 - if is_valid_fan(BYTE_1(arg2)): 146 - argr = FAN_RPM() 147 - 148 - if BYTE_0(arg2) == 0x06: 149 - skip 150 - 151 - if BYTE_0(arg2) == 0x07: 152 - argr = 0 153 - 154 - If BYTE_0(arg2) == 0x08: 155 - if is_valid_fan(BYTE_1(arg2)): 156 - argr = 0 157 - else: 158 - argr = 0xFFFFFFFF 159 - 160 - if BYTE_0(arg2) == 0x09: 161 - if is_valid_fan(BYTE_1(arg2)): 162 - argr = FAN_UNKNOWN_STAT_0() 163 - 164 - else: 165 - argr = 0xFFFFFFFF 166 - 167 - if BYTE_0(arg2) == 0x0A: 168 - argr = THERMAL_MODE_BALANCED_ID 169 - 170 - if BYTE_0(arg2) == 0x0B: 171 - argr = CURRENT_THERMAL_MODE() 172 - 173 - if BYTE_0(arg2) == 0x0C: 174 - if is_valid_fan(BYTE_1(arg2)): 175 - argr = FAN_UNKNOWN_STAT_1() 176 - else: 177 - argr = 0xFFFFFFFF 178 - 179 - Operation 0x02 returns a *system description* buffer with the following 180 - structure: 181 - 182 - :: 183 - 184 - out[0] -> Number of fans 185 - out[1] -> Number of sensors 186 - out[2] -> 0x00 187 - out[3] -> Number of thermal modes 188 - 189 - Operation 0x03 list all available fan IDs, sensor IDs and thermal profile 190 - codes in order, but different models may have different number of fans and 191 - thermal profiles. These are the known ranges: 192 - 193 - * Fan IDs: from 2 up to 4 194 - * Sensor IDs: 2 195 - * Thermal profile codes: from 1 up to 7 196 - 197 - In total BYTE_1(ARG2) may range from 0x5 up to 0xD depending on the model. 106 + +--------------------+------------------------------------+--------------------+ 107 + | Operation (Byte 0) | Description | Arguments | 108 + +====================+====================================+====================+ 109 + | 0x01 | Unknown. | - None | 110 + +--------------------+------------------------------------+--------------------+ 111 + | 0x02 | Get system description number with | - None | 112 + | | the following structure: | | 113 + | | | | 114 + | | - Byte 0: Number of fans | | 115 + | | - Byte 1: Number of temperature | | 116 + | | sensors | | 117 + | | - Byte 2: Unknown | | 118 + | | - Byte 3: Number of thermal | | 119 + | | profiles | | 120 + +--------------------+------------------------------------+--------------------+ 121 + | 0x03 | List an ID or resource at a given | - Byte 1: Index | 122 + | | index. Fan IDs, temperature IDs, | | 123 + | | unknown IDs and thermal profile | | 124 + | | IDs are listed in that exact | | 125 + | | order. | | 126 + | | | | 127 + | | Operation 0x02 is used to know | | 128 + | | which indexes map to which | | 129 + | | resources. | | 130 + | | | | 131 + | | **Returns:** ID at a given index | | 132 + +--------------------+------------------------------------+--------------------+ 133 + | 0x04 | Get the current temperature for a | - Byte 1: Sensor | 134 + | | given temperature sensor. | ID | 135 + +--------------------+------------------------------------+--------------------+ 136 + | 0x05 | Get the current RPM for a given | - Byte 1: Fan ID | 137 + | | fan. | | 138 + +--------------------+------------------------------------+--------------------+ 139 + | 0x06 | Get fan speed percentage. (not | - Byte 1: Fan ID | 140 + | | implemented in every model) | | 141 + +--------------------+------------------------------------+--------------------+ 142 + | 0x07 | Unknown. | - Unknown | 143 + +--------------------+------------------------------------+--------------------+ 144 + | 0x08 | Get minimum RPM for a given FAN | - Byte 1: Fan ID | 145 + | | ID. | | 146 + +--------------------+------------------------------------+--------------------+ 147 + | 0x09 | Get maximum RPM for a given FAN | - Byte 1: Fan ID | 148 + | | ID. | | 149 + +--------------------+------------------------------------+--------------------+ 150 + | 0x0A | Get balanced thermal profile ID. | - None | 151 + +--------------------+------------------------------------+--------------------+ 152 + | 0x0B | Get current thermal profile ID. | - None | 153 + +--------------------+------------------------------------+--------------------+ 154 + | 0x0C | Get current `boost` value for a | - Byte 1: Fan ID | 155 + | | given fan ID. | | 156 + +--------------------+------------------------------------+--------------------+ 198 157 199 158 WMI method Thermal_Control([in] uint32 arg2, [out] uint32 argr) 200 159 --------------------------------------------------------------- 201 160 202 - :: 203 - 204 - if BYTE_0(arg2) == 0x01: 205 - if is_valid_thermal_profile(BYTE_1(arg2)): 206 - SET_THERMAL_PROFILE(BYTE_1(arg2)) 207 - argr = 0 208 - 209 - if BYTE_0(arg2) == 0x02: 210 - if is_valid_fan(BYTE_1(arg2)): 211 - SET_FAN_SPEED_MULTIPLIER(BYTE_2(arg2)) 212 - argr = 0 213 - else: 214 - argr = 0xFFFFFFFF 215 - 216 - .. note:: 217 - While you can manually change the fan speed multiplier with this method, 218 - Dell's BIOS tends to overwrite this changes anyway. 161 + +--------------------+------------------------------------+--------------------+ 162 + | Operation (Byte 0) | Description | Arguments | 163 + +====================+====================================+====================+ 164 + | 0x01 | Activate a given thermal profile. | - Byte 1: Thermal | 165 + | | | profile ID | 166 + +--------------------+------------------------------------+--------------------+ 167 + | 0x02 | Set a `boost` value for a given | - Byte 1: Fan ID | 168 + | | fan ID. | - Byte 2: Boost | 169 + +--------------------+------------------------------------+--------------------+ 219 170 220 171 These are the known thermal profile codes: 221 172 222 - :: 173 + +------------------------------+----------+------+ 174 + | Thermal Profile | Type | ID | 175 + +==============================+==========+======+ 176 + | Custom | Special | 0x00 | 177 + +------------------------------+----------+------+ 178 + | G-Mode | Special | 0xAB | 179 + +------------------------------+----------+------+ 180 + | Quiet | Legacy | 0x96 | 181 + +------------------------------+----------+------+ 182 + | Balanced | Legacy | 0x97 | 183 + +------------------------------+----------+------+ 184 + | Balanced Performance | Legacy | 0x98 | 185 + +------------------------------+----------+------+ 186 + | Performance | Legacy | 0x99 | 187 + +------------------------------+----------+------+ 188 + | Balanced | USTT | 0xA0 | 189 + +------------------------------+----------+------+ 190 + | Balanced Performance | USTT | 0xA1 | 191 + +------------------------------+----------+------+ 192 + | Cool | USTT | 0xA2 | 193 + +------------------------------+----------+------+ 194 + | Quiet | USTT | 0xA3 | 195 + +------------------------------+----------+------+ 196 + | Performance | USTT | 0xA4 | 197 + +------------------------------+----------+------+ 198 + | Low Power | USTT | 0xA5 | 199 + +------------------------------+----------+------+ 223 200 224 - CUSTOM 0x00 201 + If a model supports the User Selectable Thermal Tables (USTT) profiles, it will 202 + not support the Legacy profiles and vice-versa. 225 203 226 - BALANCED_USTT 0xA0 227 - BALANCED_PERFORMANCE_USTT 0xA1 228 - COOL_USTT 0xA2 229 - QUIET_USTT 0xA3 230 - PERFORMANCE_USTT 0xA4 231 - LOW_POWER_USTT 0xA5 232 - 233 - QUIET 0x96 234 - BALANCED 0x97 235 - BALANCED_PERFORMANCE 0x98 236 - PERFORMANCE 0x99 237 - 238 - GMODE 0xAB 239 - 240 - Usually if a model doesn't support the first four profiles they will support 241 - the User Selectable Thermal Tables (USTT) profiles and vice-versa. 242 - 243 - GMODE replaces PERFORMANCE in G-Series laptops. 204 + Every model supports the CUSTOM (0x00) thermal profile. GMODE replaces 205 + PERFORMANCE in G-Series laptops. 244 206 245 207 WMI method GameShiftStatus([in] uint32 arg2, [out] uint32 argr) 246 208 --------------------------------------------------------------- 247 209 248 - :: 249 - 250 - if BYTE_0(arg2) == 0x1: 251 - TOGGLE_GAME_SHIFT() 252 - argr = GET_GAME_SHIFT_STATUS() 253 - 254 - if BYTE_0(arg2) == 0x2: 255 - argr = GET_GAME_SHIFT_STATUS() 210 + +--------------------+------------------------------------+--------------------+ 211 + | Operation (Byte 0) | Description | Arguments | 212 + +====================+====================================+====================+ 213 + | 0x01 | Toggle *Game Shift*. | - None | 214 + +--------------------+------------------------------------+--------------------+ 215 + | 0x02 | Get *Game Shift* status. | - None | 216 + +--------------------+------------------------------------+--------------------+ 256 217 257 218 Game Shift Status does not change the fan speed profile but it could be some 258 219 sort of CPU/GPU power profile. Benchmarks have not been done. ··· 222 267 G-key on Dell's G-Series laptops also changes Game Shift status, so both are 223 268 directly related. 224 269 225 - WMI method GetFanSensors([in] uint32 arg2, [out] uint32 argr) 226 - ------------------------------------------------------------- 227 - 228 - :: 229 - 230 - if BYTE_0(arg2) == 0x1: 231 - if is_valid_fan(BYTE_1(arg2)): 232 - argr = 1 233 - else: 234 - argr = 0 235 - 236 - if BYTE_0(arg2) == 0x2: 237 - if is_valid_fan(BYTE_1(arg2)): 238 - if BYTE_2(arg2) == 0: 239 - argr == SENSOR_ID 240 - else 241 - argr == 0xFFFFFFFF 242 - else: 243 - argr = 0 244 - 245 270 Overclocking Methods 246 271 ==================== 247 - 248 - .. warning:: 249 - These methods have not been tested and are only partially reverse 250 - engineered. 251 - 252 - WMI method Return_OverclockingReport([out] uint32 argr) 253 - ------------------------------------------------------- 254 - 255 - :: 256 - 257 - CSMI (0xE3, 0x99) 258 - argr = 0 259 - 260 - CSMI is an unknown operation. 261 - 262 - WMI method Set_OCUIBIOSControl([in] uint32 arg2, [out] uint32 argr) 263 - ------------------------------------------------------------------- 264 - 265 - :: 266 - 267 - CSMI (0xE3, 0x99) 268 - argr = 0 269 - 270 - CSMI is an unknown operation. 271 - 272 - WMI method Clear_OCFailSafeFlag([out] uint32 argr) 273 - -------------------------------------------------- 274 - 275 - :: 276 - 277 - CSMI (0xE3, 0x99) 278 - argr = 0 279 - 280 - CSMI is an unknown operation. 281 - 282 272 283 273 WMI method MemoryOCControl([in] uint32 arg2, [out] uint32 argr) 284 274 --------------------------------------------------------------- ··· 231 331 AWCC supports memory overclocking, but this method is very intricate and has 232 332 not been deciphered yet. 233 333 234 - GPIO methods 235 - ============ 236 - 237 - These methods are probably related to some kind of firmware update system, 238 - through a GPIO device. 239 - 240 - .. warning:: 241 - These methods have not been tested and are only partially reverse 242 - engineered. 243 - 244 - WMI method FWUpdateGPIOtoggle([in] uint32 arg2, [out] uint32 argr) 245 - ------------------------------------------------------------------ 246 - 247 - :: 248 - 249 - if BYTE_0(arg2) == 0: 250 - if BYTE_1(arg2) == 1: 251 - SET_PIN_A_HIGH() 252 - else: 253 - SET_PIN_A_LOW() 254 - 255 - if BYTE_0(arg2) == 1: 256 - if BYTE_1(arg2) == 1: 257 - SET_PIN_B_HIGH() 258 - 259 - else: 260 - SET_PIN_B_LOW() 261 - 262 - else: 263 - argr = 1 264 - 265 - WMI method ReadTotalofGPIOs([out] uint32 argr) 266 - ---------------------------------------------- 267 - 268 - :: 269 - 270 - argr = 0x02 271 - 272 - WMI method ReadGPIOpPinStatus([in] uint32 arg2, [out] uint32 argr) 273 - ------------------------------------------------------------------ 274 - 275 - :: 276 - 277 - if BYTE_0(arg2) == 0: 278 - argr = PIN_A_STATUS 279 - 280 - if BYTE_0(arg2) == 1: 281 - argr = PIN_B_STATUS 282 - 283 334 Other information Methods 284 335 ========================= 285 336 286 337 WMI method ReadChassisColor([out] uint32 argr) 287 338 ---------------------------------------------- 288 339 289 - :: 290 - 291 - argr = CHASSIS_COLOR_ID 340 + Returns the chassis color internal ID. 292 341 293 342 Acknowledgements 294 343 ================ 295 344 296 - Kudos to `AlexIII <https://github.com/AlexIII/tcc-g15>`_ for documenting 297 - and testing available thermal profile codes. 345 + Kudos to `AlexIII <https://github.com/AlexIII/tcc-g15>`_ and 346 + `T-Troll <https://github.com/T-Troll/alienfx-tools/>`_ for documenting and 347 + testing some of this device's functionality, making it possible to generalize 348 + this driver.