Re: [RFCv2 API PATCH 05/28] DocBook: bus_info can no longer be empty.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/09/2012 10:45 AM, Hans Verkuil wrote:
>>>>> diff --git a/Documentation/DocBook/media/v4l/vidioc-querycap.xml b/Documentation/DocBook/media/v4l/vidioc-querycap.xml
>>>>> index f33dd74..d5b1248 100644
>>>>> --- a/Documentation/DocBook/media/v4l/vidioc-querycap.xml
>>>>> +++ b/Documentation/DocBook/media/v4l/vidioc-querycap.xml
>>>>> @@ -90,11 +90,17 @@ ambiguities.</entry>
>>>>>     	<entry>__u8</entry>
>>>>>     	<entry><structfield>bus_info</structfield>[32]</entry>
>>>>>     	<entry>Location of the device in the system, a
>>>>> -NUL-terminated ASCII string. For example: "PCI Slot 4". This
>>>>> +NUL-terminated ASCII string. For example: "PCI:0000:05:06.0". This
>>>>>     information is intended for users, to distinguish multiple
>>>>> -identical devices. If no such information is available the field may
>>>>> -simply count the devices controlled by the driver, or contain the
>>>>> -empty string (<structfield>bus_info</structfield>[0] = 0).<!-- XXX pci_dev->slot_name example --></entry>
>>>>> +identical devices. If no such information is available the field must
>>>>> +simply count the devices controlled by the driver ("vivi-000"). The bus_info
>>>>> +must start with "PCI:" for PCI boards, "PCIe:" for PCI Express boards,
>>>>> +"usb-" for USB devices, "I2C:" for i2c devices, "ISA:" for ISA devices and
>>>>> +"parport" for parallel port devices.
>>>>> +For devices without a bus it should start with the driver name, optionally
>>>>
>>>> Most, if not all, devices are on some sort of bus. What would be an example
>>>> of a device "without a bus" ?
>>>
>>> Virtual devices like vivi and platform devices. Or is there some sort of
>>> platform bus?
>>
>> OK, then virtual devices like vivi are indeed not on any bus. But saying so,
>> or implicitly assuming, about platform devices would have been misleading.
>>
>> On ASICs and SoCs such devices are on some kind of on-chip peripheral bus,
>> e.g. AMBA APB/AHB [1].
> 
> Yes, but such busses are internal to the hardware and are not enumerated by
> the kernel. The kernel will generate unique names for e.g. usb and pci busses
> which is used to identify the device on that bus. And that's used also when
> generating the bus_info.

They are not enumerated but are commonly referred to as simple bus or AMBA 
bus and mapped to system address space. See drivers/of/platform.c or 
Documentation/devicetree/usage-model.txt. And the device names must also be 
unique IIRC. platform_bus_type is also often used for devices that don't match 
with any other existing bus_type. One could look at /sys/bus/platform/devices 
for sample list of platform devices.

> That said, I checked drivers/base/platform.c and there is actually a platform
> bus that's created in the kernel for platform devices. So perhaps something
> like platform:devname wouldn't be such a bad idea after all. I'd have to do
> some tests with this to see how it would look.

Yeah, obviously. platform:devname sounds good, bus_info would be then telling 
something about the bus, rather than being a redundant copy of driver's name.

--

Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux