@@ -719,20 +719,6 @@ static const __u8 *xpadneo_report_fixup(struct hid_device *hdev, __u8 *rdesc, un
719719 return rdesc ;
720720}
721721
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-
736722static void xpadneo_switch_profile (struct xpadneo_devdata * xdata , const u8 profile ,
737723 const bool emulated )
738724{
@@ -839,6 +825,9 @@ static int xpadneo_raw_event(struct hid_device *hdev, struct hid_report *report,
839825 }
840826 }
841827
828+ if (xpadneo_mouse_raw_event (xdata , report , data , reportsize ))
829+ return -1 ;
830+
842831 return 0 ;
843832}
844833
@@ -871,6 +860,7 @@ static int xpadneo_input_configured(struct hid_device *hdev, struct hid_input *h
871860 return 0 ;
872861 default :
873862 hid_warn (hdev , "unhandled input application 0x%x\n" , hi -> application );
863+ return 0 ;
874864 }
875865
876866 if (param_disable_deadzones ) {
@@ -920,6 +910,9 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
920910 struct input_dev * gamepad = xdata -> gamepad ;
921911 struct input_dev * keyboard = xdata -> keyboard ;
922912
913+ if (xpadneo_mouse_event (xdata , usage , value ))
914+ goto stop_processing ;
915+
923916 if ((usage -> type == EV_KEY ) && (usage -> code == BTN_PADDLES (0 ))) {
924917 if (gamepad && xdata -> profile == 0 ) {
925918 /* report the paddles individually */
@@ -1206,6 +1199,10 @@ static int xpadneo_probe(struct hid_device *hdev, const struct hid_device_id *id
12061199 if (ret )
12071200 return ret ;
12081201
1202+ ret = xpadneo_init_mouse (xdata );
1203+ if (ret )
1204+ return ret ;
1205+
12091206 ret = xpadneo_init_hw (hdev );
12101207 if (ret ) {
12111208 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
12171214 if (ret )
12181215 hid_err (hdev , "could not initialize ff, continuing anyway\n" );
12191216
1217+ timer_setup (& xdata -> mouse_timer , xpadneo_mouse_report , 0 );
1218+ mod_timer (& xdata -> mouse_timer , jiffies );
1219+
12201220 hid_info (hdev , "%s connected\n" , xdata -> battery .name );
12211221
12221222 return 0 ;
@@ -1252,6 +1252,7 @@ static void xpadneo_remove(struct hid_device *hdev)
12521252 hdev -> product = xdata -> original_product ;
12531253 }
12541254
1255+ del_timer_sync (& xdata -> mouse_timer );
12551256 cancel_delayed_work_sync (& xdata -> ff_worker );
12561257
12571258 kfree (xdata -> battery .name );
0 commit comments