Jeepster
Jeepster

Reputation: 169

How to stop/restart USB device (Linux embedded system)

Hello USB / Linux gurus!

I have an embedded system based on an Atmel ARM Cortex-A5 CPU. It runs embedded Linux kernel V3.10 that configures its high-speed USB port as a USB device.

The USB device is configured as a USB composite made up of HID, NDIS Ethernet and MTP. Everything is working well.

However When plugging in this embedded system into a host OS like Windows, a situation arises when I must notify Window of the new MTP device. Currently the only way I know how to do that is to physically unplug the USB cable from the embedded system and plug it back in. Windows then notices the 'new' MTP connection, opens a folder pointing to the files on my device and everything is great!

I would like to find a way to do exactly the same thing programmatically... in other words bring my USB device port down and up just as if I were using 'ifconfig' for Ethernet.

Is there some command I can use to suspend and resume a USB device port?

Thank you very much!

Jean-Pierre

P.S. The USB driver I'm using is called 'atmel_usba_udc.c' and contains functions like 'atmel_usba_stop()' and 'atmel_usba_start()' that I'd like to invoke from user-space.

Upvotes: 2

Views: 2489

Answers (1)

Karthik Balaguru
Karthik Balaguru

Reputation: 7852

'atmel_usba_stop()' and 'atmel_usba_start()' seem to be related to ops that refer to function pointers used for accessing hardware-specific operations. You can use it for instructing the kernel from userspace by linking with ioctl appropriately.

Upvotes: 1

Related Questions