1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2.. c:namespace:: CEC
3
4.. _CEC_ADAP_G_CAPS:
5
6*********************
7ioctl CEC_ADAP_G_CAPS
8*********************
9
10Name
11====
12
13CEC_ADAP_G_CAPS - Query device capabilities
14
15Synopsis
16========
17
18.. c:macro:: CEC_ADAP_G_CAPS
19
20``int ioctl(int fd, CEC_ADAP_G_CAPS, struct cec_caps *argp)``
21
22Arguments
23=========
24
25``fd``
26    File descriptor returned by :c:func:`open()`.
27
28``argp``
29
30Description
31===========
32
33All cec devices must support :ref:`ioctl CEC_ADAP_G_CAPS <CEC_ADAP_G_CAPS>`. To query
34device information, applications call the ioctl with a pointer to a
35struct :c:type:`cec_caps`. The driver fills the structure and
36returns the information to the application. The ioctl never fails.
37
38.. tabularcolumns:: |p{1.2cm}|p{2.5cm}|p{13.6cm}|
39
40.. c:type:: cec_caps
41
42.. flat-table:: struct cec_caps
43    :header-rows:  0
44    :stub-columns: 0
45    :widths:       1 1 16
46
47    * - char
48      - ``driver[32]``
49      - The name of the cec adapter driver.
50    * - char
51      - ``name[32]``
52      - The name of this CEC adapter. The combination ``driver`` and
53	``name`` must be unique.
54    * - __u32
55      - ``available_log_addrs``
56      - The maximum number of logical addresses that can be configured.
57    * - __u32
58      - ``capabilities``
59      - The capabilities of the CEC adapter, see
60	:ref:`cec-capabilities`.
61    * - __u32
62      - ``version``
63      - CEC Framework API version, formatted with the ``KERNEL_VERSION()``
64	macro.
65
66.. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.4cm}|
67
68.. _cec-capabilities:
69
70.. flat-table:: CEC Capabilities Flags
71    :header-rows:  0
72    :stub-columns: 0
73    :widths:       3 1 8
74
75    * .. _`CEC-CAP-PHYS-ADDR`:
76
77      - ``CEC_CAP_PHYS_ADDR``
78      - 0x00000001
79      - Userspace has to configure the physical address by calling
80	:ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>`. If
81	this capability isn't set, then setting the physical address is
82	handled by the kernel whenever the EDID is set (for an HDMI
83	receiver) or read (for an HDMI transmitter).
84    * .. _`CEC-CAP-LOG-ADDRS`:
85
86      - ``CEC_CAP_LOG_ADDRS``
87      - 0x00000002
88      - Userspace has to configure the logical addresses by calling
89	:ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`. If
90	this capability isn't set, then the kernel will have configured
91	this.
92    * .. _`CEC-CAP-TRANSMIT`:
93
94      - ``CEC_CAP_TRANSMIT``
95      - 0x00000004
96      - Userspace can transmit CEC messages by calling
97	:ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`. This implies that
98	userspace can be a follower as well, since being able to transmit
99	messages is a prerequisite of becoming a follower. If this
100	capability isn't set, then the kernel will handle all CEC
101	transmits and process all CEC messages it receives.
102    * .. _`CEC-CAP-PASSTHROUGH`:
103
104      - ``CEC_CAP_PASSTHROUGH``
105      - 0x00000008
106      - Userspace can use the passthrough mode by calling
107	:ref:`ioctl CEC_S_MODE <CEC_S_MODE>`.
108    * .. _`CEC-CAP-RC`:
109
110      - ``CEC_CAP_RC``
111      - 0x00000010
112      - This adapter supports the remote control protocol.
113    * .. _`CEC-CAP-MONITOR-ALL`:
114
115      - ``CEC_CAP_MONITOR_ALL``
116      - 0x00000020
117      - The CEC hardware can monitor all messages, not just directed and
118	broadcast messages.
119    * .. _`CEC-CAP-NEEDS-HPD`:
120
121      - ``CEC_CAP_NEEDS_HPD``
122      - 0x00000040
123      - The CEC hardware is only active if the HDMI Hotplug Detect pin is
124        high. This makes it impossible to use CEC to wake up displays that
125	set the HPD pin low when in standby mode, but keep the CEC bus
126	alive.
127    * .. _`CEC-CAP-MONITOR-PIN`:
128
129      - ``CEC_CAP_MONITOR_PIN``
130      - 0x00000080
131      - The CEC hardware can monitor CEC pin changes from low to high voltage
132        and vice versa. When in pin monitoring mode the application will
133	receive ``CEC_EVENT_PIN_CEC_LOW`` and ``CEC_EVENT_PIN_CEC_HIGH`` events.
134    * .. _`CEC-CAP-CONNECTOR-INFO`:
135
136      - ``CEC_CAP_CONNECTOR_INFO``
137      - 0x00000100
138      - If this capability is set, then :ref:`CEC_ADAP_G_CONNECTOR_INFO` can
139        be used.
140
141Return Value
142============
143
144On success 0 is returned, on error -1 and the ``errno`` variable is set
145appropriately. The generic error codes are described at the
146:ref:`Generic Error Codes <gen-errors>` chapter.
147