Lines Matching refs:hdev

133 static int __hidpp_send_report(struct hid_device *hdev,  in __hidpp_send_report()  argument
155 ret = hid_hw_raw_request(hdev, hidpp_report->report_id, in __hidpp_send_report()
704 static int wtp_input_mapping(struct hid_device *hdev, struct hid_input *hi, in wtp_input_mapping() argument
825 static int wtp_raw_event(struct hid_device *hdev, u8 *data, int size) in wtp_raw_event() argument
827 struct hidpp_device *hidpp = hid_get_drvdata(hdev); in wtp_raw_event()
838 hid_err(hdev, "Received HID report of bad size (%d)", in wtp_raw_event()
897 static int wtp_allocate(struct hid_device *hdev, const struct hid_device_id *id) in wtp_allocate() argument
899 struct hidpp_device *hidpp = hid_get_drvdata(hdev); in wtp_allocate()
902 wd = devm_kzalloc(&hdev->dev, sizeof(struct wtp_data), in wtp_allocate()
912 static int wtp_connect(struct hid_device *hdev, bool connected) in wtp_connect() argument
914 struct hidpp_device *hidpp = hid_get_drvdata(hdev); in wtp_connect()
924 hid_err(hdev, "Can not get wtp config: %d\n", ret); in wtp_connect()
937 static int hidpp_input_mapping(struct hid_device *hdev, struct hid_input *hi, in hidpp_input_mapping() argument
941 struct hidpp_device *hidpp = hid_get_drvdata(hdev); in hidpp_input_mapping()
944 return wtp_input_mapping(hdev, hi, field, usage, bit, max); in hidpp_input_mapping()
956 static void hidpp_input_configured(struct hid_device *hdev, in hidpp_input_configured() argument
959 struct hidpp_device *hidpp = hid_get_drvdata(hdev); in hidpp_input_configured()
1008 static int hidpp_raw_event(struct hid_device *hdev, struct hid_report *report, in hidpp_raw_event() argument
1011 struct hidpp_device *hidpp = hid_get_drvdata(hdev); in hidpp_raw_event()
1018 hid_err(hdev, "received hid++ report of bad size (%d)", in hidpp_raw_event()
1026 hid_err(hdev, "received hid++ report of bad size (%d)", in hidpp_raw_event()
1040 return wtp_raw_event(hdev, data, size); in hidpp_raw_event()
1045 static void hidpp_overwrite_name(struct hid_device *hdev, bool use_unifying) in hidpp_overwrite_name() argument
1047 struct hidpp_device *hidpp = hid_get_drvdata(hdev); in hidpp_overwrite_name()
1061 hid_err(hdev, "unable to retrieve the name of the device"); in hidpp_overwrite_name()
1063 snprintf(hdev->name, sizeof(hdev->name), "%s", name); in hidpp_overwrite_name()
1082 static struct input_dev *hidpp_allocate_input(struct hid_device *hdev) in hidpp_allocate_input() argument
1084 struct input_dev *input_dev = devm_input_allocate_device(&hdev->dev); in hidpp_allocate_input()
1085 struct hidpp_device *hidpp = hid_get_drvdata(hdev); in hidpp_allocate_input()
1090 input_set_drvdata(input_dev, hdev); in hidpp_allocate_input()
1095 input_dev->phys = hdev->phys; in hidpp_allocate_input()
1096 input_dev->uniq = hdev->uniq; in hidpp_allocate_input()
1097 input_dev->id.bustype = hdev->bus; in hidpp_allocate_input()
1098 input_dev->id.vendor = hdev->vendor; in hidpp_allocate_input()
1099 input_dev->id.product = hdev->product; in hidpp_allocate_input()
1100 input_dev->id.version = hdev->version; in hidpp_allocate_input()
1101 input_dev->dev.parent = &hdev->dev; in hidpp_allocate_input()
1108 struct hid_device *hdev = hidpp->hid_dev; in hidpp_connect_event() local
1115 ret = wtp_connect(hdev, connected); in hidpp_connect_event()
1126 hid_err(hdev, "Can not get the protocol version.\n"); in hidpp_connect_event()
1133 hid_info(hdev, "HID++ %u.%u device connected.\n", in hidpp_connect_event()
1136 if (!hidpp->name || hidpp->name == hdev->name) { in hidpp_connect_event()
1139 hid_err(hdev, in hidpp_connect_event()
1144 devm_name = devm_kasprintf(&hdev->dev, GFP_KERNEL, "%s", name); in hidpp_connect_event()
1152 input = hidpp_allocate_input(hdev); in hidpp_connect_event()
1154 hid_err(hdev, "cannot allocate new input device: %d\n", ret); in hidpp_connect_event()
1167 static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id) in hidpp_probe() argument
1174 hidpp = devm_kzalloc(&hdev->dev, sizeof(struct hidpp_device), in hidpp_probe()
1179 hidpp->hid_dev = hdev; in hidpp_probe()
1180 hidpp->name = hdev->name; in hidpp_probe()
1181 hid_set_drvdata(hdev, hidpp); in hidpp_probe()
1191 ret = wtp_allocate(hdev, id); in hidpp_probe()
1200 ret = hid_parse(hdev); in hidpp_probe()
1202 hid_err(hdev, "%s:parse failed\n", __func__); in hidpp_probe()
1207 hid_device_io_start(hdev); in hidpp_probe()
1213 hid_err(hdev, "Device not connected"); in hidpp_probe()
1214 hid_device_io_stop(hdev); in hidpp_probe()
1218 hid_info(hdev, "HID++ %u.%u device connected.\n", in hidpp_probe()
1222 hidpp_overwrite_name(hdev, id->group == HID_GROUP_LOGITECH_DJ_DEVICE); in hidpp_probe()
1232 hid_device_io_stop(hdev); in hidpp_probe()
1237 ret = hid_hw_start(hdev, connect_mask); in hidpp_probe()
1239 hid_err(hdev, "%s:hid_hw_start returned error\n", __func__); in hidpp_probe()
1245 hid_device_io_start(hdev); in hidpp_probe()
1257 hid_set_drvdata(hdev, NULL); in hidpp_probe()
1261 static void hidpp_remove(struct hid_device *hdev) in hidpp_remove() argument
1263 struct hidpp_device *hidpp = hid_get_drvdata(hdev); in hidpp_remove()
1267 hid_hw_stop(hdev); in hidpp_remove()