USB camera enumeration
Hi,
My board is a mini2440 SDK board, with ARM processor (400mhz) and 64mb ram. Inside it I have a custom rootfs (based on default rootfs) and kernel 2.6.32-2.
I'm working on a project with 2 usb cameras. One camera will be connected
on USB1 and another will be connected on USB2 port of a micro 2440 SDK.
Using above configuration, I have two devices on /dev/:
/dev/video0
/dev/video1
My problem is that I need to know which is connected on USB1 and which is connected on USB2.
For example, /dev/video0 is on USB2 port (1-1.2), and /dev/video1 is on USB1 port (1-1.1).
I tried to write some script calls on /etc/mdev.conf rules (to tell me which USB is being used) (mdev is a kind of udev). This works well when I plug USB cameras while system is running. But it doesn't work well when the system is restarted. The rules are not called properly (i don't know why) during initialization.
In fact, I just need to know where /dev/video0 is connected, USB1 or USB2.
Any file on system can tell me that easily (/sys/bus/usb/...), instead of write a lot of scripts?
Thanks in advance.
|