| 1 |
|
| 2 |
|
| 3 |
#ifndef SUPERIO_ITE_ENV_CTRL_CHIP_H |
| 4 |
#define SUPERIO_ITE_ENV_CTRL_CHIP_H |
| 5 |
|
| 6 |
#define ITE_EC_TMPIN_CNT 3 |
| 7 |
|
| 8 |
#if CONFIG(SUPERIO_ITE_ENV_CTRL_5FANS) |
| 9 |
#define ITE_EC_FAN_CNT 5 |
| 10 |
#else |
| 11 |
#define ITE_EC_FAN_CNT 3 |
| 12 |
#endif |
| 13 |
|
| 14 |
#define ITE_EC_FAN_VECTOR_CNT 2 |
| 15 |
|
| 16 |
|
| 17 |
enum ite_ec_thermal_mode { |
| 18 |
THERMAL_MODE_DISABLED = 0, |
| 19 |
THERMAL_DIODE, |
| 20 |
THERMAL_RESISTOR, |
| 21 |
THERMAL_PECI, |
| 22 |
}; |
| 23 |
|
| 24 |
struct ite_ec_thermal_config { |
| 25 |
enum ite_ec_thermal_mode mode; |
| 26 |
|
| 27 |
u8 offset; |
| 28 |
|
| 29 |
u8 min; |
| 30 |
u8 max; |
| 31 |
}; |
| 32 |
|
| 33 |
|
| 34 |
enum ite_ec_voltage_pin { |
| 35 |
VIN0 = 0x01, |
| 36 |
VIN1 = 0x02, |
| 37 |
VIN2 = 0x04, |
| 38 |
VIN3 = 0x08, |
| 39 |
VIN4 = 0x10, |
| 40 |
VIN5 = 0x20, |
| 41 |
VIN6 = 0x40, |
| 42 |
VIN7 = 0x80, |
| 43 |
VIN_ALL = 0xff |
| 44 |
}; |
| 45 |
|
| 46 |
enum ite_ec_fan_mode { |
| 47 |
FAN_IGNORE = 0, |
| 48 |
FAN_MODE_ON, |
| 49 |
FAN_MODE_OFF, |
| 50 |
FAN_SMART_SOFTWARE, |
| 51 |
FAN_SMART_AUTOMATIC, |
| 52 |
}; |
| 53 |
|
| 54 |
struct ite_ec_fan_smartconfig { |
| 55 |
u8 tmpin; |
| 56 |
u8 tmp_off; / |
| 57 |
u8 tmp_start; / |
| 58 |
u8 tmp_full; / |
| 59 |
u8 tmp_delta; |
| 60 |
/ |
| 61 |
u8 full_lmt; |
| 62 |
u8 smoothing; |
| 63 |
u8 pwm_start; |
| 64 |
u8 slope; / |
| 65 |
u8 clsd_loop; |
| 66 |
u16 rpm_start; |
| 67 |
}; |
| 68 |
|
| 69 |
struct ite_ec_fan_config { |
| 70 |
enum ite_ec_fan_mode mode; |
| 71 |
struct ite_ec_fan_smartconfig smart; |
| 72 |
}; |
| 73 |
|
| 74 |
|
| 75 |
struct ite_ec_fan_vector_config { |
| 76 |
u8 tmpin; |
| 77 |
u8 fanout; |
| 78 |
u8 tmp_start; |
| 79 |
u8 tmp_delta; |
| 80 |
u8 tmp_range; |
| 81 |
|
| 82 |
s8 slope; |
| 83 |
}; |
| 84 |
|
| 85 |
struct ite_ec_config { |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
enum ite_ec_voltage_pin vin_mask; |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
struct ite_ec_thermal_config tmpin[ITE_EC_TMPIN_CNT]; |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
struct ite_ec_fan_config fan[ITE_EC_FAN_CNT]; |
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
struct ite_ec_fan_vector_config fan_vector[ITE_EC_FAN_VECTOR_CNT]; |
| 105 |
|
| 106 |
bool tmpin_beep; |
| 107 |
bool fan_beep; |
| 108 |
bool vin_beep; |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
bool smbus_en; |
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
bool smbus_24mhz; |
| 119 |
}; |
| 120 |
|
| 121 |
|
| 122 |
#define TMPIN1 ec.tmpin[0] |
| 123 |
#define TMPIN2 ec.tmpin[1] |
| 124 |
#define TMPIN3 ec.tmpin[2] |
| 125 |
|
| 126 |
#define FAN1 ec.fan[0] |
| 127 |
#define FAN2 ec.fan[1] |
| 128 |
#define FAN3 ec.fan[2] |
| 129 |
#define FAN4 ec.fan[3] |
| 130 |
#define FAN5 ec.fan[4] |
| 131 |
|
| 132 |
#define FAN_VECA ec.fan_vector[0] |
| 133 |
#define FAN_VECB ec.fan_vector[1] |
| 134 |
|
| 135 |
#endif |