Seeking Assistance: Implementing USB Device Suspend/Resume in User Space Driver
Alan Stern
stern at rowland.harvard.edu
Mon May 6 10:29:44 EDT 2024
On Mon, May 06, 2024 at 04:44:30PM +0530, Muni Sekhar wrote:
> Dear Linux USB Subsystem Community,
>
> I hope this email finds you well. We are currently working on a USB
> device driver in the Linux kernel space, which supports the
> suspend/resume functionality for a USB device using the struct
> usb_driver's .suspend and .resume callbacks.
>
>
> In our driver code, we perform a check to determine if the device has
> remote wakeup capability. If the device supports remote wakeup, we
> enable the device's autosuspend mode by setting the struct
> usb_device->dev.power.autosuspend_delay parameter and then calling
> usb_enable_autosuspend().
>
>
> Similarly, to resume the suspended device, we expose an API to user
> space via IOCTL. In this process, we set struct
> usb_device->dev.power.autosuspend_delay to -1 and then call
> usb_disable_autosuspend().
>
>
> While we have successfully converted most of the USB device driver
> functionality from kernel space to user space using libusb, we are now
> seeking guidance on how to implement USB device suspend/resume in user
> space. Specifically, we would like to know if libusb provides support
> for achieving the suspend/resume functionality mentioned above.
> Additionally, any insights or suggestions on how to accomplish this
> task would be greatly appreciated.
Your question is about libusb, right? So you'll get better answers if
you post it on the libusb mailing list rather than the linux-usb mailing
list.
Alan Stern
> It's worth mentioning that our USB device driver also supports
> Bulk\Coontrol I/O transfers and other functionalities.
>
>
> Thank you in advance for any assistance you can provide. I look
> forward to your valuable inputs and recommendations.
>
>
> --
> Thanks,
> Sekhar
>
More information about the Kernelnewbies
mailing list