cec-ioc-adap-g-caps.rst 4.3 KB

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