xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/media/cec-gpio.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun* HDMI CEC GPIO driver
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunThe HDMI CEC GPIO module supports CEC implementations where the CEC line
4*4882a593Smuzhiyunis hooked up to a pull-up GPIO line and - optionally - the HPD line is
5*4882a593Smuzhiyunhooked up to another GPIO line.
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunPlease note: the maximum voltage for the CEC line is 3.63V, for the HPD and
8*4882a593Smuzhiyun5V lines it is 5.3V. So you may need some sort of level conversion circuitry
9*4882a593Smuzhiyunwhen connecting them to a GPIO line.
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunRequired properties:
12*4882a593Smuzhiyun  - compatible: value must be "cec-gpio".
13*4882a593Smuzhiyun  - cec-gpios: gpio that the CEC line is connected to. The line should be
14*4882a593Smuzhiyun    tagged as open drain.
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunIf the CEC line is associated with an HDMI receiver/transmitter, then the
17*4882a593Smuzhiyunfollowing property is also required:
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun  - hdmi-phandle - phandle to the HDMI controller, see also cec.txt.
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunIf the CEC line is not associated with an HDMI receiver/transmitter, then
22*4882a593Smuzhiyunthe following property is optional and can be used for debugging HPD changes:
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun  - hpd-gpios: gpio that the HPD line is connected to.
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunThis property is optional and can be used for debugging changes on the 5V line:
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun  - v5-gpios: gpio that the 5V line is connected to.
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunExample for the Raspberry Pi 3 where the CEC line is connected to
31*4882a593Smuzhiyunpin 26 aka BCM7 aka CE1 on the GPIO pin header, the HPD line is
32*4882a593Smuzhiyunconnected to pin 11 aka BCM17 and the 5V line is connected to pin
33*4882a593Smuzhiyun15 aka BCM22 (some level shifter is needed for the HPD and 5V lines!):
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun#include <dt-bindings/gpio/gpio.h>
36*4882a593Smuzhiyun
37*4882a593Smuzhiyuncec-gpio {
38*4882a593Smuzhiyun	compatible = "cec-gpio";
39*4882a593Smuzhiyun	cec-gpios = <&gpio 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
40*4882a593Smuzhiyun	hpd-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
41*4882a593Smuzhiyun	v5-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
42*4882a593Smuzhiyun};
43