Update cros_ec_commands.h to include definitions for getting PWM fan duty, getting and setting the fan control mode.
Showing the changes to include/linux/platform_data (1 of 1 file). Show all
Unified · Split
| @@ -1825,6 +1825,16 @@ struct ec_response_pwm_get_duty { · 1824 unmodified lines | ||
| 1825 | 1825 | uint16_t duty; /* Duty cycle, EC_PWM_MAX_DUTY = 100% */ |
| 1826 | 1826 | } __ec_align2; |
| 1827 | 1827 | |
| 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 | + | |
| 1828 | 1838 | /*****************************************************************************/ |
| 1829 | 1839 | /* |
| 1830 | 1840 | * 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 | 3141 | #define EC_CMD_THERMAL_AUTO_FAN_CTRL 0x0052 |
| 3132 | 3142 | |
| 3143 | +enum ec_auto_fan_ctrl_cmd { | |
| 3144 | + EC_AUTO_FAN_CONTROL_CMD_SET = 0, | |
| 3145 | + EC_AUTO_FAN_CONTROL_CMD_GET, | |
| 3146 | +}; | |
| 3147 | + | |
| 3133 | 3148 | /* Version 1 of input params */ |
| 3134 | 3149 | struct ec_params_auto_fan_ctrl_v1 { |
| 3135 | 3150 | uint8_t fan_idx; |
| 3136 | 3151 | } __ec_align1; |
| 3137 | 3152 | |
| 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 | + | |
| 3138 | 3165 | /* Get/Set TMP006 calibration data */ |
| 3139 | 3166 | #define EC_CMD_TMP006_GET_CALIBRATION 0x0053 |
| 3140 | 3167 | #define EC_CMD_TMP006_SET_CALIBRATION 0x0054 |