@@ -709,20 +709,6 @@ static u8 *xpadneo_report_fixup(struct hid_device *hdev, u8 *rdesc, unsigned int
709709 return rdesc ;
710710}
711711
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-
726712static void xpadneo_switch_profile (struct xpadneo_devdata * xdata , const u8 profile ,
727713 const bool emulated )
728714{
@@ -829,6 +815,9 @@ static int xpadneo_raw_event(struct hid_device *hdev, struct hid_report *report,
829815 }
830816 }
831817
818+ if (xpadneo_mouse_raw_event (xdata , report , data , reportsize ))
819+ return -1 ;
820+
832821 return 0 ;
833822}
834823
@@ -861,6 +850,7 @@ static int xpadneo_input_configured(struct hid_device *hdev, struct hid_input *h
861850 return 0 ;
862851 default :
863852 hid_warn (hdev , "unhandled input application 0x%x\n" , hi -> application );
853+ return 0 ;
864854 }
865855
866856 if (param_disable_deadzones ) {
@@ -910,6 +900,9 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
910900 struct input_dev * gamepad = xdata -> gamepad ;
911901 struct input_dev * keyboard = xdata -> keyboard ;
912902
903+ if (xpadneo_mouse_event (xdata , usage , value ))
904+ goto stop_processing ;
905+
913906 if ((usage -> type == EV_KEY ) && (usage -> code == BTN_PADDLES (0 ))) {
914907 if (gamepad && xdata -> profile == 0 ) {
915908 /* report the paddles individually */
@@ -1201,6 +1194,10 @@ static int xpadneo_probe(struct hid_device *hdev, const struct hid_device_id *id
12011194 if (ret )
12021195 return ret ;
12031196
1197+ ret = xpadneo_init_mouse (xdata );
1198+ if (ret )
1199+ return ret ;
1200+
12041201 ret = xpadneo_init_hw (hdev );
12051202 if (ret ) {
12061203 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
12121209 if (ret )
12131210 hid_err (hdev , "could not initialize ff, continuing anyway\n" );
12141211
1212+ timer_setup (& xdata -> mouse_timer , xpadneo_mouse_report , 0 );
1213+ mod_timer (& xdata -> mouse_timer , jiffies );
1214+
12151215 hid_info (hdev , "%s connected\n" , xdata -> battery .name );
12161216
12171217 return 0 ;
@@ -1247,6 +1247,7 @@ static void xpadneo_remove(struct hid_device *hdev)
12471247 hdev -> product = xdata -> original_product ;
12481248 }
12491249
1250+ del_timer_sync (& xdata -> mouse_timer );
12501251 cancel_delayed_work_sync (& xdata -> ff_worker );
12511252
12521253 kfree (xdata -> battery .name );
0 commit comments