Lines Matching +full:1 +full:st

29 		HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0},
35 HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0},
41 HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND, 1, 0},
46 {HID_USAGE_SENSOR_COMPASS_3D, HID_USAGE_SENSOR_UNITS_GAUSS, 1, 0},
52 HID_USAGE_SENSOR_UNITS_RADIANS, 1, 0},
54 {HID_USAGE_SENSOR_ALS, 0, 1, 0},
55 {HID_USAGE_SENSOR_ALS, HID_USAGE_SENSOR_UNITS_LUX, 1, 0},
64 {HID_USAGE_SENSOR_DEVICE_ORIENTATION, 0, 1, 0},
66 {HID_USAGE_SENSOR_RELATIVE_ORIENTATION, 0, 1, 0},
68 {HID_USAGE_SENSOR_GEOMAGNETIC_ORIENTATION, 0, 1, 0},
117 int sign = 1; in convert_from_vtf_format()
119 if (value & BIT(size*8 - 1)) { in convert_from_vtf_format()
120 value = ((1LL << (size * 8)) - value); in convert_from_vtf_format()
121 sign = -1; in convert_from_vtf_format()
140 int sign = 1; in convert_to_vtf_format()
143 sign = -1; in convert_to_vtf_format()
154 value = ((1LL << (size * 8)) - value); in convert_to_vtf_format()
159 s32 hid_sensor_read_poll_value(struct hid_sensor_common *st) in hid_sensor_read_poll_value() argument
164 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_read_poll_value()
165 st->poll.report_id, in hid_sensor_read_poll_value()
166 st->poll.index, sizeof(value), &value); in hid_sensor_read_poll_value()
171 if (st->poll.units == HID_USAGE_SENSOR_UNITS_SECOND) in hid_sensor_read_poll_value()
179 int hid_sensor_read_samp_freq_value(struct hid_sensor_common *st, in hid_sensor_read_samp_freq_value() argument
185 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_read_samp_freq_value()
186 st->poll.report_id, in hid_sensor_read_samp_freq_value()
187 st->poll.index, sizeof(value), &value); in hid_sensor_read_samp_freq_value()
192 if (st->poll.units == HID_USAGE_SENSOR_UNITS_MILLISECOND) in hid_sensor_read_samp_freq_value()
194 else if (st->poll.units == HID_USAGE_SENSOR_UNITS_SECOND) in hid_sensor_read_samp_freq_value()
195 simple_div(1, value, val1, val2); in hid_sensor_read_samp_freq_value()
206 int hid_sensor_write_samp_freq_value(struct hid_sensor_common *st, in hid_sensor_write_samp_freq_value() argument
217 if (st->poll.units == HID_USAGE_SENSOR_UNITS_MILLISECOND) in hid_sensor_write_samp_freq_value()
219 else if (st->poll.units == HID_USAGE_SENSOR_UNITS_SECOND) in hid_sensor_write_samp_freq_value()
224 ret = sensor_hub_set_feature(st->hsdev, st->poll.report_id, in hid_sensor_write_samp_freq_value()
225 st->poll.index, sizeof(value), &value); in hid_sensor_write_samp_freq_value()
229 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_write_samp_freq_value()
230 st->poll.report_id, in hid_sensor_write_samp_freq_value()
231 st->poll.index, sizeof(value), &value); in hid_sensor_write_samp_freq_value()
235 st->poll_interval = value; in hid_sensor_write_samp_freq_value()
241 int hid_sensor_read_raw_hyst_value(struct hid_sensor_common *st, in hid_sensor_read_raw_hyst_value() argument
247 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_read_raw_hyst_value()
248 st->sensitivity.report_id, in hid_sensor_read_raw_hyst_value()
249 st->sensitivity.index, sizeof(value), in hid_sensor_read_raw_hyst_value()
255 convert_from_vtf_format(value, st->sensitivity.size, in hid_sensor_read_raw_hyst_value()
256 st->sensitivity.unit_expo, in hid_sensor_read_raw_hyst_value()
264 int hid_sensor_write_raw_hyst_value(struct hid_sensor_common *st, in hid_sensor_write_raw_hyst_value() argument
273 value = convert_to_vtf_format(st->sensitivity.size, in hid_sensor_write_raw_hyst_value()
274 st->sensitivity.unit_expo, in hid_sensor_write_raw_hyst_value()
276 ret = sensor_hub_set_feature(st->hsdev, st->sensitivity.report_id, in hid_sensor_write_raw_hyst_value()
277 st->sensitivity.index, sizeof(value), in hid_sensor_write_raw_hyst_value()
282 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_write_raw_hyst_value()
283 st->sensitivity.report_id, in hid_sensor_write_raw_hyst_value()
284 st->sensitivity.index, sizeof(value), in hid_sensor_write_raw_hyst_value()
289 st->raw_hystersis = value; in hid_sensor_write_raw_hyst_value()
301 * 1.001745329 ->exp:0-> val0[1]val1[1745329]
325 res += int_pow(10, exp - 1 - i) * x; in adjust_exponent_nano()
360 *val0 = 1; in hid_sensor_format_scale()
379 int64_t hid_sensor_convert_timestamp(struct hid_sensor_common *st, in hid_sensor_convert_timestamp() argument
382 return st->timestamp_ns_scale * raw_value; in hid_sensor_convert_timestamp()
389 struct hid_sensor_common *st) in hid_sensor_get_reporting_interval() argument
394 &st->poll); in hid_sensor_get_reporting_interval()
396 if (st->poll.units == 0) in hid_sensor_get_reporting_interval()
397 st->poll.units = HID_USAGE_SENSOR_UNITS_MILLISECOND; in hid_sensor_get_reporting_interval()
399 st->poll_interval = -1; in hid_sensor_get_reporting_interval()
407 struct hid_sensor_common *st) in hid_sensor_get_report_latency_info() argument
412 &st->report_latency); in hid_sensor_get_report_latency_info()
415 st->report_latency.index, st->report_latency.report_id); in hid_sensor_get_report_latency_info()
418 int hid_sensor_get_report_latency(struct hid_sensor_common *st) in hid_sensor_get_report_latency() argument
423 ret = sensor_hub_get_feature(st->hsdev, st->report_latency.report_id, in hid_sensor_get_report_latency()
424 st->report_latency.index, sizeof(value), in hid_sensor_get_report_latency()
433 int hid_sensor_set_report_latency(struct hid_sensor_common *st, int latency_ms) in hid_sensor_set_report_latency() argument
435 return sensor_hub_set_feature(st->hsdev, st->report_latency.report_id, in hid_sensor_set_report_latency()
436 st->report_latency.index, in hid_sensor_set_report_latency()
441 bool hid_sensor_batch_mode_supported(struct hid_sensor_common *st) in hid_sensor_batch_mode_supported() argument
443 return st->report_latency.index > 0 && st->report_latency.report_id > 0; in hid_sensor_batch_mode_supported()
449 struct hid_sensor_common *st) in hid_sensor_parse_common_attributes() argument
456 hid_sensor_get_reporting_interval(hsdev, usage_id, st); in hid_sensor_parse_common_attributes()
461 &st->report_state); in hid_sensor_parse_common_attributes()
466 &st->power_state); in hid_sensor_parse_common_attributes()
468 st->power_state.logical_minimum = 1; in hid_sensor_parse_common_attributes()
469 st->report_state.logical_minimum = 1; in hid_sensor_parse_common_attributes()
474 &st->sensitivity); in hid_sensor_parse_common_attributes()
476 st->raw_hystersis = -1; in hid_sensor_parse_common_attributes()
487 st->timestamp_ns_scale = val0; in hid_sensor_parse_common_attributes()
489 st->timestamp_ns_scale = 1000000000; in hid_sensor_parse_common_attributes()
491 hid_sensor_get_report_latency_info(hsdev, usage_id, st); in hid_sensor_parse_common_attributes()
494 st->poll.index, st->poll.report_id, in hid_sensor_parse_common_attributes()
495 st->report_state.index, st->report_state.report_id, in hid_sensor_parse_common_attributes()
496 st->power_state.index, st->power_state.report_id, in hid_sensor_parse_common_attributes()
497 st->sensitivity.index, st->sensitivity.report_id, in hid_sensor_parse_common_attributes()
501 st->power_state.report_id, in hid_sensor_parse_common_attributes()
502 st->power_state.index, sizeof(value), &value); in hid_sensor_parse_common_attributes()