Lakka/Nintendo Switch: disable rumble gain

Rumble gain breaks controlls on Nintendo Switch port of Lakka, probably
due to issue in the driver).

Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-06-switch_disable_rumble_gain.patch
This commit is contained in:
Tomáš Kelemen (vudiq) 2021-11-17 21:59:37 +01:00
parent 44dcfb88b6
commit 0cf437e375
No known key found for this signature in database
GPG Key ID: 5CE55E600E0B3B22

View File

@ -151,6 +151,7 @@ error:
return -1;
}
#ifndef HAVE_LAKKA_SWITCH
static bool udev_set_rumble_gain(unsigned i, unsigned gain)
{
struct input_event ie;
@ -179,6 +180,7 @@ static bool udev_set_rumble_gain(unsigned i, unsigned gain)
return true;
}
#endif
static int udev_add_pad(struct udev_device *dev, unsigned p, int fd, const char *path)
{
@ -299,6 +301,7 @@ static int udev_add_pad(struct udev_device *dev, unsigned p, int fd, const char
p, path, pad->num_effects);
}
#ifndef HAVE_LAKKA_SWITCH
/* Set rumble gain here, if supported */
if (test_bit(FF_RUMBLE, ffbit))
{
@ -307,6 +310,7 @@ static int udev_add_pad(struct udev_device *dev, unsigned p, int fd, const char
: DEFAULT_RUMBLE_GAIN;
udev_set_rumble_gain(p, rumble_gain);
}
#endif
return ret;
}
@ -790,7 +794,11 @@ input_device_driver_t udev_joypad = {
udev_joypad_axis,
udev_joypad_poll,
udev_set_rumble,
#ifndef HAVE_LAKKA_SWITCH
udev_set_rumble_gain,
#else
NULL,
#endif
udev_joypad_name,
"udev",
};