Lines Matching refs:index
165 static int nct7802_read_voltage(struct nct7802_data *data, int nr, int index) in nct7802_read_voltage() argument
171 if (index == 0) { /* voltage */ in nct7802_read_voltage()
180 int shift = 8 - REG_VOLTAGE_LIMIT_MSB_SHIFT[index - 1][nr]; in nct7802_read_voltage()
183 REG_VOLTAGE_LIMIT_LSB[index - 1][nr], &v1); in nct7802_read_voltage()
197 static int nct7802_write_voltage(struct nct7802_data *data, int nr, int index, in nct7802_write_voltage() argument
200 int shift = 8 - REG_VOLTAGE_LIMIT_MSB_SHIFT[index - 1][nr]; in nct7802_write_voltage()
208 REG_VOLTAGE_LIMIT_LSB[index - 1][nr], in nct7802_write_voltage()
227 voltage = nct7802_read_voltage(data, sattr->nr, sattr->index); in show_in()
239 int index = sattr->index; in store_in() local
248 err = nct7802_write_voltage(data, nr, index, val); in store_in()
259 err = nct7802_read_temp(data, sattr->nr, sattr->index, &temp); in show_temp()
292 speed = nct7802_read_fan(data, sattr->index); in show_fan()
306 speed = nct7802_read_fan_min(data, sattr->nr, sattr->index); in show_fan_min()
325 err = nct7802_write_fan_min(data, sattr->nr, sattr->index, val); in store_fan_min()
334 int bit = sattr->index; in show_alarm()
357 return sprintf(buf, "%u\n", !!(regval & (1 << sattr->index))); in show_beep()
375 err = regmap_update_bits(data->regmap, sattr->nr, 1 << sattr->index, in store_beep()
376 val ? 1 << sattr->index : 0); in store_beep()
533 struct attribute *attr, int index) in nct7802_temp_is_visible() argument
544 if (index < 9 && in nct7802_temp_is_visible()
547 if (index >= 9 && index < 18 && in nct7802_temp_is_visible()
550 if (index >= 18 && index < 27 && (reg & 0x30) != 0x20) /* RD3 */ in nct7802_temp_is_visible()
552 if (index >= 27 && index < 35) /* local */ in nct7802_temp_is_visible()
559 if (index >= 35 && index < 43 && !(reg & 0x01)) /* PECI 0 */ in nct7802_temp_is_visible()
562 if (index >= 0x43 && (!(reg & 0x02))) /* PECI 1 */ in nct7802_temp_is_visible()
642 struct attribute *attr, int index) in nct7802_in_is_visible() argument
649 if (index < 6) /* VCC, VCORE */ in nct7802_in_is_visible()
656 if (index >= 6 && index < 11 && (reg & 0x03) != 0x03) /* VSEN1 */ in nct7802_in_is_visible()
658 if (index >= 11 && index < 17 && (reg & 0x0c) != 0x0c) /* VSEN2 */ in nct7802_in_is_visible()
660 if (index >= 17 && (reg & 0x30) != 0x30) /* VSEN3 */ in nct7802_in_is_visible()
708 struct attribute *attr, int index) in nct7802_fan_is_visible() argument
712 int fan = index / 4; /* 4 attributes per fan */ in nct7802_fan_is_visible()