coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
chip.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef DRIVERS_I2C_LM96000_CHIP_H
4 #define DRIVERS_I2C_LM96000_CHIP_H
5 
6 #include <stdint.h>
7 
8 #define LM96000_VIN_CNT 5
9 #define LM96000_TEMP_IN_CNT 3
10 #define LM96000_FAN_IN_CNT 4
11 #define LM96000_PWM_CTL_CNT 3
12 #define LM96000_TEMP_ZONE_CNT 3
13 
20 };
21 
23  /* Bit 7 merely signifies that the mode is set, so we
24  can map the lower bits directly to register values. */
34 };
35 
50 };
51 
53  /* 0 will be used for kHz frequencies */
54  LM96000_TACH_MODE_1 = 1, /* use if TACHx isn't used with PWMx */
55  LM96000_TACH_MODE_2 = 2, /* use either 2 or 3 if TACHx matches PWMx */
57 };
58 
68 };
69 
72  int invert; /* invert PWM signal */
76  union {
77  u8 duty_cycle; /* duty cycle in manual mode */
78  u8 min_duty; /* minimum duty cycle */
79  };
80 };
81 
83  u8 low_temp; /* temperature for min. duty cycle (in °C) */
84  u8 target_temp; /* temperature for 100% duty cycle (in °C) */
85  u8 panic_temp; /* temperature for 100% duty cycle on all fans */
86 
87  /* This is tied to the zone in the implementation I tested
88  with. (Datasheet clearly states the opposite, that this
89  is tied to each PWM output so YMMV.) */
90  enum {
91  /* turn fan off below `low_temp - hysteresis` */
93  /* keep PWM at minimum duty cycle */
97 };
98 
99 /* Implements only those parts currently used by coreboot mainboards. */
101  struct {
102  u16 low; /* in mV */
105 
106  struct {
107  signed char low; /* in °C */
108  signed char high;
110 
111  struct {
112  u16 low; /* in RPM */
114 
117 };
118 
119 #endif /* DRIVERS_I2C_LM96000_CHIP_H */
lm96000_spinup_time
Definition: chip.h:59
@ LM96000_SPINUP_1000MS
Definition: chip.h:65
@ LM96000_SPINUP_400MS
Definition: chip.h:63
@ LM96000_SPINUP_2000MS
Definition: chip.h:66
@ LM96000_SPINUP_4000MS
Definition: chip.h:67
@ LM96000_SPINUP_700MS
Definition: chip.h:64
@ LM96000_SPINUP_0MS
Definition: chip.h:60
@ LM96000_SPINUP_100MS
Definition: chip.h:61
@ LM96000_SPINUP_250MS
Definition: chip.h:62
#define LM96000_FAN_IN_CNT
Definition: chip.h:10
lm96000_vin
Definition: chip.h:14
@ LM96000_12V
Definition: chip.h:19
@ LM96000_2_5V
Definition: chip.h:15
@ LM96000_3_3V
Definition: chip.h:17
@ LM96000_5V
Definition: chip.h:18
@ LM96000_VCCP
Definition: chip.h:16
#define LM96000_PWM_CTL_CNT
Definition: chip.h:11
lm96000_fan_mode
Definition: chip.h:22
@ LM96000_FAN_ZONE_1_AUTO
Definition: chip.h:26
@ LM96000_FAN_ZONE_3_AUTO
Definition: chip.h:28
@ LM96000_FAN_HOTTEST_123
Definition: chip.h:32
@ LM96000_FAN_ZONE_2_AUTO
Definition: chip.h:27
@ LM96000_FAN_IGNORE
Definition: chip.h:25
@ LM96000_FAN_HOTTEST_23
Definition: chip.h:31
@ LM96000_FAN_ALWAYS_FULL
Definition: chip.h:29
@ LM96000_FAN_MANUAL
Definition: chip.h:33
@ LM96000_FAN_DISABLED
Definition: chip.h:30
lm96000_tach_mode
Definition: chip.h:52
@ LM96000_TACH_MODE_2
Definition: chip.h:55
@ LM96000_TACH_MODE_3
Definition: chip.h:56
@ LM96000_TACH_MODE_1
Definition: chip.h:54
#define LM96000_TEMP_IN_CNT
Definition: chip.h:9
#define LM96000_VIN_CNT
Definition: chip.h:8
lm96000_pwm_freq
Definition: chip.h:36
@ LM96000_PWM_38HZ
Definition: chip.h:41
@ LM96000_PWM_10HZ
Definition: chip.h:37
@ LM96000_PWM_61HZ
Definition: chip.h:43
@ LM96000_PWM_47HZ
Definition: chip.h:42
@ LM96000_PWM_15HZ
Definition: chip.h:38
@ LM96000_PWM_25_7KHZ
Definition: chip.h:47
@ LM96000_PWM_30_0KHZ
Definition: chip.h:49
@ LM96000_PWM_22_5KHZ
Definition: chip.h:45
@ LM96000_PWM_23HZ
Definition: chip.h:39
@ LM96000_PWM_27_7KHZ
Definition: chip.h:48
@ LM96000_PWM_24_0KHZ
Definition: chip.h:46
@ LM96000_PWM_94HZ
Definition: chip.h:44
@ LM96000_PWM_30HZ
Definition: chip.h:40
#define LM96000_TEMP_ZONE_CNT
Definition: chip.h:12
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45
signed char high
Definition: chip.h:108
struct lm96000_temp_zone zone[LM96000_TEMP_ZONE_CNT]
Definition: chip.h:116
struct drivers_i2c_lm96000_config::@55 fan_in[LM96000_FAN_IN_CNT]
struct lm96000_fan_config fan[LM96000_PWM_CTL_CNT]
Definition: chip.h:115
struct drivers_i2c_lm96000_config::@53 vin[LM96000_VIN_CNT]
struct drivers_i2c_lm96000_config::@54 temp_in[LM96000_TEMP_IN_CNT]
enum lm96000_pwm_freq freq
Definition: chip.h:74
enum lm96000_spinup_time spinup
Definition: chip.h:73
enum lm96000_fan_mode mode
Definition: chip.h:71
enum lm96000_tach_mode tach
Definition: chip.h:75
u8 target_temp
Definition: chip.h:84
@ LM96000_LOW_TEMP_MIN
Definition: chip.h:94
@ LM96000_LOW_TEMP_OFF
Definition: chip.h:92
enum lm96000_temp_zone::@52 min_off