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