/linux-6.3-rc2/drivers/hwmon/ |
A 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);
|
A D | smsc47m1.c | 169 data->fan_div[0] = (i >> 4) & 0x03; in smsc47m1_update_device() 170 data->fan_div[1] = i >> 6; 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() 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() 328 data->fan_div[nr] = 1; in fan_div_store() 331 data->fan_div[nr] = 2; in fan_div_store() 334 data->fan_div[nr] = 3; in fan_div_store() 346 tmp |= data->fan_div[nr] << (4 + 2 * nr); in fan_div_store() [all …]
|
A D | adm9240.c | 130 u8 fan_div[2]; /* rw fan1_div, read-only accessor */ member 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() 513 ++data->fan_div[channel]); in adm9240_fan_read() [all …]
|
A D | lm80.c | 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() 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() 373 data->fan_div[nr] = 3; in fan_div_store() 389 | (data->fan_div[nr] << (2 * (nr + 1))); in fan_div_store() [all …]
|
A D | lm78.c | 300 DIV_FROM_REG(data->fan_div[nr]))); in fan_show() 310 DIV_FROM_REG(data->fan_div[nr]))); in fan_min_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() 390 reg = (reg & 0xcf) | (data->fan_div[nr] << 4); in fan_div_store() 770 data->fan_div[0] = (i >> 4) & 0x03; in lm78_update_device() 771 data->fan_div[1] = i >> 6; in lm78_update_device() [all …]
|
A D | sis5595.c | 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() 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() 497 data->fan_div[nr] = 2; in fan_div_store() 500 data->fan_div[nr] = 3; in fan_div_store() 512 reg = (reg & 0xcf) | (data->fan_div[nr] << 4); in fan_div_store() [all …]
|
A D | w83627ehf.c | 334 u8 fan_div[5]; member 497 | (data->fan_div[3] & 0x03); in w83627ehf_write_fan_div() 517 data->fan_div[0] = (i >> 4) & 0x03; in w83627ehf_update_fan_div() 518 data->fan_div[1] = (i >> 6) & 0x03; in w83627ehf_update_fan_div() 520 data->fan_div[2] = (i >> 6) & 0x03; in w83627ehf_update_fan_div() 522 data->fan_div[0] |= (i >> 3) & 0x04; in w83627ehf_update_fan_div() 523 data->fan_div[1] |= (i >> 4) & 0x04; in w83627ehf_update_fan_div() 527 data->fan_div[3] = i & 0x03; in w83627ehf_update_fan_div() 612 data->fan_div[i]++; in w83627ehf_update_device() 775 data->fan_div[channel] = new_div; in store_in_reg() [all …]
|
A D | vt8231.c | 221 data->fan_div[0] = (i >> 4) & 0x03; in vt8231_update_device() 222 data->fan_div[1] = i >> 6; in vt8231_update_device() 565 DIV_FROM_REG(data->fan_div[nr]))); in fan_show() 575 DIV_FROM_REG(data->fan_div[nr]))); in fan_min_show() 618 DIV_FROM_REG(data->fan_div[nr])); in fan_div_store() 628 data->fan_div[nr] = 0; in fan_div_store() 631 data->fan_div[nr] = 1; in fan_div_store() 634 data->fan_div[nr] = 2; in fan_div_store() 637 data->fan_div[nr] = 3; in fan_div_store() 651 old = (old & 0x0f) | (data->fan_div[1] << 6) | (data->fan_div[0] << 4); in fan_div_store() [all …]
|
A 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() 541 data->fan_div[0] = (reg >> 4) & 3; in set_fan() 542 data->fan_div[1] = (reg >> 6) & 3; in set_fan() 554 data->fan_div[ix] = 0; in set_fan() 557 data->fan_div[ix] = 1; in set_fan() 560 data->fan_div[ix] = 2; in set_fan() 563 data->fan_div[ix] = 3; in set_fan() 573 ((data->fan_div[1] << 6) | in set_fan() [all …]
|
A D | w83l786ng.c | 124 u8 fan_div[2]; member 181 data->fan_div[0] = reg_tmp & 0x07; in w83l786ng_update_device() 182 data->fan_div[1] = (reg_tmp >> 4) & 0x07; in w83l786ng_update_device() 283 FAN_FROM_REG(data->reg[nr], DIV_FROM_REG(data->fan_div[nr]))); \ 304 data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); in store_fan_min() 318 return sprintf(buf, "%u\n", DIV_FROM_REG(data->fan_div[nr])); in show_fan_div() 352 data->fan_div[nr] = DIV_TO_REG(val); in store_fan_div() 368 tmp_fan_div = (data->fan_div[nr] << new_shift) & ~keep_mask; in store_fan_div() 374 data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr])); in store_fan_div() 734 data->fan_div[0] = reg_tmp & 0x07; in w83l786ng_probe() [all …]
|
A D | lm87.c | 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() 548 data->fan_div[nr] = 2; in fan_div_store() [all …]
|
A D | asb100.c | 292 DIV_FROM_REG(data->fan_div[nr]))); in show_fan() 301 DIV_FROM_REG(data->fan_div[nr]))); in show_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() 380 FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr])); in set_fan_div() 981 data->fan_div[0] = (i >> 4) & 0x03; in asb100_update_device() 982 data->fan_div[1] = (i >> 6) & 0x03; in asb100_update_device() [all …]
|
A D | via686a.c | 320 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 …]
|
A 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 …]
|
A D | adm1026.c | 277 u8 fan_div[8]; /* Decoded value */ member 660 data->fan_div[nr])); in fan_show() 669 data->fan_div[nr])); in fan_min_show() 717 int new_div = data->fan_div[fan]; in fixup_fan_min() 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() 763 (DIV_TO_REG(data->fan_div[1]) << 2) | in fan_div_store() 764 (DIV_TO_REG(data->fan_div[2]) << 4) | in fan_div_store() 765 (DIV_TO_REG(data->fan_div[3]) << 6)); in fan_div_store() [all …]
|
A 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()
|
A D | adm1031.c | 80 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() 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() 659 static SENSOR_DEVICE_ATTR_RW(fan1_div, fan_div, 0); [all …]
|
A D | nct6775-core.c | 1172 data->fan_div[0] = i & 0x7; in nct6775_update_fan_div() 1177 data->fan_div[2] = i & 0x7; in nct6775_update_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 1268 fan_div++; in nct6775_select_fan_div() 1270 fan_div--; in nct6775_select_fan_div() 1272 if (fan_div != data->fan_div[nr]) { in nct6775_select_fan_div() 1275 div_from_reg(fan_div)); in nct6775_select_fan_div() 1280 if (fan_div > data->fan_div[nr]) { in nct6775_select_fan_div() 1297 data->fan_div[nr] = fan_div; in nct6775_select_fan_div() [all …]
|
A D | w83627hf.c | 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() 1177 DIV_FROM_REG(data->fan_div[nr])); in fan_div_store() 1179 data->fan_div[nr] = DIV_TO_REG(val); in fan_div_store() [all …]
|
A 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);
|
A D | w83791d.c | 558 return sprintf(buf, "%u\n", DIV_FROM_REG(data->fan_div[nr])); in show_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() 1513 data->fan_div[0] = (reg_array_tmp[0] >> 4) & 0x03; in w83791d_update_device() 1514 data->fan_div[1] = (reg_array_tmp[0] >> 6) & 0x03; in w83791d_update_device() 1515 data->fan_div[2] = (reg_array_tmp[1] >> 6) & 0x03; in w83791d_update_device() 1516 data->fan_div[3] = reg_array_tmp[2] & 0x07; in w83791d_update_device() 1517 data->fan_div[4] = (reg_array_tmp[2] >> 4) & 0x07; in w83791d_update_device() 1525 data->fan_div[i] |= (vbat_reg >> (3 + i)) & 0x04; in w83791d_update_device() [all …]
|
A D | w83792d.c | 275 u8 fan_div[7]; /* Register encoding, shifted right */ member 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() 473 : ((data->fan_div[nr]) & 0x07); in store_fan_div() 1537 data->fan_div[0] = reg_array_tmp[0] & 0x07; in w83792d_update_device() 1538 data->fan_div[1] = (reg_array_tmp[0] >> 4) & 0x07; in w83792d_update_device() 1539 data->fan_div[2] = reg_array_tmp[1] & 0x07; in w83792d_update_device() 1540 data->fan_div[3] = (reg_array_tmp[1] >> 4) & 0x07; in w83792d_update_device() 1541 data->fan_div[4] = reg_array_tmp[2] & 0x07; in w83792d_update_device() 1542 data->fan_div[5] = (reg_array_tmp[2] >> 4) & 0x07; in w83792d_update_device() [all …]
|
A D | w83781d.c | 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() 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() 669 | ((data->fan_div[nr] & 0x04) << (3 + nr)); in store_fan_div() 1514 data->fan_div[0] = (i >> 4) & 0x03; in w83781d_update_device() 1515 data->fan_div[1] = (i >> 6) & 0x03; in w83781d_update_device() 1516 data->fan_div[2] = (w83781d_read_value(data, in w83781d_update_device() 1520 data->fan_div[0] |= (i >> 3) & 0x04; in w83781d_update_device() 1521 data->fan_div[1] |= (i >> 4) & 0x04; in w83781d_update_device() [all …]
|
A 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),
|
A D | it87.c | 848 data->fan_div[0] = i & 0x07; in it87_update_device() 849 data->fan_div[1] = (i >> 3) & 0x07; in it87_update_device() 850 data->fan_div[2] = (i & 0x40) ? 3 : 1; in it87_update_device() 1158 DIV_FROM_REG(data->fan_div[nr])); in show_fan() 1238 data->fan_div[nr] = reg & 0x07; in set_fan() 1279 data->fan_div[nr] = DIV_TO_REG(val); in set_fan_div() 1283 data->fan_div[nr] = 1; in set_fan_div() 1285 data->fan_div[nr] = 3; in set_fan_div() 1288 val |= (data->fan_div[0] & 0x07); in set_fan_div() 1289 val |= (data->fan_div[1] & 0x07) << 3; in set_fan_div() [all …]
|