Rémi Bernon : winebus.sys: Implement PID device gain for UDEV lnxev devices.

Alexandre Julliard julliard at winehq.org
Wed Nov 17 16:27:57 CST 2021


Module: wine
Branch: master
Commit: 354be0a169e4943a984b058559785480da6a2119
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=354be0a169e4943a984b058559785480da6a2119

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Wed Nov 17 11:51:55 2021 +0100

winebus.sys: Implement PID device gain for UDEV lnxev devices.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winebus.sys/bus_udev.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index 74cfe486a03..d7bbd5ba79d 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -926,9 +926,20 @@ static NTSTATUS lnxev_device_physical_device_control(struct unix_device *iface,
 
 static NTSTATUS lnxev_device_physical_device_set_gain(struct unix_device *iface, BYTE value)
 {
-    FIXME("iface %p, value %#x stub!\n", iface, value);
+    struct lnxev_device *impl = lnxev_impl_from_unix_device(iface);
+    struct input_event ie =
+    {
+        .type = EV_FF,
+        .code = FF_GAIN,
+        .value = value * 100 / 255,
+    };
 
-    return STATUS_NOT_IMPLEMENTED;
+    TRACE("iface %p, value %#x.\n", iface, value);
+
+    if (write(impl->base.device_fd, &ie, sizeof(ie)) == -1)
+        WARN("write failed %d %s\n", errno, strerror(errno));
+
+    return STATUS_SUCCESS;
 }
 
 static NTSTATUS lnxev_device_physical_effect_control(struct unix_device *iface, BYTE index,
@@ -1102,8 +1113,8 @@ static const struct hid_device_vtbl lnxev_device_vtbl =
     lnxev_device_start,
     lnxev_device_stop,
     lnxev_device_haptics_start,
-    lnxev_device_physical_device_set_gain,
     lnxev_device_physical_device_control,
+    lnxev_device_physical_device_set_gain,
     lnxev_device_physical_effect_control,
     lnxev_device_physical_effect_update,
 };




More information about the wine-cvs mailing list