Merge remote-tracking branch 'regmap/for-next'
[deliverable/linux.git] / Documentation / media / uapi / mediactl / media-ioc-device-info.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
d2c68150 3.. _media_ioc_device_info:
5377d91f
MH
4
5***************************
6ioctl MEDIA_IOC_DEVICE_INFO
7***************************
8
15e7d615 9Name
586027ce 10====
5377d91f 11
586027ce 12MEDIA_IOC_DEVICE_INFO - Query device information
5377d91f 13
15e7d615
MCC
14
15Synopsis
5377d91f
MH
16========
17
5ccbb182
MCC
18.. c:function:: int ioctl( int fd, MEDIA_IOC_DEVICE_INFO, struct media_device_info *argp )
19 :name: MEDIA_IOC_DEVICE_INFO
5377d91f 20
586027ce 21
15e7d615 22Arguments
5377d91f
MH
23=========
24
25``fd``
26 File descriptor returned by :ref:`open() <media-func-open>`.
27
5377d91f
MH
28``argp``
29
30
15e7d615 31Description
5377d91f
MH
32===========
33
34All media devices must support the ``MEDIA_IOC_DEVICE_INFO`` ioctl. To
35query device information, applications call the ioctl with a pointer to
e8be7e97 36a struct :c:type:`media_device_info`. The driver
5377d91f
MH
37fills the structure and returns the information to the application. The
38ioctl never fails.
39
40
e8be7e97 41.. c:type:: media_device_info
5377d91f 42
5bd4bb78
MCC
43.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
44
5377d91f
MH
45.. flat-table:: struct media_device_info
46 :header-rows: 0
47 :stub-columns: 0
48 :widths: 1 1 2
49
50
51 - .. row 1
52
53 - char
54
8968da9b 55 - ``driver``\ [16]
5377d91f
MH
56
57 - Name of the driver implementing the media API as a NUL-terminated
0579e6e3
MCC
58 ASCII string. The driver version is stored in the
59 ``driver_version`` field.
5377d91f 60
0579e6e3
MCC
61 Driver specific applications can use this information to verify
62 the driver identity. It is also useful to work around known bugs,
63 or to identify drivers in error reports.
5377d91f
MH
64
65 - .. row 2
66
67 - char
68
8968da9b 69 - ``model``\ [32]
5377d91f
MH
70
71 - Device model name as a NUL-terminated UTF-8 string. The device
0579e6e3
MCC
72 version is stored in the ``device_version`` field and is not be
73 appended to the model name.
5377d91f
MH
74
75 - .. row 3
76
77 - char
78
8968da9b 79 - ``serial``\ [40]
5377d91f
MH
80
81 - Serial number as a NUL-terminated ASCII string.
82
83 - .. row 4
84
85 - char
86
8968da9b 87 - ``bus_info``\ [32]
5377d91f
MH
88
89 - Location of the device in the system as a NUL-terminated ASCII
0579e6e3
MCC
90 string. This includes the bus type name (PCI, USB, ...) and a
91 bus-specific identifier.
5377d91f
MH
92
93 - .. row 5
94
95 - __u32
96
97 - ``media_version``
98
99 - Media API version, formatted with the ``KERNEL_VERSION()`` macro.
100
101 - .. row 6
102
103 - __u32
104
105 - ``hw_revision``
106
107 - Hardware device revision in a driver-specific format.
108
109 - .. row 7
110
111 - __u32
112
113 - ``driver_version``
114
115 - Media device driver version, formatted with the
0579e6e3
MCC
116 ``KERNEL_VERSION()`` macro. Together with the ``driver`` field
117 this identifies a particular driver.
5377d91f
MH
118
119 - .. row 8
120
121 - __u32
122
8968da9b 123 - ``reserved``\ [31]
5377d91f
MH
124
125 - Reserved for future extensions. Drivers and applications must set
0579e6e3 126 this array to zero.
5377d91f
MH
127
128
129The ``serial`` and ``bus_info`` fields can be used to distinguish
130between multiple instances of otherwise identical hardware. The serial
131number takes precedence when provided and can be assumed to be unique.
132If the serial number is an empty string, the ``bus_info`` field can be
133used instead. The ``bus_info`` field is guaranteed to be unique, but can
134vary across reboots or device unplug/replug.
135
136
15e7d615 137Return Value
5377d91f
MH
138============
139
140On success 0 is returned, on error -1 and the ``errno`` variable is set
141appropriately. The generic error codes are described at the
142:ref:`Generic Error Codes <gen-errors>` chapter.
This page took 0.051654 seconds and 5 git commands to generate.