Lines Matching defs:hdev
115 struct hid_device *hdev, *client_hdev;
136 r = steam->hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0];
138 hid_err(steam->hdev, "No HID_FEATURE_REPORT submitted - nothing to read\n");
155 ret = hid_hw_raw_request(steam->hdev, 0x00,
172 r = steam->hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0];
174 hid_err(steam->hdev, "No HID_FEATURE_REPORT submitted - nothing to read\n");
195 ret = hid_hw_raw_request(steam->hdev, 0,
205 hid_err(steam->hdev, "%s: error %d (%*ph)\n", __func__,
367 steam->battery_desc.name = devm_kasprintf(&steam->hdev->dev,
379 battery = power_supply_register(&steam->hdev->dev,
383 hid_err(steam->hdev,
389 power_supply_powers(battery, &steam->hdev->dev);
395 struct hid_device *hdev = steam->hdev;
412 input->dev.parent = &hdev->dev;
419 input->phys = hdev->phys;
421 input->id.bustype = hdev->bus;
422 input->id.vendor = hdev->vendor;
423 input->id.product = hdev->product;
424 input->id.version = hdev->version;
531 hid_info(steam->hdev, "Steam Controller '%s' connected",
563 hid_info(steam->hdev, "Steam Controller '%s' disconnected",
587 hid_err(steam->hdev,
596 static bool steam_is_valve_interface(struct hid_device *hdev)
611 rep_enum = &hdev->report_enum[HID_FEATURE_REPORT];
615 static int steam_client_ll_parse(struct hid_device *hdev)
617 struct steam_device *steam = hdev->driver_data;
619 return hid_parse_report(hdev, steam->hdev->dev_rdesc,
620 steam->hdev->dev_rsize);
623 static int steam_client_ll_start(struct hid_device *hdev)
628 static void steam_client_ll_stop(struct hid_device *hdev)
632 static int steam_client_ll_open(struct hid_device *hdev)
634 struct steam_device *steam = hdev->driver_data;
645 static void steam_client_ll_close(struct hid_device *hdev)
647 struct steam_device *steam = hdev->driver_data;
666 static int steam_client_ll_raw_request(struct hid_device *hdev,
671 struct steam_device *steam = hdev->driver_data;
673 return hid_hw_raw_request(steam->hdev, reportnum, buf, count,
686 static struct hid_device *steam_create_client_hid(struct hid_device *hdev)
695 client_hdev->dev.parent = hdev->dev.parent;
696 client_hdev->bus = hdev->bus;
697 client_hdev->vendor = hdev->vendor;
698 client_hdev->product = hdev->product;
699 client_hdev->version = hdev->version;
700 client_hdev->type = hdev->type;
701 client_hdev->country = hdev->country;
702 strlcpy(client_hdev->name, hdev->name,
704 strlcpy(client_hdev->phys, hdev->phys,
715 static int steam_probe(struct hid_device *hdev,
721 ret = hid_parse(hdev);
723 hid_err(hdev,
732 if (hdev->group == HID_GROUP_STEAM)
733 return hid_hw_start(hdev, HID_CONNECT_HIDRAW);
738 if (!steam_is_valve_interface(hdev))
739 return hid_hw_start(hdev, HID_CONNECT_DEFAULT);
741 steam = devm_kzalloc(&hdev->dev, sizeof(*steam), GFP_KERNEL);
746 steam->hdev = hdev;
747 hid_set_drvdata(hdev, steam);
754 steam->client_hdev = steam_create_client_hid(hdev);
765 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_HIDRAW);
773 ret = hid_hw_open(hdev);
775 hid_err(hdev,
782 hid_info(hdev, "Steam wireless receiver connected");
791 hid_err(hdev,
803 hid_hw_stop(hdev);
809 hid_err(hdev, "%s: failed with error %d\n",
814 static void steam_remove(struct hid_device *hdev)
816 struct steam_device *steam = hid_get_drvdata(hdev);
818 if (!steam || hdev->group == HID_GROUP_STEAM) {
819 hid_hw_stop(hdev);
827 hid_info(hdev, "Steam wireless receiver disconnected");
829 hid_hw_close(hdev);
830 hid_hw_stop(hdev);
1027 static int steam_raw_event(struct hid_device *hdev,
1031 struct steam_device *steam = hid_get_drvdata(hdev);