Lines Matching refs:sattr

86 	struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr);  in temp_type_show()  local
94 return sprintf(buf, "%u\n", (mode >> (2 * sattr->index) & 3) + 2); in temp_type_show()
102 struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); in temp_type_store() local
109 if (sattr->index == 2 && type != 4) /* RD3 */ in temp_type_store()
114 3 << 2 * sattr->index, (type - 2) << 2 * sattr->index); in temp_type_store()
121 struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); in pwm_mode_show() local
126 if (sattr->index > 1) in pwm_mode_show()
133 return sprintf(buf, "%u\n", !(regval & (1 << sattr->index))); in pwm_mode_show()
174 struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); in pwm_enable_show() local
178 ret = regmap_read(data->regmap, REG_SMARTFAN_EN(sattr->index), &reg); in pwm_enable_show()
181 enabled = reg >> SMARTFAN_EN_SHIFT(sattr->index) & 1; in pwm_enable_show()
190 struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); in pwm_enable_store() local
199 ret = regmap_update_bits(data->regmap, REG_SMARTFAN_EN(sattr->index), in pwm_enable_store()
200 1 << SMARTFAN_EN_SHIFT(sattr->index), in pwm_enable_store()
201 (val - 1) << SMARTFAN_EN_SHIFT(sattr->index)); in pwm_enable_store()
361 struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); in in_show() local
365 voltage = nct7802_read_voltage(data, sattr->nr, sattr->index); in in_show()
375 struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); in in_store() local
377 int index = sattr->index; in in_store()
378 int nr = sattr->nr; in in_store()
393 struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); in in_alarm_show() local
420 if (!(data->in_status & (0x10 << sattr->index))) { in in_alarm_show()
421 ret = nct7802_read_voltage(data, sattr->nr, 0); in in_alarm_show()
426 ret = nct7802_read_voltage(data, sattr->nr, 1); in in_alarm_show()
431 ret = nct7802_read_voltage(data, sattr->nr, 2); in in_alarm_show()
437 data->in_status |= (1 << sattr->index); in in_alarm_show()
439 data->in_status &= ~(1 << sattr->index); in in_alarm_show()
441 data->in_status |= 0x10 << sattr->index; in in_alarm_show()
444 ret = sprintf(buf, "%u\n", !!(data->in_status & (1 << sattr->index))); in in_alarm_show()
454 struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); in temp_show() local
457 err = nct7802_read_temp(data, sattr->nr, sattr->index, &temp); in temp_show()
467 struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); in temp_store() local
469 int nr = sattr->nr; in temp_store()
486 struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr); in fan_show() local
490 speed = nct7802_read_fan(data, sattr->index); in fan_show()
500 struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); in fan_min_show() local
504 speed = nct7802_read_fan_min(data, sattr->nr, sattr->index); in fan_min_show()
515 struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); in fan_min_store() local
524 err = nct7802_write_fan_min(data, sattr->nr, sattr->index, val); in fan_min_store()
532 struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); in alarm_show() local
533 int bit = sattr->index; in alarm_show()
537 ret = regmap_read(data->regmap, sattr->nr, &val); in alarm_show()
547 struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); in beep_show() local
552 err = regmap_read(data->regmap, sattr->nr, &regval); in beep_show()
556 return sprintf(buf, "%u\n", !!(regval & (1 << sattr->index))); in beep_show()
563 struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr); in beep_store() local
574 err = regmap_update_bits(data->regmap, sattr->nr, 1 << sattr->index, in beep_store()
575 val ? 1 << sattr->index : 0); in beep_store()