How to get the connection/disconnection of a usb cable

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

lodogg
Posts: 1
Joined: Wed Apr 24, 2013 8:42 am

How to get the connection/disconnection of a usb cable

Wed Apr 24, 2013 9:14 am

Hi everybody.
I am pretty new to Linux so I apologize if I will ask some really simple stuff.
I am working on a custom board with SAM9G25 and Angstrom distribution as operating system.

The board as to act as a USB Device (Mass storage device), when will be connected to a Host computer. Right now I am simply enabling and removing the g_mass_storage module and the things are working fine.
In the final version, I need to manage the g_mass_storage module according to the connection and disconnection of a USB cable. I tought to use VBUS as an interrupt (also polling will be fine).

Here it comes my problem.

Since the VBUS GPIO is handled by the USB driver i cannot read it's status from userspace. I only see an interrupt count in /proc/interrupt.
I am asking if there is a way to get an interrupt (from the Driver :?: :?: ) or to be able to read the VBUS GPIO value when the usb cable is connected/disconnected from the system.

I apreciate any kind of help.

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 5 guests