Lines Matching refs:value

109 static void convert_from_vtf_format(u32 value, int size, int exp,  in convert_from_vtf_format()  argument
114 if (value & BIT(size*8 - 1)) { in convert_from_vtf_format()
115 value = ((1LL << (size * 8)) - value); in convert_from_vtf_format()
120 *val1 = sign * value * pow_10(exp); in convert_from_vtf_format()
123 split_micro_fraction(value, -exp, val1, val2); in convert_from_vtf_format()
133 u32 value; in convert_to_vtf_format() local
140 value = abs(val1) * pow_10(-exp); in convert_to_vtf_format()
141 value += abs(val2) / pow_10(6+exp); in convert_to_vtf_format()
143 value = abs(val1) / pow_10(exp); in convert_to_vtf_format()
145 value = ((1LL << (size * 8)) - value); in convert_to_vtf_format()
147 return value; in convert_to_vtf_format()
152 s32 value = 0; in hid_sensor_read_poll_value() local
157 st->poll.index, sizeof(value), &value); in hid_sensor_read_poll_value()
159 if (ret < 0 || value < 0) { in hid_sensor_read_poll_value()
163 value = value * 1000; in hid_sensor_read_poll_value()
166 return value; in hid_sensor_read_poll_value()
173 s32 value; in hid_sensor_read_samp_freq_value() local
178 st->poll.index, sizeof(value), &value); in hid_sensor_read_samp_freq_value()
179 if (ret < 0 || value < 0) { in hid_sensor_read_samp_freq_value()
184 simple_div(1000, value, val1, val2); in hid_sensor_read_samp_freq_value()
186 simple_div(1, value, val1, val2); in hid_sensor_read_samp_freq_value()
200 s32 value; in hid_sensor_write_samp_freq_value() local
206 value = val1 * pow_10(6) + val2; in hid_sensor_write_samp_freq_value()
207 if (value) { in hid_sensor_write_samp_freq_value()
209 value = pow_10(9)/value; in hid_sensor_write_samp_freq_value()
211 value = pow_10(6)/value; in hid_sensor_write_samp_freq_value()
213 value = 0; in hid_sensor_write_samp_freq_value()
216 st->poll.index, sizeof(value), &value); in hid_sensor_write_samp_freq_value()
217 if (ret < 0 || value < 0) in hid_sensor_write_samp_freq_value()
227 s32 value; in hid_sensor_read_raw_hyst_value() local
232 st->sensitivity.index, sizeof(value), in hid_sensor_read_raw_hyst_value()
233 &value); in hid_sensor_read_raw_hyst_value()
234 if (ret < 0 || value < 0) { in hid_sensor_read_raw_hyst_value()
238 convert_from_vtf_format(value, st->sensitivity.size, in hid_sensor_read_raw_hyst_value()
250 s32 value; in hid_sensor_write_raw_hyst_value() local
253 value = convert_to_vtf_format(st->sensitivity.size, in hid_sensor_write_raw_hyst_value()
257 st->sensitivity.index, sizeof(value), in hid_sensor_write_raw_hyst_value()
258 &value); in hid_sensor_write_raw_hyst_value()
259 if (ret < 0 || value < 0) in hid_sensor_write_raw_hyst_value()