Home
last modified time | relevance | path

Searched refs:fan_div (Results 1 – 25 of 28) sorted by relevance

12

/linux-6.1.9/drivers/hwmon/
Dadm1029.c108 u8 fan_div[ARRAY_SIZE(ADM1029_REG_FAN_DIV)]; member
140 data->fan_div[nr] = in adm1029_update_device()
175 (data->fan_div[attr->index] & 0xC0) == 0 || in fan_show()
180 val = 1880 * 120 / DIV_FROM_REG(data->fan_div[attr->index]) in fan_show()
191 if ((data->fan_div[attr->index] & 0xC0) == 0) in fan_div_show()
193 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[attr->index])); in fan_div_show()
237 data->fan_div[attr->index] = reg; in fan_div_store()
266 static SENSOR_DEVICE_ATTR_RW(fan1_div, fan_div, 0);
267 static SENSOR_DEVICE_ATTR_RW(fan2_div, fan_div, 1);
Dsmsc47m1.c127 u8 fan_div[3]; /* Register encoding, shifted right */ member
169 data->fan_div[0] = (i >> 4) & 0x03; in smsc47m1_update_device()
170 data->fan_div[1] = i >> 6; in smsc47m1_update_device()
179 data->fan_div[2] = (smsc47m1_read_value(data, in smsc47m1_update_device()
211 DIV_FROM_REG(data->fan_div[nr]), in fan_show()
223 DIV_FROM_REG(data->fan_div[nr])); in fan_min_show()
232 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[attr->index])); in fan_div_show()
282 rpmdiv = val * DIV_FROM_REG(data->fan_div[nr]); in fan_min_store()
313 u8 old_div = DIV_FROM_REG(data->fan_div[nr]); in fan_div_store()
325 data->fan_div[nr] = 0; in fan_div_store()
[all …]
Dadm9240.c130 u8 fan_div[2]; /* rw fan1_div, read-only accessor */ member
135 static int adm9240_write_fan_div(struct adm9240_data *data, int channel, u8 fan_div) in adm9240_write_fan_div() argument
145 reg |= (fan_div << shift); in adm9240_write_fan_div()
151 channel + 1, BIT(old), BIT(fan_div)); in adm9240_write_fan_div()
177 new_div = data->fan_div[channel]; in adm9240_fan_min_write()
203 if (new_div != data->fan_div[channel]) { in adm9240_fan_min_write()
204 data->fan_div[channel] = new_div; in adm9240_fan_min_write()
376 data->fan_div[0] = (regval >> 4) & 3; in adm9240_init_client()
377 data->fan_div[1] = (regval >> 6) & 3; in adm9240_init_client()
510 if (regval == 255 && data->fan_div[channel] < 3) { in adm9240_fan_read()
[all …]
Dlm80.c125 u8 fan_div[2]; /* Register encoding, shifted right */ member
227 data->fan_div[0] = (rv >> 2) & 0x03; in lm80_update_device()
228 data->fan_div[1] = (rv >> 4) & 0x03; in lm80_update_device()
302 DIV_FROM_REG(data->fan_div[index]))); in fan_show()
312 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr])); in fan_div_show()
329 DIV_FROM_REG(data->fan_div[index])); in fan_store()
360 DIV_FROM_REG(data->fan_div[nr])); in fan_div_store()
364 data->fan_div[nr] = 0; in fan_div_store()
367 data->fan_div[nr] = 1; in fan_div_store()
370 data->fan_div[nr] = 2; in fan_div_store()
[all …]
Dlm78.c131 u8 fan_div[3]; /* Register encoding, shifted right */ member
300 DIV_FROM_REG(data->fan_div[nr]))); in fan_show()
310 DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show()
327 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in fan_min_store()
338 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[attr->index])); in fan_div_show()
364 DIV_FROM_REG(data->fan_div[nr])); in fan_div_store()
368 data->fan_div[nr] = 0; in fan_div_store()
371 data->fan_div[nr] = 1; in fan_div_store()
374 data->fan_div[nr] = 2; in fan_div_store()
377 data->fan_div[nr] = 3; in fan_div_store()
[all …]
Dsis5595.c189 u8 fan_div[2]; /* Register encoding, shifted right */ member
251 data->fan_div[0] = (i >> 4) & 0x03; in sis5595_update_device()
252 data->fan_div[1] = i >> 6; in sis5595_update_device()
421 DIV_FROM_REG(data->fan_div[nr]))); in fan_show()
431 DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show()
448 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in fan_min_store()
460 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr])); in fan_div_show()
486 DIV_FROM_REG(data->fan_div[nr])); in fan_div_store()
491 data->fan_div[nr] = 0; in fan_div_store()
494 data->fan_div[nr] = 1; in fan_div_store()
[all …]
Dw83627ehf.c334 u8 fan_div[5]; member
469 | ((data->fan_div[0] & 0x03) << 4); in w83627ehf_write_fan_div()
474 | ((data->fan_div[0] & 0x04) << 3); in w83627ehf_write_fan_div()
479 | ((data->fan_div[1] & 0x03) << 6); in w83627ehf_write_fan_div()
484 | ((data->fan_div[1] & 0x04) << 4); in w83627ehf_write_fan_div()
489 | ((data->fan_div[2] & 0x03) << 6); in w83627ehf_write_fan_div()
492 | ((data->fan_div[2] & 0x04) << 5); in w83627ehf_write_fan_div()
497 | (data->fan_div[3] & 0x03); in w83627ehf_write_fan_div()
500 | ((data->fan_div[3] & 0x04) << 5); in w83627ehf_write_fan_div()
505 | ((data->fan_div[4] & 0x03) << 2) in w83627ehf_write_fan_div()
[all …]
Dvt8231.c161 u8 fan_div[2]; /* Register encoding, shifted right */ member
222 data->fan_div[0] = (i >> 4) & 0x03; in vt8231_update_device()
223 data->fan_div[1] = i >> 6; in vt8231_update_device()
566 DIV_FROM_REG(data->fan_div[nr]))); in fan_show()
576 DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show()
585 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr])); in fan_div_show()
603 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in fan_min_store()
619 DIV_FROM_REG(data->fan_div[nr])); in fan_div_store()
629 data->fan_div[nr] = 0; in fan_div_store()
632 data->fan_div[nr] = 1; in fan_div_store()
[all …]
Dvt1211.c120 u8 fan_div[2]; member
293 data->fan_div[0] = (val >> 4) & 3; in vt1211_update_device()
294 data->fan_div[1] = (val >> 6) & 3; in vt1211_update_device()
502 res = RPM_FROM_REG(data->fan[ix], data->fan_div[ix]); in show_fan()
505 res = RPM_FROM_REG(data->fan_min[ix], data->fan_div[ix]); in show_fan()
508 res = DIV_FROM_REG(data->fan_div[ix]); in show_fan()
541 data->fan_div[0] = (reg >> 4) & 3; in set_fan()
542 data->fan_div[1] = (reg >> 6) & 3; in set_fan()
547 data->fan_min[ix] = RPM_TO_REG(val, data->fan_div[ix]); in set_fan()
554 data->fan_div[ix] = 0; in set_fan()
[all …]
Dw83l786ng.c125 u8 fan_div[2]; member
182 data->fan_div[0] = reg_tmp & 0x07; in w83l786ng_update_device()
183 data->fan_div[1] = (reg_tmp >> 4) & 0x07; in w83l786ng_update_device()
284 FAN_FROM_REG(data->reg[nr], DIV_FROM_REG(data->fan_div[nr]))); \
305 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in store_fan_min()
319 return sprintf(buf, "%u\n", DIV_FROM_REG(data->fan_div[nr])); in show_fan_div()
351 min = FAN_FROM_REG(data->fan_min[nr], DIV_FROM_REG(data->fan_div[nr])); in store_fan_div()
353 data->fan_div[nr] = DIV_TO_REG(val); in store_fan_div()
369 tmp_fan_div = (data->fan_div[nr] << new_shift) & ~keep_mask; in store_fan_div()
375 data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr])); in store_fan_div()
[all …]
Dlm87.c163 u8 fan_div[2]; /* register value, shifted right */ member
242 data->fan_div[0] = (i >> 4) & 0x03; in lm87_update_device()
243 data->fan_div[1] = (i >> 6) & 0x03; in lm87_update_device()
469 FAN_DIV_FROM_REG(data->fan_div[nr]))); in fan_input_show()
479 FAN_DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show()
489 FAN_DIV_FROM_REG(data->fan_div[nr])); in fan_div_show()
508 FAN_DIV_FROM_REG(data->fan_div[nr])); in fan_min_store()
538 FAN_DIV_FROM_REG(data->fan_div[nr])); in fan_div_store()
542 data->fan_div[nr] = 0; in fan_div_store()
545 data->fan_div[nr] = 1; in fan_div_store()
[all …]
Dasb100.c198 u8 fan_div[3]; /* Register encoding, right justified */ member
292 DIV_FROM_REG(data->fan_div[nr]))); in show_fan()
301 DIV_FROM_REG(data->fan_div[nr]))); in show_fan_min()
309 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr])); in show_fan_div()
326 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in set_fan_min()
356 DIV_FROM_REG(data->fan_div[nr])); in set_fan_div()
357 data->fan_div[nr] = DIV_TO_REG(val); in set_fan_div()
362 reg = (reg & 0xcf) | (data->fan_div[0] << 4); in set_fan_div()
368 reg = (reg & 0x3f) | (data->fan_div[1] << 6); in set_fan_div()
374 reg = (reg & 0x3f) | (data->fan_div[2] << 6); in set_fan_div()
[all …]
Dvia686a.c320 u8 fan_div[2]; /* Register encoding, shifted right */ member
340 data->fan_div[0] = (reg >> 4) & 0x03; in via686a_update_fan_div()
341 data->fan_div[1] = reg >> 6; in via686a_update_fan_div()
570 DIV_FROM_REG(data->fan_div[nr]))); in fan_show()
579 DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show()
586 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr])); in fan_div_show()
601 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in fan_min_store()
621 data->fan_div[nr] = DIV_TO_REG(val); in fan_div_store()
622 old = (old & 0x0f) | (data->fan_div[1] << 6) | (data->fan_div[0] << 4); in fan_div_store()
630 static SENSOR_DEVICE_ATTR_RW(fan1_div, fan_div, 0);
[all …]
Dgl518sm.c118 u8 fan_div[2]; /* Register encoding, shifted right */ member
193 data->fan_div[0] = (val >> 6) & 0x03; in gl518_update_device()
194 data->fan_div[1] = (val >> 4) & 0x03; in gl518_update_device()
260 DIV_FROM_REG(data->fan_div[nr]))); in fan_input_show()
269 DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show()
277 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr])); in fan_div_show()
357 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in fan_min_store()
411 data->fan_div[nr] = val; in fan_div_store()
413 | (data->fan_div[nr] << (6 - 2 * nr)); in fan_div_store()
428 static SENSOR_DEVICE_ATTR_RW(fan1_div, fan_div, 0);
[all …]
Dadm1026.c277 u8 fan_div[8]; /* Decoded value */ member
395 data->fan_div[i] = DIV_FROM_REG(value & 0x03); in adm1026_update_device()
660 data->fan_div[nr])); in fan_show()
669 data->fan_div[nr])); in fan_min_show()
687 data->fan_min[nr] = FAN_TO_REG(val, data->fan_div[nr]); in fan_min_store()
717 int new_div = data->fan_div[fan]; in fixup_fan_min()
736 return sprintf(buf, "%d\n", data->fan_div[nr]); in fan_div_show()
757 orig_div = data->fan_div[nr]; in fan_div_store()
758 data->fan_div[nr] = DIV_FROM_REG(new_div); in fan_div_store()
762 (DIV_TO_REG(data->fan_div[0]) << 0) | in fan_div_store()
[all …]
Dg760a.c41 u16 fan_div; /* default P=2 */ member
114 rpm = rpm_from_cnt(data->act_cnt, data->clk, data->fan_div); in fan1_input_show()
190 data->fan_div = G760A_DEFAULT_FAN_DIV; in g760a_probe()
Dadm1031.c80 u8 fan_div[2]; member
176 data->fan_div[chan] = in adm1031_update_device()
563 FAN_DIV_FROM_REG(data->fan_div[nr])) : 0; in fan_show()
572 return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[nr])); in fan_div_show()
581 FAN_DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show()
600 FAN_TO_REG(val, FAN_DIV_FROM_REG(data->fan_div[nr])); in fan_min_store()
635 data->fan_div[nr] = adm1031_read_value(client, in fan_div_store()
641 old_div = FAN_DIV_FROM_REG(data->fan_div[nr]); in fan_div_store()
642 data->fan_div[nr] = tmp | (0x3f & data->fan_div[nr]); in fan_div_store()
647 data->fan_div[nr]); in fan_div_store()
[all …]
Dnct6775-core.c1153 reg |= data->fan_div[nr] & (0x7 << oddshift); in nct6775_write_fan_div()
1172 data->fan_div[0] = i & 0x7; in nct6775_update_fan_div()
1173 data->fan_div[1] = (i & 0x70) >> 4; in nct6775_update_fan_div()
1177 data->fan_div[2] = i & 0x7; in nct6775_update_fan_div()
1179 data->fan_div[3] = (i & 0x70) >> 4; in nct6775_update_fan_div()
1205 for (i = 0; i < ARRAY_SIZE(data->fan_div); i++) { in nct6775_init_fan_div()
1208 if (data->fan_div[i] == 0) { in nct6775_init_fan_div()
1209 data->fan_div[i] = 7; in nct6775_init_fan_div()
1256 u8 fan_div = data->fan_div[nr]; in nct6775_select_fan_div() local
1267 if (reg == 0x00 && fan_div < 0x07) in nct6775_select_fan_div()
[all …]
Dw83627hf.c369 u8 fan_div[3]; /* Register encoding, shifted right */ member
464 data->fan_div[0] = (reg >> 4) & 0x03; in w83627hf_update_fan_div()
465 data->fan_div[1] = (reg >> 6) & 0x03; in w83627hf_update_fan_div()
467 data->fan_div[2] = (w83627hf_read_value(data, in w83627hf_update_fan_div()
471 data->fan_div[0] |= (reg >> 3) & 0x04; in w83627hf_update_fan_div()
472 data->fan_div[1] |= (reg >> 4) & 0x04; in w83627hf_update_fan_div()
474 data->fan_div[2] |= (reg >> 5) & 0x04; in w83627hf_update_fan_div()
1102 (long)DIV_FROM_REG(data->fan_div[nr]))); in fan_input_show()
1111 (long)DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show()
1128 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in fan_min_store()
[all …]
Dgl520sm.c77 u8 fan_div[2]; member
150 data->fan_div[0] = (val >> 6) & 0x03; in gl520_update_device()
151 data->fan_div[1] = (val >> 4) & 0x03; in gl520_update_device()
345 data->fan_div[n])); in fan_input_show()
355 data->fan_div[n])); in fan_min_show()
364 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[n])); in fan_div_show()
390 r = FAN_TO_REG(v, data->fan_div[n]); in fan_min_store()
449 data->fan_div[n] = r; in fan_div_store()
493 static SENSOR_DEVICE_ATTR_RW(fan1_div, fan_div, 0);
494 static SENSOR_DEVICE_ATTR_RW(fan2_div, fan_div, 1);
Dw83791d.c284 u8 fan_div[NUMBER_OF_FANIN]; /* Register encoding, shifted right */ member
524 FAN_FROM_REG(data->reg[nr], DIV_FROM_REG(data->fan_div[nr]))); \
545 data->fan_min[nr] = fan_to_reg(val, DIV_FROM_REG(data->fan_div[nr])); in store_fan_min()
558 return sprintf(buf, "%u\n", DIV_FROM_REG(data->fan_div[nr])); in show_fan_div()
589 min = FAN_FROM_REG(data->fan_min[nr], DIV_FROM_REG(data->fan_div[nr])); in store_fan_div()
592 data->fan_div[nr] = div_to_reg(nr, val); in store_fan_div()
630 tmp_fan_div = (data->fan_div[nr] << new_shift) & ~keep_mask; in store_fan_div()
640 tmp_fan_div = (data->fan_div[nr] << (3 + nr)) & ~keep_mask; in store_fan_div()
646 data->fan_min[nr] = fan_to_reg(min, DIV_FROM_REG(data->fan_div[nr])); in store_fan_div()
1513 data->fan_div[0] = (reg_array_tmp[0] >> 4) & 0x03; in w83791d_update_device()
[all …]
Dw83792d.c275 u8 fan_div[7]; /* Register encoding, shifted right */ member
398 FAN_FROM_REG(data->reg[nr], DIV_FROM_REG(data->fan_div[nr]))); \
420 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in store_fan_min()
435 return sprintf(buf, "%u\n", DIV_FROM_REG(data->fan_div[nr - 1])); in show_fan_div()
466 DIV_FROM_REG(data->fan_div[nr])); in store_fan_div()
468 data->fan_div[nr] = DIV_TO_REG(val); in store_fan_div()
472 tmp_fan_div = (nr & 0x01) ? (((data->fan_div[nr]) << 4) & 0x70) in store_fan_div()
473 : ((data->fan_div[nr]) & 0x07); in store_fan_div()
478 data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr])); in store_fan_div()
1537 data->fan_div[0] = reg_array_tmp[0] & 0x07; in w83792d_update_device()
[all …]
Dw83781d.c223 u8 fan_div[3]; /* Register encoding, shifted right */ member
307 DIV_FROM_REG(data->fan_div[attr->index]))); \
328 FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in store_fan_min()
625 (long) DIV_FROM_REG(data->fan_div[attr->index])); in show_fan_div()
654 DIV_FROM_REG(data->fan_div[nr])); in store_fan_div()
656 data->fan_div[nr] = DIV_TO_REG(val, data->type); in store_fan_div()
661 | ((data->fan_div[nr] & 0x03) << (nr == 0 ? 4 : 6)); in store_fan_div()
669 | ((data->fan_div[nr] & 0x04) << (3 + nr)); in store_fan_div()
674 data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr])); in store_fan_div()
1514 data->fan_div[0] = (i >> 4) & 0x03; in w83781d_update_device()
[all …]
Dfschmd.c655 SENSOR_ATTR_RW(fan1_div, fan_div, 0),
660 SENSOR_ATTR_RW(fan2_div, fan_div, 1),
665 SENSOR_ATTR_RW(fan3_div, fan_div, 2),
670 SENSOR_ATTR_RW(fan4_div, fan_div, 3),
675 SENSOR_ATTR_RW(fan5_div, fan_div, 4),
680 SENSOR_ATTR_RW(fan6_div, fan_div, 5),
685 SENSOR_ATTR_RW(fan7_div, fan_div, 6),
Dit87.c536 u8 fan_div[NUM_FAN_DIV];/* Register encoding, shifted right */ member
811 data->fan_div[0] = i & 0x07; in it87_update_device()
812 data->fan_div[1] = (i >> 3) & 0x07; in it87_update_device()
813 data->fan_div[2] = (i & 0x40) ? 3 : 1; in it87_update_device()
1121 DIV_FROM_REG(data->fan_div[nr])); in show_fan()
1132 return sprintf(buf, "%lu\n", DIV_FROM_REG(data->fan_div[nr])); in show_fan_div()
1201 data->fan_div[nr] = reg & 0x07; in set_fan()
1204 data->fan_div[nr] = (reg >> 3) & 0x07; in set_fan()
1207 data->fan_div[nr] = (reg & 0x40) ? 3 : 1; in set_fan()
1211 FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in set_fan()
[all …]

12