History

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.

Sung-Chi Li committed 1 year ago

Commit 60ac65a1 parent 443b39c1 file · +28 −1Browse files

Showing the changes to include/linux/platform_data (1 of 1 file). Show all

Unified · Split

include/linux/platform_data/cros_ec_commands.h+28−1
@@ -1825,6 +1825,16 @@ struct ec_response_pwm_get_duty { · 1824 unmodified lines
1825 uint16_t duty; /* Duty cycle, EC_PWM_MAX_DUTY = 100% */1825 uint16_t duty; /* Duty cycle, EC_PWM_MAX_DUTY = 100% */
1826} __ec_align2;1826} __ec_align2;
1827 1827
1828#define EC_CMD_PWM_GET_FAN_DUTY 0x0027
1829
1830struct ec_params_pwm_get_fan_duty {
1831 uint8_t fan_idx;
1832} __ec_align1;
1833
1834struct ec_response_pwm_get_fan_duty {
1835 uint32_t percent; /* Percentage of duty cycle, ranging from 0 ~ 100 */
1836} __ec_align4;
1837
1828/*****************************************************************************/1838/*****************************************************************************/
1829/*1839/*
1830 * Lightbar commands. This looks worse than it is. Since we only use one HOST1840 * 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 { · 1296 unmodified lines
3127 3137
3128/****************************************************************************/3138/****************************************************************************/
3129 3139
3130/* Toggle automatic fan control */3140/* Set or get fan control mode */
3131#define EC_CMD_THERMAL_AUTO_FAN_CTRL 0x00523141#define EC_CMD_THERMAL_AUTO_FAN_CTRL 0x0052
3132 3142
3143enum ec_auto_fan_ctrl_cmd {
3144 EC_AUTO_FAN_CONTROL_CMD_SET = 0,
3145 EC_AUTO_FAN_CONTROL_CMD_GET,
3146};
3147
3133/* Version 1 of input params */3148/* Version 1 of input params */
3134struct ec_params_auto_fan_ctrl_v1 {3149struct ec_params_auto_fan_ctrl_v1 {
3135 uint8_t fan_idx;3150 uint8_t fan_idx;
3136} __ec_align1;3151} __ec_align1;
3137 3152
3153/* Version 2 of input params */
3154struct 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
3161struct ec_response_auto_fan_control {
3162 uint8_t is_auto; /* bool */
3163} __ec_align1;
3164
3138/* Get/Set TMP006 calibration data */3165/* Get/Set TMP006 calibration data */
3139#define EC_CMD_TMP006_GET_CALIBRATION 0x00533166#define EC_CMD_TMP006_GET_CALIBRATION 0x0053
3140#define EC_CMD_TMP006_SET_CALIBRATION 0x00543167#define EC_CMD_TMP006_SET_CALIBRATION 0x0054