Lines Matching defs:hdev
55 static struct hid_report *sensor_hub_report(int id, struct hid_device *hdev,
60 list_for_each_entry(report, &hdev->report_enum[dir].report_list, list) {
64 hid_warn(hdev, "No report with id 0x%x found\n", id);
69 static int sensor_hub_get_physical_device_count(struct hid_device *hdev)
74 for (i = 0; i < hdev->maxcollection; ++i) {
75 struct hid_collection *collection = &hdev->collection[i];
98 struct hid_device *hdev,
105 struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
132 struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev);
173 struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev);
194 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
202 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
228 hid_hw_request(hsdev->hdev, report, HID_REQ_SET_REPORT);
229 hid_hw_wait(hsdev->hdev);
242 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
252 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
258 hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT);
259 hid_hw_wait(hsdev->hdev);
296 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
301 report = sensor_hub_report(report_id, hsdev->hdev,
319 hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT);
359 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
385 struct hid_device *hdev = hsdev->hdev;
395 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,
522 hid_dbg(hdev, "data was pending ...\n");
553 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
557 ret = hid_hw_open(hsdev->hdev);
559 hid_err(hsdev->hdev, "failed to open hid device\n");
573 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
578 hid_hw_close(hsdev->hdev);
583 static __u8 *sensor_hub_report_fixup(struct hid_device *hdev, __u8 *rdesc,
590 if (hdev->product == USB_DEVICE_ID_TEXAS_INSTRUMENTS_LENOVO_YOGA &&
605 static int sensor_hub_probe(struct hid_device *hdev,
617 sd = devm_kzalloc(&hdev->dev, sizeof(*sd), GFP_KERNEL);
619 hid_err(hdev, "cannot allocate Sensor data\n");
623 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, HID_CONNECT_DEFAULT | HID_CONNECT_DRIVER);
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);