diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-27 21:47:39 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-27 21:47:39 -0200 |
commit | 2c2c41eb10e9ce7b7ae1550615f1fb48fbaa9e10 (patch) | |
tree | e6b5d725d369e40071b12ce19509ef218ca5f0f9 /linux/firmware/cpia2 | |
parent | 66be1e92cb9080a37ed87cba444d46cc84ea4f9b (diff) | |
download | mediapointer-dvb-s2-2c2c41eb10e9ce7b7ae1550615f1fb48fbaa9e10.tar.gz mediapointer-dvb-s2-2c2c41eb10e9ce7b7ae1550615f1fb48fbaa9e10.tar.bz2 |
Add a small utility for retrieving sysfs bus path
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Thanks to Carsten Meier <cm@trexity.de> for providing us a c++ code
snippet for USB.
This code is capable of getting the bus info for both USB and PCI
devices. This is retrieved via bus_info returned by VIDIOC_QUERYCAP.
The utility will output the following info for a usb device:
bus info = usb-0000:00:1d.7-1
bus path = /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1
And, for PCI devices, it will output:
bus info = PCI:0000:01:02.0
bus path = /sys/devices/pci0000:00/0000:00:1e.0/0000:01:02.0
Notice: This will only work for devices that uses the standard
notation for the bus info:
on PCI:
sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
or
sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci));
on USB:
usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/firmware/cpia2')
0 files changed, 0 insertions, 0 deletions