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