Home
last modified time | relevance | path

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

12345

/drivers/macintosh/
Dwindfarm_fcu_controls.c80 struct wf_fcu_fan *fan = ct->priv; in wf_fcu_fan_release() local
82 kref_put(&fan->fcu_priv->ref, wf_fcu_release); in wf_fcu_fan_release()
83 kfree(fan); in wf_fcu_fan_release()
146 struct wf_fcu_fan *fan = ct->priv; in wf_fcu_fan_set_rpm() local
147 struct wf_fcu_priv *pv = fan->fcu_priv; in wf_fcu_fan_set_rpm()
151 if (value < fan->min) in wf_fcu_fan_set_rpm()
152 value = fan->min; in wf_fcu_fan_set_rpm()
153 if (value > fan->max) in wf_fcu_fan_set_rpm()
154 value = fan->max; in wf_fcu_fan_set_rpm()
156 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.c258 struct device_node *smu, *fans, *fan; in smu_controls_init() local
272 for (fan = NULL; in smu_controls_init()
273 fans && (fan = of_get_next_child(fans, fan)) != NULL;) { in smu_controls_init()
276 fct = smu_fan_create(fan, 0); in smu_controls_init()
279 "RPM fan %pOFn\n", fan); in smu_controls_init()
291 for (fan = NULL; in smu_controls_init()
292 fans && (fan = of_get_next_child(fans, fan)) != NULL;) { in smu_controls_init()
295 fct = smu_fan_create(fan, 1); in smu_controls_init()
298 "PWM fan %pOFn\n", fan); in smu_controls_init()
Dtherm_adt746x.c92 static void write_fan_speed(struct thermostat *th, int speed, int fan);
149 static void write_fan_speed(struct thermostat *th, int speed, int fan) in write_fan_speed() argument
158 if (th->type == ADT7467 && fan == 1) in write_fan_speed()
161 if (th->last_speed[fan] != speed) { in write_fan_speed()
165 "for %s fan.\n", sensor_location[fan+1]); in write_fan_speed()
168 "for %s fan.\n", speed, sensor_location[fan+1]); in write_fan_speed()
174 manual = read_reg(th, MANUAL_MODE[fan]); in write_fan_speed()
176 write_reg(th, MANUAL_MODE[fan], in write_fan_speed()
177 manual | MANUAL_MASK | th->pwm_inv[fan]); in write_fan_speed()
178 write_reg(th, FAN_SPD_SET[fan], speed); in write_fan_speed()
[all …]
/drivers/hwmon/
Dmlxreg-fan.c120 struct mlxreg_fan *fan = dev_get_drvdata(dev); in mlxreg_fan_read() local
127 tacho = &fan->tacho[channel]; in mlxreg_fan_read()
134 if (tacho->prsnt && fan->tachos_per_drwr) { in mlxreg_fan_read()
135 err = regmap_read(fan->regmap, tacho->prsnt, &regval); in mlxreg_fan_read()
143 if (BIT(channel / fan->tachos_per_drwr) & regval) { in mlxreg_fan_read()
150 err = regmap_read(fan->regmap, tacho->reg, &regval); in mlxreg_fan_read()
160 *val = MLXREG_FAN_GET_RPM(regval, fan->divider, in mlxreg_fan_read()
161 fan->samples); in mlxreg_fan_read()
165 err = regmap_read(fan->regmap, tacho->reg, &regval); in mlxreg_fan_read()
180 err = regmap_read(fan->regmap, fan->pwm.reg, &regval); in mlxreg_fan_read()
[all …]
Ddell-smm-hwmon.c77 bool fan[DELL_SMM_NO_FANS]; member
252 static int i8k_get_fan_status(const struct dell_smm_data *data, int fan) in i8k_get_fan_status() argument
259 regs.ebx = fan & 0xff; in i8k_get_fan_status()
266 static int i8k_get_fan_speed(const struct dell_smm_data *data, int fan) in i8k_get_fan_speed() argument
273 regs.ebx = fan & 0xff; in i8k_get_fan_speed()
280 static int _i8k_get_fan_type(const struct dell_smm_data *data, int fan) in _i8k_get_fan_type() argument
287 regs.ebx = fan & 0xff; in _i8k_get_fan_type()
291 static int i8k_get_fan_type(struct dell_smm_data *data, int fan) in i8k_get_fan_type() argument
294 if (data->fan_type[fan] == INT_MIN) in i8k_get_fan_type()
295 data->fan_type[fan] = _i8k_get_fan_type(data, fan); in i8k_get_fan_type()
[all …]
Dnpcm750-pwm-fan.c166 #define NPCM7XX_FAN_INPUT(fan, cmp) (((fan) << 1) + (cmp)) argument
265 u8 fan, u8 cmp) in npcm7xx_fan_start_capture() argument
272 fan_id = NPCM7XX_FAN_INPUT(fan, cmp); in npcm7xx_fan_start_capture()
277 spin_lock_irqsave(&data->fan_lock[fan], flags); in npcm7xx_fan_start_capture()
280 reg_int = ioread8(NPCM7XX_FAN_REG_TIEN(data->fan_base, fan)); in npcm7xx_fan_start_capture()
292 NPCM7XX_FAN_REG_TIEN(data->fan_base, fan)); in npcm7xx_fan_start_capture()
296 fan)); in npcm7xx_fan_start_capture()
300 fan)); in npcm7xx_fan_start_capture()
305 NPCM7XX_FAN_REG_TIEN(data->fan_base, fan)); in npcm7xx_fan_start_capture()
310 fan)); in npcm7xx_fan_start_capture()
[all …]
Demc6w201.c54 u16 fan[2][5]; member
156 data->fan[input][nr] = in emc6w201_update_device()
159 data->fan[min][nr] = in emc6w201_update_device()
265 if (data->fan[sf][nr] == 0 || data->fan[sf][nr] == 0xFFFF) in fan_show()
268 rpm = 5400000U / data->fan[sf][nr]; in fan_show()
295 data->fan[sf][nr] = val; in fan_store()
297 data->fan[sf][nr]); in fan_store()
341 static SENSOR_DEVICE_ATTR_2_RO(fan1_input, fan, 0, input);
342 static SENSOR_DEVICE_ATTR_2_RW(fan1_min, fan, 0, min);
343 static SENSOR_DEVICE_ATTR_2_RO(fan2_input, fan, 1, input);
[all …]
Dlm80.c124 u8 fan[f_num_fan][2]; /* Register value, 1st index enum fan_index */ member
192 data->fan[f_input][0] = rv; in lm80_update_device()
197 data->fan[f_min][0] = rv; in lm80_update_device()
202 data->fan[f_input][1] = rv; in lm80_update_device()
207 data->fan[f_min][1] = rv; in lm80_update_device()
301 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[nr][index], in fan_show()
328 data->fan[nr][index] = FAN_TO_REG(val, in fan_store()
331 data->fan[nr][index]); in fan_store()
359 min = FAN_FROM_REG(data->fan[f_min][nr], in fan_div_store()
393 data->fan[f_min][nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr])); in fan_div_store()
[all …]
Dadm1029.c107 u8 fan[ARRAY_SIZE(ADM1029_REG_FAN)]; member
135 data->fan[nr] = in adm1029_update_device()
174 if (data->fan[attr->index] == 0 || in fan_show()
176 data->fan[attr->index] == 255) { in fan_show()
181 / data->fan[attr->index]; in fan_show()
260 static SENSOR_DEVICE_ATTR_RO(fan1_input, fan, 0);
261 static SENSOR_DEVICE_ATTR_RO(fan2_input, fan, 1);
263 static SENSOR_DEVICE_ATTR_RO(fan1_min, fan, 2);
264 static SENSOR_DEVICE_ATTR_RO(fan2_min, fan, 3);
Dsmsc47b397.c102 u16 fan[4]; member
133 data->fan[i] = smsc47b397_read_value(data, in smsc47b397_update_device()
135 data->fan[i] |= smsc47b397_read_value(data, in smsc47b397_update_device()
188 return sprintf(buf, "%d\n", fan_from_reg(data->fan[attr->index])); in fan_show()
190 static SENSOR_DEVICE_ATTR_RO(fan1_input, fan, 0);
191 static SENSOR_DEVICE_ATTR_RO(fan2_input, fan, 1);
192 static SENSOR_DEVICE_ATTR_RO(fan3_input, fan, 2);
193 static SENSOR_DEVICE_ATTR_RO(fan4_input, fan, 3);
Dultra45_env.c148 #define fan(index) \ macro
149 static SENSOR_DEVICE_ATTR(fan##index##_speed, S_IRUGO | S_IWUSR, \
151 static SENSOR_DEVICE_ATTR(fan##index##_fault, S_IRUGO, \
154 fan(0);
155 fan(1);
156 fan(2);
157 fan(3);
158 fan(4);
Damc6821.c150 u16 fan[FAN1_IDX_LEN]; member
189 data->fan[i] = i2c_smbus_read_byte_data( in amc6821_update_device()
192 data->fan[i] += i2c_smbus_read_byte_data( in amc6821_update_device()
597 if (0 == data->fan[ix]) in fan_show()
599 return sprintf(buf, "%d\n", (int)(6000000 / data->fan[ix])); in fan_show()
625 data->fan[ix] = (u16) clamp_val(val, 1, 0xFFFF); in fan_store()
627 data->fan[ix] & 0xFF)) { in fan_store()
633 fan_reg_hi[ix], data->fan[ix] >> 8)) { in fan_store()
706 static SENSOR_DEVICE_ATTR_RO(fan1_input, fan, IDX_FAN1_INPUT);
707 static SENSOR_DEVICE_ATTR_RW(fan1_min, fan, IDX_FAN1_MIN);
[all …]
Dadt7462.c204 u16 fan[ADT7462_FAN_COUNT]; member
234 static int ADT7462_REG_FAN(int fan) in ADT7462_REG_FAN() argument
236 if (fan < 4) in ADT7462_REG_FAN()
237 return ADT7462_REG_FAN_BASE_ADDR + (2 * fan); in ADT7462_REG_FAN()
238 return ADT7462_REG_FAN2_BASE_ADDR + (2 * (fan - 4)); in ADT7462_REG_FAN()
697 data->fan[i] = adt7462_read_word_data(client, in adt7462_update_device()
989 static int fan_enabled(struct adt7462_data *data, int fan) in fan_enabled() argument
991 return data->fan_enabled & (1 << fan); in fan_enabled()
1045 !FAN_DATA_VALID(data->fan[attr->index])) in fan_show()
1049 FAN_PERIOD_TO_RPM(data->fan[attr->index])); in fan_show()
[all …]
Dsch5627.c81 u16 fan[SCH5627_NO_FANS]; member
127 data->fan[i] = val; in sch5627_update_fan()
262 ret = reg_to_rpm(data->fan[channel]); in sch5627_read()
274 *val = (data->fan[channel] == 0xffff); in sch5627_read()
338 HWMON_CHANNEL_INFO(fan,
/drivers/platform/x86/
Dgpd-pocket-fan.c55 static void gpd_pocket_fan_set_speed(struct gpd_pocket_fan_data *fan, int speed) in gpd_pocket_fan_set_speed() argument
57 if (speed == fan->last_speed) in gpd_pocket_fan_set_speed()
60 gpiod_direction_output(fan->gpio0, !!(speed & 1)); in gpd_pocket_fan_set_speed()
61 gpiod_direction_output(fan->gpio1, !!(speed & 2)); in gpd_pocket_fan_set_speed()
63 fan->last_speed = speed; in gpd_pocket_fan_set_speed()
76 struct gpd_pocket_fan_data *fan = in gpd_pocket_fan_worker() local
80 if (thermal_zone_get_temp(fan->dts0, &t0) || in gpd_pocket_fan_worker()
81 thermal_zone_get_temp(fan->dts1, &t1)) { in gpd_pocket_fan_worker()
82 dev_warn(fan->dev, "Error getting temperature\n"); in gpd_pocket_fan_worker()
89 speed = fan->last_speed; in gpd_pocket_fan_worker()
[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.c40 struct nvbios_therm_trip_point *trip = therm->fan->bios.trip, in nvkm_therm_update_trip()
48 for (i = 0; i < therm->fan->bios.nr_fan_trip; i++) { in nvkm_therm_update_trip()
78 return therm->fan->bios.min_duty; in nvkm_therm_compute_linear_duty()
80 return therm->fan->bios.max_duty; in nvkm_therm_compute_linear_duty()
84 duty *= (therm->fan->bios.max_duty - therm->fan->bios.min_duty); in nvkm_therm_compute_linear_duty()
86 duty += therm->fan->bios.min_duty; in nvkm_therm_compute_linear_duty()
93 u8 min = therm->fan->bios.linear_min_temp; in nvkm_therm_update_linear()
94 u8 max = therm->fan->bios.linear_max_temp; in nvkm_therm_update_linear()
129 switch(therm->fan->bios.fan_mode) { in nvkm_therm_update()
164 nvkm_therm_cstate(struct nvkm_therm *therm, int fan, int dir) in nvkm_therm_cstate() argument
[all …]
/drivers/acpi/
Dfan.c90 struct acpi_fan *fan = acpi_driver_data(device); in fan_get_max_state() local
92 if (fan->acpi4) in fan_get_max_state()
93 *state = fan->fps_count - 1; in fan_get_max_state()
102 struct acpi_fan *fan = acpi_driver_data(device); in fan_get_state_acpi4() local
123 for (i = 0; i < fan->fps_count; i++) { in fan_get_state_acpi4()
130 if (fan->fif.fine_grain_ctrl && control < fan->fps[i].control) { in fan_get_state_acpi4()
133 } else if (control == fan->fps[i].control) { in fan_get_state_acpi4()
137 if (i == fan->fps_count) { in fan_get_state_acpi4()
169 struct acpi_fan *fan = acpi_driver_data(device); in fan_get_cur_state() local
171 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 u32 fan = 0; in nvbios_fan_table() local
36 fan = nvbios_rd32(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/gpu/drm/radeon/
Dr600_dpm.c815 struct _ATOM_PPLIB_FANTABLE fan; member
895 rdev->pm.dpm.fan.t_hyst = fan_info->fan.ucTHyst; in r600_parse_extended_power_table()
896 rdev->pm.dpm.fan.t_min = le16_to_cpu(fan_info->fan.usTMin); in r600_parse_extended_power_table()
897 rdev->pm.dpm.fan.t_med = le16_to_cpu(fan_info->fan.usTMed); in r600_parse_extended_power_table()
898 rdev->pm.dpm.fan.t_high = le16_to_cpu(fan_info->fan.usTHigh); in r600_parse_extended_power_table()
899 rdev->pm.dpm.fan.pwm_min = le16_to_cpu(fan_info->fan.usPWMMin); in r600_parse_extended_power_table()
900 rdev->pm.dpm.fan.pwm_med = le16_to_cpu(fan_info->fan.usPWMMed); in r600_parse_extended_power_table()
901 rdev->pm.dpm.fan.pwm_high = le16_to_cpu(fan_info->fan.usPWMHigh); in r600_parse_extended_power_table()
902 if (fan_info->fan.ucFanTableFormat >= 2) in r600_parse_extended_power_table()
903 rdev->pm.dpm.fan.t_max = le16_to_cpu(fan_info->fan2.usTMax); in r600_parse_extended_power_table()
[all …]
/drivers/gpu/drm/amd/pm/
Damdgpu_dpm.c226 struct _ATOM_PPLIB_FANTABLE fan; member
308 adev->pm.dpm.fan.t_hyst = fan_info->fan.ucTHyst; in amdgpu_parse_extended_power_table()
309 adev->pm.dpm.fan.t_min = le16_to_cpu(fan_info->fan.usTMin); in amdgpu_parse_extended_power_table()
310 adev->pm.dpm.fan.t_med = le16_to_cpu(fan_info->fan.usTMed); in amdgpu_parse_extended_power_table()
311 adev->pm.dpm.fan.t_high = le16_to_cpu(fan_info->fan.usTHigh); in amdgpu_parse_extended_power_table()
312 adev->pm.dpm.fan.pwm_min = le16_to_cpu(fan_info->fan.usPWMMin); in amdgpu_parse_extended_power_table()
313 adev->pm.dpm.fan.pwm_med = le16_to_cpu(fan_info->fan.usPWMMed); in amdgpu_parse_extended_power_table()
314 adev->pm.dpm.fan.pwm_high = le16_to_cpu(fan_info->fan.usPWMHigh); in amdgpu_parse_extended_power_table()
315 if (fan_info->fan.ucFanTableFormat >= 2) in amdgpu_parse_extended_power_table()
316 adev->pm.dpm.fan.t_max = le16_to_cpu(fan_info->fan2.usTMax); in amdgpu_parse_extended_power_table()
[all …]

12345