cec-ioc-adap-g-phys-addr.rst 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _CEC_ADAP_PHYS_ADDR:
  3. .. _CEC_ADAP_G_PHYS_ADDR:
  4. .. _CEC_ADAP_S_PHYS_ADDR:
  5. ****************************************************
  6. ioctls CEC_ADAP_G_PHYS_ADDR and CEC_ADAP_S_PHYS_ADDR
  7. ****************************************************
  8. Name
  9. ====
  10. CEC_ADAP_G_PHYS_ADDR, CEC_ADAP_S_PHYS_ADDR - Get or set the physical address
  11. Synopsis
  12. ========
  13. .. c:function:: int ioctl( int fd, CEC_ADAP_G_PHYS_ADDR, __u16 *argp )
  14. :name: CEC_ADAP_G_PHYS_ADDR
  15. .. c:function:: int ioctl( int fd, CEC_ADAP_S_PHYS_ADDR, __u16 *argp )
  16. :name: CEC_ADAP_S_PHYS_ADDR
  17. Arguments
  18. =========
  19. ``fd``
  20. File descriptor returned by :c:func:`open() <cec-open>`.
  21. ``argp``
  22. Pointer to the CEC address.
  23. Description
  24. ===========
  25. .. note::
  26. This documents the proposed CEC API. This API is not yet finalized
  27. and is currently only available as a staging kernel module.
  28. To query the current physical address applications call
  29. :ref:`ioctl CEC_ADAP_G_PHYS_ADDR <CEC_ADAP_G_PHYS_ADDR>` with a pointer to a __u16 where the
  30. driver stores the physical address.
  31. To set a new physical address applications store the physical address in
  32. a __u16 and call :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` with a pointer to
  33. this integer. The :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` is only available if
  34. ``CEC_CAP_PHYS_ADDR`` is set (the ``ENOTTY`` error code will be returned
  35. otherwise). The :ref:`ioctl CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` can only be called
  36. by a file descriptor in initiator mode (see :ref:`CEC_S_MODE`), if not
  37. the ``EBUSY`` error code will be returned.
  38. To clear an existing physical address use ``CEC_PHYS_ADDR_INVALID``.
  39. The adapter will go to the unconfigured state.
  40. If logical address types have been defined (see :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`),
  41. then this ioctl will block until all
  42. requested logical addresses have been claimed. If the file descriptor is in non-blocking mode
  43. then it will not wait for the logical addresses to be claimed, instead it just returns 0.
  44. A :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STATE-CHANGE>` event is sent when the physical address
  45. changes.
  46. The physical address is a 16-bit number where each group of 4 bits
  47. represent a digit of the physical address a.b.c.d where the most
  48. significant 4 bits represent 'a'. The CEC root device (usually the TV)
  49. has address 0.0.0.0. Every device that is hooked up to an input of the
  50. TV has address a.0.0.0 (where 'a' is ≥ 1), devices hooked up to those in
  51. turn have addresses a.b.0.0, etc. So a topology of up to 5 devices deep
  52. is supported. The physical address a device shall use is stored in the
  53. EDID of the sink.
  54. For example, the EDID for each HDMI input of the TV will have a
  55. different physical address of the form a.0.0.0 that the sources will
  56. read out and use as their physical address.
  57. Return Value
  58. ============
  59. On success 0 is returned, on error -1 and the ``errno`` variable is set
  60. appropriately. The generic error codes are described at the
  61. :ref:`Generic Error Codes <gen-errors>` chapter.