0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 .. c:namespace:: CEC
0003
0004 .. _CEC_ADAP_G_CAPS:
0005
0006 *********************
0007 ioctl CEC_ADAP_G_CAPS
0008 *********************
0009
0010 Name
0011 ====
0012
0013 CEC_ADAP_G_CAPS - Query device capabilities
0014
0015 Synopsis
0016 ========
0017
0018 .. c:macro:: CEC_ADAP_G_CAPS
0019
0020 ``int ioctl(int fd, CEC_ADAP_G_CAPS, struct cec_caps *argp)``
0021
0022 Arguments
0023 =========
0024
0025 ``fd``
0026 File descriptor returned by :c:func:`open()`.
0027
0028 ``argp``
0029
0030 Description
0031 ===========
0032
0033 All cec devices must support :ref:`ioctl CEC_ADAP_G_CAPS <CEC_ADAP_G_CAPS>`. To query
0034 device information, applications call the ioctl with a pointer to a
0035 struct :c:type:`cec_caps`. The driver fills the structure and
0036 returns the information to the application. The ioctl never fails.
0037
0038 .. tabularcolumns:: |p{1.2cm}|p{2.5cm}|p{13.6cm}|
0039
0040 .. c:type:: cec_caps
0041
0042 .. flat-table:: struct cec_caps
0043 :header-rows: 0
0044 :stub-columns: 0
0045 :widths: 1 1 16
0046
0047 * - char
0048 - ``driver[32]``
0049 - The name of the cec adapter driver.
0050 * - char
0051 - ``name[32]``
0052 - The name of this CEC adapter. The combination ``driver`` and
0053 ``name`` must be unique.
0054 * - __u32
0055 - ``available_log_addrs``
0056 - The maximum number of logical addresses that can be configured.
0057 * - __u32
0058 - ``capabilities``
0059 - The capabilities of the CEC adapter, see
0060 :ref:`cec-capabilities`.
0061 * - __u32
0062 - ``version``
0063 - CEC Framework API version, formatted with the ``KERNEL_VERSION()``
0064 macro.
0065
0066 .. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.4cm}|
0067
0068 .. _cec-capabilities:
0069
0070 .. flat-table:: CEC Capabilities Flags
0071 :header-rows: 0
0072 :stub-columns: 0
0073 :widths: 3 1 8
0074
0075 * .. _`CEC-CAP-PHYS-ADDR`:
0076
0077 - ``CEC_CAP_PHYS_ADDR``
0078 - 0x00000001
0079 - Userspace has to configure the physical address by calling
0080 :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>`. If
0081 this capability isn't set, then setting the physical address is
0082 handled by the kernel whenever the EDID is set (for an HDMI
0083 receiver) or read (for an HDMI transmitter).
0084 * .. _`CEC-CAP-LOG-ADDRS`:
0085
0086 - ``CEC_CAP_LOG_ADDRS``
0087 - 0x00000002
0088 - Userspace has to configure the logical addresses by calling
0089 :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`. If
0090 this capability isn't set, then the kernel will have configured
0091 this.
0092 * .. _`CEC-CAP-TRANSMIT`:
0093
0094 - ``CEC_CAP_TRANSMIT``
0095 - 0x00000004
0096 - Userspace can transmit CEC messages by calling
0097 :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`. This implies that
0098 userspace can be a follower as well, since being able to transmit
0099 messages is a prerequisite of becoming a follower. If this
0100 capability isn't set, then the kernel will handle all CEC
0101 transmits and process all CEC messages it receives.
0102 * .. _`CEC-CAP-PASSTHROUGH`:
0103
0104 - ``CEC_CAP_PASSTHROUGH``
0105 - 0x00000008
0106 - Userspace can use the passthrough mode by calling
0107 :ref:`ioctl CEC_S_MODE <CEC_S_MODE>`.
0108 * .. _`CEC-CAP-RC`:
0109
0110 - ``CEC_CAP_RC``
0111 - 0x00000010
0112 - This adapter supports the remote control protocol.
0113 * .. _`CEC-CAP-MONITOR-ALL`:
0114
0115 - ``CEC_CAP_MONITOR_ALL``
0116 - 0x00000020
0117 - The CEC hardware can monitor all messages, not just directed and
0118 broadcast messages.
0119 * .. _`CEC-CAP-NEEDS-HPD`:
0120
0121 - ``CEC_CAP_NEEDS_HPD``
0122 - 0x00000040
0123 - The CEC hardware is only active if the HDMI Hotplug Detect pin is
0124 high. This makes it impossible to use CEC to wake up displays that
0125 set the HPD pin low when in standby mode, but keep the CEC bus
0126 alive.
0127 * .. _`CEC-CAP-MONITOR-PIN`:
0128
0129 - ``CEC_CAP_MONITOR_PIN``
0130 - 0x00000080
0131 - The CEC hardware can monitor CEC pin changes from low to high voltage
0132 and vice versa. When in pin monitoring mode the application will
0133 receive ``CEC_EVENT_PIN_CEC_LOW`` and ``CEC_EVENT_PIN_CEC_HIGH`` events.
0134 * .. _`CEC-CAP-CONNECTOR-INFO`:
0135
0136 - ``CEC_CAP_CONNECTOR_INFO``
0137 - 0x00000100
0138 - If this capability is set, then :ref:`CEC_ADAP_G_CONNECTOR_INFO` can
0139 be used.
0140
0141 Return Value
0142 ============
0143
0144 On success 0 is returned, on error -1 and the ``errno`` variable is set
0145 appropriately. The generic error codes are described at the
0146 :ref:`Generic Error Codes <gen-errors>` chapter.