1*cb7aa33aSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2*cb7aa33aSEmmanuel Vadot%YAML 1.2
3*cb7aa33aSEmmanuel Vadot---
4*cb7aa33aSEmmanuel Vadot$id: http://devicetree.org/schemas/media/cec/cec-gpio.yaml#
5*cb7aa33aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*cb7aa33aSEmmanuel Vadot
7*cb7aa33aSEmmanuel Vadottitle: HDMI CEC GPIO
8*cb7aa33aSEmmanuel Vadot
9*cb7aa33aSEmmanuel Vadotmaintainers:
10*cb7aa33aSEmmanuel Vadot  - Hans Verkuil <hverkuil-cisco@xs4all.nl>
11*cb7aa33aSEmmanuel Vadot
12*cb7aa33aSEmmanuel Vadotdescription: |
13*cb7aa33aSEmmanuel Vadot  The HDMI CEC GPIO module supports CEC implementations where the CEC line is
14*cb7aa33aSEmmanuel Vadot  hooked up to a pull-up GPIO line and - optionally - the HPD line is hooked up
15*cb7aa33aSEmmanuel Vadot  to another GPIO line.
16*cb7aa33aSEmmanuel Vadot
17*cb7aa33aSEmmanuel Vadot  Please note:: the maximum voltage for the CEC line is 3.63V, for the HPD and
18*cb7aa33aSEmmanuel Vadot  5V lines it is 5.3V. So you may need some sort of level conversion
19*cb7aa33aSEmmanuel Vadot  circuitry when connecting them to a GPIO line.
20*cb7aa33aSEmmanuel Vadot
21*cb7aa33aSEmmanuel Vadotproperties:
22*cb7aa33aSEmmanuel Vadot  compatible:
23*cb7aa33aSEmmanuel Vadot    const: cec-gpio
24*cb7aa33aSEmmanuel Vadot
25*cb7aa33aSEmmanuel Vadot  cec-gpios:
26*cb7aa33aSEmmanuel Vadot    maxItems: 1
27*cb7aa33aSEmmanuel Vadot    description:
28*cb7aa33aSEmmanuel Vadot      GPIO that the CEC line is connected to. The line should be tagged as open
29*cb7aa33aSEmmanuel Vadot      drain.
30*cb7aa33aSEmmanuel Vadot
31*cb7aa33aSEmmanuel Vadot  hpd-gpios:
32*cb7aa33aSEmmanuel Vadot    maxItems: 1
33*cb7aa33aSEmmanuel Vadot    description:
34*cb7aa33aSEmmanuel Vadot      GPIO that the HPD line is connected to.  Used for debugging HPD changes
35*cb7aa33aSEmmanuel Vadot      when the CEC line is not associated with an HDMI receiver/transmitter.
36*cb7aa33aSEmmanuel Vadot
37*cb7aa33aSEmmanuel Vadot  v5-gpios:
38*cb7aa33aSEmmanuel Vadot    maxItems: 1
39*cb7aa33aSEmmanuel Vadot    description:
40*cb7aa33aSEmmanuel Vadot      GPIO that the 5V line is connected to.  Used for debugging changes on the
41*cb7aa33aSEmmanuel Vadot      5V line.
42*cb7aa33aSEmmanuel Vadot
43*cb7aa33aSEmmanuel Vadotrequired:
44*cb7aa33aSEmmanuel Vadot  - compatible
45*cb7aa33aSEmmanuel Vadot  - cec-gpios
46*cb7aa33aSEmmanuel Vadot
47*cb7aa33aSEmmanuel VadotallOf:
48*cb7aa33aSEmmanuel Vadot  - $ref: cec-common.yaml#
49*cb7aa33aSEmmanuel Vadot  - if:
50*cb7aa33aSEmmanuel Vadot      required:
51*cb7aa33aSEmmanuel Vadot        - hdmi-phandle
52*cb7aa33aSEmmanuel Vadot    then:
53*cb7aa33aSEmmanuel Vadot      properties:
54*cb7aa33aSEmmanuel Vadot        hpd-gpios: false
55*cb7aa33aSEmmanuel Vadot
56*cb7aa33aSEmmanuel Vadot  - if:
57*cb7aa33aSEmmanuel Vadot      required:
58*cb7aa33aSEmmanuel Vadot        - hpd-gpios
59*cb7aa33aSEmmanuel Vadot    then:
60*cb7aa33aSEmmanuel Vadot      properties:
61*cb7aa33aSEmmanuel Vadot        hdmi-phandle: false
62*cb7aa33aSEmmanuel Vadot
63*cb7aa33aSEmmanuel VadotunevaluatedProperties: false
64*cb7aa33aSEmmanuel Vadot
65*cb7aa33aSEmmanuel Vadotexamples:
66*cb7aa33aSEmmanuel Vadot  - |
67*cb7aa33aSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
68*cb7aa33aSEmmanuel Vadot
69*cb7aa33aSEmmanuel Vadot    cec {
70*cb7aa33aSEmmanuel Vadot        compatible = "cec-gpio";
71*cb7aa33aSEmmanuel Vadot        cec-gpios = <&gpio 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
72*cb7aa33aSEmmanuel Vadot        hpd-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
73*cb7aa33aSEmmanuel Vadot        v5-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
74*cb7aa33aSEmmanuel Vadot    };
75