@@ -719,20 +719,6 @@ static const __u8 *xpadneo_report_fixup(struct hid_device *hdev, __u8 *rdesc, un
719
719
return rdesc ;
720
720
}
721
721
722
- static void xpadneo_toggle_mouse (struct xpadneo_devdata * xdata )
723
- {
724
- if (xdata -> mouse_mode ) {
725
- xdata -> mouse_mode = false;
726
- hid_info (xdata -> hdev , "mouse mode disabled\n" );
727
- } else {
728
- xdata -> mouse_mode = true;
729
- hid_info (xdata -> hdev , "mouse mode enabled\n" );
730
- }
731
-
732
- /* Indicate that a request was made */
733
- xdata -> profile_switched = true;
734
- }
735
-
736
722
static void xpadneo_switch_profile (struct xpadneo_devdata * xdata , const u8 profile ,
737
723
const bool emulated )
738
724
{
@@ -839,6 +825,9 @@ static int xpadneo_raw_event(struct hid_device *hdev, struct hid_report *report,
839
825
}
840
826
}
841
827
828
+ if (xpadneo_mouse_raw_event (xdata , report , data , reportsize ))
829
+ return -1 ;
830
+
842
831
return 0 ;
843
832
}
844
833
@@ -871,6 +860,7 @@ static int xpadneo_input_configured(struct hid_device *hdev, struct hid_input *h
871
860
return 0 ;
872
861
default :
873
862
hid_warn (hdev , "unhandled input application 0x%x\n" , hi -> application );
863
+ return 0 ;
874
864
}
875
865
876
866
if (param_disable_deadzones ) {
@@ -920,6 +910,9 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
920
910
struct input_dev * gamepad = xdata -> gamepad ;
921
911
struct input_dev * keyboard = xdata -> keyboard ;
922
912
913
+ if (xpadneo_mouse_event (xdata , usage , value ))
914
+ goto stop_processing ;
915
+
923
916
if ((usage -> type == EV_KEY ) && (usage -> code == BTN_PADDLES (0 ))) {
924
917
if (gamepad && xdata -> profile == 0 ) {
925
918
/* report the paddles individually */
@@ -1206,6 +1199,10 @@ static int xpadneo_probe(struct hid_device *hdev, const struct hid_device_id *id
1206
1199
if (ret )
1207
1200
return ret ;
1208
1201
1202
+ ret = xpadneo_init_mouse (xdata );
1203
+ if (ret )
1204
+ return ret ;
1205
+
1209
1206
ret = xpadneo_init_hw (hdev );
1210
1207
if (ret ) {
1211
1208
hid_err (hdev , "hw init failed: %d\n" , ret );
@@ -1217,6 +1214,9 @@ static int xpadneo_probe(struct hid_device *hdev, const struct hid_device_id *id
1217
1214
if (ret )
1218
1215
hid_err (hdev , "could not initialize ff, continuing anyway\n" );
1219
1216
1217
+ timer_setup (& xdata -> mouse_timer , xpadneo_mouse_report , 0 );
1218
+ mod_timer (& xdata -> mouse_timer , jiffies );
1219
+
1220
1220
hid_info (hdev , "%s connected\n" , xdata -> battery .name );
1221
1221
1222
1222
return 0 ;
@@ -1252,6 +1252,7 @@ static void xpadneo_remove(struct hid_device *hdev)
1252
1252
hdev -> product = xdata -> original_product ;
1253
1253
}
1254
1254
1255
+ del_timer_sync (& xdata -> mouse_timer );
1255
1256
cancel_delayed_work_sync (& xdata -> ff_worker );
1256
1257
1257
1258
kfree (xdata -> battery .name );
0 commit comments