• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/hwmon/

Lines Matching refs:ix

67 /* Voltages (in) numbered 0-5 (ix) */
68 #define VT1211_REG_IN(ix) (0x21 + (ix))
69 #define VT1211_REG_IN_MIN(ix) ((ix) == 0 ? 0x3e : 0x2a + 2 * (ix))
70 #define VT1211_REG_IN_MAX(ix) ((ix) == 0 ? 0x3d : 0x29 + 2 * (ix))
72 /* Temperatures (temp) numbered 0-6 (ix) */
77 /* Fans numbered 0-1 (ix) */
78 #define VT1211_REG_FAN(ix) (0x29 + (ix))
79 #define VT1211_REG_FAN_MIN(ix) (0x3b + (ix))
82 /* PWMs numbered 0-1 (ix) */
84 #define VT1211_REG_PWM(ix) (0x60 + (ix))
88 #define VT1211_REG_PWM_AUTO_PWM(ix, ap) (0x58 + 2 * (ix) - (ap))
139 /* ix = [0-5] */
140 #define ISVOLT(ix, uch_config) ((ix) > 4 ? 1 : \
141 !(((uch_config) >> ((ix) + 2)) & 1))
143 /* ix = [0-6] */
144 #define ISTEMP(ix, uch_config) ((ix) < 2 ? 1 : \
145 ((uch_config) >> (ix)) & 1)
147 /* in5 (ix = 5) is special. It's the internal 3.3V so it's scaled in the
149 #define IN_FROM_REG(ix, reg) ((reg) < 3 ? 0 : (ix) == 5 ? \
152 #define IN_TO_REG(ix, val) (SENSORS_LIMIT((ix) == 5 ? \
156 /* temp1 (ix = 0) is an intel thermal diode which is scaled in user space.
157 temp2 (ix = 1) is the internal temp diode so it's scaled in the driver
161 #define TEMP_FROM_REG(ix, reg) ((ix) == 0 ? (reg) * 1000 : \
162 (ix) == 1 ? (reg) < 51 ? 0 : \
165 #define TEMP_TO_REG(ix, val) SENSORS_LIMIT( \
166 ((ix) == 0 ? ((val) + 500) / 1000 : \
167 (ix) == 1 ? ((val) + 500) / 1000 + 51 : \
244 int ix, val;
254 for (ix = 0; ix < ARRAY_SIZE(data->in); ix++) {
255 if (ISVOLT(ix, data->uch_config)) {
256 data->in[ix] = vt1211_read8(data,
257 VT1211_REG_IN(ix));
258 data->in_min[ix] = vt1211_read8(data,
259 VT1211_REG_IN_MIN(ix));
260 data->in_max[ix] = vt1211_read8(data,
261 VT1211_REG_IN_MAX(ix));
266 for (ix = 0; ix < ARRAY_SIZE(data->temp); ix++) {
267 if (ISTEMP(ix, data->uch_config)) {
268 data->temp[ix] = vt1211_read8(data,
269 regtemp[ix]);
270 data->temp_max[ix] = vt1211_read8(data,
271 regtempmax[ix]);
272 data->temp_hyst[ix] = vt1211_read8(data,
273 regtemphyst[ix]);
278 for (ix = 0; ix < ARRAY_SIZE(data->fan); ix++) {
279 data->fan[ix] = vt1211_read8(data,
280 VT1211_REG_FAN(ix));
281 data->fan_min[ix] = vt1211_read8(data,
282 VT1211_REG_FAN_MIN(ix));
283 data->pwm[ix] = vt1211_read8(data,
284 VT1211_REG_PWM(ix));
306 for (ix = 0; ix < ARRAY_SIZE(data->pwm_auto_temp); ix++) {
307 data->pwm_auto_temp[ix] = vt1211_read8(data,
308 VT1211_REG_PWM_AUTO_TEMP(ix));
326 * ix = [0-5]
340 int ix = sensor_attr_2->index;
346 res = IN_FROM_REG(ix, data->in[ix]);
349 res = IN_FROM_REG(ix, data->in_min[ix]);
352 res = IN_FROM_REG(ix, data->in_max[ix]);
355 res = (data->alarms >> bitalarmin[ix]) & 1;
371 int ix = sensor_attr_2->index;
378 data->in_min[ix] = IN_TO_REG(ix, val);
379 vt1211_write8(data, VT1211_REG_IN_MIN(ix), data->in_min[ix]);
382 data->in_max[ix] = IN_TO_REG(ix, val);
383 vt1211_write8(data, VT1211_REG_IN_MAX(ix), data->in_max[ix]);
395 * ix = [0-6]
409 int ix = sensor_attr_2->index;
415 res = TEMP_FROM_REG(ix, data->temp[ix]);
418 res = TEMP_FROM_REG(ix, data->temp_max[ix]);
421 res = TEMP_FROM_REG(ix, data->temp_hyst[ix]);
424 res = (data->alarms >> bitalarmtemp[ix]) & 1;
440 int ix = sensor_attr_2->index;
447 data->temp_max[ix] = TEMP_TO_REG(ix, val);
448 vt1211_write8(data, regtempmax[ix],
449 data->temp_max[ix]);
452 data->temp_hyst[ix] = TEMP_TO_REG(ix, val);
453 vt1211_write8(data, regtemphyst[ix],
454 data->temp_hyst[ix]);
466 * ix = [0-1]
480 int ix = sensor_attr_2->index;
486 res = RPM_FROM_REG(data->fan[ix], data->fan_div[ix]);
489 res = RPM_FROM_REG(data->fan_min[ix], data->fan_div[ix]);
492 res = DIV_FROM_REG(data->fan_div[ix]);
495 res = (data->alarms >> bitalarmfan[ix]) & 1;
511 int ix = sensor_attr_2->index;
526 data->fan_min[ix] = RPM_TO_REG(val, data->fan_div[ix]);
527 vt1211_write8(data, VT1211_REG_FAN_MIN(ix),
528 data->fan_min[ix]);
532 case 1: data->fan_div[ix] = 0; break;
533 case 2: data->fan_div[ix] = 1; break;
534 case 4: data->fan_div[ix] = 2; break;
535 case 8: data->fan_div[ix] = 3; break;
559 * ix = [0-1]
573 int ix = sensor_attr_2->index;
579 res = data->pwm[ix];
582 res = ((data->pwm_ctl[ix] >> 3) & 1) ? 2 : 0;
588 res = (data->pwm_ctl[ix] & 7) + 1;
604 int ix = sensor_attr_2->index;
623 data->pwm_ctl[ix] &= 7;
626 if ((data->pwm_ctl[ix ^ 1] & 1) == 0) {
631 data->pwm_ctl[ix] |= 8;
677 data->pwm_ctl[ix] = (data->pwm_ctl[ix] & 8) | (val - 1);
692 * ix = [0-1]
697 * pwm[ix+1]_auto_point[ap+1]_temp mapping table:
702 * ix ap : description
721 int ix = sensor_attr_2->index;
724 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->pwm_ctl[ix] & 7,
735 int ix = sensor_attr_2->index;
747 data->pwm_auto_temp[ap] = TEMP_TO_REG(data->pwm_ctl[ix] & 7, val);
756 * pwm[ix+1]_auto_point[ap+1]_pwm mapping table:
760 * ix ap : description
779 int ix = sensor_attr_2->index;
782 return sprintf(buf, "%d\n", data->pwm_auto_pwm[ix][ap]);
792 int ix = sensor_attr_2->index;
803 data->pwm_auto_pwm[ix][ap] = val;
804 vt1211_write8(data, VT1211_REG_PWM_AUTO_PWM(ix, ap),
805 data->pwm_auto_pwm[ix][ap]);
862 #define SENSOR_ATTR_IN_INPUT(ix) \
863 SENSOR_ATTR_2(in##ix##_input, S_IRUGO, \
864 show_in, NULL, SHOW_IN_INPUT, ix)
875 #define SENSOR_ATTR_IN_MIN(ix) \
876 SENSOR_ATTR_2(in##ix##_min, S_IRUGO | S_IWUSR, \
877 show_in, set_in, SHOW_SET_IN_MIN, ix)
888 #define SENSOR_ATTR_IN_MAX(ix) \
889 SENSOR_ATTR_2(in##ix##_max, S_IRUGO | S_IWUSR, \
890 show_in, set_in, SHOW_SET_IN_MAX, ix)
901 #define SENSOR_ATTR_IN_ALARM(ix) \
902 SENSOR_ATTR_2(in##ix##_alarm, S_IRUGO, \
903 show_in, NULL, SHOW_IN_ALARM, ix)
914 #define SENSOR_ATTR_TEMP_INPUT(ix) \
915 SENSOR_ATTR_2(temp##ix##_input, S_IRUGO, \
916 show_temp, NULL, SHOW_TEMP_INPUT, ix-1)
928 #define SENSOR_ATTR_TEMP_MAX(ix) \
929 SENSOR_ATTR_2(temp##ix##_max, S_IRUGO | S_IWUSR, \
930 show_temp, set_temp, SHOW_SET_TEMP_MAX, ix-1)
942 #define SENSOR_ATTR_TEMP_MAX_HYST(ix) \
943 SENSOR_ATTR_2(temp##ix##_max_hyst, S_IRUGO | S_IWUSR, \
944 show_temp, set_temp, SHOW_SET_TEMP_MAX_HYST, ix-1)
956 #define SENSOR_ATTR_TEMP_ALARM(ix) \
957 SENSOR_ATTR_2(temp##ix##_alarm, S_IRUGO, \
958 show_temp, NULL, SHOW_TEMP_ALARM, ix-1)
970 #define SENSOR_ATTR_FAN(ix) \
971 SENSOR_ATTR_2(fan##ix##_input, S_IRUGO, \
972 show_fan, NULL, SHOW_FAN_INPUT, ix-1), \
973 SENSOR_ATTR_2(fan##ix##_min, S_IRUGO | S_IWUSR, \
974 show_fan, set_fan, SHOW_SET_FAN_MIN, ix-1), \
975 SENSOR_ATTR_2(fan##ix##_div, S_IRUGO | S_IWUSR, \
976 show_fan, set_fan, SHOW_SET_FAN_DIV, ix-1), \
977 SENSOR_ATTR_2(fan##ix##_alarm, S_IRUGO, \
978 show_fan, NULL, SHOW_FAN_ALARM, ix-1)
980 #define SENSOR_ATTR_PWM(ix) \
981 SENSOR_ATTR_2(pwm##ix, S_IRUGO, \
982 show_pwm, NULL, SHOW_PWM, ix-1), \
983 SENSOR_ATTR_2(pwm##ix##_enable, S_IRUGO | S_IWUSR, \
984 show_pwm, set_pwm, SHOW_SET_PWM_ENABLE, ix-1), \
985 SENSOR_ATTR_2(pwm##ix##_auto_channels_temp, S_IRUGO | S_IWUSR, \
986 show_pwm, set_pwm, SHOW_SET_PWM_AUTO_CHANNELS_TEMP, ix-1)
988 #define SENSOR_ATTR_PWM_FREQ(ix) \
989 SENSOR_ATTR_2(pwm##ix##_freq, S_IRUGO | S_IWUSR, \
990 show_pwm, set_pwm, SHOW_SET_PWM_FREQ, ix-1)
992 #define SENSOR_ATTR_PWM_FREQ_RO(ix) \
993 SENSOR_ATTR_2(pwm##ix##_freq, S_IRUGO, \
994 show_pwm, NULL, SHOW_SET_PWM_FREQ, ix-1)
996 #define SENSOR_ATTR_PWM_AUTO_POINT_TEMP(ix, ap) \
997 SENSOR_ATTR_2(pwm##ix##_auto_point##ap##_temp, S_IRUGO | S_IWUSR, \
999 ap-1, ix-1)
1001 #define SENSOR_ATTR_PWM_AUTO_POINT_TEMP_RO(ix, ap) \
1002 SENSOR_ATTR_2(pwm##ix##_auto_point##ap##_temp, S_IRUGO, \
1004 ap-1, ix-1)
1006 #define SENSOR_ATTR_PWM_AUTO_POINT_PWM(ix, ap) \
1007 SENSOR_ATTR_2(pwm##ix##_auto_point##ap##_pwm, S_IRUGO | S_IWUSR, \
1009 ap-1, ix-1)
1011 #define SENSOR_ATTR_PWM_AUTO_POINT_PWM_RO(ix, ap) \
1012 SENSOR_ATTR_2(pwm##ix##_auto_point##ap##_pwm, S_IRUGO, \
1014 ap-1, ix-1)