Exemplo n.º 1
0
int ec_write(uint8_t addr, uint8_t data)
{
	send_ec_command(WR_EC);
	send_ec_data(addr);

	return send_ec_data(data);
}
Exemplo n.º 2
0
Arquivo: ec.c Projeto: 0ida/coreboot
/**
 * 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)
{
	if (send_ec_command(IT8516E_CMD_SET_FAN_PWM))
		return;
	if (send_ec_data(idx))
		return;
	send_ec_data(pwm);
}
Exemplo n.º 3
0
Arquivo: ec.c Projeto: 0ida/coreboot
/**
 * 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)
{
	if (send_ec_command(IT8516E_CMD_SET_FAN_MODE))
		return;
	if (send_ec_data(idx))
		return;
	send_ec_data(mode);
}
Exemplo n.º 4
0
int ec_ext_write(uint16_t addr, uint8_t data)
{
	send_ec_command(WR_EC);
	send_ec_data(0x02);
	send_ec_data(addr & 0xff);
	send_ec_command(WX_EC);
	send_ec_data(addr >> 8);

	return send_ec_data(data);
}
Exemplo n.º 5
0
uint8_t ec_ext_read(uint16_t addr)
{
	send_ec_command(WR_EC);
	send_ec_data(0x02);
	send_ec_data(addr & 0xff);
	send_ec_command(RX_EC);
	send_ec_data(addr >> 8);

	return recv_ec_data();
}
Exemplo n.º 6
0
Arquivo: ec.c Projeto: 0ida/coreboot
/**
 * 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)
{
	if (send_ec_command(IT8516E_CMD_SET_FAN_SPEED))
		return;
	if (send_ec_data(idx))
		return;
	if (send_ec_data(speed & 0xff))
		return;
	send_ec_data(speed >> 8);
}
Exemplo n.º 7
0
Arquivo: ec.c Projeto: 0ida/coreboot
/**
 * 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)
{
	if (send_ec_command(IT8516E_CMD_SET_FAN_LIMITS))
		return;
	if (send_ec_data(idx))
		return;
	if (send_ec_data(min))
		return;
	send_ec_data(max);
}
Exemplo n.º 8
0
Arquivo: ec.c Projeto: 0ida/coreboot
/**
 * 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)
{
	if (send_ec_command(IT8516E_CMD_SET_FAN_TEMP))
		return;
	if (send_ec_data(idx))
		return;
	if (send_ec_data(temp & 0xff))
		return;
	send_ec_data(temp >> 8);
}
Exemplo n.º 9
0
Arquivo: ec.c Projeto: jaanek/coreboot
u8 ec_read(u8 addr)
{
	send_ec_command(0x80);
	send_ec_data(addr);

	return recv_ec_data();
}
Exemplo n.º 10
0
uint8_t ec_read(uint8_t addr)
{
	send_ec_command(RD_EC);
	send_ec_data(addr);

	return recv_ec_data();
}
Exemplo n.º 11
0
Arquivo: ec.c Projeto: jaanek/coreboot
int ec_write(u8 addr, u8 data)
{
	send_ec_command(0x81);
	send_ec_data(addr);
	return send_ec_data(data);
}
Exemplo n.º 12
0
Arquivo: ec.c Projeto: 0ida/coreboot
/**
 * 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)
{
	if (send_ec_command(IT8516E_CMD_SET_SYSTEMP_TYPE))
		return;
	send_ec_data(type);
}