@@ -787,20 +787,6 @@ static const __u8 *xpadneo_report_fixup(struct hid_device *hdev, __u8 *rdesc, un
787787 return rdesc ;
788788}
789789
790- static void xpadneo_toggle_mouse (struct xpadneo_devdata * xdata )
791- {
792- if (xdata -> mouse_mode ) {
793- xdata -> mouse_mode = false;
794- hid_info (xdata -> hdev , "mouse mode disabled\n" );
795- } else {
796- xdata -> mouse_mode = true;
797- hid_info (xdata -> hdev , "mouse mode enabled\n" );
798- }
799-
800- /* Indicate that a request was made */
801- xdata -> profile_switched = true;
802- }
803-
804790static void xpadneo_switch_profile (struct xpadneo_devdata * xdata , const u8 profile ,
805791 const bool emulated )
806792{
@@ -907,6 +893,9 @@ static int xpadneo_raw_event(struct hid_device *hdev, struct hid_report *report,
907893 }
908894 }
909895
896+ if (xpadneo_mouse_raw_event (xdata , report , data , reportsize ))
897+ return -1 ;
898+
910899 return 0 ;
911900}
912901
@@ -939,6 +928,7 @@ static int xpadneo_input_configured(struct hid_device *hdev, struct hid_input *h
939928 return 0 ;
940929 default :
941930 hid_warn (hdev , "unhandled input application 0x%x\n" , hi -> application );
931+ return 0 ;
942932 }
943933
944934 if (param_disable_deadzones ) {
@@ -988,6 +978,9 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
988978 struct input_dev * gamepad = xdata -> gamepad ;
989979 struct input_dev * keyboard = xdata -> keyboard ;
990980
981+ if (xpadneo_mouse_event (xdata , usage , value ))
982+ goto stop_processing ;
983+
991984 if ((usage -> type == EV_KEY ) && (usage -> code == BTN_PADDLES (0 ))) {
992985 if (gamepad && xdata -> profile == 0 ) {
993986 /* report the paddles individually */
@@ -1306,6 +1299,10 @@ static int xpadneo_probe(struct hid_device *hdev, const struct hid_device_id *id
13061299 if (ret )
13071300 return ret ;
13081301
1302+ ret = xpadneo_init_mouse (xdata );
1303+ if (ret )
1304+ return ret ;
1305+
13091306 ret = xpadneo_init_hw (hdev );
13101307 if (ret ) {
13111308 hid_err (hdev , "hw init failed: %d\n" , ret );
@@ -1317,6 +1314,9 @@ static int xpadneo_probe(struct hid_device *hdev, const struct hid_device_id *id
13171314 if (ret )
13181315 hid_err (hdev , "could not initialize ff, continuing anyway\n" );
13191316
1317+ timer_setup (& xdata -> mouse_timer , xpadneo_mouse_report , 0 );
1318+ mod_timer (& xdata -> mouse_timer , jiffies );
1319+
13201320 hid_info (hdev , "%s connected\n" , xdata -> battery .name );
13211321
13221322 return 0 ;
@@ -1352,6 +1352,7 @@ static void xpadneo_remove(struct hid_device *hdev)
13521352 hdev -> product = xdata -> original_product ;
13531353 }
13541354
1355+ del_timer_sync (& xdata -> mouse_timer );
13551356 cancel_delayed_work_sync (& xdata -> ff_worker );
13561357
13571358 kfree (xdata -> battery .name );
0 commit comments