Skip to content

Commit 60ac65a

Browse files
Sung-Chi Ligroeck
authored andcommitted
platform/chrome: update pwm fan control host commands
Update cros_ec_commands.h to include definitions for getting PWM fan duty, getting and setting the fan control mode. Signed-off-by: Sung-Chi Li <lschyi@chromium.org> Acked-by: Tzung-Bi Shih <tzungbi@kernel.org> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20250911-cros_ec_fan-v6-1-a1446cc098af@google.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 443b39c commit 60ac65a

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

include/linux/platform_data/cros_ec_commands.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1825,6 +1825,16 @@ struct ec_response_pwm_get_duty {
18251825
uint16_t duty; /* Duty cycle, EC_PWM_MAX_DUTY = 100% */
18261826
} __ec_align2;
18271827

1828+
#define EC_CMD_PWM_GET_FAN_DUTY 0x0027
1829+
1830+
struct ec_params_pwm_get_fan_duty {
1831+
uint8_t fan_idx;
1832+
} __ec_align1;
1833+
1834+
struct ec_response_pwm_get_fan_duty {
1835+
uint32_t percent; /* Percentage of duty cycle, ranging from 0 ~ 100 */
1836+
} __ec_align4;
1837+
18281838
/*****************************************************************************/
18291839
/*
18301840
* Lightbar commands. This looks worse than it is. Since we only use one HOST
@@ -3127,14 +3137,31 @@ struct ec_params_thermal_set_threshold_v1 {
31273137

31283138
/****************************************************************************/
31293139

3130-
/* Toggle automatic fan control */
3140+
/* Set or get fan control mode */
31313141
#define EC_CMD_THERMAL_AUTO_FAN_CTRL 0x0052
31323142

3143+
enum ec_auto_fan_ctrl_cmd {
3144+
EC_AUTO_FAN_CONTROL_CMD_SET = 0,
3145+
EC_AUTO_FAN_CONTROL_CMD_GET,
3146+
};
3147+
31333148
/* Version 1 of input params */
31343149
struct ec_params_auto_fan_ctrl_v1 {
31353150
uint8_t fan_idx;
31363151
} __ec_align1;
31373152

3153+
/* Version 2 of input params */
3154+
struct ec_params_auto_fan_ctrl_v2 {
3155+
uint8_t fan_idx;
3156+
uint8_t cmd; /* enum ec_auto_fan_ctrl_cmd */
3157+
uint8_t set_auto; /* only used with EC_AUTO_FAN_CONTROL_CMD_SET - bool
3158+
*/
3159+
} __ec_align4;
3160+
3161+
struct ec_response_auto_fan_control {
3162+
uint8_t is_auto; /* bool */
3163+
} __ec_align1;
3164+
31383165
/* Get/Set TMP006 calibration data */
31393166
#define EC_CMD_TMP006_GET_CALIBRATION 0x0053
31403167
#define EC_CMD_TMP006_SET_CALIBRATION 0x0054

0 commit comments

Comments
 (0)