18c2ecf20Sopenharmony_ci* HDMI CEC GPIO driver 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ciThe HDMI CEC GPIO module supports CEC implementations where the CEC line 48c2ecf20Sopenharmony_ciis hooked up to a pull-up GPIO line and - optionally - the HPD line is 58c2ecf20Sopenharmony_cihooked up to another GPIO line. 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciPlease note: the maximum voltage for the CEC line is 3.63V, for the HPD and 88c2ecf20Sopenharmony_ci5V lines it is 5.3V. So you may need some sort of level conversion circuitry 98c2ecf20Sopenharmony_ciwhen connecting them to a GPIO line. 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ciRequired properties: 128c2ecf20Sopenharmony_ci - compatible: value must be "cec-gpio". 138c2ecf20Sopenharmony_ci - cec-gpios: gpio that the CEC line is connected to. The line should be 148c2ecf20Sopenharmony_ci tagged as open drain. 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ciIf the CEC line is associated with an HDMI receiver/transmitter, then the 178c2ecf20Sopenharmony_cifollowing property is also required: 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci - hdmi-phandle - phandle to the HDMI controller, see also cec.txt. 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ciIf the CEC line is not associated with an HDMI receiver/transmitter, then 228c2ecf20Sopenharmony_cithe following property is optional and can be used for debugging HPD changes: 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci - hpd-gpios: gpio that the HPD line is connected to. 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ciThis property is optional and can be used for debugging changes on the 5V line: 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci - v5-gpios: gpio that the 5V line is connected to. 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ciExample for the Raspberry Pi 3 where the CEC line is connected to 318c2ecf20Sopenharmony_cipin 26 aka BCM7 aka CE1 on the GPIO pin header, the HPD line is 328c2ecf20Sopenharmony_ciconnected to pin 11 aka BCM17 and the 5V line is connected to pin 338c2ecf20Sopenharmony_ci15 aka BCM22 (some level shifter is needed for the HPD and 5V lines!): 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci#include <dt-bindings/gpio/gpio.h> 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_cicec-gpio { 388c2ecf20Sopenharmony_ci compatible = "cec-gpio"; 398c2ecf20Sopenharmony_ci cec-gpios = <&gpio 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 408c2ecf20Sopenharmony_ci hpd-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; 418c2ecf20Sopenharmony_ci v5-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; 428c2ecf20Sopenharmony_ci}; 43