@@ -731,20 +731,6 @@ static const __u8 *xpadneo_report_fixup(struct hid_device *hdev, __u8 *rdesc, un
731731 return rdesc ;
732732}
733733
734- static void xpadneo_toggle_mouse (struct xpadneo_devdata * xdata )
735- {
736- if (xdata -> mouse_mode ) {
737- xdata -> mouse_mode = false;
738- hid_info (xdata -> hdev , "mouse mode disabled\n" );
739- } else {
740- xdata -> mouse_mode = true;
741- hid_info (xdata -> hdev , "mouse mode enabled\n" );
742- }
743-
744- /* Indicate that a request was made */
745- xdata -> profile_switched = true;
746- }
747-
748734static void xpadneo_switch_profile (struct xpadneo_devdata * xdata , const u8 profile ,
749735 const bool emulated )
750736{
@@ -851,6 +837,9 @@ static int xpadneo_raw_event(struct hid_device *hdev, struct hid_report *report,
851837 }
852838 }
853839
840+ if (xpadneo_mouse_raw_event (xdata , report , data , reportsize ))
841+ return -1 ;
842+
854843 return 0 ;
855844}
856845
@@ -883,6 +872,7 @@ static int xpadneo_input_configured(struct hid_device *hdev, struct hid_input *h
883872 return 0 ;
884873 default :
885874 hid_warn (hdev , "unhandled input application 0x%x\n" , hi -> application );
875+ return 0 ;
886876 }
887877
888878 if (param_disable_deadzones ) {
@@ -932,6 +922,9 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
932922 struct input_dev * gamepad = xdata -> gamepad ;
933923 struct input_dev * keyboard = xdata -> keyboard ;
934924
925+ if (xpadneo_mouse_event (xdata , usage , value ))
926+ goto stop_processing ;
927+
935928 if ((usage -> type == EV_KEY ) && (usage -> code == BTN_PADDLES (0 ))) {
936929 if (gamepad && xdata -> profile == 0 ) {
937930 /* report the paddles individually */
@@ -1234,6 +1227,10 @@ static int xpadneo_probe(struct hid_device *hdev, const struct hid_device_id *id
12341227 if (ret )
12351228 return ret ;
12361229
1230+ ret = xpadneo_init_mouse (xdata );
1231+ if (ret )
1232+ return ret ;
1233+
12371234 ret = xpadneo_init_hw (hdev );
12381235 if (ret ) {
12391236 hid_err (hdev , "hw init failed: %d\n" , ret );
@@ -1245,6 +1242,9 @@ static int xpadneo_probe(struct hid_device *hdev, const struct hid_device_id *id
12451242 if (ret )
12461243 hid_err (hdev , "could not initialize ff, continuing anyway\n" );
12471244
1245+ timer_setup (& xdata -> mouse_timer , xpadneo_mouse_report , 0 );
1246+ mod_timer (& xdata -> mouse_timer , jiffies );
1247+
12481248 hid_info (hdev , "%s connected\n" , xdata -> battery .name );
12491249
12501250 return 0 ;
@@ -1280,6 +1280,7 @@ static void xpadneo_remove(struct hid_device *hdev)
12801280 hdev -> product = xdata -> original_product ;
12811281 }
12821282
1283+ del_timer_sync (& xdata -> mouse_timer );
12831284 cancel_delayed_work_sync (& xdata -> ff_worker );
12841285
12851286 kfree (xdata -> battery .name );
0 commit comments