Home
last modified time | relevance | path

Searched refs:fan (Results 1 – 25 of 87) sorted by relevance

1234

/drivers/macintosh/
Dwindfarm_fcu_controls.c81 struct wf_fcu_fan *fan = ct->priv; in wf_fcu_fan_release() local
83 kref_put(&fan->fcu_priv->ref, wf_fcu_release); in wf_fcu_fan_release()
84 kfree(fan); in wf_fcu_fan_release()
147 struct wf_fcu_fan *fan = ct->priv; in wf_fcu_fan_set_rpm() local
148 struct wf_fcu_priv *pv = fan->fcu_priv; in wf_fcu_fan_set_rpm()
152 if (value < fan->min) in wf_fcu_fan_set_rpm()
153 value = fan->min; in wf_fcu_fan_set_rpm()
154 if (value > fan->max) in wf_fcu_fan_set_rpm()
155 value = fan->max; in wf_fcu_fan_set_rpm()
157 fan->target = value; in wf_fcu_fan_set_rpm()
[all …]
Dtherm_windtunnel.c57 struct i2c_client *fan; member
158 write_reg( x.fan, 0x25, val, 1 ); in tune_fan()
159 write_reg( x.fan, 0x20, 0, 1 ); in tune_fan()
179 casetemp = read_reg(x.fan, 0x0b, 1) << 8; in poll_temp()
180 casetemp |= (read_reg(x.fan, 0x06, 1) & 0x7) << 5; in poll_temp()
215 x.r0 = read_reg( x.fan, 0x00, 1 ); in setup_hardware()
216 x.r1 = read_reg( x.fan, 0x01, 1 ); in setup_hardware()
217 x.r20 = read_reg( x.fan, 0x20, 1 ); in setup_hardware()
218 x.r23 = read_reg( x.fan, 0x23, 1 ); in setup_hardware()
219 x.r25 = read_reg( x.fan, 0x25, 1 ); in setup_hardware()
[all …]
Dwindfarm_smu_controls.c259 struct device_node *smu, *fans, *fan; in smu_controls_init() local
273 for (fan = NULL; in smu_controls_init()
274 fans && (fan = of_get_next_child(fans, fan)) != NULL;) { in smu_controls_init()
277 fct = smu_fan_create(fan, 0); in smu_controls_init()
280 "RPM fan %s\n", fan->name); in smu_controls_init()
292 for (fan = NULL; in smu_controls_init()
293 fans && (fan = of_get_next_child(fans, fan)) != NULL;) { in smu_controls_init()
296 fct = smu_fan_create(fan, 1); in smu_controls_init()
299 "PWM fan %s\n", fan->name); in smu_controls_init()
Dtherm_adt746x.c91 static void write_fan_speed(struct thermostat *th, int speed, int fan);
148 static void write_fan_speed(struct thermostat *th, int speed, int fan) in write_fan_speed() argument
157 if (th->type == ADT7467 && fan == 1) in write_fan_speed()
160 if (th->last_speed[fan] != speed) { in write_fan_speed()
164 "for %s fan.\n", sensor_location[fan+1]); in write_fan_speed()
167 "for %s fan.\n", speed, sensor_location[fan+1]); in write_fan_speed()
173 manual = read_reg(th, MANUAL_MODE[fan]); in write_fan_speed()
175 write_reg(th, MANUAL_MODE[fan], in write_fan_speed()
176 manual | MANUAL_MASK | th->pwm_inv[fan]); in write_fan_speed()
177 write_reg(th, FAN_SPD_SET[fan], speed); in write_fan_speed()
[all …]
/drivers/gpu/drm/nouveau/nvkm/subdev/therm/
Dfan.c32 nvkm_fan_update(struct nvkm_fan *fan, bool immediate, int target) in nvkm_fan_update() argument
34 struct nvkm_therm *therm = fan->parent; in nvkm_fan_update()
42 spin_lock_irqsave(&fan->lock, flags); in nvkm_fan_update()
44 target = fan->percent; in nvkm_fan_update()
45 target = max_t(u8, target, fan->bios.min_duty); in nvkm_fan_update()
46 target = min_t(u8, target, fan->bios.max_duty); in nvkm_fan_update()
47 if (fan->percent != target) { in nvkm_fan_update()
49 fan->percent = target; in nvkm_fan_update()
53 duty = fan->get(therm); in nvkm_fan_update()
55 spin_unlock_irqrestore(&fan->lock, flags); in nvkm_fan_update()
[all …]
Dfantog.c39 nvkm_fantog_update(struct nvkm_fantog *fan, int percent) in nvkm_fantog_update() argument
41 struct nvkm_therm *therm = fan->base.parent; in nvkm_fantog_update()
48 spin_lock_irqsave(&fan->lock, flags); in nvkm_fantog_update()
50 percent = fan->percent; in nvkm_fantog_update()
51 fan->percent = percent; in nvkm_fantog_update()
57 u64 next_change = (percent * fan->period_us) / 100; in nvkm_fantog_update()
59 next_change = fan->period_us - next_change; in nvkm_fantog_update()
60 nvkm_timer_alarm(tmr, next_change * 1000, &fan->alarm); in nvkm_fantog_update()
62 spin_unlock_irqrestore(&fan->lock, flags); in nvkm_fantog_update()
68 struct nvkm_fantog *fan = in nvkm_fantog_alarm() local
[all …]
Dfanpwm.c40 struct nvkm_fanpwm *fan = (void *)therm->fan; in nvkm_fanpwm_get() local
47 ret = therm->func->pwm_get(therm, fan->func.line, &divs, &duty); in nvkm_fanpwm_get()
50 if (card_type <= NV_40 || (fan->func.log[0] & 1)) in nvkm_fanpwm_get()
55 return nvkm_gpio_get(gpio, 0, fan->func.func, fan->func.line) * 100; in nvkm_fanpwm_get()
61 struct nvkm_fanpwm *fan = (void *)therm->fan; in nvkm_fanpwm_set() local
66 divs = fan->base.perf.pwm_divisor; in nvkm_fanpwm_set()
67 if (fan->base.bios.pwm_freq) { in nvkm_fanpwm_set()
70 divs = therm->func->pwm_clock(therm, fan->func.line); in nvkm_fanpwm_set()
71 divs /= fan->base.bios.pwm_freq; in nvkm_fanpwm_set()
75 if (card_type <= NV_40 || (fan->func.log[0] & 1)) in nvkm_fanpwm_set()
[all …]
Dbase.c37 struct nvbios_therm_trip_point *trip = therm->fan->bios.trip, in nvkm_therm_update_trip()
45 for (i = 0; i < therm->fan->bios.nr_fan_trip; i++) { in nvkm_therm_update_trip()
69 u8 linear_min_temp = therm->fan->bios.linear_min_temp; in nvkm_therm_update_linear()
70 u8 linear_max_temp = therm->fan->bios.linear_max_temp; in nvkm_therm_update_linear()
76 return therm->fan->bios.min_duty; in nvkm_therm_update_linear()
78 return therm->fan->bios.max_duty; in nvkm_therm_update_linear()
82 duty *= (therm->fan->bios.max_duty - therm->fan->bios.min_duty); in nvkm_therm_update_linear()
84 duty += therm->fan->bios.min_duty; in nvkm_therm_update_linear()
112 switch(therm->fan->bios.fan_mode) { in nvkm_therm_update()
144 nvkm_therm_cstate(struct nvkm_therm *therm, int fan, int dir) in nvkm_therm_cstate() argument
[all …]
/drivers/acpi/
Dfan.c98 struct acpi_fan *fan = acpi_driver_data(device); in fan_get_max_state() local
100 if (fan->acpi4) in fan_get_max_state()
101 *state = fan->fps_count - 1; in fan_get_max_state()
110 struct acpi_fan *fan = acpi_driver_data(device); in fan_get_state_acpi4() local
131 for (i = 0; i < fan->fps_count; i++) { in fan_get_state_acpi4()
138 if (fan->fif.fine_grain_ctrl && control < fan->fps[i].control) { in fan_get_state_acpi4()
141 } else if (control == fan->fps[i].control) { in fan_get_state_acpi4()
145 if (i == fan->fps_count) { in fan_get_state_acpi4()
177 struct acpi_fan *fan = acpi_driver_data(device); in fan_get_cur_state() local
179 if (fan->acpi4) in fan_get_cur_state()
[all …]
/drivers/gpu/drm/nouveau/nvkm/subdev/bios/
Dtherm.c153 nvbios_therm_fan_parse(struct nvkm_bios *bios, struct nvbios_therm_fan *fan) in nvbios_therm_fan_parse() argument
163 fan->nr_fan_trip = 0; in nvbios_therm_fan_parse()
164 fan->fan_mode = NVBIOS_THERM_FAN_OTHER; 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()
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()
183 cur_trip = &fan->trip[fan->nr_fan_trip - 1]; in nvbios_therm_fan_parse()
[all …]
Dfan.c32 u16 fan = 0x0000; in nvbios_fan_table() local
36 fan = nvbios_rd16(bios, bit_P.offset + 0x58); in nvbios_fan_table()
38 if (fan) { in nvbios_fan_table()
39 *ver = nvbios_rd08(bios, fan + 0); in nvbios_fan_table()
42 *hdr = nvbios_rd08(bios, fan + 1); in nvbios_fan_table()
43 *len = nvbios_rd08(bios, fan + 2); in nvbios_fan_table()
44 *cnt = nvbios_rd08(bios, fan + 3); in nvbios_fan_table()
45 return fan; in nvbios_fan_table()
66 nvbios_fan_parse(struct nvkm_bios *bios, struct nvbios_therm_fan *fan) in nvbios_fan_parse() argument
75 fan->type = NVBIOS_THERM_FAN_TOGGLE; in nvbios_fan_parse()
[all …]
/drivers/hwmon/
Ddell-smm-hwmon.c241 static int i8k_get_fan_status(int fan) in i8k_get_fan_status() argument
245 regs.ebx = fan & 0xff; in i8k_get_fan_status()
252 static int i8k_get_fan_speed(int fan) in i8k_get_fan_speed() argument
256 regs.ebx = fan & 0xff; in i8k_get_fan_speed()
263 static int _i8k_get_fan_type(int fan) in _i8k_get_fan_type() argument
270 regs.ebx = fan & 0xff; in _i8k_get_fan_type()
274 static int i8k_get_fan_type(int fan) in i8k_get_fan_type() argument
279 if (types[fan] == INT_MIN) in i8k_get_fan_type()
280 types[fan] = _i8k_get_fan_type(fan); in i8k_get_fan_type()
282 return types[fan]; in i8k_get_fan_type()
[all …]
Dultra45_env.c147 #define fan(index) \ macro
148 static SENSOR_DEVICE_ATTR(fan##index##_speed, S_IRUGO | S_IWUSR, \
150 static SENSOR_DEVICE_ATTR(fan##index##_fault, S_IRUGO, \
153 fan(0);
154 fan(1);
155 fan(2);
156 fan(3);
157 fan(4);
Dlm80.c137 u8 fan[f_num_fan][2]; /* Register value, 1st index enum fan_index */ member
205 data->fan[f_input][0] = rv; in lm80_update_device()
210 data->fan[f_min][0] = rv; in lm80_update_device()
215 data->fan[f_input][1] = rv; in lm80_update_device()
220 data->fan[f_min][1] = rv; in lm80_update_device()
314 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[nr][index], in show_fan()
341 data->fan[nr][index] = FAN_TO_REG(val, in set_fan_min()
344 data->fan[nr][index]); in set_fan_min()
369 min = FAN_FROM_REG(data->fan[f_min][nr], in set_fan_div()
398 data->fan[f_min][nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr])); in set_fan_div()
[all …]
Dadm9240.c144 u8 fan[2]; /* ro fan1_input */ member
203 data->fan[i] = i2c_smbus_read_byte_data(client, in adm9240_update_device()
207 if (data->valid && data->fan[i] == 255 && in adm9240_update_device()
397 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[attr->index], in show_fan()
489 #define fan(nr) \ macro
490 static SENSOR_DEVICE_ATTR(fan##nr##_input, S_IRUGO, \
492 static SENSOR_DEVICE_ATTR(fan##nr##_div, S_IRUGO, \
494 static SENSOR_DEVICE_ATTR(fan##nr##_min, S_IRUGO | S_IWUSR, \
497 fan(1);
498 fan(2);
Dadm1029.c120 u8 fan[ARRAY_SIZE(ADM1029_REG_FAN)]; member
149 data->fan[nr] = in adm1029_update_device()
186 if (data->fan[attr->index] == 0 in show_fan()
188 || data->fan[attr->index] == 255) { in show_fan()
193 / data->fan[attr->index]; in show_fan()
Demc6w201.c67 u16 fan[2][5]; member
169 data->fan[input][nr] = in emc6w201_update_device()
172 data->fan[min][nr] = in emc6w201_update_device()
275 if (data->fan[sf][nr] == 0 || data->fan[sf][nr] == 0xFFFF) in show_fan()
278 rpm = 5400000U / data->fan[sf][nr]; in show_fan()
305 data->fan[sf][nr] = val; in set_fan()
307 data->fan[sf][nr]); in set_fan()
Dsmsc47b397.c110 u16 fan[4]; member
141 data->fan[i] = smsc47b397_read_value(data, in smsc47b397_update_device()
143 data->fan[i] |= smsc47b397_read_value(data, in smsc47b397_update_device()
196 return sprintf(buf, "%d\n", fan_from_reg(data->fan[attr->index])); in show_fan()
Dabituguru3.c955 SENSOR_ATTR_2(fan%d_input, 0444, show_value, NULL, 0, 0),
956 SENSOR_ATTR_2(fan%d_min, 0444, show_value, NULL, 1, 0),
957 SENSOR_ATTR_2(fan%d_alarm, 0444, show_alarm, NULL, 0, 0),
958 SENSOR_ATTR_2(fan%d_beep, 0444, show_mask, NULL,
960 SENSOR_ATTR_2(fan%d_shutdown, 0444, show_mask, NULL,
962 SENSOR_ATTR_2(fan%d_alarm_enable, 0444, show_mask, NULL,
964 SENSOR_ATTR_2(fan%d_label, 0444, show_label, NULL, 0, 0)
Dvt8231.c170 u8 fan[2]; /* Register value */ member
502 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[nr], in show_fan()
595 static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, \
597 static SENSOR_DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
599 static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
899 data->fan[i] = vt8231_read_value(data, in vt8231_update_device()
927 if (!data->fan[0] && data->fan_min[0]) in vt8231_update_device()
929 else if (data->fan[0] && !data->fan_min[0]) in vt8231_update_device()
932 if (!data->fan[1] && data->fan_min[1]) in vt8231_update_device()
934 else if (data->fan[1] && !data->fan_min[1]) in vt8231_update_device()
Dsmsc47m1.c133 u8 fan[3]; /* Register value */ member
168 data->fan[i] = smsc47m1_read_value(data, in smsc47m1_update_device()
218 FAN_FROM_REG(data->fan[nr], in get_fan()
426 static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, get_fan, \
428 static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
430 static SENSOR_DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
432 static SENSOR_DEVICE_ATTR(fan##offset##_alarm, S_IRUGO, get_fan_alarm, \
Damc6821.c163 u16 fan[FAN1_IDX_LEN]; member
202 data->fan[i] = i2c_smbus_read_byte_data( in amc6821_update_device()
205 data->fan[i] += i2c_smbus_read_byte_data( in amc6821_update_device()
636 if (0 == data->fan[ix]) in get_fan()
638 return sprintf(buf, "%d\n", (int)(6000000 / data->fan[ix])); in get_fan()
668 data->fan[ix] = (u16) clamp_val(val, 1, 0xFFFF); in set_fan()
670 data->fan[ix] & 0xFF)) { in set_fan()
676 fan_reg_hi[ix], data->fan[ix] >> 8)) { in set_fan()
/drivers/gpu/drm/amd/amdgpu/
Damdgpu_dpm.c254 struct _ATOM_PPLIB_FANTABLE fan; member
336 adev->pm.dpm.fan.t_hyst = fan_info->fan.ucTHyst; in amdgpu_parse_extended_power_table()
337 adev->pm.dpm.fan.t_min = le16_to_cpu(fan_info->fan.usTMin); in amdgpu_parse_extended_power_table()
338 adev->pm.dpm.fan.t_med = le16_to_cpu(fan_info->fan.usTMed); in amdgpu_parse_extended_power_table()
339 adev->pm.dpm.fan.t_high = le16_to_cpu(fan_info->fan.usTHigh); in amdgpu_parse_extended_power_table()
340 adev->pm.dpm.fan.pwm_min = le16_to_cpu(fan_info->fan.usPWMMin); in amdgpu_parse_extended_power_table()
341 adev->pm.dpm.fan.pwm_med = le16_to_cpu(fan_info->fan.usPWMMed); in amdgpu_parse_extended_power_table()
342 adev->pm.dpm.fan.pwm_high = le16_to_cpu(fan_info->fan.usPWMHigh); in amdgpu_parse_extended_power_table()
343 if (fan_info->fan.ucFanTableFormat >= 2) in amdgpu_parse_extended_power_table()
344 adev->pm.dpm.fan.t_max = le16_to_cpu(fan_info->fan2.usTMax); in amdgpu_parse_extended_power_table()
[all …]
/drivers/gpu/drm/radeon/
Dr600_dpm.c813 struct _ATOM_PPLIB_FANTABLE fan; member
893 rdev->pm.dpm.fan.t_hyst = fan_info->fan.ucTHyst; in r600_parse_extended_power_table()
894 rdev->pm.dpm.fan.t_min = le16_to_cpu(fan_info->fan.usTMin); in r600_parse_extended_power_table()
895 rdev->pm.dpm.fan.t_med = le16_to_cpu(fan_info->fan.usTMed); in r600_parse_extended_power_table()
896 rdev->pm.dpm.fan.t_high = le16_to_cpu(fan_info->fan.usTHigh); in r600_parse_extended_power_table()
897 rdev->pm.dpm.fan.pwm_min = le16_to_cpu(fan_info->fan.usPWMMin); in r600_parse_extended_power_table()
898 rdev->pm.dpm.fan.pwm_med = le16_to_cpu(fan_info->fan.usPWMMed); in r600_parse_extended_power_table()
899 rdev->pm.dpm.fan.pwm_high = le16_to_cpu(fan_info->fan.usPWMHigh); in r600_parse_extended_power_table()
900 if (fan_info->fan.ucFanTableFormat >= 2) in r600_parse_extended_power_table()
901 rdev->pm.dpm.fan.t_max = le16_to_cpu(fan_info->fan2.usTMax); in r600_parse_extended_power_table()
[all …]
/drivers/hwmon/pmbus/
Ducd9000.c55 static int ucd9000_get_fan_config(struct i2c_client *client, int fan) in ucd9000_get_fan_config() argument
61 if (data->fan_data[fan][3] & 1) in ucd9000_get_fan_config()
65 fan_config |= (data->fan_data[fan][3] & 0x06) >> 1; in ucd9000_get_fan_config()

1234