mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 10:25:20 +00:00
EC_LPC_COMMAND_PWM_GET_FAN_RPM return target RPM
Actual RPM is now read from LPC mapped space. Modify this command to return target RPM so we can verify EC receives target RPM. Signed-off-by: Vic Yang <victoryang@chromium.org> BUG=chrome-os-partner:8238 TEST=Get the same value after setting target RPM. Change-Id: I9bcc9edd327cec1311b51fd0fcbc4a43b353daff
This commit is contained in:
@@ -63,6 +63,12 @@ int pwm_get_fan_rpm(void)
|
||||
}
|
||||
|
||||
|
||||
int pwm_get_fan_target_rpm(void)
|
||||
{
|
||||
return (LM4_FAN_FANCMD(FAN_CH_CPU) & MAX_RPM) * CPU_FAN_SCALE;
|
||||
}
|
||||
|
||||
|
||||
int pwm_set_fan_target_rpm(int rpm)
|
||||
{
|
||||
/* Apply fan scaling */
|
||||
|
||||
@@ -18,7 +18,7 @@ enum lpc_status pwm_command_get_fan_rpm(uint8_t *data)
|
||||
struct lpc_response_pwm_get_fan_rpm *r =
|
||||
(struct lpc_response_pwm_get_fan_rpm *)data;
|
||||
|
||||
r->rpm = pwm_get_fan_rpm();
|
||||
r->rpm = pwm_get_fan_target_rpm();
|
||||
return EC_LPC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ int pwm_enable_fan(int enable);
|
||||
/* Gets the current fan RPM. */
|
||||
int pwm_get_fan_rpm(void);
|
||||
|
||||
/* Get the target fan RPM. */
|
||||
int pwm_get_fan_target_rpm(void);
|
||||
|
||||
/* Sets the target fan RPM. Pass -1 to set fan to maximum. */
|
||||
int pwm_set_fan_target_rpm(int rpm);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user