Lines Matching refs:temp
173 u16 temp[6][3]; member
183 int temp = reg; in tmp401_register_to_temp() local
186 temp -= 64 * 256; in tmp401_register_to_temp()
188 return DIV_ROUND_CLOSEST(temp * 125, 32); in tmp401_register_to_temp()
191 static u16 tmp401_temp_to_register(long temp, u8 config, int zbits) in tmp401_temp_to_register() argument
194 temp = clamp_val(temp, -64000, 191000); in tmp401_temp_to_register()
195 temp += 64000; in tmp401_temp_to_register()
197 temp = clamp_val(temp, 0, 127000); in tmp401_temp_to_register()
199 return DIV_ROUND_CLOSEST(temp * (1 << (8 - zbits)), 1000) << zbits; in tmp401_temp_to_register()
222 data->temp[j][i] = val << 8; in tmp401_update_device_reg16()
230 data->temp[j][i] |= val; in tmp401_update_device_reg16()
319 tmp401_register_to_temp(data->temp[nr][index], data->config)); in show_temp()
325 int temp, index = to_sensor_dev_attr(devattr)->index; in show_temp_crit_hyst() local
332 temp = tmp401_register_to_temp(data->temp[3][index], data->config); in show_temp_crit_hyst()
333 temp -= data->temp_crit_hyst * 1000; in show_temp_crit_hyst()
336 return sprintf(buf, "%d\n", temp); in show_temp_crit_hyst()
378 data->temp[nr][index] = reg; in store_temp()
388 int temp, index = to_sensor_dev_attr(devattr)->index; in store_temp_crit_hyst() local
405 temp = tmp401_register_to_temp(data->temp[3][index], data->config); in store_temp_crit_hyst()
406 val = clamp_val(val, temp - 255000, temp); in store_temp_crit_hyst()
407 reg = ((temp - val) + 500) / 1000; in store_temp_crit_hyst()