Lines Matching +full:fan +full:- +full:0
32 u32 therm = 0; in therm_table()
40 nvkm_error(&bios->subdev, in therm_table()
47 return 0; in therm_table()
49 *ver = nvbios_rd08(bios, therm + 0); in therm_table()
63 return 0; in nvbios_therm_entry()
77 return -EINVAL; in nvbios_therm_sensor_parse()
80 thrs_section = 0; in nvbios_therm_sensor_parse()
81 sensor_section = -1; in nvbios_therm_sensor_parse()
82 i = 0; in nvbios_therm_sensor_parse()
86 switch (nvbios_rd08(bios, entry + 0)) { in nvbios_therm_sensor_parse()
87 case 0x0: in nvbios_therm_sensor_parse()
89 if (value > 0) in nvbios_therm_sensor_parse()
90 return 0; /* we do not try to support ambient */ in nvbios_therm_sensor_parse()
92 case 0x01: in nvbios_therm_sensor_parse()
94 if (sensor_section == 0) { in nvbios_therm_sensor_parse()
96 sensor->offset_constant = offset; in nvbios_therm_sensor_parse()
100 case 0x04: in nvbios_therm_sensor_parse()
101 if (thrs_section == 0) { in nvbios_therm_sensor_parse()
102 sensor->thrs_critical.temp = (value & 0xff0) >> 4; in nvbios_therm_sensor_parse()
103 sensor->thrs_critical.hysteresis = value & 0xf; in nvbios_therm_sensor_parse()
107 case 0x07: in nvbios_therm_sensor_parse()
108 if (thrs_section == 0) { in nvbios_therm_sensor_parse()
109 sensor->thrs_down_clock.temp = (value & 0xff0) >> 4; in nvbios_therm_sensor_parse()
110 sensor->thrs_down_clock.hysteresis = value & 0xf; in nvbios_therm_sensor_parse()
114 case 0x08: in nvbios_therm_sensor_parse()
115 if (thrs_section == 0) { in nvbios_therm_sensor_parse()
116 sensor->thrs_fan_boost.temp = (value & 0xff0) >> 4; in nvbios_therm_sensor_parse()
117 sensor->thrs_fan_boost.hysteresis = value & 0xf; in nvbios_therm_sensor_parse()
121 case 0x10: in nvbios_therm_sensor_parse()
122 if (sensor_section == 0) in nvbios_therm_sensor_parse()
123 sensor->offset_num = value; in nvbios_therm_sensor_parse()
126 case 0x11: in nvbios_therm_sensor_parse()
127 if (sensor_section == 0) in nvbios_therm_sensor_parse()
128 sensor->offset_den = value; in nvbios_therm_sensor_parse()
131 case 0x12: in nvbios_therm_sensor_parse()
132 if (sensor_section == 0) in nvbios_therm_sensor_parse()
133 sensor->slope_mult = value; in nvbios_therm_sensor_parse()
136 case 0x13: in nvbios_therm_sensor_parse()
137 if (sensor_section == 0) in nvbios_therm_sensor_parse()
138 sensor->slope_div = value; in nvbios_therm_sensor_parse()
140 case 0x32: in nvbios_therm_sensor_parse()
141 if (thrs_section == 0) { in nvbios_therm_sensor_parse()
142 sensor->thrs_shutdown.temp = (value & 0xff0) >> 4; in nvbios_therm_sensor_parse()
143 sensor->thrs_shutdown.hysteresis = value & 0xf; in nvbios_therm_sensor_parse()
149 return 0; in nvbios_therm_sensor_parse()
153 nvbios_therm_fan_parse(struct nvkm_bios *bios, struct nvbios_therm_fan *fan) in nvbios_therm_fan_parse() argument
159 uint8_t duty_lut[] = { 0, 0, 25, 0, 40, 0, 50, 0, in nvbios_therm_fan_parse()
160 75, 0, 85, 0, 100, 0, 100, 0 }; in nvbios_therm_fan_parse()
162 i = 0; in nvbios_therm_fan_parse()
163 fan->nr_fan_trip = 0; in nvbios_therm_fan_parse()
164 fan->fan_mode = NVBIOS_THERM_FAN_OTHER; in nvbios_therm_fan_parse()
168 switch (nvbios_rd08(bios, entry + 0)) { in nvbios_therm_fan_parse()
169 case 0x22: in nvbios_therm_fan_parse()
170 fan->min_duty = value & 0xff; in nvbios_therm_fan_parse()
171 fan->max_duty = (value & 0xff00) >> 8; in nvbios_therm_fan_parse()
173 case 0x24: in nvbios_therm_fan_parse()
174 fan->nr_fan_trip++; in nvbios_therm_fan_parse()
175 if (fan->fan_mode > NVBIOS_THERM_FAN_TRIP) in nvbios_therm_fan_parse()
176 fan->fan_mode = NVBIOS_THERM_FAN_TRIP; in nvbios_therm_fan_parse()
177 cur_trip = &fan->trip[fan->nr_fan_trip - 1]; in nvbios_therm_fan_parse()
178 cur_trip->hysteresis = value & 0xf; in nvbios_therm_fan_parse()
179 cur_trip->temp = (value & 0xff0) >> 4; in nvbios_therm_fan_parse()
180 cur_trip->fan_duty = duty_lut[(value & 0xf000) >> 12]; in nvbios_therm_fan_parse()
182 case 0x25: in nvbios_therm_fan_parse()
183 cur_trip = &fan->trip[fan->nr_fan_trip - 1]; in nvbios_therm_fan_parse()
184 cur_trip->fan_duty = value; in nvbios_therm_fan_parse()
186 case 0x26: in nvbios_therm_fan_parse()
187 if (!fan->pwm_freq) in nvbios_therm_fan_parse()
188 fan->pwm_freq = value; in nvbios_therm_fan_parse()
190 case 0x3b: in nvbios_therm_fan_parse()
191 fan->bump_period = value; in nvbios_therm_fan_parse()
193 case 0x3c: in nvbios_therm_fan_parse()
194 fan->slow_down_period = value; in nvbios_therm_fan_parse()
196 case 0x46: in nvbios_therm_fan_parse()
197 if (fan->fan_mode > NVBIOS_THERM_FAN_LINEAR) in nvbios_therm_fan_parse()
198 fan->fan_mode = NVBIOS_THERM_FAN_LINEAR; in nvbios_therm_fan_parse()
199 fan->linear_min_temp = nvbios_rd08(bios, entry + 1); in nvbios_therm_fan_parse()
200 fan->linear_max_temp = nvbios_rd08(bios, entry + 2); in nvbios_therm_fan_parse()
205 /* starting from fermi, fan management is always linear */ in nvbios_therm_fan_parse()
206 if (bios->subdev.device->card_type >= NV_C0 && in nvbios_therm_fan_parse()
207 fan->fan_mode == NVBIOS_THERM_FAN_OTHER) { in nvbios_therm_fan_parse()
208 fan->fan_mode = NVBIOS_THERM_FAN_LINEAR; in nvbios_therm_fan_parse()
211 return 0; in nvbios_therm_fan_parse()