/kernel/linux/linux-5.10/drivers/hwmon/ |
D | adm1029.c | 108 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);
|
D | smsc47m1.c | 127 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 …]
|
D | lm80.c | 125 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 …]
|
D | lm78.c | 131 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 …]
|
D | sis5595.c | 188 u8 fan_div[2]; /* Register encoding, shifted right */ member 366 DIV_FROM_REG(data->fan_div[nr]))); in fan_show() 376 DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show() 393 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in fan_min_store() 405 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr])); in fan_div_show() 431 DIV_FROM_REG(data->fan_div[nr])); in fan_div_store() 436 data->fan_div[nr] = 0; in fan_div_store() 439 data->fan_div[nr] = 1; in fan_div_store() 442 data->fan_div[nr] = 2; in fan_div_store() 445 data->fan_div[nr] = 3; in fan_div_store() [all …]
|
D | adm9240.c | 138 u8 fan_div[2]; /* rw fan1_div, read-only accessor */ member 149 u8 fan_div) in adm9240_write_fan_div() argument 159 reg |= (fan_div << shift); in adm9240_write_fan_div() 165 nr + 1, 1 << old, 1 << fan_div); in adm9240_write_fan_div() 208 data->fan_div[i] < 3) { in adm9240_update_measure() 211 ++data->fan_div[i]); in adm9240_update_measure() 254 data->fan_div[0] = (val >> 4) & 3; in adm9240_update_config() 255 data->fan_div[1] = (val >> 6) & 3; in adm9240_update_config() 465 1 << data->fan_div[attr->index])); in fan_show() 478 1 << data->fan_div[attr->index])); in fan_min_show() [all …]
|
D | w83627ehf.c | 334 u8 fan_div[5]; member 471 | ((data->fan_div[0] & 0x03) << 4); in w83627ehf_write_fan_div() 476 | ((data->fan_div[0] & 0x04) << 3); in w83627ehf_write_fan_div() 481 | ((data->fan_div[1] & 0x03) << 6); in w83627ehf_write_fan_div() 486 | ((data->fan_div[1] & 0x04) << 4); in w83627ehf_write_fan_div() 491 | ((data->fan_div[2] & 0x03) << 6); in w83627ehf_write_fan_div() 494 | ((data->fan_div[2] & 0x04) << 5); in w83627ehf_write_fan_div() 499 | (data->fan_div[3] & 0x03); in w83627ehf_write_fan_div() 502 | ((data->fan_div[3] & 0x04) << 5); in w83627ehf_write_fan_div() 507 | ((data->fan_div[4] & 0x03) << 2) in w83627ehf_write_fan_div() [all …]
|
D | vt8231.c | 159 u8 fan_div[2]; /* Register encoding, shifted right */ member 500 DIV_FROM_REG(data->fan_div[nr]))); in fan_show() 510 DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show() 519 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr])); in fan_div_show() 537 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in fan_min_store() 553 DIV_FROM_REG(data->fan_div[nr])); in fan_div_store() 563 data->fan_div[nr] = 0; in fan_div_store() 566 data->fan_div[nr] = 1; in fan_div_store() 569 data->fan_div[nr] = 2; in fan_div_store() 572 data->fan_div[nr] = 3; in fan_div_store() [all …]
|
D | vt1211.c | 120 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 …]
|
D | w83l786ng.c | 125 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 …]
|
D | lm87.c | 163 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 …]
|
D | asb100.c | 198 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 …]
|
D | via686a.c | 318 u8 fan_div[2]; /* Register encoding, shifted right */ member 503 DIV_FROM_REG(data->fan_div[nr]))); in fan_show() 512 DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show() 519 return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr])); in fan_div_show() 534 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in fan_min_store() 554 data->fan_div[nr] = DIV_TO_REG(val); in fan_div_store() 555 old = (old & 0x0f) | (data->fan_div[1] << 6) | (data->fan_div[0] << 4); in fan_div_store() 563 static SENSOR_DEVICE_ATTR_RW(fan1_div, fan_div, 0); 566 static SENSOR_DEVICE_ATTR_RW(fan2_div, fan_div, 1); 725 data->fan_div[0] = (reg >> 4) & 0x03; in via686a_update_fan_div() [all …]
|
D | gl518sm.c | 118 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 …]
|
D | adm1026.c | 277 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 …]
|
D | g760a.c | 41 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()
|
D | adm1031.c | 80 u8 fan_div[2]; member 176 data->fan_div[chan] = in adm1031_update_device() 564 FAN_DIV_FROM_REG(data->fan_div[nr])) : 0; in fan_show() 573 return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[nr])); in fan_div_show() 582 FAN_DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show() 601 FAN_TO_REG(val, FAN_DIV_FROM_REG(data->fan_div[nr])); in fan_min_store() 636 data->fan_div[nr] = adm1031_read_value(client, in fan_div_store() 642 old_div = FAN_DIV_FROM_REG(data->fan_div[nr]); in fan_div_store() 643 data->fan_div[nr] = tmp | (0x3f & data->fan_div[nr]); in fan_div_store() 648 data->fan_div[nr]); in fan_div_store() [all …]
|
D | w83627hf.c | 369 u8 fan_div[3]; /* Register encoding, shifted right */ member 671 (long)DIV_FROM_REG(data->fan_div[nr]))); in fan_input_show() 679 (long)DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show() 695 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in fan_min_store() 982 (long) DIV_FROM_REG(data->fan_div[nr])); in fan_div_show() 1009 DIV_FROM_REG(data->fan_div[nr])); in fan_div_store() 1011 data->fan_div[nr] = DIV_TO_REG(val); in fan_div_store() 1015 | ((data->fan_div[nr] & 0x03) << (nr==0 ? 4 : 6)); in fan_div_store() 1020 | ((data->fan_div[nr] & 0x04) << (3 + nr)); in fan_div_store() 1024 data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr])); in fan_div_store() [all …]
|
D | nct6775.c | 1150 u8 fan_div[NUM_FAN]; member 1484 | (data->fan_div[0] & 0x7); in nct6775_write_fan_div() 1489 | ((data->fan_div[1] << 4) & 0x70); in nct6775_write_fan_div() 1494 | (data->fan_div[2] & 0x7); in nct6775_write_fan_div() 1499 | ((data->fan_div[3] << 4) & 0x70); in nct6775_write_fan_div() 1516 data->fan_div[0] = i & 0x7; in nct6775_update_fan_div() 1517 data->fan_div[1] = (i & 0x70) >> 4; in nct6775_update_fan_div() 1519 data->fan_div[2] = i & 0x7; in nct6775_update_fan_div() 1521 data->fan_div[3] = (i & 0x70) >> 4; in nct6775_update_fan_div() 1541 for (i = 0; i < ARRAY_SIZE(data->fan_div); i++) { in nct6775_init_fan_div() [all …]
|
D | gl520sm.c | 77 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);
|
D | w83791d.c | 284 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() 1515 data->fan_div[0] = (reg_array_tmp[0] >> 4) & 0x03; in w83791d_update_device() [all …]
|
D | w83792d.c | 275 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() 1539 data->fan_div[0] = reg_array_tmp[0] & 0x07; in w83792d_update_device() [all …]
|
D | w83781d.c | 223 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() 1516 data->fan_div[0] = (i >> 4) & 0x03; in w83781d_update_device() [all …]
|
D | fschmd.c | 655 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),
|
D | it87.c | 536 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 …]
|