ec/kontron/it8516e: Comment low-level EC functions

Change-Id: I5f75998356554e08f8c9920e7612494e4710ab15
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/3786
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Nico Huber 2013-07-18 11:50:59 +02:00 committed by Stefan Reinauer
parent 260c33ba56
commit 1f9f67864a
1 changed files with 36 additions and 0 deletions

View File

@ -43,6 +43,11 @@ enum { /* EC commands */
IT8516E_CMD_SET_FAN_LIMITS = 0x1a, IT8516E_CMD_SET_FAN_LIMITS = 0x1a,
}; };
/**
* Sets the type of the external temperature sensor used
*
* @param type Type of sensor to set
*/
static void it8516e_set_systemp_type(const u8 type) static void it8516e_set_systemp_type(const u8 type)
{ {
if (send_ec_command(IT8516E_CMD_SET_SYSTEMP_TYPE)) if (send_ec_command(IT8516E_CMD_SET_SYSTEMP_TYPE))
@ -50,6 +55,12 @@ static void it8516e_set_systemp_type(const u8 type)
send_ec_data(type); send_ec_data(type);
} }
/**
* Sets the operating mode of a fan
*
* @param idx Selects the fan; 0: CPU, 1: System
* @param mode Mode to set
*/
static void it8516e_set_fan_mode(const u8 idx, const u8 mode) static void it8516e_set_fan_mode(const u8 idx, const u8 mode)
{ {
if (send_ec_command(IT8516E_CMD_SET_FAN_MODE)) if (send_ec_command(IT8516E_CMD_SET_FAN_MODE))
@ -59,6 +70,12 @@ static void it8516e_set_fan_mode(const u8 idx, const u8 mode)
send_ec_data(mode); send_ec_data(mode);
} }
/**
* Sets the PWM rate of a fan in IT8516E_MODE_PWM
*
* @param idx Selects the fan; 0: CPU, 1: System
* @param pwm PWM rate measured in 255ths
*/
static void it8516e_set_fan_pwm(const u8 idx, const u8 pwm) static void it8516e_set_fan_pwm(const u8 idx, const u8 pwm)
{ {
if (send_ec_command(IT8516E_CMD_SET_FAN_PWM)) if (send_ec_command(IT8516E_CMD_SET_FAN_PWM))
@ -68,6 +85,12 @@ static void it8516e_set_fan_pwm(const u8 idx, const u8 pwm)
send_ec_data(pwm); send_ec_data(pwm);
} }
/**
* Sets the target speed in RPM for a fan in IT8516E_MODE_SPEED
*
* @param idx Selects the fan; 0: CPU, 1: System
* @param speed Speed in RPM
*/
static void it8516e_set_fan_speed(const u8 idx, const u16 speed) static void it8516e_set_fan_speed(const u8 idx, const u16 speed)
{ {
if (send_ec_command(IT8516E_CMD_SET_FAN_SPEED)) if (send_ec_command(IT8516E_CMD_SET_FAN_SPEED))
@ -79,6 +102,12 @@ static void it8516e_set_fan_speed(const u8 idx, const u16 speed)
send_ec_data(speed >> 8); send_ec_data(speed >> 8);
} }
/**
* Sets the target temperature for a fan in IT8516E_MODE_THERMAL
*
* @param idx Selects the fan; 0: CPU, 1: System
* @param temp Temperature in 64ths degree C
*/
static void it8516e_set_fan_temperature(const u8 idx, const u16 temp) static void it8516e_set_fan_temperature(const u8 idx, const u16 temp)
{ {
if (send_ec_command(IT8516E_CMD_SET_FAN_TEMP)) if (send_ec_command(IT8516E_CMD_SET_FAN_TEMP))
@ -90,6 +119,13 @@ static void it8516e_set_fan_temperature(const u8 idx, const u16 temp)
send_ec_data(temp >> 8); send_ec_data(temp >> 8);
} }
/**
* Sets the minimum and maximum PWM rate of a fan in IT8516E_MODE_THERMAL
*
* @param idx Selects the fan; 0: CPU, 1: System
* @param min Minimum PWM rate in %
* @param max Maximum PWM rate in %
*/
static void it8516e_set_fan_limits(const u8 idx, const u8 min, const u8 max) static void it8516e_set_fan_limits(const u8 idx, const u8 min, const u8 max)
{ {
if (send_ec_command(IT8516E_CMD_SET_FAN_LIMITS)) if (send_ec_command(IT8516E_CMD_SET_FAN_LIMITS))