Lines Matching refs:als_state

24 struct als_state {  struct
88 struct als_state *als_state = iio_priv(indio_dev); in als_read_raw() local
89 struct hid_sensor_hub_device *hsdev = als_state->common_attributes.hsdev; in als_read_raw()
102 report_id = als_state->als_illum.report_id; in als_read_raw()
103 min = als_state->als_illum.logical_minimum; in als_read_raw()
111 hid_sensor_power_state(&als_state->common_attributes, in als_read_raw()
116 hid_sensor_power_state(&als_state->common_attributes, in als_read_raw()
125 *val = als_state->scale_pre_decml; in als_read_raw()
126 *val2 = als_state->scale_post_decml; in als_read_raw()
127 ret_type = als_state->scale_precision; in als_read_raw()
130 *val = als_state->value_offset; in als_read_raw()
135 &als_state->common_attributes, val, val2); in als_read_raw()
139 &als_state->common_attributes, val, val2); in als_read_raw()
143 &als_state->common_attributes, val, val2); in als_read_raw()
160 struct als_state *als_state = iio_priv(indio_dev); in als_write_raw() local
166 &als_state->common_attributes, val, val2); in als_write_raw()
170 &als_state->common_attributes, val, val2); in als_write_raw()
174 &als_state->common_attributes, val, val2); in als_write_raw()
194 struct als_state *als_state = iio_priv(indio_dev); in als_proc_event() local
197 if (atomic_read(&als_state->common_attributes.data_ready)) { in als_proc_event()
198 if (!als_state->timestamp) in als_proc_event()
199 als_state->timestamp = iio_get_time_ns(indio_dev); in als_proc_event()
201 iio_push_to_buffers_with_timestamp(indio_dev, &als_state->scan, in als_proc_event()
202 als_state->timestamp); in als_proc_event()
203 als_state->timestamp = 0; in als_proc_event()
216 struct als_state *als_state = iio_priv(indio_dev); in als_capture_sample() local
222 als_state->scan.illum[CHANNEL_SCAN_INDEX_INTENSITY] = sample_data; in als_capture_sample()
223 als_state->scan.illum[CHANNEL_SCAN_INDEX_ILLUM] = sample_data; in als_capture_sample()
227 als_state->timestamp = hid_sensor_convert_timestamp(&als_state->common_attributes, in als_capture_sample()
242 struct als_state *st) in als_parse_report()
272 struct als_state *als_state; in hid_als_probe() local
275 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct als_state)); in hid_als_probe()
280 als_state = iio_priv(indio_dev); in hid_als_probe()
281 als_state->common_attributes.hsdev = hsdev; in hid_als_probe()
282 als_state->common_attributes.pdev = pdev; in hid_als_probe()
286 &als_state->common_attributes, in hid_als_probe()
304 als_state); in hid_als_probe()
316 atomic_set(&als_state->common_attributes.data_ready, 0); in hid_als_probe()
319 &als_state->common_attributes); in hid_als_probe()
331 als_state->callbacks.send_event = als_proc_event; in hid_als_probe()
332 als_state->callbacks.capture_sample = als_capture_sample; in hid_als_probe()
333 als_state->callbacks.pdev = pdev; in hid_als_probe()
334 ret = sensor_hub_register_callback(hsdev, hsdev->usage, &als_state->callbacks); in hid_als_probe()
345 hid_sensor_remove_trigger(indio_dev, &als_state->common_attributes); in hid_als_probe()
354 struct als_state *als_state = iio_priv(indio_dev); in hid_als_remove() local
358 hid_sensor_remove_trigger(indio_dev, &als_state->common_attributes); in hid_als_remove()