Lines Matching refs:temp
150 s8 temp[ADT7470_TEMP_COUNT]; member
244 data->temp[i] = i2c_smbus_read_byte_data(client, in adt7470_read_temperatures()
246 if (data->temp[i]) in adt7470_read_temperatures()
309 data->temp[i] = i2c_smbus_read_byte_data(client, in adt7470_update_device()
406 long temp; in auto_update_interval_store() local
408 if (kstrtol(buf, 10, &temp)) in auto_update_interval_store()
411 temp = clamp_val(temp, 0, 60000); in auto_update_interval_store()
414 data->auto_update_interval = temp; in auto_update_interval_store()
433 long temp; in num_temp_sensors_store() local
435 if (kstrtol(buf, 10, &temp)) in num_temp_sensors_store()
438 temp = clamp_val(temp, -1, 10); in num_temp_sensors_store()
441 data->num_temp_sensors = temp; in num_temp_sensors_store()
442 if (temp < 0) in num_temp_sensors_store()
464 long temp; in temp_min_store() local
466 if (kstrtol(buf, 10, &temp)) in temp_min_store()
469 temp = clamp_val(temp, -128000, 127000); in temp_min_store()
470 temp = DIV_ROUND_CLOSEST(temp, 1000); in temp_min_store()
473 data->temp_min[attr->index] = temp; in temp_min_store()
475 temp); in temp_min_store()
496 long temp; in temp_max_store() local
498 if (kstrtol(buf, 10, &temp)) in temp_max_store()
501 temp = clamp_val(temp, -128000, 127000); in temp_max_store()
502 temp = DIV_ROUND_CLOSEST(temp, 1000); in temp_max_store()
505 data->temp_max[attr->index] = temp; in temp_max_store()
507 temp); in temp_max_store()
518 return sprintf(buf, "%d\n", 1000 * data->temp[attr->index]); in temp_show()
571 long temp; in fan_max_store() local
573 if (kstrtol(buf, 10, &temp) || !temp) in fan_max_store()
576 temp = FAN_RPM_TO_PERIOD(temp); in fan_max_store()
577 temp = clamp_val(temp, 1, 65534); in fan_max_store()
580 data->fan_max[attr->index] = temp; in fan_max_store()
581 adt7470_write_word_data(client, ADT7470_REG_FAN_MAX(attr->index), temp); in fan_max_store()
607 long temp; in fan_min_store() local
609 if (kstrtol(buf, 10, &temp) || !temp) in fan_min_store()
612 temp = FAN_RPM_TO_PERIOD(temp); in fan_min_store()
613 temp = clamp_val(temp, 1, 65534); in fan_min_store()
616 data->fan_min[attr->index] = temp; in fan_min_store()
617 adt7470_write_word_data(client, ADT7470_REG_FAN_MIN(attr->index), temp); in fan_min_store()
649 long temp; in force_pwm_max_store() local
652 if (kstrtol(buf, 10, &temp)) in force_pwm_max_store()
656 data->force_pwm_max = temp; in force_pwm_max_store()
658 if (temp) in force_pwm_max_store()
682 long temp; in pwm_store() local
684 if (kstrtol(buf, 10, &temp)) in pwm_store()
687 temp = clamp_val(temp, 0, 255); in pwm_store()
690 data->pwm[attr->index] = temp; in pwm_store()
691 i2c_smbus_write_byte_data(client, ADT7470_REG_PWM(attr->index), temp); in pwm_store()
776 long temp; in pwm_max_store() local
778 if (kstrtol(buf, 10, &temp)) in pwm_max_store()
781 temp = clamp_val(temp, 0, 255); in pwm_max_store()
784 data->pwm_max[attr->index] = temp; in pwm_max_store()
786 temp); in pwm_max_store()
807 long temp; in pwm_min_store() local
809 if (kstrtol(buf, 10, &temp)) in pwm_min_store()
812 temp = clamp_val(temp, 0, 255); in pwm_min_store()
815 data->pwm_min[attr->index] = temp; in pwm_min_store()
817 temp); in pwm_min_store()
847 long temp; in pwm_tmin_store() local
849 if (kstrtol(buf, 10, &temp)) in pwm_tmin_store()
852 temp = clamp_val(temp, -128000, 127000); in pwm_tmin_store()
853 temp = DIV_ROUND_CLOSEST(temp, 1000); in pwm_tmin_store()
856 data->pwm_tmin[attr->index] = temp; in pwm_tmin_store()
858 temp); in pwm_tmin_store()
881 long temp; in pwm_auto_store() local
884 if (kstrtol(buf, 10, &temp)) in pwm_auto_store()
892 if (temp != 2 && temp != 1) in pwm_auto_store()
894 temp--; in pwm_auto_store()
897 data->pwm_automatic[attr->index] = temp; in pwm_auto_store()
899 if (temp) in pwm_auto_store()
939 long temp; in pwm_auto_temp_store() local
942 if (kstrtol(buf, 10, &temp)) in pwm_auto_temp_store()
945 temp = cvt_auto_temp(temp); in pwm_auto_temp_store()
946 if (temp < 0) in pwm_auto_temp_store()
947 return temp; in pwm_auto_temp_store()
950 data->pwm_automatic[attr->index] = temp; in pwm_auto_temp_store()
955 reg |= (temp << 4) & 0xF0; in pwm_auto_temp_store()
958 reg |= temp & 0xF; in pwm_auto_temp_store()
1005 static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, 0);
1006 static SENSOR_DEVICE_ATTR_RO(temp2_input, temp, 1);
1007 static SENSOR_DEVICE_ATTR_RO(temp3_input, temp, 2);
1008 static SENSOR_DEVICE_ATTR_RO(temp4_input, temp, 3);
1009 static SENSOR_DEVICE_ATTR_RO(temp5_input, temp, 4);
1010 static SENSOR_DEVICE_ATTR_RO(temp6_input, temp, 5);
1011 static SENSOR_DEVICE_ATTR_RO(temp7_input, temp, 6);
1012 static SENSOR_DEVICE_ATTR_RO(temp8_input, temp, 7);
1013 static SENSOR_DEVICE_ATTR_RO(temp9_input, temp, 8);
1014 static SENSOR_DEVICE_ATTR_RO(temp10_input, temp, 9);