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