Lines Matching full:nr

117 /* in nr from 0 to 10 (8-bit values) */
118 #define F71805F_REG_IN(nr) (0x10 + (nr)) argument
119 #define F71805F_REG_IN_HIGH(nr) ((nr) < 10 ? 0x40 + 2 * (nr) : 0x2E) argument
120 #define F71805F_REG_IN_LOW(nr) ((nr) < 10 ? 0x41 + 2 * (nr) : 0x2F) argument
121 /* fan nr from 0 to 2 (12-bit values, two registers) */
122 #define F71805F_REG_FAN(nr) (0x20 + 2 * (nr)) argument
123 #define F71805F_REG_FAN_LOW(nr) (0x28 + 2 * (nr)) argument
124 #define F71805F_REG_FAN_TARGET(nr) (0x69 + 16 * (nr)) argument
125 #define F71805F_REG_FAN_CTRL(nr) (0x60 + 16 * (nr)) argument
126 #define F71805F_REG_PWM_FREQ(nr) (0x63 + 16 * (nr)) argument
127 #define F71805F_REG_PWM_DUTY(nr) (0x6B + 16 * (nr)) argument
128 /* temp nr from 0 to 2 (8-bit values) */
129 #define F71805F_REG_TEMP(nr) (0x1B + (nr)) argument
130 #define F71805F_REG_TEMP_HIGH(nr) (0x54 + 2 * (nr)) argument
131 #define F71805F_REG_TEMP_HYST(nr) (0x55 + 2 * (nr)) argument
142 /* status nr from 0 to 2 */
143 #define F71805F_REG_STATUS(nr) (0x36 + (nr)) argument
335 int nr, apnr; in f71805f_update_device() local
342 for (nr = 0; nr < 11; nr++) { in f71805f_update_device()
343 if (!(data->has_in & (1 << nr))) in f71805f_update_device()
345 data->in_high[nr] = f71805f_read8(data, in f71805f_update_device()
346 F71805F_REG_IN_HIGH(nr)); in f71805f_update_device()
347 data->in_low[nr] = f71805f_read8(data, in f71805f_update_device()
348 F71805F_REG_IN_LOW(nr)); in f71805f_update_device()
350 for (nr = 0; nr < 3; nr++) { in f71805f_update_device()
351 data->fan_low[nr] = f71805f_read16(data, in f71805f_update_device()
352 F71805F_REG_FAN_LOW(nr)); in f71805f_update_device()
353 data->fan_target[nr] = f71805f_read16(data, in f71805f_update_device()
354 F71805F_REG_FAN_TARGET(nr)); in f71805f_update_device()
355 data->pwm_freq[nr] = f71805f_read8(data, in f71805f_update_device()
356 F71805F_REG_PWM_FREQ(nr)); in f71805f_update_device()
358 for (nr = 0; nr < 3; nr++) { in f71805f_update_device()
359 data->temp_high[nr] = f71805f_read8(data, in f71805f_update_device()
360 F71805F_REG_TEMP_HIGH(nr)); in f71805f_update_device()
361 data->temp_hyst[nr] = f71805f_read8(data, in f71805f_update_device()
362 F71805F_REG_TEMP_HYST(nr)); in f71805f_update_device()
365 for (nr = 0; nr < 3; nr++) { in f71805f_update_device()
367 data->auto_points[nr].temp[apnr] = in f71805f_update_device()
369 F71805F_REG_PWM_AUTO_POINT_TEMP(nr, in f71805f_update_device()
371 data->auto_points[nr].fan[apnr] = in f71805f_update_device()
373 F71805F_REG_PWM_AUTO_POINT_FAN(nr, in f71805f_update_device()
384 for (nr = 0; nr < 11; nr++) { in f71805f_update_device()
385 if (!(data->has_in & (1 << nr))) in f71805f_update_device()
387 data->in[nr] = f71805f_read8(data, in f71805f_update_device()
388 F71805F_REG_IN(nr)); in f71805f_update_device()
390 for (nr = 0; nr < 3; nr++) { in f71805f_update_device()
391 data->fan[nr] = f71805f_read16(data, in f71805f_update_device()
392 F71805F_REG_FAN(nr)); in f71805f_update_device()
393 data->fan_ctrl[nr] = f71805f_read8(data, in f71805f_update_device()
394 F71805F_REG_FAN_CTRL(nr)); in f71805f_update_device()
395 data->pwm[nr] = f71805f_read8(data, in f71805f_update_device()
396 F71805F_REG_PWM_DUTY(nr)); in f71805f_update_device()
398 for (nr = 0; nr < 3; nr++) { in f71805f_update_device()
399 data->temp[nr] = f71805f_read8(data, in f71805f_update_device()
400 F71805F_REG_TEMP(nr)); in f71805f_update_device()
424 int nr = attr->index; in show_in0() local
426 return sprintf(buf, "%ld\n", in0_from_reg(data->in[nr])); in show_in0()
434 int nr = attr->index; in show_in0_max() local
436 return sprintf(buf, "%ld\n", in0_from_reg(data->in_high[nr])); in show_in0_max()
444 int nr = attr->index; in show_in0_min() local
446 return sprintf(buf, "%ld\n", in0_from_reg(data->in_low[nr])); in show_in0_min()
454 int nr = attr->index; in set_in0_max() local
463 data->in_high[nr] = in0_to_reg(val); in set_in0_max()
464 f71805f_write8(data, F71805F_REG_IN_HIGH(nr), data->in_high[nr]); in set_in0_max()
475 int nr = attr->index; in set_in0_min() local
484 data->in_low[nr] = in0_to_reg(val); in set_in0_min()
485 f71805f_write8(data, F71805F_REG_IN_LOW(nr), data->in_low[nr]); in set_in0_min()
496 int nr = attr->index; in show_in() local
498 return sprintf(buf, "%ld\n", in_from_reg(data->in[nr])); in show_in()
506 int nr = attr->index; in show_in_max() local
508 return sprintf(buf, "%ld\n", in_from_reg(data->in_high[nr])); in show_in_max()
516 int nr = attr->index; in show_in_min() local
518 return sprintf(buf, "%ld\n", in_from_reg(data->in_low[nr])); in show_in_min()
526 int nr = attr->index; in set_in_max() local
535 data->in_high[nr] = in_to_reg(val); in set_in_max()
536 f71805f_write8(data, F71805F_REG_IN_HIGH(nr), data->in_high[nr]); in set_in_max()
547 int nr = attr->index; in set_in_min() local
556 data->in_low[nr] = in_to_reg(val); in set_in_min()
557 f71805f_write8(data, F71805F_REG_IN_LOW(nr), data->in_low[nr]); in set_in_min()
568 int nr = attr->index; in show_fan() local
570 return sprintf(buf, "%ld\n", fan_from_reg(data->fan[nr])); in show_fan()
578 int nr = attr->index; in show_fan_min() local
580 return sprintf(buf, "%ld\n", fan_from_reg(data->fan_low[nr])); in show_fan_min()
588 int nr = attr->index; in show_fan_target() local
590 return sprintf(buf, "%ld\n", fan_from_reg(data->fan_target[nr])); in show_fan_target()
598 int nr = attr->index; in set_fan_min() local
607 data->fan_low[nr] = fan_to_reg(val); in set_fan_min()
608 f71805f_write16(data, F71805F_REG_FAN_LOW(nr), data->fan_low[nr]); in set_fan_min()
619 int nr = attr->index; in set_fan_target() local
628 data->fan_target[nr] = fan_to_reg(val); in set_fan_target()
629 f71805f_write16(data, F71805F_REG_FAN_TARGET(nr), in set_fan_target()
630 data->fan_target[nr]); in set_fan_target()
641 int nr = attr->index; in show_pwm() local
643 return sprintf(buf, "%d\n", (int)data->pwm[nr]); in show_pwm()
651 int nr = attr->index; in show_pwm_enable() local
654 switch (data->fan_ctrl[nr] & FAN_CTRL_MODE_MASK) { in show_pwm_enable()
673 int nr = attr->index; in show_pwm_freq() local
675 return sprintf(buf, "%lu\n", pwm_freq_from_reg(data->pwm_freq[nr])); in show_pwm_freq()
683 int nr = attr->index; in show_pwm_mode() local
685 return sprintf(buf, "%d\n", pwm_mode_from_reg(data->fan_ctrl[nr])); in show_pwm_mode()
693 int nr = attr->index; in set_pwm() local
705 data->pwm[nr] = val; in set_pwm()
706 f71805f_write8(data, F71805F_REG_PWM_DUTY(nr), data->pwm[nr]); in set_pwm()
719 int nr = attr->index; in set_pwm_enable() local
732 if (sysfs_chmod_file(&dev->kobj, f71805f_attr_pwm[nr], in set_pwm_enable()
734 dev_dbg(dev, "chmod -w pwm%d failed\n", nr + 1); in set_pwm_enable()
738 reg = f71805f_read8(data, F71805F_REG_FAN_CTRL(nr)) in set_pwm_enable()
751 data->fan_ctrl[nr] = reg; in set_pwm_enable()
752 f71805f_write8(data, F71805F_REG_FAN_CTRL(nr), reg); in set_pwm_enable()
756 if (sysfs_chmod_file(&dev->kobj, f71805f_attr_pwm[nr], in set_pwm_enable()
758 dev_dbg(dev, "chmod +w pwm%d failed\n", nr + 1); in set_pwm_enable()
769 int nr = attr->index; in set_pwm_freq() local
778 data->pwm_freq[nr] = pwm_freq_to_reg(val); in set_pwm_freq()
779 f71805f_write8(data, F71805F_REG_PWM_FREQ(nr), data->pwm_freq[nr]); in set_pwm_freq()
791 int pwmnr = attr->nr; in show_pwm_auto_point_temp()
804 int pwmnr = attr->nr; in set_pwm_auto_point_temp()
828 int pwmnr = attr->nr; in show_pwm_auto_point_fan()
841 int pwmnr = attr->nr; in set_pwm_auto_point_fan()
864 int nr = attr->index; in show_temp() local
866 return sprintf(buf, "%ld\n", temp_from_reg(data->temp[nr])); in show_temp()
874 int nr = attr->index; in show_temp_max() local
876 return sprintf(buf, "%ld\n", temp_from_reg(data->temp_high[nr])); in show_temp_max()
884 int nr = attr->index; in show_temp_hyst() local
886 return sprintf(buf, "%ld\n", temp_from_reg(data->temp_hyst[nr])); in show_temp_hyst()
894 int nr = attr->index; in show_temp_type() local
897 return sprintf(buf, "%u\n", (data->temp_mode & (1 << nr)) ? 3 : 4); in show_temp_type()
905 int nr = attr->index; in set_temp_max() local
914 data->temp_high[nr] = temp_to_reg(val); in set_temp_max()
915 f71805f_write8(data, F71805F_REG_TEMP_HIGH(nr), data->temp_high[nr]); in set_temp_max()
926 int nr = attr->index; in set_temp_hyst() local
935 data->temp_hyst[nr] = temp_to_reg(val); in set_temp_hyst()
936 f71805f_write8(data, F71805F_REG_TEMP_HYST(nr), data->temp_hyst[nr]); in set_temp_hyst()