Lines Matching refs:index
84 return sprintf(buf, "%u\n", (mode >> (2 * sattr->index) & 3) + 2); in show_temp_type()
99 if (sattr->index == 2 && type != 4) /* RD3 */ in store_temp_type()
104 3 << 2 * sattr->index, (type - 2) << 2 * sattr->index); in store_temp_type()
116 if (sattr->index > 1) in show_pwm_mode()
123 return sprintf(buf, "%u\n", !(regval & (1 << sattr->index))); in show_pwm_mode()
134 if (!attr->index) in show_pwm()
137 ret = regmap_read(data->regmap, attr->index, &val); in show_pwm()
156 err = regmap_write(data->regmap, attr->index, val); in store_pwm()
168 ret = regmap_read(data->regmap, REG_SMARTFAN_EN(sattr->index), ®); in show_pwm_enable()
171 enabled = reg >> SMARTFAN_EN_SHIFT(sattr->index) & 1; in show_pwm_enable()
189 ret = regmap_update_bits(data->regmap, REG_SMARTFAN_EN(sattr->index), in store_pwm_enable()
190 1 << SMARTFAN_EN_SHIFT(sattr->index), in store_pwm_enable()
191 (val - 1) << SMARTFAN_EN_SHIFT(sattr->index)); in store_pwm_enable()
291 static int nct7802_read_voltage(struct nct7802_data *data, int nr, int index) in nct7802_read_voltage() argument
297 if (index == 0) { /* voltage */ in nct7802_read_voltage()
306 int shift = 8 - REG_VOLTAGE_LIMIT_MSB_SHIFT[index - 1][nr]; in nct7802_read_voltage()
309 REG_VOLTAGE_LIMIT_LSB[index - 1][nr], &v1); in nct7802_read_voltage()
323 static int nct7802_write_voltage(struct nct7802_data *data, int nr, int index, in nct7802_write_voltage() argument
326 int shift = 8 - REG_VOLTAGE_LIMIT_MSB_SHIFT[index - 1][nr]; in nct7802_write_voltage()
334 REG_VOLTAGE_LIMIT_LSB[index - 1][nr], in nct7802_write_voltage()
353 voltage = nct7802_read_voltage(data, sattr->nr, sattr->index); in show_in()
365 int index = sattr->index; in store_in() local
374 err = nct7802_write_voltage(data, nr, index, val); in store_in()
385 err = nct7802_read_temp(data, sattr->nr, sattr->index, &temp); in show_temp()
418 speed = nct7802_read_fan(data, sattr->index); in show_fan()
432 speed = nct7802_read_fan_min(data, sattr->nr, sattr->index); in show_fan_min()
451 err = nct7802_write_fan_min(data, sattr->nr, sattr->index, val); in store_fan_min()
460 int bit = sattr->index; in show_alarm()
483 return sprintf(buf, "%u\n", !!(regval & (1 << sattr->index))); in show_beep()
501 err = regmap_update_bits(data->regmap, sattr->nr, 1 << sattr->index, in store_beep()
502 val ? 1 << sattr->index : 0); in store_beep()
668 struct attribute *attr, int index) in nct7802_temp_is_visible() argument
679 if (index < 10 && in nct7802_temp_is_visible()
683 if (index >= 10 && index < 20 && in nct7802_temp_is_visible()
686 if (index >= 20 && index < 30 && (reg & 0x30) != 0x20) /* RD3 */ in nct7802_temp_is_visible()
689 if (index >= 30 && index < 38) /* local */ in nct7802_temp_is_visible()
696 if (index >= 38 && index < 46 && !(reg & 0x01)) /* PECI 0 */ in nct7802_temp_is_visible()
699 if (index >= 0x46 && (!(reg & 0x02))) /* PECI 1 */ in nct7802_temp_is_visible()
779 struct attribute *attr, int index) in nct7802_in_is_visible() argument
786 if (index < 6) /* VCC, VCORE */ in nct7802_in_is_visible()
793 if (index >= 6 && index < 11 && (reg & 0x03) != 0x03) /* VSEN1 */ in nct7802_in_is_visible()
795 if (index >= 11 && index < 17 && (reg & 0x0c) != 0x0c) /* VSEN2 */ in nct7802_in_is_visible()
797 if (index >= 17 && (reg & 0x30) != 0x30) /* VSEN3 */ in nct7802_in_is_visible()
866 struct attribute *attr, int index) in nct7802_fan_is_visible() argument
870 int fan = index / 4; /* 4 attributes per fan */ in nct7802_fan_is_visible()