Lines Matching defs:hdev

486 	struct hid_device *hdev;
540 hid_err(sc->hdev, "URB transfer failed : %d", urb->status);
552 hid_err(sc->hdev, "usb_submit_urb failed: %d", ret);
565 cr = devm_kzalloc(&sc->hdev->dev, sizeof(*cr), GFP_ATOMIC);
569 databuf = devm_kzalloc(&sc->hdev->dev, poke_size, GFP_ATOMIC);
587 static int guitar_mapping(struct hid_device *hdev, struct hid_input *hi,
602 static u8 *motion_fixup(struct hid_device *hdev, u8 *rdesc,
609 static u8 *ps3remote_fixup(struct hid_device *hdev, u8 *rdesc,
616 static int ps3remote_mapping(struct hid_device *hdev, struct hid_input *hi,
650 static int navigation_mapping(struct hid_device *hdev, struct hid_input *hi,
698 static int sixaxis_mapping(struct hid_device *hdev, struct hid_input *hi,
746 static u8 *sony_report_fixup(struct hid_device *hdev, u8 *rdesc,
749 struct sony_sc *sc = hid_get_drvdata(hdev);
765 hid_info(hdev, "Fixing up Sony RF Receiver report descriptor\n");
771 return motion_fixup(hdev, rdesc, rsize);
774 return ps3remote_fixup(hdev, rdesc, rsize);
787 hid_info(hdev, "Fixing up USB dongle report descriptor\n");
918 static int sony_raw_event(struct hid_device *hdev, struct hid_report *report,
921 struct sony_sc *sc = hid_get_drvdata(hdev);
963 static int sony_mapping(struct hid_device *hdev, struct hid_input *hi,
967 struct sony_sc *sc = hid_get_drvdata(hdev);
993 return ps3remote_mapping(hdev, hi, field, usage, bit, max);
996 return navigation_mapping(hdev, hi, field, usage, bit, max);
999 return sixaxis_mapping(hdev, hi, field, usage, bit, max);
1002 return guitar_mapping(hdev, hi, field, usage, bit, max);
1015 sc->touchpad = devm_input_allocate_device(&sc->hdev->dev);
1020 sc->touchpad->dev.parent = &sc->hdev->dev;
1021 sc->touchpad->phys = sc->hdev->phys;
1022 sc->touchpad->uniq = sc->hdev->uniq;
1023 sc->touchpad->id.bustype = sc->hdev->bus;
1024 sc->touchpad->id.vendor = sc->hdev->vendor;
1025 sc->touchpad->id.product = sc->hdev->product;
1026 sc->touchpad->id.version = sc->hdev->version;
1034 name_sz = strlen(sc->hdev->name) + sizeof(TOUCHPAD_SUFFIX);
1035 name = devm_kzalloc(&sc->hdev->dev, name_sz, GFP_KERNEL);
1038 snprintf(name, name_sz, "%s" TOUCHPAD_SUFFIX, sc->hdev->name);
1081 sc->sensor_dev = devm_input_allocate_device(&sc->hdev->dev);
1086 sc->sensor_dev->dev.parent = &sc->hdev->dev;
1087 sc->sensor_dev->phys = sc->hdev->phys;
1088 sc->sensor_dev->uniq = sc->hdev->uniq;
1089 sc->sensor_dev->id.bustype = sc->hdev->bus;
1090 sc->sensor_dev->id.vendor = sc->hdev->vendor;
1091 sc->sensor_dev->id.product = sc->hdev->product;
1092 sc->sensor_dev->id.version = sc->hdev->version;
1097 name_sz = strlen(sc->hdev->name) + sizeof(SENSOR_SUFFIX);
1098 name = devm_kzalloc(&sc->hdev->dev, name_sz, GFP_KERNEL);
1101 snprintf(name, name_sz, "%s" SENSOR_SUFFIX, sc->hdev->name);
1133 static int sixaxis_set_operational_usb(struct hid_device *hdev)
1135 struct sony_sc *sc = hid_get_drvdata(hdev);
1145 ret = hid_hw_raw_request(hdev, 0xf2, buf, SIXAXIS_REPORT_0xF2_SIZE,
1148 hid_err(hdev, "can't set operational mode: step 1\n");
1156 ret = hid_hw_raw_request(hdev, 0xf5, buf, SIXAXIS_REPORT_0xF5_SIZE,
1159 hid_err(hdev, "can't set operational mode: step 2\n");
1170 ret = hid_hw_output_report(hdev, buf, 1);
1172 hid_info(hdev, "can't set operational mode: step 3, ignoring\n");
1182 static int sixaxis_set_operational_bt(struct hid_device *hdev)
1192 ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(report),
1228 struct hid_device *hdev = sc->hdev;
1230 &hdev->report_enum[HID_OUTPUT_REPORT].report_list;
1244 hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
1259 struct hid_device *hdev = to_hid_device(dev);
1265 drv_data = hid_get_drvdata(hdev);
1267 hid_err(hdev, "No device data\n");
1301 struct hid_device *hdev = to_hid_device(dev);
1306 drv_data = hid_get_drvdata(hdev);
1308 hid_err(hdev, "No device data\n");
1324 struct hid_device *hdev = to_hid_device(dev);
1325 struct sony_sc *drv_data = hid_get_drvdata(hdev);
1330 hid_err(hdev, "No device data\n");
1369 struct hid_device *hdev = sc->hdev;
1390 if (!hid_validate_values(hdev, HID_OUTPUT_REPORT, 0, 0, 7))
1423 name_sz = strlen(dev_name(&hdev->dev)) + name_len + 1;
1428 name_sz = strlen(dev_name(&hdev->dev)) + strlen(color_name_str[n]) + 2;
1430 led = devm_kzalloc(&hdev->dev, sizeof(struct led_classdev) + name_sz, GFP_KERNEL);
1432 hid_err(hdev, "Couldn't allocate memory for LED %d\n", n);
1438 snprintf(name, name_sz, name_fmt, dev_name(&hdev->dev),
1441 snprintf(name, name_sz, name_fmt, dev_name(&hdev->dev), n + 1);
1454 ret = devm_led_classdev_register(&hdev->dev, led);
1456 hid_err(hdev, "Failed to register LED %d\n", n);
1517 hid_hw_output_report(sc->hdev, (u8 *)report,
1520 hid_hw_raw_request(sc->hdev, report->report_id, (u8 *)report,
1527 struct hid_device *hdev = sc->hdev;
1542 hid_hw_output_report(hdev, (u8 *)report, MOTION_REPORT_0x02_SIZE);
1565 devm_kmalloc(&sc->hdev->dev,
1569 sc->output_report_dmabuf = devm_kmalloc(&sc->hdev->dev,
1603 if (list_empty(&sc->hdev->inputs)) {
1604 hid_err(sc->hdev, "no inputs found\n");
1607 hidinput = list_entry(sc->hdev->inputs.next, struct hid_input, list);
1663 struct hid_device *hdev = sc->hdev;
1677 sc->battery_desc.name = devm_kasprintf(&hdev->dev, GFP_KERNEL,
1682 sc->battery = devm_power_supply_register(&hdev->dev, &sc->battery_desc,
1686 hid_err(hdev, "Unable to register battery device\n");
1690 power_supply_powers(sc->battery, &hdev->dev);
1730 hid_info(sc->hdev,
1762 ret = strlen(sc->hdev->uniq);
1766 ret = sscanf(sc->hdev->uniq,
1792 hid_warn(sc->hdev, "UNIQ does not contain a MAC address; duplicate check skipped\n");
1806 ret = hid_hw_raw_request(sc->hdev, 0xf2, buf,
1811 hid_err(sc->hdev, "failed to retrieve feature report 0xf2 with the Sixaxis MAC address\n");
1823 snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq),
1891 static int sony_input_configured(struct hid_device *hdev,
1894 struct sony_sc *sc = hid_get_drvdata(hdev);
1900 hid_err(hdev, "failed to allocate the device id\n");
1910 hid_err(hdev, "failed to allocate the output report buffer\n");
1931 hdev->quirks |= HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP;
1932 hdev->quirks |= HID_QUIRK_SKIP_OUTPUT_REPORT_ID;
1935 ret = sixaxis_set_operational_usb(hdev);
1937 hid_err(hdev, "Failed to set controller into operational mode\n");
1947 hdev->quirks |= HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP;
1949 ret = sixaxis_set_operational_bt(hdev);
1951 hid_err(hdev, "Failed to set controller into operational mode\n");
1963 hdev->quirks |= HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP;
1964 hdev->quirks |= HID_QUIRK_SKIP_OUTPUT_REPORT_ID;
1967 ret = sixaxis_set_operational_usb(hdev);
1969 hid_err(hdev, "Failed to set controller into operational mode\n");
1975 hid_err(sc->hdev,
1986 hdev->quirks |= HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP;
1988 ret = sixaxis_set_operational_bt(hdev);
1990 hid_err(hdev, "Failed to set controller into operational mode\n");
1996 hid_err(sc->hdev,
2010 hid_err(sc->hdev,
2032 ret = hid_hw_open(hdev);
2034 hid_err(hdev, "hw open failed\n");
2047 hid_hw_close(hdev);
2055 static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
2063 if (!strcmp(hdev->name, "FutureMax Dance Mat"))
2066 if (!strcmp(hdev->name, "SHANWAN PS3 GamePad") ||
2067 !strcmp(hdev->name, "ShanWan PS(R) Ga`epad"))
2070 sc = devm_kzalloc(&hdev->dev, sizeof(*sc), GFP_KERNEL);
2072 hid_err(hdev, "can't alloc sony descriptor\n");
2079 hid_set_drvdata(hdev, sc);
2080 sc->hdev = hdev;
2082 ret = hid_parse(hdev);
2084 hid_err(hdev, "parse failed\n");
2100 hdev->version |= 0x8000;
2102 ret = hid_hw_start(hdev, connect_mask);
2104 hid_err(hdev, "hw start failed\n");
2116 if (!(hdev->claimed & HID_CLAIMED_INPUT)) {
2117 hid_err(hdev, "failed to claim input\n");
2123 if (!hid_is_usb(hdev)) {
2128 usbdev = to_usb_device(sc->hdev->dev.parent->parent);
2143 hid_err(hdev, "error preparing URB\n");
2157 hid_hw_stop(hdev);
2161 static void sony_remove(struct hid_device *hdev)
2163 struct sony_sc *sc = hid_get_drvdata(hdev);
2170 hid_hw_close(hdev);
2178 hid_hw_stop(hdev);
2183 static int sony_suspend(struct hid_device *hdev, pm_message_t message)
2189 struct sony_sc *sc = hid_get_drvdata(hdev);
2199 static int sony_resume(struct hid_device *hdev)
2201 struct sony_sc *sc = hid_get_drvdata(hdev);
2209 sixaxis_set_operational_usb(sc->hdev);