cec-ioc-adap-g-caps.rst 3.6 KB
Newer Older
1 2
.. -*- coding: utf-8; mode: rst -*-

3
.. _CEC_ADAP_G_CAPS:
4 5 6 7 8

*********************
ioctl CEC_ADAP_G_CAPS
*********************

9 10
Name
====
11

12
CEC_ADAP_G_CAPS - Query device capabilities
13 14 15 16

Synopsis
========

17
.. cpp:function:: int ioctl( int fd, int request, struct cec_caps *argp )
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

Arguments
=========

``fd``
    File descriptor returned by :ref:`open() <cec-func-open>`.

``request``
    CEC_ADAP_G_CAPS

``argp``


Description
===========

34 35 36
.. note::

   This documents the proposed CEC API. This API is not yet finalized
37
   and is currently only available as a staging kernel module.
38

39
All cec devices must support :ref:`ioctl CEC_ADAP_G_CAPS <CEC_ADAP_G_CAPS>`. To query
40 41 42 43 44 45 46
device information, applications call the ioctl with a pointer to a
struct :ref:`cec_caps <cec-caps>`. The driver fills the structure and
returns the information to the application. The ioctl never fails.


.. _cec-caps:

47
.. tabularcolumns:: |p{1.2cm}|p{2.5cm}|p{13.8cm}|
48

49 50 51
.. flat-table:: struct cec_caps
    :header-rows:  0
    :stub-columns: 0
52
    :widths:       1 1 16
53 54 55 56 57 58


    -  .. row 1

       -  char

59
       -  ``driver[32]``
60 61 62 63 64 65 66

       -  The name of the cec adapter driver.

    -  .. row 2

       -  char

67
       -  ``name[32]``
68 69

       -  The name of this CEC adapter. The combination ``driver`` and
70
	  ``name`` must be unique.
71 72 73 74 75 76 77 78

    -  .. row 3

       -  __u32

       -  ``capabilities``

       -  The capabilities of the CEC adapter, see
79
	  :ref:`cec-capabilities`.
80 81 82 83 84 85 86 87

    -  .. row 4

       -  __u32

       -  ``version``

       -  CEC Framework API version, formatted with the ``KERNEL_VERSION()``
88
	  macro.
89 90 91 92 93



.. _cec-capabilities:

94
.. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.6cm}|
95

96 97 98
.. flat-table:: CEC Capabilities Flags
    :header-rows:  0
    :stub-columns: 0
99
    :widths:       3 1 8
100 101


102
    -  .. _`CEC-CAP-PHYS-ADDR`:
103 104 105 106 107 108

       -  ``CEC_CAP_PHYS_ADDR``

       -  0x00000001

       -  Userspace has to configure the physical address by calling
109
	  :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>`. If
110 111 112
	  this capability isn't set, then setting the physical address is
	  handled by the kernel whenever the EDID is set (for an HDMI
	  receiver) or read (for an HDMI transmitter).
113

114
    -  .. _`CEC-CAP-LOG-ADDRS`:
115 116 117 118 119 120

       -  ``CEC_CAP_LOG_ADDRS``

       -  0x00000002

       -  Userspace has to configure the logical addresses by calling
121
	  :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`. If
122 123
	  this capability isn't set, then the kernel will have configured
	  this.
124

125
    -  .. _`CEC-CAP-TRANSMIT`:
126 127 128 129 130 131

       -  ``CEC_CAP_TRANSMIT``

       -  0x00000004

       -  Userspace can transmit CEC messages by calling
132
	  :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`. This implies that
133 134 135 136
	  userspace can be a follower as well, since being able to transmit
	  messages is a prerequisite of becoming a follower. If this
	  capability isn't set, then the kernel will handle all CEC
	  transmits and process all CEC messages it receives.
137

138
    -  .. _`CEC-CAP-PASSTHROUGH`:
139 140 141 142 143 144

       -  ``CEC_CAP_PASSTHROUGH``

       -  0x00000008

       -  Userspace can use the passthrough mode by calling
145
	  :ref:`ioctl CEC_S_MODE <CEC_S_MODE>`.
146

147
    -  .. _`CEC-CAP-RC`:
148 149 150 151 152 153 154

       -  ``CEC_CAP_RC``

       -  0x00000010

       -  This adapter supports the remote control protocol.

155
    -  .. _`CEC-CAP-MONITOR-ALL`:
156 157 158 159 160 161

       -  ``CEC_CAP_MONITOR_ALL``

       -  0x00000020

       -  The CEC hardware can monitor all messages, not just directed and
162
	  broadcast messages.
163 164 165 166 167 168 169 170 171



Return Value
============

On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.