@@ -709,20 +709,6 @@ static u8 *xpadneo_report_fixup(struct hid_device *hdev, u8 *rdesc, unsigned int
709
709
return rdesc ;
710
710
}
711
711
712
- static void xpadneo_toggle_mouse (struct xpadneo_devdata * xdata )
713
- {
714
- if (xdata -> mouse_mode ) {
715
- xdata -> mouse_mode = false;
716
- hid_info (xdata -> hdev , "mouse mode disabled\n" );
717
- } else {
718
- xdata -> mouse_mode = true;
719
- hid_info (xdata -> hdev , "mouse mode enabled\n" );
720
- }
721
-
722
- /* Indicate that a request was made */
723
- xdata -> profile_switched = true;
724
- }
725
-
726
712
static void xpadneo_switch_profile (struct xpadneo_devdata * xdata , const u8 profile ,
727
713
const bool emulated )
728
714
{
@@ -829,6 +815,9 @@ static int xpadneo_raw_event(struct hid_device *hdev, struct hid_report *report,
829
815
}
830
816
}
831
817
818
+ if (xpadneo_mouse_raw_event (xdata , report , data , reportsize ))
819
+ return -1 ;
820
+
832
821
return 0 ;
833
822
}
834
823
@@ -861,6 +850,7 @@ static int xpadneo_input_configured(struct hid_device *hdev, struct hid_input *h
861
850
return 0 ;
862
851
default :
863
852
hid_warn (hdev , "unhandled input application 0x%x\n" , hi -> application );
853
+ return 0 ;
864
854
}
865
855
866
856
if (param_disable_deadzones ) {
@@ -910,6 +900,9 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
910
900
struct input_dev * gamepad = xdata -> gamepad ;
911
901
struct input_dev * keyboard = xdata -> keyboard ;
912
902
903
+ if (xpadneo_mouse_event (xdata , usage , value ))
904
+ goto stop_processing ;
905
+
913
906
if ((usage -> type == EV_KEY ) && (usage -> code == BTN_PADDLES (0 ))) {
914
907
if (gamepad && xdata -> profile == 0 ) {
915
908
/* report the paddles individually */
@@ -1201,6 +1194,10 @@ static int xpadneo_probe(struct hid_device *hdev, const struct hid_device_id *id
1201
1194
if (ret )
1202
1195
return ret ;
1203
1196
1197
+ ret = xpadneo_init_mouse (xdata );
1198
+ if (ret )
1199
+ return ret ;
1200
+
1204
1201
ret = xpadneo_init_hw (hdev );
1205
1202
if (ret ) {
1206
1203
hid_err (hdev , "hw init failed: %d\n" , ret );
@@ -1212,6 +1209,9 @@ static int xpadneo_probe(struct hid_device *hdev, const struct hid_device_id *id
1212
1209
if (ret )
1213
1210
hid_err (hdev , "could not initialize ff, continuing anyway\n" );
1214
1211
1212
+ timer_setup (& xdata -> mouse_timer , xpadneo_mouse_report , 0 );
1213
+ mod_timer (& xdata -> mouse_timer , jiffies );
1214
+
1215
1215
hid_info (hdev , "%s connected\n" , xdata -> battery .name );
1216
1216
1217
1217
return 0 ;
@@ -1247,6 +1247,7 @@ static void xpadneo_remove(struct hid_device *hdev)
1247
1247
hdev -> product = xdata -> original_product ;
1248
1248
}
1249
1249
1250
+ del_timer_sync (& xdata -> mouse_timer );
1250
1251
cancel_delayed_work_sync (& xdata -> ff_worker );
1251
1252
1252
1253
kfree (xdata -> battery .name );
0 commit comments