Lines Matching defs:hdev
56 static struct hid_report *sensor_hub_report(int id, struct hid_device *hdev,
61 list_for_each_entry(report, &hdev->report_enum[dir].report_list, list) {
65 hid_warn(hdev, "No report with id 0x%x found\n", id);
70 static int sensor_hub_get_physical_device_count(struct hid_device *hdev)
75 for (i = 0; i < hdev->maxcollection; ++i) {
76 struct hid_collection *collection = &hdev->collection[i];
99 struct hid_device *hdev,
106 struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
133 struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev);
174 struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev);
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);
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);
297 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
302 report = sensor_hub_report(report_id, hsdev->hdev,
320 hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT);
360 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
386 struct hid_device *hdev = hsdev->hdev;
396 report_enum = &hdev->report_enum[type];
426 static int sensor_hub_suspend(struct hid_device *hdev, pm_message_t message)
428 struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
432 hid_dbg(hdev, " sensor_hub_suspend\n");
444 static int sensor_hub_resume(struct hid_device *hdev)
446 struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
450 hid_dbg(hdev, " sensor_hub_resume\n");
462 static int sensor_hub_reset_resume(struct hid_device *hdev)
471 static int sensor_hub_raw_event(struct hid_device *hdev,
477 struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
484 hid_dbg(hdev, "sensor_hub_raw_event report id:0x%x size:%d type:%d\n",
486 hid_dbg(hdev, "maxfield:%d\n", report->maxfield);
497 hid_dbg(hdev, "%d collection_index:%x hid:%x sz:%x\n",
504 collection = &hdev->collection[
506 hid_dbg(hdev, "collection->usage %x\n",
509 callback = sensor_hub_get_callback(hdev,
521 hid_dbg(hdev, "data was pending ...\n");
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");
572 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
577 hid_hw_close(hsdev->hdev);
582 static __u8 *sensor_hub_report_fixup(struct hid_device *hdev, __u8 *rdesc,
589 if (hdev->product == USB_DEVICE_ID_TEXAS_INSTRUMENTS_LENOVO_YOGA &&
604 static int sensor_hub_probe(struct hid_device *hdev,
616 sd = devm_kzalloc(&hdev->dev, sizeof(*sd), GFP_KERNEL);
618 hid_err(hdev, "cannot allocate Sensor data\n");
622 hid_set_drvdata(hdev, sd);
628 ret = hid_parse(hdev);
630 hid_err(hdev, "parse failed\n");
633 INIT_LIST_HEAD(&hdev->inputs);
635 ret = hid_hw_start(hdev, 0);
637 hid_err(hdev, "hw start failed\n");
643 dev_cnt = sensor_hub_get_physical_device_count(hdev);
645 hid_err(hdev, "Invalid Physical device count\n");
649 sd->hid_sensor_hub_client_devs = devm_kcalloc(&hdev->dev,
654 hid_err(hdev, "Failed to allocate memory for mfd cells\n");
659 for (i = 0; i < hdev->maxcollection; ++i) {
660 struct hid_collection *collection = &hdev->collection[i];
665 hsdev = devm_kzalloc(&hdev->dev, sizeof(*hsdev),
668 hid_err(hdev, "cannot allocate hid_sensor_hub_device\n");
672 hsdev->hdev = hdev;
673 hsdev->vendor_id = hdev->vendor;
674 hsdev->product_id = hdev->product;
676 hsdev->mutex_ptr = devm_kzalloc(&hdev->dev,
688 name = devm_kasprintf(&hdev->dev, GFP_KERNEL,
692 hid_err(hdev, "Failed MFD device name\n");
704 hid_dbg(hdev, "Adding %s:%d\n", name,
719 ret = mfd_add_hotplug_devices(&hdev->dev,
728 hid_hw_stop(hdev);
733 static void sensor_hub_remove(struct hid_device *hdev)
735 struct sensor_hub_data *data = hid_get_drvdata(hdev);
739 hid_dbg(hdev, " hardware removed\n");
740 hid_hw_close(hdev);
741 hid_hw_stop(hdev);
750 mfd_remove_devices(&hdev->dev);