Lines Matching defs:index

67  * Valid for index 0..2, indicating RTD1..3.
69 #define MODE_BIT_OFFSET_RTD(index) ((index) * 2)
94 return sprintf(buf, "%u\n", (mode >> (2 * sattr->index) & 3) + 2);
109 if (sattr->index == 2 && type != 4) /* RD3 */
114 3 << 2 * sattr->index, (type - 2) << 2 * sattr->index);
126 if (sattr->index > 1)
133 return sprintf(buf, "%u\n", !(regval & (1 << sattr->index)));
144 if (!attr->index)
147 ret = regmap_read(data->regmap, attr->index, &val);
166 err = regmap_write(data->regmap, attr->index, val);
178 ret = regmap_read(data->regmap, REG_SMARTFAN_EN(sattr->index), &reg);
181 enabled = reg >> SMARTFAN_EN_SHIFT(sattr->index) & 1;
199 ret = regmap_update_bits(data->regmap, REG_SMARTFAN_EN(sattr->index),
200 1 << SMARTFAN_EN_SHIFT(sattr->index),
201 (val - 1) << SMARTFAN_EN_SHIFT(sattr->index));
303 static int nct7802_read_voltage(struct nct7802_data *data, int nr, int index)
309 if (index == 0) { /* voltage */
318 int shift = 8 - REG_VOLTAGE_LIMIT_MSB_SHIFT[index - 1][nr];
321 REG_VOLTAGE_LIMIT_LSB[index - 1][nr], &v1);
335 static int nct7802_write_voltage(struct nct7802_data *data, int nr, int index,
338 int shift = 8 - REG_VOLTAGE_LIMIT_MSB_SHIFT[index - 1][nr];
346 REG_VOLTAGE_LIMIT_LSB[index - 1][nr],
365 voltage = nct7802_read_voltage(data, sattr->nr, sattr->index);
377 int index = sattr->index;
386 err = nct7802_write_voltage(data, nr, index, val);
420 if (!(data->in_status & (0x10 << sattr->index))) {
437 data->in_status |= (1 << sattr->index);
439 data->in_status &= ~(1 << sattr->index);
441 data->in_status |= 0x10 << sattr->index;
444 ret = sprintf(buf, "%u\n", !!(data->in_status & (1 << sattr->index)));
457 err = nct7802_read_temp(data, sattr->nr, sattr->index, &temp);
490 speed = nct7802_read_fan(data, sattr->index);
504 speed = nct7802_read_fan_min(data, sattr->nr, sattr->index);
524 err = nct7802_write_fan_min(data, sattr->nr, sattr->index, val);
533 int bit = sattr->index;
556 return sprintf(buf, "%u\n", !!(regval & (1 << sattr->index)));
574 err = regmap_update_bits(data->regmap, sattr->nr, 1 << sattr->index,
575 val ? 1 << sattr->index : 0);
697 struct attribute *attr, int index)
708 if (index < 10 &&
712 if (index >= 10 && index < 20 &&
715 if (index >= 20 && index < 30 && (reg & 0x30) != 0x20) /* RD3 */
718 if (index >= 30 && index < 38) /* local */
725 if (index >= 38 && index < 46 && !(reg & 0x01)) /* PECI 0 */
728 if (index >= 46 && !(reg & 0x02)) /* PECI 1 */
796 struct attribute *attr, int index)
803 if (index < 6) /* VCC, VCORE */
810 if (index >= 6 && index < 11 && (reg & 0x03) != 0x03) /* VSEN1 */
812 if (index >= 11 && index < 16 && (reg & 0x0c) != 0x0c) /* VSEN2 */
814 if (index >= 16 && (reg & 0x30) != 0x30) /* VSEN3 */
871 struct attribute *attr, int index)
875 int fan = index / 4; /* 4 attributes per fan */