@@ -3316,24 +3316,23 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
3316
3316
hid_warn (hdev , "Cannot allocate sysfs group for %s\n" ,
3317
3317
hdev -> name );
3318
3318
3319
- if (hidpp -> quirks & HIDPP_QUIRK_NO_HIDINPUT )
3320
- connect_mask &= ~HID_CONNECT_HIDINPUT ;
3321
-
3322
- if (hidpp -> quirks & HIDPP_QUIRK_CLASS_G920 ) {
3323
- ret = hid_hw_start (hdev , connect_mask );
3324
- if (ret ) {
3325
- hid_err (hdev , "hw start failed\n" );
3326
- goto hid_hw_start_fail ;
3327
- }
3328
- ret = hid_hw_open (hdev );
3329
- if (ret < 0 ) {
3330
- dev_err (& hdev -> dev , "%s:hid_hw_open returned error:%d\n" ,
3331
- __func__ , ret );
3332
- hid_hw_stop (hdev );
3333
- goto hid_hw_start_fail ;
3334
- }
3319
+ /*
3320
+ * Plain USB connections need to actually call start and open
3321
+ * on the transport driver to allow incoming data.
3322
+ */
3323
+ ret = hid_hw_start (hdev , 0 );
3324
+ if (ret ) {
3325
+ hid_err (hdev , "hw start failed\n" );
3326
+ goto hid_hw_start_fail ;
3335
3327
}
3336
3328
3329
+ ret = hid_hw_open (hdev );
3330
+ if (ret < 0 ) {
3331
+ dev_err (& hdev -> dev , "%s:hid_hw_open returned error:%d\n" ,
3332
+ __func__ , ret );
3333
+ hid_hw_stop (hdev );
3334
+ goto hid_hw_open_fail ;
3335
+ }
3337
3336
3338
3337
/* Allow incoming packets */
3339
3338
hid_device_io_start (hdev );
@@ -3347,7 +3346,7 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
3347
3346
if (!connected ) {
3348
3347
ret = - ENODEV ;
3349
3348
hid_err (hdev , "Device not connected" );
3350
- goto hid_hw_open_failed ;
3349
+ goto hid_hw_init_fail ;
3351
3350
}
3352
3351
3353
3352
hidpp_overwrite_name (hdev );
@@ -3356,37 +3355,36 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
3356
3355
if (connected && (hidpp -> quirks & HIDPP_QUIRK_CLASS_WTP )) {
3357
3356
ret = wtp_get_config (hidpp );
3358
3357
if (ret )
3359
- goto hid_hw_open_failed ;
3358
+ goto hid_hw_init_fail ;
3360
3359
} else if (connected && (hidpp -> quirks & HIDPP_QUIRK_CLASS_G920 )) {
3361
3360
ret = g920_get_config (hidpp );
3362
3361
if (ret )
3363
- goto hid_hw_open_failed ;
3362
+ goto hid_hw_init_fail ;
3364
3363
}
3365
3364
3366
- /* Block incoming packets */
3367
- hid_device_io_stop (hdev );
3365
+ hidpp_connect_event (hidpp );
3368
3366
3369
- if (!(hidpp -> quirks & HIDPP_QUIRK_CLASS_G920 )) {
3370
- ret = hid_hw_start (hdev , connect_mask );
3371
- if (ret ) {
3372
- hid_err (hdev , "%s:hid_hw_start returned error\n" , __func__ );
3373
- goto hid_hw_start_fail ;
3374
- }
3375
- }
3367
+ /* Reset the HID node state */
3368
+ hid_device_io_stop (hdev );
3369
+ hid_hw_close (hdev );
3370
+ hid_hw_stop (hdev );
3376
3371
3377
- /* Allow incoming packets */
3378
- hid_device_io_start ( hdev ) ;
3372
+ if ( hidpp -> quirks & HIDPP_QUIRK_NO_HIDINPUT )
3373
+ connect_mask &= ~ HID_CONNECT_HIDINPUT ;
3379
3374
3380
- hidpp_connect_event (hidpp );
3375
+ /* Now export the actual inputs and hidraw nodes to the world */
3376
+ ret = hid_hw_start (hdev , connect_mask );
3377
+ if (ret ) {
3378
+ hid_err (hdev , "%s:hid_hw_start returned error\n" , __func__ );
3379
+ goto hid_hw_start_fail ;
3380
+ }
3381
3381
3382
3382
return ret ;
3383
3383
3384
- hid_hw_open_failed :
3385
- hid_device_io_stop (hdev );
3386
- if (hidpp -> quirks & HIDPP_QUIRK_CLASS_G920 ) {
3387
- hid_hw_close (hdev );
3388
- hid_hw_stop (hdev );
3389
- }
3384
+ hid_hw_init_fail :
3385
+ hid_hw_close (hdev );
3386
+ hid_hw_open_fail :
3387
+ hid_hw_stop (hdev );
3390
3388
hid_hw_start_fail :
3391
3389
sysfs_remove_group (& hdev -> dev .kobj , & ps_attribute_group );
3392
3390
cancel_work_sync (& hidpp -> work );
@@ -3403,10 +3401,9 @@ static void hidpp_remove(struct hid_device *hdev)
3403
3401
3404
3402
sysfs_remove_group (& hdev -> dev .kobj , & ps_attribute_group );
3405
3403
3406
- if (hidpp -> quirks & HIDPP_QUIRK_CLASS_G920 ) {
3404
+ if (hidpp -> quirks & HIDPP_QUIRK_CLASS_G920 )
3407
3405
hidpp_ff_deinit (hdev );
3408
- hid_hw_close (hdev );
3409
- }
3406
+
3410
3407
hid_hw_stop (hdev );
3411
3408
cancel_work_sync (& hidpp -> work );
3412
3409
mutex_destroy (& hidpp -> send_mutex );
@@ -3470,7 +3467,14 @@ static const struct hid_device_id hidpp_devices[] = {
3470
3467
3471
3468
{ LDJ_DEVICE (HID_ANY_ID ) },
3472
3469
3473
- { HID_USB_DEVICE (USB_VENDOR_ID_LOGITECH , USB_DEVICE_ID_LOGITECH_G920_WHEEL ),
3470
+ { /* Logitech G403 Gaming Mouse over USB */
3471
+ HID_USB_DEVICE (USB_VENDOR_ID_LOGITECH , 0xC082 ) },
3472
+ { /* Logitech G700 Gaming Mouse over USB */
3473
+ HID_USB_DEVICE (USB_VENDOR_ID_LOGITECH , 0xC06B ) },
3474
+ { /* Logitech G900 Gaming Mouse over USB */
3475
+ HID_USB_DEVICE (USB_VENDOR_ID_LOGITECH , 0xC081 ) },
3476
+ { /* Logitech G920 Wheel over USB */
3477
+ HID_USB_DEVICE (USB_VENDOR_ID_LOGITECH , USB_DEVICE_ID_LOGITECH_G920_WHEEL ),
3474
3478
.driver_data = HIDPP_QUIRK_CLASS_G920 | HIDPP_QUIRK_FORCE_OUTPUT_REPORTS },
3475
3479
{}
3476
3480
};
0 commit comments