Lines Matching +full:1 +full:st
22 HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0},
28 HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0},
34 HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND, 1, 0},
39 {HID_USAGE_SENSOR_COMPASS_3D, HID_USAGE_SENSOR_UNITS_GAUSS, 1, 0},
45 HID_USAGE_SENSOR_UNITS_RADIANS, 1, 0},
47 {HID_USAGE_SENSOR_ALS, 0, 1, 0},
48 {HID_USAGE_SENSOR_ALS, HID_USAGE_SENSOR_UNITS_LUX, 1, 0},
57 {HID_USAGE_SENSOR_DEVICE_ORIENTATION, 0, 1, 0},
59 {HID_USAGE_SENSOR_RELATIVE_ORIENTATION, 0, 1, 0},
61 {HID_USAGE_SENSOR_GEOMAGNETIC_ORIENTATION, 0, 1, 0},
112 int sign = 1; in convert_from_vtf_format()
114 if (value & BIT(size*8 - 1)) { in convert_from_vtf_format()
115 value = ((1LL << (size * 8)) - value); in convert_from_vtf_format()
116 sign = -1; in convert_from_vtf_format()
135 int sign = 1; in convert_to_vtf_format()
138 sign = -1; in convert_to_vtf_format()
149 value = ((1LL << (size * 8)) - value); in convert_to_vtf_format()
154 s32 hid_sensor_read_poll_value(struct hid_sensor_common *st) in hid_sensor_read_poll_value() argument
159 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_read_poll_value()
160 st->poll.report_id, in hid_sensor_read_poll_value()
161 st->poll.index, sizeof(value), &value); in hid_sensor_read_poll_value()
166 if (st->poll.units == HID_USAGE_SENSOR_UNITS_SECOND) in hid_sensor_read_poll_value()
174 int hid_sensor_read_samp_freq_value(struct hid_sensor_common *st, in hid_sensor_read_samp_freq_value() argument
180 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_read_samp_freq_value()
181 st->poll.report_id, in hid_sensor_read_samp_freq_value()
182 st->poll.index, sizeof(value), &value); in hid_sensor_read_samp_freq_value()
187 if (st->poll.units == HID_USAGE_SENSOR_UNITS_MILLISECOND) in hid_sensor_read_samp_freq_value()
189 else if (st->poll.units == HID_USAGE_SENSOR_UNITS_SECOND) in hid_sensor_read_samp_freq_value()
190 simple_div(1, value, val1, val2); in hid_sensor_read_samp_freq_value()
201 int hid_sensor_write_samp_freq_value(struct hid_sensor_common *st, in hid_sensor_write_samp_freq_value() argument
212 if (st->poll.units == HID_USAGE_SENSOR_UNITS_MILLISECOND) in hid_sensor_write_samp_freq_value()
214 else if (st->poll.units == HID_USAGE_SENSOR_UNITS_SECOND) in hid_sensor_write_samp_freq_value()
219 ret = sensor_hub_set_feature(st->hsdev, st->poll.report_id, in hid_sensor_write_samp_freq_value()
220 st->poll.index, sizeof(value), &value); in hid_sensor_write_samp_freq_value()
224 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_write_samp_freq_value()
225 st->poll.report_id, in hid_sensor_write_samp_freq_value()
226 st->poll.index, sizeof(value), &value); in hid_sensor_write_samp_freq_value()
230 st->poll_interval = value; in hid_sensor_write_samp_freq_value()
236 int hid_sensor_read_raw_hyst_value(struct hid_sensor_common *st, in hid_sensor_read_raw_hyst_value() argument
242 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_read_raw_hyst_value()
243 st->sensitivity.report_id, in hid_sensor_read_raw_hyst_value()
244 st->sensitivity.index, sizeof(value), in hid_sensor_read_raw_hyst_value()
250 convert_from_vtf_format(value, st->sensitivity.size, in hid_sensor_read_raw_hyst_value()
251 st->sensitivity.unit_expo, in hid_sensor_read_raw_hyst_value()
259 int hid_sensor_read_raw_hyst_rel_value(struct hid_sensor_common *st, int *val1, in hid_sensor_read_raw_hyst_rel_value() argument
265 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_read_raw_hyst_rel_value()
266 st->sensitivity_rel.report_id, in hid_sensor_read_raw_hyst_rel_value()
267 st->sensitivity_rel.index, sizeof(value), in hid_sensor_read_raw_hyst_rel_value()
274 convert_from_vtf_format(value, st->sensitivity_rel.size, in hid_sensor_read_raw_hyst_rel_value()
275 st->sensitivity_rel.unit_expo, val1, val2); in hid_sensor_read_raw_hyst_rel_value()
282 int hid_sensor_write_raw_hyst_value(struct hid_sensor_common *st, in hid_sensor_write_raw_hyst_value() argument
291 value = convert_to_vtf_format(st->sensitivity.size, in hid_sensor_write_raw_hyst_value()
292 st->sensitivity.unit_expo, in hid_sensor_write_raw_hyst_value()
294 ret = sensor_hub_set_feature(st->hsdev, st->sensitivity.report_id, in hid_sensor_write_raw_hyst_value()
295 st->sensitivity.index, sizeof(value), in hid_sensor_write_raw_hyst_value()
300 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_write_raw_hyst_value()
301 st->sensitivity.report_id, in hid_sensor_write_raw_hyst_value()
302 st->sensitivity.index, sizeof(value), in hid_sensor_write_raw_hyst_value()
307 st->raw_hystersis = value; in hid_sensor_write_raw_hyst_value()
313 int hid_sensor_write_raw_hyst_rel_value(struct hid_sensor_common *st, in hid_sensor_write_raw_hyst_rel_value() argument
322 value = convert_to_vtf_format(st->sensitivity_rel.size, in hid_sensor_write_raw_hyst_rel_value()
323 st->sensitivity_rel.unit_expo, in hid_sensor_write_raw_hyst_rel_value()
325 ret = sensor_hub_set_feature(st->hsdev, st->sensitivity_rel.report_id, in hid_sensor_write_raw_hyst_rel_value()
326 st->sensitivity_rel.index, sizeof(value), in hid_sensor_write_raw_hyst_rel_value()
331 ret = sensor_hub_get_feature(st->hsdev, in hid_sensor_write_raw_hyst_rel_value()
332 st->sensitivity_rel.report_id, in hid_sensor_write_raw_hyst_rel_value()
333 st->sensitivity_rel.index, sizeof(value), in hid_sensor_write_raw_hyst_rel_value()
338 st->raw_hystersis = value; in hid_sensor_write_raw_hyst_rel_value()
350 * 1.001745329 ->exp:0-> val0[1]val1[1745329]
374 res += int_pow(10, exp - 1 - i) * x; in adjust_exponent_nano()
409 *val0 = 1; in hid_sensor_format_scale()
428 int64_t hid_sensor_convert_timestamp(struct hid_sensor_common *st, in hid_sensor_convert_timestamp() argument
431 return st->timestamp_ns_scale * raw_value; in hid_sensor_convert_timestamp()
438 struct hid_sensor_common *st) in hid_sensor_get_reporting_interval() argument
443 &st->poll); in hid_sensor_get_reporting_interval()
445 if (st->poll.units == 0) in hid_sensor_get_reporting_interval()
446 st->poll.units = HID_USAGE_SENSOR_UNITS_MILLISECOND; in hid_sensor_get_reporting_interval()
448 st->poll_interval = -1; in hid_sensor_get_reporting_interval()
456 struct hid_sensor_common *st) in hid_sensor_get_report_latency_info() argument
461 &st->report_latency); in hid_sensor_get_report_latency_info()
464 st->report_latency.index, st->report_latency.report_id); in hid_sensor_get_report_latency_info()
467 int hid_sensor_get_report_latency(struct hid_sensor_common *st) in hid_sensor_get_report_latency() argument
472 ret = sensor_hub_get_feature(st->hsdev, st->report_latency.report_id, in hid_sensor_get_report_latency()
473 st->report_latency.index, sizeof(value), in hid_sensor_get_report_latency()
482 int hid_sensor_set_report_latency(struct hid_sensor_common *st, int latency_ms) in hid_sensor_set_report_latency() argument
484 return sensor_hub_set_feature(st->hsdev, st->report_latency.report_id, in hid_sensor_set_report_latency()
485 st->report_latency.index, in hid_sensor_set_report_latency()
490 bool hid_sensor_batch_mode_supported(struct hid_sensor_common *st) in hid_sensor_batch_mode_supported() argument
492 return st->report_latency.index > 0 && st->report_latency.report_id > 0; in hid_sensor_batch_mode_supported()
498 struct hid_sensor_common *st, in hid_sensor_parse_common_attributes() argument
508 hid_sensor_get_reporting_interval(hsdev, usage_id, st); in hid_sensor_parse_common_attributes()
513 &st->report_state); in hid_sensor_parse_common_attributes()
518 &st->power_state); in hid_sensor_parse_common_attributes()
520 st->power_state.logical_minimum = 1; in hid_sensor_parse_common_attributes()
521 st->report_state.logical_minimum = 1; in hid_sensor_parse_common_attributes()
526 &st->sensitivity); in hid_sensor_parse_common_attributes()
531 &st->sensitivity_rel); in hid_sensor_parse_common_attributes()
537 if (st->sensitivity.index < 0) in hid_sensor_parse_common_attributes()
542 &st->sensitivity); in hid_sensor_parse_common_attributes()
544 if (st->sensitivity_rel.index < 0) in hid_sensor_parse_common_attributes()
549 &st->sensitivity_rel); in hid_sensor_parse_common_attributes()
552 st->raw_hystersis = -1; in hid_sensor_parse_common_attributes()
563 st->timestamp_ns_scale = val0; in hid_sensor_parse_common_attributes()
565 st->timestamp_ns_scale = 1000000000; in hid_sensor_parse_common_attributes()
567 hid_sensor_get_report_latency_info(hsdev, usage_id, st); in hid_sensor_parse_common_attributes()
570 st->poll.index, st->poll.report_id, in hid_sensor_parse_common_attributes()
571 st->report_state.index, st->report_state.report_id, in hid_sensor_parse_common_attributes()
572 st->power_state.index, st->power_state.report_id, in hid_sensor_parse_common_attributes()
573 st->sensitivity.index, st->sensitivity.report_id, in hid_sensor_parse_common_attributes()
577 st->power_state.report_id, in hid_sensor_parse_common_attributes()
578 st->power_state.index, sizeof(value), &value); in hid_sensor_parse_common_attributes()