Lines Matching refs:callback
104 struct hid_sensor_hub_callbacks_list *callback; in sensor_hub_get_callback() local
109 list_for_each_entry(callback, &pdata->dyn_callback_list, list) in sensor_hub_get_callback()
110 if ((callback->usage_id == usage_id || in sensor_hub_get_callback()
111 callback->usage_id == HID_USAGE_SENSOR_COLLECTION) && in sensor_hub_get_callback()
113 callback->hsdev->start_collection_index) && in sensor_hub_get_callback()
115 callback->hsdev->end_collection_index)) { in sensor_hub_get_callback()
116 *priv = callback->priv; in sensor_hub_get_callback()
117 *hsdev = callback->hsdev; in sensor_hub_get_callback()
120 return callback->usage_callback; in sensor_hub_get_callback()
131 struct hid_sensor_hub_callbacks_list *callback; in sensor_hub_register_callback() local
136 list_for_each_entry(callback, &pdata->dyn_callback_list, list) in sensor_hub_register_callback()
137 if (callback->usage_id == usage_id && in sensor_hub_register_callback()
138 callback->hsdev == hsdev) { in sensor_hub_register_callback()
142 callback = kzalloc(sizeof(*callback), GFP_ATOMIC); in sensor_hub_register_callback()
143 if (!callback) { in sensor_hub_register_callback()
147 callback->hsdev = hsdev; in sensor_hub_register_callback()
148 callback->usage_callback = usage_callback; in sensor_hub_register_callback()
149 callback->usage_id = usage_id; in sensor_hub_register_callback()
150 callback->priv = NULL; in sensor_hub_register_callback()
160 list_add(&callback->list, &pdata->dyn_callback_list); in sensor_hub_register_callback()
162 list_add_tail(&callback->list, &pdata->dyn_callback_list); in sensor_hub_register_callback()
172 struct hid_sensor_hub_callbacks_list *callback; in sensor_hub_remove_callback() local
177 list_for_each_entry(callback, &pdata->dyn_callback_list, list) in sensor_hub_remove_callback()
178 if (callback->usage_id == usage_id && in sensor_hub_remove_callback()
179 callback->hsdev == hsdev) { in sensor_hub_remove_callback()
180 list_del(&callback->list); in sensor_hub_remove_callback()
181 kfree(callback); in sensor_hub_remove_callback()
428 struct hid_sensor_hub_callbacks_list *callback; in sensor_hub_suspend() local
433 list_for_each_entry(callback, &pdata->dyn_callback_list, list) { in sensor_hub_suspend()
434 if (callback->usage_callback->suspend) in sensor_hub_suspend()
435 callback->usage_callback->suspend( in sensor_hub_suspend()
436 callback->hsdev, callback->priv); in sensor_hub_suspend()
446 struct hid_sensor_hub_callbacks_list *callback; in sensor_hub_resume() local
451 list_for_each_entry(callback, &pdata->dyn_callback_list, list) { in sensor_hub_resume()
452 if (callback->usage_callback->resume) in sensor_hub_resume()
453 callback->usage_callback->resume( in sensor_hub_resume()
454 callback->hsdev, callback->priv); in sensor_hub_resume()
478 struct hid_sensor_hub_callbacks *callback = NULL; in sensor_hub_raw_event() local
508 callback = sensor_hub_get_callback(hdev, in sensor_hub_raw_event()
512 if (!callback) { in sensor_hub_raw_event()
528 if (callback->capture_sample) { in sensor_hub_raw_event()
530 callback->capture_sample(hsdev, in sensor_hub_raw_event()
532 callback->pdev); in sensor_hub_raw_event()
534 callback->capture_sample(hsdev, in sensor_hub_raw_event()
536 callback->pdev); in sensor_hub_raw_event()
540 if (callback && collection && callback->send_event) in sensor_hub_raw_event()
541 callback->send_event(hsdev, collection->usage, in sensor_hub_raw_event()
542 callback->pdev); in sensor_hub_raw_event()