4

I have a USB touchscreen connected to my hardware setup. and when I use cat /proc/bus/input/devices I get the following details about my device:

I: Bus=0003 Vendor=2965 Product=5023 Version=0110
N: Name="Kortek Kortek Touch"
P: Phys=usb-0000:00:14.0-3.4/input2
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.4/3-3.4:1.2/0003:2965:5023.0006/input/input7
U: Uniq=S20131028
H: Handlers=mouse1 event7 js0
B: PROP=0
B: EV=1b
B: KEY=30000 0 0 0 0 0 0 0 0
B: ABS=3
B: MSC=10

I want to know what does the line S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.4/3-3.4:1.2/0003:2965:5023.0006/input/input7 means. How to read it ? What are the numbers in the path ?

Sam Protsenko
  • 14,045
  • 4
  • 59
  • 75
Monku
  • 2,440
  • 4
  • 33
  • 57

1 Answers1

11

The Sysfs attribute is the location of that device within the sysfs filesystem. Assuming your kernel was compiled with CONFIG_SYSFS and the sysfs filesystem is mounted to /sys, you can view the device at:

/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.4/3-3.4:1.2/0003:2965:5023.0006/input/input7

To break down what path represents:

/sys/ is the mountpoint of the sysfs filesystem (see the output of mount | grep sysfs).

/devices/ contains a filesystem representation of the device tree (source).

/pci0000:00/ describes the PCI domain and the bus number. In this case, the domain number is 0000 and the bus number is 00 (source).

/0000:00:14.0/ has the the PCI domain and bus number repeated, along with the slot and function. In this case, the USB device's slot number is 14 and its function number is 0 (source).

/usb3/ refers to USB controller attached to bus number 3 (source).

/3-3/3-3.4/3-3.4:1.2/ has redundant information. The last /3-3.4:1.2/ means you are referring to the USB controller attached to bus 3, port 3, port 4, configuration number 1 and interface number 2 (source).

/0003:2965:5023.0006/ means the device is attached to bus 0003, has a vendor ID of 2965, and a product ID of 5023.

Tim
  • 4,790
  • 4
  • 33
  • 41
  • I am aware of that. What I am asking is what does the path tells us about the device like "pci0000:00/0000:00:14.0/usb3/3-3/3-3.4/3-3.4:1.2/0003:2965:5023.0006". What does the numbers in the path say about the device ? – Monku Jul 07 '16 at 23:58
  • Let me know if I should clarify more... – Tim Jul 08 '16 at 00:16
  • what does the number `0006` mean in `/0003:2965:5023.0006/` – Monku Jul 08 '16 at 17:21
  • I don't know for sure... maybe it is the revision number? See if it matches the Rev property of your device in `/sys/kernel/debug/usb/devices` – Tim Jul 08 '16 at 17:39
  • `Rev= 1.00` So it does not seem to match it. However, there is one more property `Dev#= 6`. Do you know what this is ? – Monku Jul 08 '16 at 18:04
  • `0006` is the device number that gets assigned by the kernel. A device number will NOT be re-used by the kernel, so if you unplug and replug the device, you should see the device number counting up (i.e. `0006`, then `0007`, then `0008`, and so on). An easy way to check would be to use `lsusb`. – Ken Lin Aug 09 '20 at 07:28