Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] doc-rst: linux_tv CEC part, DocBook to reST migration

This is the reST migration of media's CEC part. The migration is based
on media_tree's cec branch:

https://git.linuxtv.org/media_tree.git

c7169ad * cec media_tree/cec [media] DocBook/media: add CEC documentation

Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Markus Heiser and committed by
Mauro Carvalho Chehab
e2460b1d 4606ce43

+1964 -5
+8 -5
Documentation/media/media_uapi.rst
··· 37 37 Typical Media Device 38 38 39 39 The media infrastructure API was designed to control such devices. It is 40 - divided into four parts. 40 + divided into five parts. 41 41 42 - The :Ref:`first part <v4l2spec>` covers radio, video capture and output, 42 + The :ref:`first part <v4l2spec>` covers radio, video capture and output, 43 43 cameras, analog TV devices and codecs. 44 44 45 - The :Ref:`second part <dvbapi>` covers the API used for digital TV and 45 + The :ref:`second part <dvbapi>` covers the API used for digital TV and 46 46 Internet reception via one of the several digital tv standards. While it 47 47 is called as DVB API, in fact it covers several different video 48 48 standards including DVB-T/T2, DVB-S/S2, DVB-C, ATSC, ISDB-T, ISDB-S, 49 49 DTMB, etc. The complete list of supported standards can be found at 50 50 :ref:`fe-delivery-system-t`. 51 51 52 - The :Ref:`third part <remote_controllers>` covers the Remote Controller API. 52 + The :ref:`third part <remote_controllers>` covers the Remote Controller API. 53 53 54 - The :Ref:`fourth part <media_controller>` covers the Media Controller API. 54 + The :ref:`fourth part <media_controller>` covers the Media Controller API. 55 + 56 + The :ref:`fifth part <cec>` covers the CEC (Consumer Electronics Control) API. 55 57 56 58 It should also be noted that a media device may also have audio 57 59 components, like mixers, PCM capture, PCM playback, etc, which are ··· 74 72 uapi/dvb/dvbapi 75 73 uapi/rc/remote_controllers 76 74 uapi/mediactl/media-controller 75 + uapi/cec/cec-api 77 76 uapi/gen-errors 78 77 uapi/fdl-appendix 79 78
+94
Documentation/media/uapi/cec/cec-api.rst
··· 1 + .. -*- coding: utf-8; mode: rst -*- 2 + 3 + .. _cec: 4 + 5 + ####### 6 + CEC API 7 + ####### 8 + 9 + .. _cec-api: 10 + 11 + ********************************* 12 + CEC: Consumer Electronics Control 13 + ********************************* 14 + 15 + 16 + .. _cec-intro: 17 + 18 + Introduction 19 + ============ 20 + 21 + Note: this documents the proposed CEC API. This API is not yet finalized 22 + and is currently only available as a staging kernel module. 23 + 24 + HDMI connectors provide a single pin for use by the Consumer Electronics 25 + Control protocol. This protocol allows different devices connected by an 26 + HDMI cable to communicate. The protocol for CEC version 1.4 is defined 27 + in supplements 1 (CEC) and 2 (HEAC or HDMI Ethernet and Audio Return 28 + Channel) of the HDMI 1.4a (:ref:`hdmi`) specification and the 29 + extensions added to CEC version 2.0 are defined in chapter 11 of the 30 + HDMI 2.0 (:ref:`hdmi2`) specification. 31 + 32 + The bitrate is very slow (effectively no more than 36 bytes per second) 33 + and is based on the ancient AV.link protocol used in old SCART 34 + connectors. The protocol closely resembles a crazy Rube Goldberg 35 + contraption and is an unholy mix of low and high level messages. Some 36 + messages, especially those part of the HEAC protocol layered on top of 37 + CEC, need to be handled by the kernel, others can be handled either by 38 + the kernel or by userspace. 39 + 40 + In addition, CEC can be implemented in HDMI receivers, transmitters and 41 + in USB devices that have an HDMI input and an HDMI output and that 42 + control just the CEC pin. 43 + 44 + Drivers that support CEC will create a CEC device node (/dev/cecX) to 45 + give userspace access to the CEC adapter. The 46 + :ref:`CEC_ADAP_G_CAPS <cec-ioc-adap-g-caps>` ioctl will tell 47 + userspace what it is allowed to do. 48 + 49 + 50 + .. _cec-user-func: 51 + 52 + ****************** 53 + Function Reference 54 + ****************** 55 + 56 + 57 + .. toctree:: 58 + :maxdepth: 1 59 + 60 + cec-func-open 61 + cec-func-close 62 + cec-func-ioctl 63 + cec-func-poll 64 + cec-ioc-adap-g-caps 65 + cec-ioc-adap-g-log-addrs 66 + cec-ioc-adap-g-phys-addr 67 + cec-ioc-dqevent 68 + cec-ioc-g-mode 69 + cec-ioc-receive 70 + 71 + 72 + ********************** 73 + Revision and Copyright 74 + ********************** 75 + 76 + 77 + :author: Verkuil Hans 78 + :address: hans.verkuil@cisco.com 79 + :contrib: Initial version. 80 + 81 + **Copyright** 2016 : Hans Verkuil 82 + 83 + :revision: 1.0.0 / 2016-03-17 (*hv*) 84 + 85 + Initial revision 86 + 87 + 88 + .. ------------------------------------------------------------------------------ 89 + .. This file was automatically converted from DocBook-XML with the dbxml 90 + .. library (https://github.com/return42/sphkerneldoc). The origin XML comes 91 + .. from the linux kernel, refer to: 92 + .. 93 + .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook 94 + .. ------------------------------------------------------------------------------
+57
Documentation/media/uapi/cec/cec-func-close.rst
··· 1 + .. -*- coding: utf-8; mode: rst -*- 2 + 3 + .. _cec-func-close: 4 + 5 + *********** 6 + cec close() 7 + *********** 8 + 9 + *man cec-close(2)* 10 + 11 + Close a cec device 12 + 13 + 14 + Synopsis 15 + ======== 16 + 17 + .. code-block:: c 18 + 19 + #include <unistd.h> 20 + 21 + 22 + .. c:function:: int close( int fd ) 23 + 24 + Arguments 25 + ========= 26 + 27 + ``fd`` 28 + File descriptor returned by :ref:`open() <func-open>`. 29 + 30 + 31 + Description 32 + =========== 33 + 34 + Note: this documents the proposed CEC API. This API is not yet finalized 35 + and is currently only available as a staging kernel module. 36 + 37 + Closes the cec device. Resources associated with the file descriptor are 38 + freed. The device configuration remain unchanged. 39 + 40 + 41 + Return Value 42 + ============ 43 + 44 + :c:func:`close()` returns 0 on success. On error, -1 is returned, and 45 + ``errno`` is set appropriately. Possible error codes are: 46 + 47 + EBADF 48 + ``fd`` is not a valid open file descriptor. 49 + 50 + 51 + .. ------------------------------------------------------------------------------ 52 + .. This file was automatically converted from DocBook-XML with the dbxml 53 + .. library (https://github.com/return42/sphkerneldoc). The origin XML comes 54 + .. from the linux kernel, refer to: 55 + .. 56 + .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook 57 + .. ------------------------------------------------------------------------------
+77
Documentation/media/uapi/cec/cec-func-ioctl.rst
··· 1 + .. -*- coding: utf-8; mode: rst -*- 2 + 3 + .. _cec-func-ioctl: 4 + 5 + *********** 6 + cec ioctl() 7 + *********** 8 + 9 + *man cec-ioctl(2)* 10 + 11 + Control a cec device 12 + 13 + 14 + Synopsis 15 + ======== 16 + 17 + .. code-block:: c 18 + 19 + #include <sys/ioctl.h> 20 + 21 + 22 + .. c:function:: int ioctl( int fd, int request, void *argp ) 23 + 24 + Arguments 25 + ========= 26 + 27 + ``fd`` 28 + File descriptor returned by :ref:`open() <func-open>`. 29 + 30 + ``request`` 31 + CEC ioctl request code as defined in the cec.h header file, for 32 + example CEC_ADAP_G_CAPS. 33 + 34 + ``argp`` 35 + Pointer to a request-specific structure. 36 + 37 + 38 + Description 39 + =========== 40 + 41 + Note: this documents the proposed CEC API. This API is not yet finalized 42 + and is currently only available as a staging kernel module. 43 + 44 + The :c:func:`ioctl()` function manipulates cec device parameters. The 45 + argument ``fd`` must be an open file descriptor. 46 + 47 + The ioctl ``request`` code specifies the cec function to be called. It 48 + has encoded in it whether the argument is an input, output or read/write 49 + parameter, and the size of the argument ``argp`` in bytes. 50 + 51 + Macros and structures definitions specifying cec ioctl requests and 52 + their parameters are located in the cec.h header file. All cec ioctl 53 + requests, their respective function and parameters are specified in 54 + :ref:`cec-user-func`. 55 + 56 + 57 + Return Value 58 + ============ 59 + 60 + On success 0 is returned, on error -1 and the ``errno`` variable is set 61 + appropriately. The generic error codes are described at the 62 + :ref:`Generic Error Codes <gen-errors>` chapter. 63 + 64 + Request-specific error codes are listed in the individual requests 65 + descriptions. 66 + 67 + When an ioctl that takes an output or read/write parameter fails, the 68 + parameter remains unmodified. 69 + 70 + 71 + .. ------------------------------------------------------------------------------ 72 + .. This file was automatically converted from DocBook-XML with the dbxml 73 + .. library (https://github.com/return42/sphkerneldoc). The origin XML comes 74 + .. from the linux kernel, refer to: 75 + .. 76 + .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook 77 + .. ------------------------------------------------------------------------------
+88
Documentation/media/uapi/cec/cec-func-open.rst
··· 1 + .. -*- coding: utf-8; mode: rst -*- 2 + 3 + .. _cec-func-open: 4 + 5 + ********** 6 + cec open() 7 + ********** 8 + 9 + *man cec-open(2)* 10 + 11 + Open a cec device 12 + 13 + 14 + Synopsis 15 + ======== 16 + 17 + .. code-block:: c 18 + 19 + #include <fcntl.h> 20 + 21 + 22 + .. c:function:: int open( const char *device_name, int flags ) 23 + 24 + Arguments 25 + ========= 26 + 27 + ``device_name`` 28 + Device to be opened. 29 + 30 + ``flags`` 31 + Open flags. Access mode must be ``O_RDWR``. 32 + 33 + When the ``O_NONBLOCK`` flag is given, the 34 + :ref:`CEC_RECEIVE <cec-ioc-receive>` ioctl will return EAGAIN 35 + error code when no message is available, and the 36 + :ref:`CEC_TRANSMIT <cec-ioc-receive>`, 37 + :ref:`CEC_ADAP_S_PHYS_ADDR <cec-ioc-adap-g-phys-addr>` and 38 + :ref:`CEC_ADAP_S_LOG_ADDRS <cec-ioc-adap-g-log-addrs>` ioctls 39 + all act in non-blocking mode. 40 + 41 + Other flags have no effect. 42 + 43 + 44 + Description 45 + =========== 46 + 47 + Note: this documents the proposed CEC API. This API is not yet finalized 48 + and is currently only available as a staging kernel module. 49 + 50 + To open a cec device applications call :c:func:`open()` with the 51 + desired device name. The function has no side effects; the device 52 + configuration remain unchanged. 53 + 54 + When the device is opened in read-only mode, attempts to modify its 55 + configuration will result in an error, and ``errno`` will be set to 56 + EBADF. 57 + 58 + 59 + Return Value 60 + ============ 61 + 62 + :c:func:`open()` returns the new file descriptor on success. On error, 63 + -1 is returned, and ``errno`` is set appropriately. Possible error codes 64 + include: 65 + 66 + EACCES 67 + The requested access to the file is not allowed. 68 + 69 + EMFILE 70 + The process already has the maximum number of files open. 71 + 72 + ENFILE 73 + The system limit on the total number of open files has been reached. 74 + 75 + ENOMEM 76 + Insufficient kernel memory was available. 77 + 78 + ENXIO 79 + No device corresponding to this device special file exists. 80 + 81 + 82 + .. ------------------------------------------------------------------------------ 83 + .. This file was automatically converted from DocBook-XML with the dbxml 84 + .. library (https://github.com/return42/sphkerneldoc). The origin XML comes 85 + .. from the linux kernel, refer to: 86 + .. 87 + .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook 88 + .. ------------------------------------------------------------------------------
+74
Documentation/media/uapi/cec/cec-func-poll.rst
··· 1 + .. -*- coding: utf-8; mode: rst -*- 2 + 3 + .. _cec-func-poll: 4 + 5 + ********** 6 + cec poll() 7 + ********** 8 + 9 + *man cec-poll(2)* 10 + 11 + Wait for some event on a file descriptor 12 + 13 + 14 + Synopsis 15 + ======== 16 + 17 + .. code-block:: c 18 + 19 + #include <sys/poll.h> 20 + 21 + 22 + .. c:function:: int poll( struct pollfd *ufds, unsigned int nfds, int timeout ) 23 + 24 + Description 25 + =========== 26 + 27 + Note: this documents the proposed CEC API. This API is not yet finalized 28 + and is currently only available as a staging kernel module. 29 + 30 + With the :c:func:`poll()` function applications can wait for CEC 31 + events. 32 + 33 + On success :c:func:`poll()` returns the number of file descriptors 34 + that have been selected (that is, file descriptors for which the 35 + ``revents`` field of the respective :c:type:`struct pollfd` structure 36 + is non-zero). CEC devices set the ``POLLIN`` and ``POLLRDNORM`` flags in 37 + the ``revents`` field if there are messages in the receive queue. If the 38 + transmit queue has room for new messages, the ``POLLOUT`` and 39 + ``POLLWRNORM`` flags are set. If there are events in the event queue, 40 + then the ``POLLPRI`` flag is set. When the function timed out it returns 41 + a value of zero, on failure it returns -1 and the ``errno`` variable is 42 + set appropriately. 43 + 44 + For more details see the :c:func:`poll()` manual page. 45 + 46 + 47 + Return Value 48 + ============ 49 + 50 + On success, :c:func:`poll()` returns the number structures which have 51 + non-zero ``revents`` fields, or zero if the call timed out. On error -1 52 + is returned, and the ``errno`` variable is set appropriately: 53 + 54 + EBADF 55 + One or more of the ``ufds`` members specify an invalid file 56 + descriptor. 57 + 58 + EFAULT 59 + ``ufds`` references an inaccessible memory area. 60 + 61 + EINTR 62 + The call was interrupted by a signal. 63 + 64 + EINVAL 65 + The ``nfds`` argument is greater than ``OPEN_MAX``. 66 + 67 + 68 + .. ------------------------------------------------------------------------------ 69 + .. This file was automatically converted from DocBook-XML with the dbxml 70 + .. library (https://github.com/return42/sphkerneldoc). The origin XML comes 71 + .. from the linux kernel, refer to: 72 + .. 73 + .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook 74 + .. ------------------------------------------------------------------------------
+174
Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
··· 1 + .. -*- coding: utf-8; mode: rst -*- 2 + 3 + .. _cec-ioc-adap-g-caps: 4 + 5 + ********************* 6 + ioctl CEC_ADAP_G_CAPS 7 + ********************* 8 + 9 + *man CEC_ADAP_G_CAPS(2)* 10 + 11 + Query device capabilities 12 + 13 + 14 + Synopsis 15 + ======== 16 + 17 + .. c:function:: int ioctl( int fd, int request, struct cec_caps *argp ) 18 + 19 + Arguments 20 + ========= 21 + 22 + ``fd`` 23 + File descriptor returned by :ref:`open() <cec-func-open>`. 24 + 25 + ``request`` 26 + CEC_ADAP_G_CAPS 27 + 28 + ``argp`` 29 + 30 + 31 + Description 32 + =========== 33 + 34 + Note: this documents the proposed CEC API. This API is not yet finalized 35 + and is currently only available as a staging kernel module. 36 + 37 + All cec devices must support the ``CEC_ADAP_G_CAPS`` ioctl. To query 38 + device information, applications call the ioctl with a pointer to a 39 + struct :ref:`cec_caps <cec-caps>`. The driver fills the structure and 40 + returns the information to the application. The ioctl never fails. 41 + 42 + 43 + .. _cec-caps: 44 + 45 + .. flat-table:: struct cec_caps 46 + :header-rows: 0 47 + :stub-columns: 0 48 + :widths: 1 1 2 49 + 50 + 51 + - .. row 1 52 + 53 + - char 54 + 55 + - ``driver[32]`` 56 + 57 + - The name of the cec adapter driver. 58 + 59 + - .. row 2 60 + 61 + - char 62 + 63 + - ``name[32]`` 64 + 65 + - The name of this CEC adapter. The combination ``driver`` and 66 + ``name`` must be unique. 67 + 68 + - .. row 3 69 + 70 + - __u32 71 + 72 + - ``capabilities`` 73 + 74 + - The capabilities of the CEC adapter, see 75 + :ref:`cec-capabilities`. 76 + 77 + - .. row 4 78 + 79 + - __u32 80 + 81 + - ``version`` 82 + 83 + - CEC Framework API version, formatted with the ``KERNEL_VERSION()`` 84 + macro. 85 + 86 + 87 + 88 + .. _cec-capabilities: 89 + 90 + .. flat-table:: CEC Capabilities Flags 91 + :header-rows: 0 92 + :stub-columns: 0 93 + :widths: 3 1 4 94 + 95 + 96 + - .. row 1 97 + 98 + - ``CEC_CAP_PHYS_ADDR`` 99 + 100 + - 0x00000001 101 + 102 + - Userspace has to configure the physical address by calling 103 + :ref:`CEC_ADAP_S_PHYS_ADDR <cec-ioc-adap-g-phys-addr>`. If 104 + this capability isn't set, then setting the physical address is 105 + handled by the kernel whenever the EDID is set (for an HDMI 106 + receiver) or read (for an HDMI transmitter). 107 + 108 + - .. row 2 109 + 110 + - ``CEC_CAP_LOG_ADDRS`` 111 + 112 + - 0x00000002 113 + 114 + - Userspace has to configure the logical addresses by calling 115 + :ref:`CEC_ADAP_S_LOG_ADDRS <cec-ioc-adap-g-log-addrs>`. If 116 + this capability isn't set, then the kernel will have configured 117 + this. 118 + 119 + - .. row 3 120 + 121 + - ``CEC_CAP_TRANSMIT`` 122 + 123 + - 0x00000004 124 + 125 + - Userspace can transmit CEC messages by calling 126 + :ref:`CEC_TRANSMIT <cec-ioc-receive>`. This implies that 127 + userspace can be a follower as well, since being able to transmit 128 + messages is a prerequisite of becoming a follower. If this 129 + capability isn't set, then the kernel will handle all CEC 130 + transmits and process all CEC messages it receives. 131 + 132 + - .. row 4 133 + 134 + - ``CEC_CAP_PASSTHROUGH`` 135 + 136 + - 0x00000008 137 + 138 + - Userspace can use the passthrough mode by calling 139 + :ref:`CEC_S_MODE <cec-ioc-g-mode>`. 140 + 141 + - .. row 5 142 + 143 + - ``CEC_CAP_RC`` 144 + 145 + - 0x00000010 146 + 147 + - This adapter supports the remote control protocol. 148 + 149 + - .. row 6 150 + 151 + - ``CEC_CAP_MONITOR_ALL`` 152 + 153 + - 0x00000020 154 + 155 + - The CEC hardware can monitor all messages, not just directed and 156 + broadcast messages. 157 + 158 + 159 + 160 + Return Value 161 + ============ 162 + 163 + On success 0 is returned, on error -1 and the ``errno`` variable is set 164 + appropriately. The generic error codes are described at the 165 + :ref:`Generic Error Codes <gen-errors>` chapter. 166 + 167 + 168 + .. ------------------------------------------------------------------------------ 169 + .. This file was automatically converted from DocBook-XML with the dbxml 170 + .. library (https://github.com/return42/sphkerneldoc). The origin XML comes 171 + .. from the linux kernel, refer to: 172 + .. 173 + .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook 174 + .. ------------------------------------------------------------------------------
+427
Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
··· 1 + .. -*- coding: utf-8; mode: rst -*- 2 + 3 + .. _cec-ioc-adap-g-log-addrs: 4 + 5 + ************************************************ 6 + ioctl CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS 7 + ************************************************ 8 + 9 + *man CEC_ADAP_G_LOG_ADDRS(2)* 10 + 11 + CEC_ADAP_S_LOG_ADDRS 12 + Get or set the logical addresses 13 + 14 + 15 + Synopsis 16 + ======== 17 + 18 + .. c:function:: int ioctl( int fd, int request, struct cec_log_addrs *argp ) 19 + 20 + Arguments 21 + ========= 22 + 23 + ``fd`` 24 + File descriptor returned by :ref:`open() <cec-func-open>`. 25 + 26 + ``request`` 27 + CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS 28 + 29 + ``argp`` 30 + 31 + 32 + Description 33 + =========== 34 + 35 + Note: this documents the proposed CEC API. This API is not yet finalized 36 + and is currently only available as a staging kernel module. 37 + 38 + To query the current CEC logical addresses, applications call the 39 + ``CEC_ADAP_G_LOG_ADDRS`` ioctl with a pointer to a 40 + :c:type:`struct cec_log_addrs` structure where the drivers stores 41 + the logical addresses. 42 + 43 + To set new logical addresses, applications fill in struct 44 + :c:type:`struct cec_log_addrs` and call the ``CEC_ADAP_S_LOG_ADDRS`` 45 + ioctl with a pointer to this struct. The ``CEC_ADAP_S_LOG_ADDRS`` ioctl 46 + is only available if ``CEC_CAP_LOG_ADDRS`` is set (ENOTTY error code is 47 + returned otherwise). This ioctl will block until all requested logical 48 + addresses have been claimed. ``CEC_ADAP_S_LOG_ADDRS`` can only be called 49 + by a file handle in initiator mode (see 50 + :ref:`CEC_S_MODE <cec-ioc-g-mode>`). 51 + 52 + 53 + .. _cec-log-addrs: 54 + 55 + .. flat-table:: struct cec_log_addrs 56 + :header-rows: 0 57 + :stub-columns: 0 58 + :widths: 1 1 2 59 + 60 + 61 + - .. row 1 62 + 63 + - __u8 64 + 65 + - ``log_addr`` [CEC_MAX_LOG_ADDRS] 66 + 67 + - The actual logical addresses that were claimed. This is set by the 68 + driver. If no logical address could be claimed, then it is set to 69 + ``CEC_LOG_ADDR_INVALID``. If this adapter is Unregistered, then 70 + ``log_addr[0]`` is set to 0xf and all others to 71 + ``CEC_LOG_ADDR_INVALID``. 72 + 73 + - .. row 2 74 + 75 + - __u16 76 + 77 + - ``log_addr_mask`` 78 + 79 + - The bitmask of all logical addresses this adapter has claimed. If 80 + this adapter is Unregistered then ``log_addr_mask`` sets bit 15 81 + and clears all other bits. If this adapter is not configured at 82 + all, then ``log_addr_mask`` is set to 0. Set by the driver. 83 + 84 + - .. row 3 85 + 86 + - __u8 87 + 88 + - ``cec_version`` 89 + 90 + - The CEC version that this adapter shall use. See 91 + :ref:`cec-versions`. Used to implement the 92 + ``CEC_MSG_CEC_VERSION`` and ``CEC_MSG_REPORT_FEATURES`` messages. 93 + Note that ``CEC_OP_CEC_VERSION_1_3A`` is not allowed by the CEC 94 + framework. 95 + 96 + - .. row 4 97 + 98 + - __u8 99 + 100 + - ``num_log_addrs`` 101 + 102 + - Number of logical addresses to set up. Must be ≤ 103 + ``available_log_addrs`` as returned by 104 + :ref:`CEC_ADAP_G_CAPS <cec-ioc-adap-g-caps>`. All arrays in 105 + this structure are only filled up to index 106 + ``available_log_addrs``-1. The remaining array elements will be 107 + ignored. Note that the CEC 2.0 standard allows for a maximum of 2 108 + logical addresses, although some hardware has support for more. 109 + ``CEC_MAX_LOG_ADDRS`` is 4. The driver will return the actual 110 + number of logical addresses it could claim, which may be less than 111 + what was requested. If this field is set to 0, then the CEC 112 + adapter shall clear all claimed logical addresses and all other 113 + fields will be ignored. 114 + 115 + - .. row 5 116 + 117 + - __u32 118 + 119 + - ``vendor_id`` 120 + 121 + - The vendor ID is a 24-bit number that identifies the specific 122 + vendor or entity. Based on this ID vendor specific commands may be 123 + defined. If you do not want a vendor ID then set it to 124 + ``CEC_VENDOR_ID_NONE``. 125 + 126 + - .. row 6 127 + 128 + - __u32 129 + 130 + - ``flags`` 131 + 132 + - Flags. No flags are defined yet, so set this to 0. 133 + 134 + - .. row 7 135 + 136 + - char 137 + 138 + - ``osd_name``\ [15] 139 + 140 + - The On-Screen Display name as is returned by the 141 + ``CEC_MSG_SET_OSD_NAME`` message. 142 + 143 + - .. row 8 144 + 145 + - __u8 146 + 147 + - ``primary_device_type`` [CEC_MAX_LOG_ADDRS] 148 + 149 + - Primary device type for each logical address. See 150 + :ref:`cec-prim-dev-types` for possible types. 151 + 152 + - .. row 9 153 + 154 + - __u8 155 + 156 + - ``log_addr_type`` [CEC_MAX_LOG_ADDRS] 157 + 158 + - Logical address types. See :ref:`cec-log-addr-types` for 159 + possible types. The driver will update this with the actual 160 + logical address type that it claimed (e.g. it may have to fallback 161 + to ``CEC_LOG_ADDR_TYPE_UNREGISTERED``). 162 + 163 + - .. row 10 164 + 165 + - __u8 166 + 167 + - ``all_device_types`` [CEC_MAX_LOG_ADDRS] 168 + 169 + - CEC 2.0 specific: all device types. See 170 + :ref:`cec-all-dev-types-flags`. Used to implement the 171 + ``CEC_MSG_REPORT_FEATURES`` message. This field is ignored if 172 + ``cec_version`` < ``CEC_OP_CEC_VERSION_2_0``. 173 + 174 + - .. row 11 175 + 176 + - __u8 177 + 178 + - ``features`` [CEC_MAX_LOG_ADDRS][12] 179 + 180 + - Features for each logical address. Used to implement the 181 + ``CEC_MSG_REPORT_FEATURES`` message. The 12 bytes include both the 182 + RC Profile and the Device Features. This field is ignored if 183 + ``cec_version`` < ``CEC_OP_CEC_VERSION_2_0``. 184 + 185 + 186 + 187 + .. _cec-versions: 188 + 189 + .. flat-table:: CEC Versions 190 + :header-rows: 0 191 + :stub-columns: 0 192 + :widths: 3 1 4 193 + 194 + 195 + - .. row 1 196 + 197 + - ``CEC_OP_CEC_VERSION_1_3A`` 198 + 199 + - 4 200 + 201 + - CEC version according to the HDMI 1.3a standard. 202 + 203 + - .. row 2 204 + 205 + - ``CEC_OP_CEC_VERSION_1_4B`` 206 + 207 + - 5 208 + 209 + - CEC version according to the HDMI 1.4b standard. 210 + 211 + - .. row 3 212 + 213 + - ``CEC_OP_CEC_VERSION_2_0`` 214 + 215 + - 6 216 + 217 + - CEC version according to the HDMI 2.0 standard. 218 + 219 + 220 + 221 + .. _cec-prim-dev-types: 222 + 223 + .. flat-table:: CEC Primary Device Types 224 + :header-rows: 0 225 + :stub-columns: 0 226 + :widths: 3 1 4 227 + 228 + 229 + - .. row 1 230 + 231 + - ``CEC_OP_PRIM_DEVTYPE_TV`` 232 + 233 + - 0 234 + 235 + - Use for a TV. 236 + 237 + - .. row 2 238 + 239 + - ``CEC_OP_PRIM_DEVTYPE_RECORD`` 240 + 241 + - 1 242 + 243 + - Use for a recording device. 244 + 245 + - .. row 3 246 + 247 + - ``CEC_OP_PRIM_DEVTYPE_TUNER`` 248 + 249 + - 3 250 + 251 + - Use for a device with a tuner. 252 + 253 + - .. row 4 254 + 255 + - ``CEC_OP_PRIM_DEVTYPE_PLAYBACK`` 256 + 257 + - 4 258 + 259 + - Use for a playback device. 260 + 261 + - .. row 5 262 + 263 + - ``CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM`` 264 + 265 + - 5 266 + 267 + - Use for an audio system (e.g. an audio/video receiver). 268 + 269 + - .. row 6 270 + 271 + - ``CEC_OP_PRIM_DEVTYPE_SWITCH`` 272 + 273 + - 6 274 + 275 + - Use for a CEC switch. 276 + 277 + - .. row 7 278 + 279 + - ``CEC_OP_PRIM_DEVTYPE_VIDEOPROC`` 280 + 281 + - 7 282 + 283 + - Use for a video processor device. 284 + 285 + 286 + 287 + .. _cec-log-addr-types: 288 + 289 + .. flat-table:: CEC Logical Address Types 290 + :header-rows: 0 291 + :stub-columns: 0 292 + :widths: 3 1 4 293 + 294 + 295 + - .. row 1 296 + 297 + - ``CEC_LOG_ADDR_TYPE_TV`` 298 + 299 + - 0 300 + 301 + - Use for a TV. 302 + 303 + - .. row 2 304 + 305 + - ``CEC_LOG_ADDR_TYPE_RECORD`` 306 + 307 + - 1 308 + 309 + - Use for a recording device. 310 + 311 + - .. row 3 312 + 313 + - ``CEC_LOG_ADDR_TYPE_TUNER`` 314 + 315 + - 2 316 + 317 + - Use for a tuner device. 318 + 319 + - .. row 4 320 + 321 + - ``CEC_LOG_ADDR_TYPE_PLAYBACK`` 322 + 323 + - 3 324 + 325 + - Use for a playback device. 326 + 327 + - .. row 5 328 + 329 + - ``CEC_LOG_ADDR_TYPE_AUDIOSYSTEM`` 330 + 331 + - 4 332 + 333 + - Use for an audio system device. 334 + 335 + - .. row 6 336 + 337 + - ``CEC_LOG_ADDR_TYPE_SPECIFIC`` 338 + 339 + - 5 340 + 341 + - Use for a second TV or for a video processor device. 342 + 343 + - .. row 7 344 + 345 + - ``CEC_LOG_ADDR_TYPE_UNREGISTERED`` 346 + 347 + - 6 348 + 349 + - Use this if you just want to remain unregistered. Used for pure 350 + CEC switches or CDC-only devices (CDC: Capability Discovery and 351 + Control). 352 + 353 + 354 + 355 + .. _cec-all-dev-types-flags: 356 + 357 + .. flat-table:: CEC All Device Types Flags 358 + :header-rows: 0 359 + :stub-columns: 0 360 + :widths: 3 1 4 361 + 362 + 363 + - .. row 1 364 + 365 + - ``CEC_OP_ALL_DEVTYPE_TV`` 366 + 367 + - 0x80 368 + 369 + - This supports the TV type. 370 + 371 + - .. row 2 372 + 373 + - ``CEC_OP_ALL_DEVTYPE_RECORD`` 374 + 375 + - 0x40 376 + 377 + - This supports the Recording type. 378 + 379 + - .. row 3 380 + 381 + - ``CEC_OP_ALL_DEVTYPE_TUNER`` 382 + 383 + - 0x20 384 + 385 + - This supports the Tuner type. 386 + 387 + - .. row 4 388 + 389 + - ``CEC_OP_ALL_DEVTYPE_PLAYBACK`` 390 + 391 + - 0x10 392 + 393 + - This supports the Playback type. 394 + 395 + - .. row 5 396 + 397 + - ``CEC_OP_ALL_DEVTYPE_AUDIOSYSTEM`` 398 + 399 + - 0x08 400 + 401 + - This supports the Audio System type. 402 + 403 + - .. row 6 404 + 405 + - ``CEC_OP_ALL_DEVTYPE_SWITCH`` 406 + 407 + - 0x04 408 + 409 + - This supports the CEC Switch or Video Processing type. 410 + 411 + 412 + 413 + Return Value 414 + ============ 415 + 416 + On success 0 is returned, on error -1 and the ``errno`` variable is set 417 + appropriately. The generic error codes are described at the 418 + :ref:`Generic Error Codes <gen-errors>` chapter. 419 + 420 + 421 + .. ------------------------------------------------------------------------------ 422 + .. This file was automatically converted from DocBook-XML with the dbxml 423 + .. library (https://github.com/return42/sphkerneldoc). The origin XML comes 424 + .. from the linux kernel, refer to: 425 + .. 426 + .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook 427 + .. ------------------------------------------------------------------------------
+78
Documentation/media/uapi/cec/cec-ioc-adap-g-phys-addr.rst
··· 1 + .. -*- coding: utf-8; mode: rst -*- 2 + 3 + .. _cec-ioc-adap-g-phys-addr: 4 + 5 + ************************************************ 6 + ioctl CEC_ADAP_G_PHYS_ADDR, CEC_ADAP_S_PHYS_ADDR 7 + ************************************************ 8 + 9 + *man CEC_ADAP_G_PHYS_ADDR(2)* 10 + 11 + CEC_ADAP_S_PHYS_ADDR 12 + Get or set the physical address 13 + 14 + 15 + Synopsis 16 + ======== 17 + 18 + .. c:function:: int ioctl( int fd, int request, __u16 *argp ) 19 + 20 + Arguments 21 + ========= 22 + 23 + ``fd`` 24 + File descriptor returned by :ref:`open() <cec-func-open>`. 25 + 26 + ``request`` 27 + CEC_ADAP_G_PHYS_ADDR, CEC_ADAP_S_PHYS_ADDR 28 + 29 + ``argp`` 30 + 31 + 32 + Description 33 + =========== 34 + 35 + Note: this documents the proposed CEC API. This API is not yet finalized 36 + and is currently only available as a staging kernel module. 37 + 38 + To query the current physical address applications call the 39 + ``CEC_ADAP_G_PHYS_ADDR`` ioctl with a pointer to an __u16 where the 40 + driver stores the physical address. 41 + 42 + To set a new physical address applications store the physical address in 43 + an __u16 and call the ``CEC_ADAP_S_PHYS_ADDR`` ioctl with a pointer to 44 + this integer. ``CEC_ADAP_S_PHYS_ADDR`` is only available if 45 + ``CEC_CAP_PHYS_ADDR`` is set (ENOTTY error code will be returned 46 + otherwise). ``CEC_ADAP_S_PHYS_ADDR`` can only be called by a file handle 47 + in initiator mode (see :ref:`CEC_S_MODE <cec-ioc-g-mode>`), if not 48 + EBUSY error code will be returned. 49 + 50 + The physical address is a 16-bit number where each group of 4 bits 51 + represent a digit of the physical address a.b.c.d where the most 52 + significant 4 bits represent 'a'. The CEC root device (usually the TV) 53 + has address 0.0.0.0. Every device that is hooked up to an input of the 54 + TV has address a.0.0.0 (where 'a' is ≥ 1), devices hooked up to those in 55 + turn have addresses a.b.0.0, etc. So a topology of up to 5 devices deep 56 + is supported. The physical address a device shall use is stored in the 57 + EDID of the sink. 58 + 59 + For example, the EDID for each HDMI input of the TV will have a 60 + different physical address of the form a.0.0.0 that the sources will 61 + read out and use as their physical address. 62 + 63 + 64 + Return Value 65 + ============ 66 + 67 + On success 0 is returned, on error -1 and the ``errno`` variable is set 68 + appropriately. The generic error codes are described at the 69 + :ref:`Generic Error Codes <gen-errors>` chapter. 70 + 71 + 72 + .. ------------------------------------------------------------------------------ 73 + .. This file was automatically converted from DocBook-XML with the dbxml 74 + .. library (https://github.com/return42/sphkerneldoc). The origin XML comes 75 + .. from the linux kernel, refer to: 76 + .. 77 + .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook 78 + .. ------------------------------------------------------------------------------
+237
Documentation/media/uapi/cec/cec-ioc-dqevent.rst
··· 1 + .. -*- coding: utf-8; mode: rst -*- 2 + 3 + .. _cec-ioc-g-event: 4 + 5 + ***************** 6 + ioctl CEC_DQEVENT 7 + ***************** 8 + 9 + *man CEC_DQEVENT(2)* 10 + 11 + Dequeue a CEC event 12 + 13 + 14 + Synopsis 15 + ======== 16 + 17 + .. c:function:: int ioctl( int fd, int request, struct cec_event *argp ) 18 + 19 + Arguments 20 + ========= 21 + 22 + ``fd`` 23 + File descriptor returned by :ref:`open() <cec-func-open>`. 24 + 25 + ``request`` 26 + CEC_DQEVENT 27 + 28 + ``argp`` 29 + 30 + 31 + Description 32 + =========== 33 + 34 + Note: this documents the proposed CEC API. This API is not yet finalized 35 + and is currently only available as a staging kernel module. 36 + 37 + CEC devices can send asynchronous events. These can be retrieved by 38 + calling the ``CEC_DQEVENT`` ioctl. If the file descriptor is in 39 + non-blocking mode and no event is pending, then it will return -1 and 40 + set errno to the EAGAIN error code. 41 + 42 + The internal event queues are per-filehandle and per-event type. If 43 + there is no more room in a queue then the last event is overwritten with 44 + the new one. This means that intermediate results can be thrown away but 45 + that the latest event is always available. This also means that is it 46 + possible to read two successive events that have the same value (e.g. 47 + two CEC_EVENT_STATE_CHANGE events with the same state). In that case 48 + the intermediate state changes were lost but it is guaranteed that the 49 + state did change in between the two events. 50 + 51 + 52 + .. _cec-event-state-change: 53 + 54 + .. flat-table:: struct cec_event_state_change 55 + :header-rows: 0 56 + :stub-columns: 0 57 + :widths: 1 1 2 58 + 59 + 60 + - .. row 1 61 + 62 + - __u16 63 + 64 + - ``phys_addr`` 65 + 66 + - The current physical address. 67 + 68 + - .. row 2 69 + 70 + - __u16 71 + 72 + - ``log_addr_mask`` 73 + 74 + - The current set of claimed logical addresses. 75 + 76 + 77 + 78 + .. _cec-event-lost-msgs: 79 + 80 + .. flat-table:: struct cec_event_lost_msgs 81 + :header-rows: 0 82 + :stub-columns: 0 83 + :widths: 1 1 2 84 + 85 + 86 + - .. row 1 87 + 88 + - __u32 89 + 90 + - ``lost_msgs`` 91 + 92 + - Set to the number of lost messages since the filehandle was opened 93 + or since the last time this event was dequeued for this 94 + filehandle. The messages lost are the oldest messages. So when a 95 + new message arrives and there is no more room, then the oldest 96 + message is discarded to make room for the new one. The internal 97 + size of the message queue guarantees that all messages received in 98 + the last two seconds will be stored. Since messages should be 99 + replied to within a second according to the CEC specification, 100 + this is more than enough. 101 + 102 + 103 + 104 + .. _cec-event: 105 + 106 + .. flat-table:: struct cec_event 107 + :header-rows: 0 108 + :stub-columns: 0 109 + :widths: 1 1 2 1 110 + 111 + 112 + - .. row 1 113 + 114 + - __u64 115 + 116 + - ``ts`` 117 + 118 + - Timestamp of the event in ns. 119 + 120 + - 121 + 122 + - .. row 2 123 + 124 + - __u32 125 + 126 + - ``event`` 127 + 128 + - The CEC event type, see :ref:`cec-events`. 129 + 130 + - 131 + 132 + - .. row 3 133 + 134 + - __u32 135 + 136 + - ``flags`` 137 + 138 + - Event flags, see :ref:`cec-event-flags`. 139 + 140 + - 141 + 142 + - .. row 4 143 + 144 + - union 145 + 146 + - (anonymous) 147 + 148 + - 149 + - 150 + 151 + - .. row 5 152 + 153 + - 154 + - struct cec_event_state_change 155 + 156 + - ``state_change`` 157 + 158 + - The new adapter state as sent by the ``CEC_EVENT_STATE_CHANGE`` 159 + event. 160 + 161 + - .. row 6 162 + 163 + - 164 + - struct cec_event_lost_msgs 165 + 166 + - ``lost_msgs`` 167 + 168 + - The number of lost messages as sent by the ``CEC_EVENT_LOST_MSGS`` 169 + event. 170 + 171 + 172 + 173 + .. _cec-events: 174 + 175 + .. flat-table:: CEC Events Types 176 + :header-rows: 0 177 + :stub-columns: 0 178 + :widths: 3 1 4 179 + 180 + 181 + - .. row 1 182 + 183 + - ``CEC_EVENT_STATE_CHANGE`` 184 + 185 + - 1 186 + 187 + - Generated when the CEC Adapter's state changes. When open() is 188 + called an initial event will be generated for that filehandle with 189 + the CEC Adapter's state at that time. 190 + 191 + - .. row 2 192 + 193 + - ``CEC_EVENT_LOST_MSGS`` 194 + 195 + - 2 196 + 197 + - Generated if one or more CEC messages were lost because the 198 + application didn't dequeue CEC messages fast enough. 199 + 200 + 201 + 202 + .. _cec-event-flags: 203 + 204 + .. flat-table:: CEC Event Flags 205 + :header-rows: 0 206 + :stub-columns: 0 207 + :widths: 3 1 4 208 + 209 + 210 + - .. row 1 211 + 212 + - ``CEC_EVENT_FL_INITIAL_VALUE`` 213 + 214 + - 1 215 + 216 + - Set for the initial events that are generated when the device is 217 + opened. See the table above for which events do this. This allows 218 + applications to learn the initial state of the CEC adapter at 219 + open() time. 220 + 221 + 222 + 223 + Return Value 224 + ============ 225 + 226 + On success 0 is returned, on error -1 and the ``errno`` variable is set 227 + appropriately. The generic error codes are described at the 228 + :ref:`Generic Error Codes <gen-errors>` chapter. 229 + 230 + 231 + .. ------------------------------------------------------------------------------ 232 + .. This file was automatically converted from DocBook-XML with the dbxml 233 + .. library (https://github.com/return42/sphkerneldoc). The origin XML comes 234 + .. from the linux kernel, refer to: 235 + .. 236 + .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook 237 + .. ------------------------------------------------------------------------------
+311
Documentation/media/uapi/cec/cec-ioc-g-mode.rst
··· 1 + .. -*- coding: utf-8; mode: rst -*- 2 + 3 + .. _cec-ioc-g-mode: 4 + 5 + **************************** 6 + ioctl CEC_G_MODE, CEC_S_MODE 7 + **************************** 8 + 9 + *man CEC_G_MODE(2)* 10 + 11 + CEC_S_MODE 12 + Get or set exclusive use of the CEC adapter 13 + 14 + 15 + Synopsis 16 + ======== 17 + 18 + .. c:function:: int ioctl( int fd, int request, __u32 *argp ) 19 + 20 + Arguments 21 + ========= 22 + 23 + ``fd`` 24 + File descriptor returned by :ref:`open() <cec-func-open>`. 25 + 26 + ``request`` 27 + CEC_G_MODE, CEC_S_MODE 28 + 29 + ``argp`` 30 + 31 + 32 + Description 33 + =========== 34 + 35 + Note: this documents the proposed CEC API. This API is not yet finalized 36 + and is currently only available as a staging kernel module. 37 + 38 + By default any filehandle can use 39 + :ref:`CEC_TRANSMIT <cec-ioc-receive>` and 40 + :ref:`CEC_RECEIVE <cec-ioc-receive>`, but in order to prevent 41 + applications from stepping on each others toes it must be possible to 42 + obtain exclusive access to the CEC adapter. This ioctl sets the 43 + filehandle to initiator and/or follower mode which can be exclusive 44 + depending on the chosen mode. The initiator is the filehandle that is 45 + used to initiate messages, i.e. it commands other CEC devices. The 46 + follower is the filehandle that receives messages sent to the CEC 47 + adapter and processes them. The same filehandle can be both initiator 48 + and follower, or this role can be taken by two different filehandles. 49 + 50 + When a CEC message is received, then the CEC framework will decide how 51 + it will be processed. If the message is a reply to an earlier 52 + transmitted message, then the reply is sent back to the filehandle that 53 + is waiting for it. In addition the CEC framework will process it. 54 + 55 + If the message is not a reply, then the CEC framework will process it 56 + first. If there is no follower, then the message is just discarded and a 57 + feature abort is sent back to the initiator if the framework couldn't 58 + process it. If there is a follower, then the message is passed on to the 59 + follower who will use :ref:`CEC_RECEIVE <cec-ioc-receive>` to dequeue 60 + the new message. The framework expects the follower to make the right 61 + decisions. 62 + 63 + The CEC framework will process core messages unless requested otherwise 64 + by the follower. The follower can enable the passthrough mode. In that 65 + case, the CEC framework will pass on most core messages without 66 + processing them and the follower will have to implement those messages. 67 + There are some messages that the core will always process, regardless of 68 + the passthrough mode. See :ref:`cec-core-processing` for details. 69 + 70 + If there is no initiator, then any CEC filehandle can use 71 + :ref:`CEC_TRANSMIT <cec-ioc-receive>`. If there is an exclusive 72 + initiator then only that initiator can call 73 + :ref:`CEC_TRANSMIT <cec-ioc-receive>`. The follower can of course 74 + always call :ref:`CEC_TRANSMIT <cec-ioc-receive>`. 75 + 76 + Available initiator modes are: 77 + 78 + 79 + .. _cec-mode-initiator: 80 + 81 + .. flat-table:: Initiator Modes 82 + :header-rows: 0 83 + :stub-columns: 0 84 + :widths: 3 1 4 85 + 86 + 87 + - .. row 1 88 + 89 + - ``CEC_MODE_NO_INITIATOR`` 90 + 91 + - 0x0 92 + 93 + - This is not an initiator, i.e. it cannot transmit CEC messages or 94 + make any other changes to the CEC adapter. 95 + 96 + - .. row 2 97 + 98 + - ``CEC_MODE_INITIATOR`` 99 + 100 + - 0x1 101 + 102 + - This is an initiator (the default when the device is opened) and 103 + it can transmit CEC messages and make changes to the CEC adapter, 104 + unless there is an exclusive initiator. 105 + 106 + - .. row 3 107 + 108 + - ``CEC_MODE_EXCL_INITIATOR`` 109 + 110 + - 0x2 111 + 112 + - This is an exclusive initiator and this file descriptor is the 113 + only one that can transmit CEC messages and make changes to the 114 + CEC adapter. If someone else is already the exclusive initiator 115 + then an attempt to become one will return the EBUSY error code 116 + error. 117 + 118 + 119 + Available follower modes are: 120 + 121 + 122 + .. _cec-mode-follower: 123 + 124 + .. flat-table:: Follower Modes 125 + :header-rows: 0 126 + :stub-columns: 0 127 + :widths: 3 1 4 128 + 129 + 130 + - .. row 1 131 + 132 + - ``CEC_MODE_NO_FOLLOWER`` 133 + 134 + - 0x00 135 + 136 + - This is not a follower (the default when the device is opened). 137 + 138 + - .. row 2 139 + 140 + - ``CEC_MODE_FOLLOWER`` 141 + 142 + - 0x10 143 + 144 + - This is a follower and it will receive CEC messages unless there 145 + is an exclusive follower. You cannot become a follower if 146 + ``CEC_CAP_TRANSMIT`` is not set or if ``CEC_MODE_NO_INITIATOR`` 147 + was specified, EINVAL error code is returned in that case. 148 + 149 + - .. row 3 150 + 151 + - ``CEC_MODE_EXCL_FOLLOWER`` 152 + 153 + - 0x20 154 + 155 + - This is an exclusive follower and only this file descriptor will 156 + receive CEC messages for processing. If someone else is already 157 + the exclusive follower then an attempt to become one will return 158 + the EBUSY error code error. You cannot become a follower if 159 + ``CEC_CAP_TRANSMIT`` is not set or if ``CEC_MODE_NO_INITIATOR`` 160 + was specified, EINVAL error code is returned in that case. 161 + 162 + - .. row 4 163 + 164 + - ``CEC_MODE_EXCL_FOLLOWER_PASSTHRU`` 165 + 166 + - 0x30 167 + 168 + - This is an exclusive follower and only this file descriptor will 169 + receive CEC messages for processing. In addition it will put the 170 + CEC device into passthrough mode, allowing the exclusive follower 171 + to handle most core messages instead of relying on the CEC 172 + framework for that. If someone else is already the exclusive 173 + follower then an attempt to become one will return the EBUSY error 174 + code error. You cannot become a follower if ``CEC_CAP_TRANSMIT`` 175 + is not set or if ``CEC_MODE_NO_INITIATOR`` was specified, EINVAL 176 + error code is returned in that case. 177 + 178 + - .. row 5 179 + 180 + - ``CEC_MODE_MONITOR`` 181 + 182 + - 0xe0 183 + 184 + - Put the file descriptor into monitor mode. Can only be used in 185 + combination with ``CEC_MODE_NO_INITIATOR``, otherwise EINVAL error 186 + code will be returned. In monitor mode all messages this CEC 187 + device transmits and all messages it receives (both broadcast 188 + messages and directed messages for one its logical addresses) will 189 + be reported. This is very useful for debugging. This is only 190 + allowed if the process has the ``CAP_NET_ADMIN`` capability. If 191 + that is not set, then EPERM error code is returned. 192 + 193 + - .. row 6 194 + 195 + - ``CEC_MODE_MONITOR_ALL`` 196 + 197 + - 0xf0 198 + 199 + - Put the file descriptor into 'monitor all' mode. Can only be used 200 + in combination with ``CEC_MODE_NO_INITIATOR``, otherwise EINVAL 201 + error code will be returned. In 'monitor all' mode all messages 202 + this CEC device transmits and all messages it receives, including 203 + directed messages for other CEC devices will be reported. This is 204 + very useful for debugging, but not all devices support this. This 205 + mode requires that the ``CEC_CAP_MONITOR_ALL`` capability is set, 206 + otherwise EINVAL error code is returned. This is only allowed if 207 + the process has the ``CAP_NET_ADMIN`` capability. If that is not 208 + set, then EPERM error code is returned. 209 + 210 + 211 + Core message processing details: 212 + 213 + 214 + .. _cec-core-processing: 215 + 216 + .. flat-table:: Core Message Processing 217 + :header-rows: 0 218 + :stub-columns: 0 219 + 220 + 221 + - .. row 1 222 + 223 + - ``CEC_MSG_GET_CEC_VERSION`` 224 + 225 + - When in passthrough mode this message has to be handled by 226 + userspace, otherwise the core will return the CEC version that was 227 + set with 228 + :ref:`CEC_ADAP_S_LOG_ADDRS <cec-ioc-adap-g-log-addrs>`. 229 + 230 + - .. row 2 231 + 232 + - ``CEC_MSG_GIVE_DEVICE_VENDOR_ID`` 233 + 234 + - When in passthrough mode this message has to be handled by 235 + userspace, otherwise the core will return the vendor ID that was 236 + set with 237 + :ref:`CEC_ADAP_S_LOG_ADDRS <cec-ioc-adap-g-log-addrs>`. 238 + 239 + - .. row 3 240 + 241 + - ``CEC_MSG_ABORT`` 242 + 243 + - When in passthrough mode this message has to be handled by 244 + userspace, otherwise the core will return a feature refused 245 + message as per the specification. 246 + 247 + - .. row 4 248 + 249 + - ``CEC_MSG_GIVE_PHYSICAL_ADDR`` 250 + 251 + - When in passthrough mode this message has to be handled by 252 + userspace, otherwise the core will report the current physical 253 + address. 254 + 255 + - .. row 5 256 + 257 + - ``CEC_MSG_GIVE_OSD_NAME`` 258 + 259 + - When in passthrough mode this message has to be handled by 260 + userspace, otherwise the core will report the current OSD name as 261 + was set with 262 + :ref:`CEC_ADAP_S_LOG_ADDRS <cec-ioc-adap-g-log-addrs>`. 263 + 264 + - .. row 6 265 + 266 + - ``CEC_MSG_GIVE_FEATURES`` 267 + 268 + - When in passthrough mode this message has to be handled by 269 + userspace, otherwise the core will report the current features as 270 + was set with 271 + :ref:`CEC_ADAP_S_LOG_ADDRS <cec-ioc-adap-g-log-addrs>` or 272 + the message is ignore if the CEC version was older than 2.0. 273 + 274 + - .. row 7 275 + 276 + - ``CEC_MSG_USER_CONTROL_PRESSED`` 277 + 278 + - If ``CEC_CAP_RC`` is set, then generate a remote control key 279 + press. This message is always passed on to userspace. 280 + 281 + - .. row 8 282 + 283 + - ``CEC_MSG_USER_CONTROL_RELEASED`` 284 + 285 + - If ``CEC_CAP_RC`` is set, then generate a remote control key 286 + release. This message is always passed on to userspace. 287 + 288 + - .. row 9 289 + 290 + - ``CEC_MSG_REPORT_PHYSICAL_ADDR`` 291 + 292 + - The CEC framework will make note of the reported physical address 293 + and then just pass the message on to userspace. 294 + 295 + 296 + 297 + Return Value 298 + ============ 299 + 300 + On success 0 is returned, on error -1 and the ``errno`` variable is set 301 + appropriately. The generic error codes are described at the 302 + :ref:`Generic Error Codes <gen-errors>` chapter. 303 + 304 + 305 + .. ------------------------------------------------------------------------------ 306 + .. This file was automatically converted from DocBook-XML with the dbxml 307 + .. library (https://github.com/return42/sphkerneldoc). The origin XML comes 308 + .. from the linux kernel, refer to: 309 + .. 310 + .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook 311 + .. ------------------------------------------------------------------------------
+329
Documentation/media/uapi/cec/cec-ioc-receive.rst
··· 1 + .. -*- coding: utf-8; mode: rst -*- 2 + 3 + .. _cec-ioc-receive: 4 + 5 + ******************************* 6 + ioctl CEC_RECEIVE, CEC_TRANSMIT 7 + ******************************* 8 + 9 + *man CEC_RECEIVE(2)* 10 + 11 + CEC_TRANSMIT 12 + Receive or transmit a CEC message 13 + 14 + 15 + Synopsis 16 + ======== 17 + 18 + .. c:function:: int ioctl( int fd, int request, struct cec_msg *argp ) 19 + 20 + Arguments 21 + ========= 22 + 23 + ``fd`` 24 + File descriptor returned by :ref:`open() <cec-func-open>`. 25 + 26 + ``request`` 27 + CEC_RECEIVE, CEC_TRANSMIT 28 + 29 + ``argp`` 30 + 31 + 32 + Description 33 + =========== 34 + 35 + Note: this documents the proposed CEC API. This API is not yet finalized 36 + and is currently only available as a staging kernel module. 37 + 38 + To receive a CEC message the application has to fill in the 39 + :c:type:`struct cec_msg` structure and pass it to the ``CEC_RECEIVE`` 40 + ioctl. ``CEC_RECEIVE`` is only available if ``CEC_CAP_RECEIVE`` is set. 41 + If the file descriptor is in non-blocking mode and there are no received 42 + messages pending, then it will return -1 and set errno to the EAGAIN 43 + error code. If the file descriptor is in blocking mode and ``timeout`` 44 + is non-zero and no message arrived within ``timeout`` milliseconds, then 45 + it will return -1 and set errno to the ETIMEDOUT error code. 46 + 47 + To send a CEC message the application has to fill in the 48 + :c:type:`struct cec_msg` structure and pass it to the 49 + ``CEC_TRANSMIT`` ioctl. ``CEC_TRANSMIT`` is only available if 50 + ``CEC_CAP_TRANSMIT`` is set. If there is no more room in the transmit 51 + queue, then it will return -1 and set errno to the EBUSY error code. 52 + 53 + 54 + .. _cec-msg: 55 + 56 + .. flat-table:: struct cec_msg 57 + :header-rows: 0 58 + :stub-columns: 0 59 + :widths: 1 1 2 60 + 61 + 62 + - .. row 1 63 + 64 + - __u64 65 + 66 + - ``ts`` 67 + 68 + - Timestamp of when the message was transmitted in ns in the case of 69 + ``CEC_TRANSMIT`` with ``reply`` set to 0, or the timestamp of the 70 + received message in all other cases. 71 + 72 + - .. row 2 73 + 74 + - __u32 75 + 76 + - ``len`` 77 + 78 + - The length of the message. For ``CEC_TRANSMIT`` this is filled in 79 + by the application. The driver will fill this in for 80 + ``CEC_RECEIVE`` and for ``CEC_TRANSMIT`` it will be filled in with 81 + the length of the reply message if ``reply`` was set. 82 + 83 + - .. row 3 84 + 85 + - __u32 86 + 87 + - ``timeout`` 88 + 89 + - The timeout in milliseconds. This is the time the device will wait 90 + for a message to be received before timing out. If it is set to 0, 91 + then it will wait indefinitely when it is called by 92 + ``CEC_RECEIVE``. If it is 0 and it is called by ``CEC_TRANSMIT``, 93 + then it will be replaced by 1000 if the ``reply`` is non-zero or 94 + ignored if ``reply`` is 0. 95 + 96 + - .. row 4 97 + 98 + - __u32 99 + 100 + - ``sequence`` 101 + 102 + - The sequence number is automatically assigned by the CEC framework 103 + for all transmitted messages. It can be later used by the 104 + framework to generate an event if a reply for a message was 105 + requested and the message was transmitted in a non-blocking mode. 106 + 107 + - .. row 5 108 + 109 + - __u32 110 + 111 + - ``flags`` 112 + 113 + - Flags. No flags are defined yet, so set this to 0. 114 + 115 + - .. row 6 116 + 117 + - __u8 118 + 119 + - ``rx_status`` 120 + 121 + - The status bits of the received message. See 122 + :ref:`cec-rx-status` for the possible status values. It is 0 if 123 + this message was transmitted, not received, unless this is the 124 + reply to a transmitted message. In that case both ``rx_status`` 125 + and ``tx_status`` are set. 126 + 127 + - .. row 7 128 + 129 + - __u8 130 + 131 + - ``tx_status`` 132 + 133 + - The status bits of the transmitted message. See 134 + :ref:`cec-tx-status` for the possible status values. It is 0 if 135 + this messages was received, not transmitted. 136 + 137 + - .. row 8 138 + 139 + - __u8 140 + 141 + - ``msg``\ [16] 142 + 143 + - The message payload. For ``CEC_TRANSMIT`` this is filled in by the 144 + application. The driver will fill this in for ``CEC_RECEIVE`` and 145 + for ``CEC_TRANSMIT`` it will be filled in with the payload of the 146 + reply message if ``reply`` was set. 147 + 148 + - .. row 9 149 + 150 + - __u8 151 + 152 + - ``reply`` 153 + 154 + - Wait until this message is replied. If ``reply`` is 0 and the 155 + ``timeout`` is 0, then don't wait for a reply but return after 156 + transmitting the message. If there was an error as indicated by a 157 + non-zero ``tx_status`` field, then ``reply`` and ``timeout`` are 158 + both set to 0 by the driver. Ignored by ``CEC_RECEIVE``. The case 159 + where ``reply`` is 0 (this is the opcode for the Feature Abort 160 + message) and ``timeout`` is non-zero is specifically allowed to 161 + send a message and wait up to ``timeout`` milliseconds for a 162 + Feature Abort reply. In this case ``rx_status`` will either be set 163 + to ``CEC_RX_STATUS_TIMEOUT`` or ``CEC_RX_STATUS_FEATURE_ABORT``. 164 + 165 + - .. row 10 166 + 167 + - __u8 168 + 169 + - ``tx_arb_lost_cnt`` 170 + 171 + - A counter of the number of transmit attempts that resulted in the 172 + Arbitration Lost error. This is only set if the hardware supports 173 + this, otherwise it is always 0. This counter is only valid if the 174 + ``CEC_TX_STATUS_ARB_LOST`` status bit is set. 175 + 176 + - .. row 11 177 + 178 + - __u8 179 + 180 + - ``tx_nack_cnt`` 181 + 182 + - A counter of the number of transmit attempts that resulted in the 183 + Not Acknowledged error. This is only set if the hardware supports 184 + this, otherwise it is always 0. This counter is only valid if the 185 + ``CEC_TX_STATUS_NACK`` status bit is set. 186 + 187 + - .. row 12 188 + 189 + - __u8 190 + 191 + - ``tx_low_drive_cnt`` 192 + 193 + - A counter of the number of transmit attempts that resulted in the 194 + Arbitration Lost error. This is only set if the hardware supports 195 + this, otherwise it is always 0. This counter is only valid if the 196 + ``CEC_TX_STATUS_LOW_DRIVE`` status bit is set. 197 + 198 + - .. row 13 199 + 200 + - __u8 201 + 202 + - ``tx_error_cnt`` 203 + 204 + - A counter of the number of transmit errors other than Arbitration 205 + Lost or Not Acknowledged. This is only set if the hardware 206 + supports this, otherwise it is always 0. This counter is only 207 + valid if the ``CEC_TX_STATUS_ERROR`` status bit is set. 208 + 209 + 210 + 211 + .. _cec-tx-status: 212 + 213 + .. flat-table:: CEC Transmit Status 214 + :header-rows: 0 215 + :stub-columns: 0 216 + :widths: 3 1 4 217 + 218 + 219 + - .. row 1 220 + 221 + - ``CEC_TX_STATUS_OK`` 222 + 223 + - 0x01 224 + 225 + - The message was transmitted successfully. This is mutually 226 + exclusive with ``CEC_TX_STATUS_MAX_RETRIES``. Other bits can still 227 + be set if earlier attempts met with failure before the transmit 228 + was eventually successful. 229 + 230 + - .. row 2 231 + 232 + - ``CEC_TX_STATUS_ARB_LOST`` 233 + 234 + - 0x02 235 + 236 + - CEC line arbitration was lost. 237 + 238 + - .. row 3 239 + 240 + - ``CEC_TX_STATUS_NACK`` 241 + 242 + - 0x04 243 + 244 + - Message was not acknowledged. 245 + 246 + - .. row 4 247 + 248 + - ``CEC_TX_STATUS_LOW_DRIVE`` 249 + 250 + - 0x08 251 + 252 + - Low drive was detected on the CEC bus. This indicates that a 253 + follower detected an error on the bus and requests a 254 + retransmission. 255 + 256 + - .. row 5 257 + 258 + - ``CEC_TX_STATUS_ERROR`` 259 + 260 + - 0x10 261 + 262 + - Some error occurred. This is used for any errors that do not fit 263 + the previous two, either because the hardware could not tell which 264 + error occurred, or because the hardware tested for other 265 + conditions besides those two. 266 + 267 + - .. row 6 268 + 269 + - ``CEC_TX_STATUS_MAX_RETRIES`` 270 + 271 + - 0x20 272 + 273 + - The transmit failed after one or more retries. This status bit is 274 + mutually exclusive with ``CEC_TX_STATUS_OK``. Other bits can still 275 + be set to explain which failures were seen. 276 + 277 + 278 + 279 + .. _cec-rx-status: 280 + 281 + .. flat-table:: CEC Receive Status 282 + :header-rows: 0 283 + :stub-columns: 0 284 + :widths: 3 1 4 285 + 286 + 287 + - .. row 1 288 + 289 + - ``CEC_RX_STATUS_OK`` 290 + 291 + - 0x01 292 + 293 + - The message was received successfully. 294 + 295 + - .. row 2 296 + 297 + - ``CEC_RX_STATUS_TIMEOUT`` 298 + 299 + - 0x02 300 + 301 + - The reply to an earlier transmitted message timed out. 302 + 303 + - .. row 3 304 + 305 + - ``CEC_RX_STATUS_FEATURE_ABORT`` 306 + 307 + - 0x04 308 + 309 + - The message was received successfully but the reply was 310 + ``CEC_MSG_FEATURE_ABORT``. This status is only set if this message 311 + was the reply to an earlier transmitted message. 312 + 313 + 314 + 315 + Return Value 316 + ============ 317 + 318 + On success 0 is returned, on error -1 and the ``errno`` variable is set 319 + appropriately. The generic error codes are described at the 320 + :ref:`Generic Error Codes <gen-errors>` chapter. 321 + 322 + 323 + .. ------------------------------------------------------------------------------ 324 + .. This file was automatically converted from DocBook-XML with the dbxml 325 + .. library (https://github.com/return42/sphkerneldoc). The origin XML comes 326 + .. from the linux kernel, refer to: 327 + .. 328 + .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook 329 + .. ------------------------------------------------------------------------------
+10
Documentation/media/uapi/v4l/biblio.rst
··· 349 349 350 350 :author: HDMI Licensing LLC (http://www.hdmi.org) 351 351 352 + .. _hdmi2: 353 + 354 + HDMI2 355 + ===== 356 + 357 + :title: High-Definition Multimedia Interface 358 + :subtitle: Specification Version 2.0 359 + 360 + :author: HDMI Licensing LLC (http://www.hdmi.org) 361 + 352 362 .. _dp: 353 363 354 364 DP