ftdipp: Add wrapper for ftdi_set_module_detach_mode()
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Sun, 4 Jan 2026 11:56:35 +0000 (12:56 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Sun, 4 Jan 2026 11:59:02 +0000 (12:59 +0100)
This wraps the ftdi_set_module_detach_mode() C function. The method allows
setting the module detach mode behavior for the FTDI kernel driver.

The new method follows the existing wrapper pattern.

ftdipp/ftdi.cpp
ftdipp/ftdi.hpp

index 2df1e6c..91eb384 100644 (file)
@@ -200,6 +200,11 @@ int Context::set_interface(enum ftdi_interface interface)
     return ftdi_set_interface(d->ftdi, interface);
 }
 
+int Context::set_module_detach_mode(enum ftdi_module_detach_mode mode)
+{
+    return ftdi_set_module_detach_mode(d->ftdi, mode);
+}
+
 void Context::set_usb_device(struct libusb_device_handle *dev)
 {
     ftdi_set_usbdev(d->ftdi, dev);
index 3d07e77..327242f 100644 (file)
@@ -88,6 +88,7 @@ public:
     int DEPRECATED(flush)(int mask = Input|Output);
     int tcflush(int mask = Input|Output);
     int set_interface(enum ftdi_interface interface);
+    int set_module_detach_mode(enum ftdi_module_detach_mode mode);
     void set_usb_device(struct libusb_device_handle *dev);
 
     /* Line manipulators */