Lines Matching full:temp
199 u8 temp[ADT7462_TEMP_COUNT]; member
200 /* bits 6-7 are quarter pieces of temp */
692 data->temp[i] = i2c_smbus_read_byte_data(client, in adt7462_update_device()
797 long temp; in temp_min_store() local
799 if (kstrtol(buf, 10, &temp) || !temp_enabled(data, attr->index)) in temp_min_store()
802 temp = clamp_val(temp, -64000, 191000); in temp_min_store()
803 temp = DIV_ROUND_CLOSEST(temp, 1000) + 64; in temp_min_store()
806 data->temp_min[attr->index] = temp; in temp_min_store()
808 temp); in temp_min_store()
833 long temp; in temp_max_store() local
835 if (kstrtol(buf, 10, &temp) || !temp_enabled(data, attr->index)) in temp_max_store()
838 temp = clamp_val(temp, -64000, 191000); in temp_max_store()
839 temp = DIV_ROUND_CLOSEST(temp, 1000) + 64; in temp_max_store()
842 data->temp_max[attr->index] = temp; in temp_max_store()
844 temp); in temp_max_store()
860 return sprintf(buf, "%d\n", 1000 * (data->temp[attr->index] - 64) + in temp_show()
894 long temp; in volt_max_store() local
896 if (kstrtol(buf, 10, &temp) || !x) in volt_max_store()
899 temp = clamp_val(temp, 0, 255 * x / 1000); in volt_max_store()
900 temp *= 1000; /* convert mV to uV */ in volt_max_store()
901 temp = DIV_ROUND_CLOSEST(temp, x); in volt_max_store()
904 data->volt_max[attr->index] = temp; in volt_max_store()
907 temp); in volt_max_store()
934 long temp; in volt_min_store() local
936 if (kstrtol(buf, 10, &temp) || !x) in volt_min_store()
939 temp = clamp_val(temp, 0, 255 * x / 1000); in volt_min_store()
940 temp *= 1000; /* convert mV to uV */ in volt_min_store()
941 temp = DIV_ROUND_CLOSEST(temp, x); in volt_min_store()
944 data->volt_min[attr->index] = temp; in volt_min_store()
947 temp); in volt_min_store()
999 u16 temp; in fan_min_show() local
1002 temp = data->fan_min[attr->index]; in fan_min_show()
1003 temp <<= 8; in fan_min_show()
1006 !FAN_DATA_VALID(temp)) in fan_min_show()
1009 return sprintf(buf, "%d\n", FAN_PERIOD_TO_RPM(temp)); in fan_min_show()
1019 long temp; in fan_min_store() local
1021 if (kstrtol(buf, 10, &temp) || !temp || in fan_min_store()
1025 temp = FAN_RPM_TO_PERIOD(temp); in fan_min_store()
1026 temp >>= 8; in fan_min_store()
1027 temp = clamp_val(temp, 1, 255); in fan_min_store()
1030 data->fan_min[attr->index] = temp; in fan_min_store()
1032 temp); in fan_min_store()
1065 long temp; in force_pwm_max_store() local
1068 if (kstrtol(buf, 10, &temp)) in force_pwm_max_store()
1073 if (temp) in force_pwm_max_store()
1098 long temp; in pwm_store() local
1100 if (kstrtol(buf, 10, &temp)) in pwm_store()
1103 temp = clamp_val(temp, 0, 255); in pwm_store()
1106 data->pwm[attr->index] = temp; in pwm_store()
1107 i2c_smbus_write_byte_data(client, ADT7462_REG_PWM(attr->index), temp); in pwm_store()
1126 long temp; in pwm_max_store() local
1128 if (kstrtol(buf, 10, &temp)) in pwm_max_store()
1131 temp = clamp_val(temp, 0, 255); in pwm_max_store()
1134 data->pwm_max = temp; in pwm_max_store()
1135 i2c_smbus_write_byte_data(client, ADT7462_REG_PWM_MAX, temp); in pwm_max_store()
1156 long temp; in pwm_min_store() local
1158 if (kstrtol(buf, 10, &temp)) in pwm_min_store()
1161 temp = clamp_val(temp, 0, 255); in pwm_min_store()
1164 data->pwm_min[attr->index] = temp; in pwm_min_store()
1166 temp); in pwm_min_store()
1188 long temp; in pwm_hyst_store() local
1190 if (kstrtol(buf, 10, &temp)) in pwm_hyst_store()
1193 temp = clamp_val(temp, 0, 15000); in pwm_hyst_store()
1194 temp = DIV_ROUND_CLOSEST(temp, 1000); in pwm_hyst_store()
1197 temp &= ADT7462_PWM_HYST_MASK; in pwm_hyst_store()
1198 temp |= data->pwm_trange[attr->index] & ADT7462_PWM_RANGE_MASK; in pwm_hyst_store()
1201 data->pwm_trange[attr->index] = temp; in pwm_hyst_store()
1203 temp); in pwm_hyst_store()
1227 int temp; in pwm_tmax_store() local
1243 temp = trange_value << ADT7462_PWM_RANGE_SHIFT; in pwm_tmax_store()
1244 temp |= data->pwm_trange[attr->index] & ADT7462_PWM_HYST_MASK; in pwm_tmax_store()
1247 data->pwm_trange[attr->index] = temp; in pwm_tmax_store()
1249 temp); in pwm_tmax_store()
1270 long temp; in pwm_tmin_store() local
1272 if (kstrtol(buf, 10, &temp)) in pwm_tmin_store()
1275 temp = clamp_val(temp, -64000, 191000); in pwm_tmin_store()
1276 temp = DIV_ROUND_CLOSEST(temp, 1000) + 64; in pwm_tmin_store()
1279 data->pwm_tmin[attr->index] = temp; in pwm_tmin_store()
1281 temp); in pwm_tmin_store()
1309 int temp = data->pwm_cfg[which] & ~ADT7462_PWM_CHANNEL_MASK; in set_pwm_channel() local
1310 temp |= value << ADT7462_PWM_CHANNEL_SHIFT; in set_pwm_channel()
1313 data->pwm_cfg[which] = temp; in set_pwm_channel()
1314 i2c_smbus_write_byte_data(client, ADT7462_REG_PWM_CFG(which), temp); in set_pwm_channel()
1325 long temp; in pwm_auto_store() local
1327 if (kstrtol(buf, 10, &temp)) in pwm_auto_store()
1330 switch (temp) { in pwm_auto_store()
1350 case 0: /* temp[1234] only */ in pwm_auto_temp_show()
1382 long temp; in pwm_auto_temp_store() local
1384 if (kstrtol(buf, 10, &temp)) in pwm_auto_temp_store()
1387 temp = cvt_auto_temp(temp); in pwm_auto_temp_store()
1388 if (temp < 0) in pwm_auto_temp_store()
1389 return temp; in pwm_auto_temp_store()
1391 set_pwm_channel(client, data, attr->index, temp); in pwm_auto_temp_store()
1406 static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, 0);
1407 static SENSOR_DEVICE_ATTR_RO(temp2_input, temp, 1);
1408 static SENSOR_DEVICE_ATTR_RO(temp3_input, temp, 2);
1409 static SENSOR_DEVICE_ATTR_RO(temp4_input, temp, 3);