• Home
  • Raw
  • Download

Lines Matching refs:hsdev

51 	struct hid_sensor_hub_device *hsdev;  member
102 struct hid_sensor_hub_device **hsdev, in sensor_hub_get_callback() argument
114 callback->hsdev->start_collection_index) && in sensor_hub_get_callback()
116 callback->hsdev->end_collection_index)) { in sensor_hub_get_callback()
118 *hsdev = callback->hsdev; in sensor_hub_get_callback()
128 int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev, in sensor_hub_register_callback() argument
133 struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev); in sensor_hub_register_callback()
139 callback->hsdev == hsdev) { in sensor_hub_register_callback()
148 callback->hsdev = hsdev; in sensor_hub_register_callback()
170 int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev, in sensor_hub_remove_callback() argument
174 struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev); in sensor_hub_remove_callback()
180 callback->hsdev == hsdev) { in sensor_hub_remove_callback()
191 int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, in sensor_hub_set_feature() argument
195 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); in sensor_hub_set_feature()
203 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); in sensor_hub_set_feature()
229 hid_hw_request(hsdev->hdev, report, HID_REQ_SET_REPORT); in sensor_hub_set_feature()
230 hid_hw_wait(hsdev->hdev); in sensor_hub_set_feature()
239 int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, in sensor_hub_get_feature() argument
243 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); in sensor_hub_get_feature()
253 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); in sensor_hub_get_feature()
259 hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT); in sensor_hub_get_feature()
260 hid_hw_wait(hsdev->hdev); in sensor_hub_get_feature()
291 int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev, in sensor_hub_input_attr_get_raw_value() argument
297 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); in sensor_hub_input_attr_get_raw_value()
302 report = sensor_hub_report(report_id, hsdev->hdev, in sensor_hub_input_attr_get_raw_value()
307 mutex_lock(hsdev->mutex_ptr); in sensor_hub_input_attr_get_raw_value()
309 memset(&hsdev->pending, 0, sizeof(hsdev->pending)); in sensor_hub_input_attr_get_raw_value()
310 init_completion(&hsdev->pending.ready); in sensor_hub_input_attr_get_raw_value()
311 hsdev->pending.usage_id = usage_id; in sensor_hub_input_attr_get_raw_value()
312 hsdev->pending.attr_usage_id = attr_usage_id; in sensor_hub_input_attr_get_raw_value()
313 hsdev->pending.raw_size = 0; in sensor_hub_input_attr_get_raw_value()
316 hsdev->pending.status = true; in sensor_hub_input_attr_get_raw_value()
320 hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT); in sensor_hub_input_attr_get_raw_value()
324 &hsdev->pending.ready, HZ*5); in sensor_hub_input_attr_get_raw_value()
325 switch (hsdev->pending.raw_size) { in sensor_hub_input_attr_get_raw_value()
328 ret_val = *(s8 *)hsdev->pending.raw_data; in sensor_hub_input_attr_get_raw_value()
330 ret_val = *(u8 *)hsdev->pending.raw_data; in sensor_hub_input_attr_get_raw_value()
334 ret_val = *(s16 *)hsdev->pending.raw_data; in sensor_hub_input_attr_get_raw_value()
336 ret_val = *(u16 *)hsdev->pending.raw_data; in sensor_hub_input_attr_get_raw_value()
339 ret_val = *(u32 *)hsdev->pending.raw_data; in sensor_hub_input_attr_get_raw_value()
344 kfree(hsdev->pending.raw_data); in sensor_hub_input_attr_get_raw_value()
345 hsdev->pending.status = false; in sensor_hub_input_attr_get_raw_value()
347 mutex_unlock(hsdev->mutex_ptr); in sensor_hub_input_attr_get_raw_value()
353 int hid_sensor_get_usage_index(struct hid_sensor_hub_device *hsdev, in hid_sensor_get_usage_index() argument
360 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); in hid_sensor_get_usage_index()
375 int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev, in sensor_hub_input_get_attribute_info() argument
386 struct hid_device *hdev = hsdev->hdev; in sensor_hub_input_get_attribute_info()
406 hsdev->start_collection_index) && in sensor_hub_input_get_attribute_info()
408 hsdev->end_collection_index)) { in sensor_hub_input_get_attribute_info()
437 callback->hsdev, callback->priv); in sensor_hub_suspend()
455 callback->hsdev, callback->priv); in sensor_hub_resume()
482 struct hid_sensor_hub_device *hsdev = NULL; in sensor_hub_raw_event() local
512 &hsdev, &priv); in sensor_hub_raw_event()
517 if (hsdev->pending.status && (hsdev->pending.attr_usage_id == in sensor_hub_raw_event()
519 hsdev->pending.attr_usage_id == in sensor_hub_raw_event()
522 hsdev->pending.raw_data = kmemdup(ptr, sz, GFP_ATOMIC); in sensor_hub_raw_event()
523 if (hsdev->pending.raw_data) in sensor_hub_raw_event()
524 hsdev->pending.raw_size = sz; in sensor_hub_raw_event()
526 hsdev->pending.raw_size = 0; in sensor_hub_raw_event()
527 complete(&hsdev->pending.ready); in sensor_hub_raw_event()
531 callback->capture_sample(hsdev, in sensor_hub_raw_event()
535 callback->capture_sample(hsdev, in sensor_hub_raw_event()
542 callback->send_event(hsdev, collection->usage, in sensor_hub_raw_event()
549 int sensor_hub_device_open(struct hid_sensor_hub_device *hsdev) in sensor_hub_device_open() argument
552 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); in sensor_hub_device_open()
556 ret = hid_hw_open(hsdev->hdev); in sensor_hub_device_open()
558 hid_err(hsdev->hdev, "failed to open hid device\n"); in sensor_hub_device_open()
570 void sensor_hub_device_close(struct hid_sensor_hub_device *hsdev) in sensor_hub_device_close() argument
572 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); in sensor_hub_device_close()
577 hid_hw_close(hsdev->hdev); in sensor_hub_device_close()
612 struct hid_sensor_hub_device *hsdev; in sensor_hub_probe() local
665 hsdev = devm_kzalloc(&hdev->dev, sizeof(*hsdev), in sensor_hub_probe()
667 if (!hsdev) { in sensor_hub_probe()
672 hsdev->hdev = hdev; in sensor_hub_probe()
673 hsdev->vendor_id = hdev->vendor; in sensor_hub_probe()
674 hsdev->product_id = hdev->product; in sensor_hub_probe()
675 hsdev->usage = collection->usage; in sensor_hub_probe()
676 hsdev->mutex_ptr = devm_kzalloc(&hdev->dev, in sensor_hub_probe()
679 if (!hsdev->mutex_ptr) { in sensor_hub_probe()
683 mutex_init(hsdev->mutex_ptr); in sensor_hub_probe()
684 hsdev->start_collection_index = i; in sensor_hub_probe()
687 last_hsdev = hsdev; in sensor_hub_probe()
700 hsdev; in sensor_hub_probe()
703 sizeof(*hsdev); in sensor_hub_probe()
705 hsdev->start_collection_index); in sensor_hub_probe()
711 collection_hsdev = hsdev; in sensor_hub_probe()
744 struct hid_sensor_hub_device *hsdev = in sensor_hub_remove() local
746 if (hsdev->pending.status) in sensor_hub_remove()
747 complete(&hsdev->pending.ready); in sensor_hub_remove()