Introduce new detach mode:
AUTO_DETACH_REATACH_SIO_MODULE
Tested on linux (Ubuntu 16.04 and Raspbian Stretch) with an FT230.
if (libusb_detach_kernel_driver(ftdi->usb_dev, ftdi->interface) !=0)
detach_errno = errno;
}
+ else if (ftdi->module_detach_mode == AUTO_DETACH_REATACH_SIO_MODULE)
+ {
+ if (libusb_set_auto_detach_kernel_driver(ftdi->usb_dev, 1) != LIBUSB_SUCCESS)
+ detach_errno = errno;
+ }
if (libusb_get_configuration (ftdi->usb_dev, &cfg) < 0)
ftdi_error_return(-12, "libusb_get_configuration () failed");
enum ftdi_module_detach_mode
{
AUTO_DETACH_SIO_MODULE = 0,
- DONT_DETACH_SIO_MODULE = 1
+ DONT_DETACH_SIO_MODULE = 1,
+ AUTO_DETACH_REATACH_SIO_MODULE = 2
};
/* Shifting commands IN MPSSE Mode*/