SDL: Don't mess with the state of the Motion Plus extension on Linux

From 87f8b6ff0f89ae572056301b1361a5db9be8b4cb Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 7 Sep 2022 01:21:01 -0700
Subject: [PATCH] Don't mess with the state of the Motion Plus extension on
 Linux

---
 src/joystick/hidapi/SDL_hidapi_wii.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/joystick/hidapi/SDL_hidapi_wii.c b/src/joystick/hidapi/SDL_hidapi_wii.c
index 7fd3d012398..09d23bedfbb 100644
--- a/src/joystick/hidapi/SDL_hidapi_wii.c
+++ b/src/joystick/hidapi/SDL_hidapi_wii.c
@@ -463,9 +463,15 @@ static void CheckMotionPlusConnection(SDL_DriverWii_Context *ctx)
 
 static void ActivateMotionPlusWithMode(SDL_DriverWii_Context *ctx, Uint8 mode)
 {
+#if defined(__LINUX__)
+    /* Linux drivers maintain a lot of state around the Motion Plus
+     * extension, so don't mess with it here.
+     */
+#else
     WriteRegister(ctx, 0xA600FE, &mode, sizeof(mode), SDL_TRUE);
 
     ctx->m_ucMotionPlusMode = mode;
+#endif /* LINUX */
 }
 
 static void ActivateMotionPlus(SDL_DriverWii_Context *ctx)