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