Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/hdmi: Clean up HDMI gpio DT bindings

Make the following changes in the HDMI gpio bindings:

- Use "-gpios" as the suffix for all the gpio names
- Move all the gpios to optional, since there are platforms that use none
of them.
- The HPD gpio is a standard one, remove the "qcom,hdmi-tx-" prefix from
it.
- Remove the HDMI DDC clk/data gpios. They are just leftovers of an old
way to configure pinctrl properties.
- Add a missing lpm gpio used on some platforms.

Make the necessary changes in the driver to incorporate these changes.

There hasn't been any upstream DT that uses the HDMI bindings, so it's
okay to change and move around these properties.

Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>

authored by

Archit Taneja and committed by
Rob Clark
5f6f5e08 13ce5b6e

+23 -7
+4 -5
Documentation/devicetree/bindings/display/msm/hdmi.txt
··· 14 14 - power-domains: Should be <&mmcc MDSS_GDSC>. 15 15 - clocks: device clocks 16 16 See ../clocks/clock-bindings.txt for details. 17 - - qcom,hdmi-tx-ddc-clk-gpio: ddc clk pin 18 - - qcom,hdmi-tx-ddc-data-gpio: ddc data pin 19 - - qcom,hdmi-tx-hpd-gpio: hpd pin 20 17 - core-vdda-supply: phandle to supply regulator 21 18 - hdmi-mux-supply: phandle to mux regulator 22 19 - phys: the phandle for the HDMI PHY device 23 20 - phy-names: the name of the corresponding PHY device 24 21 25 22 Optional properties: 26 - - qcom,hdmi-tx-mux-en-gpio: hdmi mux enable pin 27 - - qcom,hdmi-tx-mux-sel-gpio: hdmi mux select pin 23 + - hpd-gpios: hpd pin 24 + - qcom,hdmi-tx-mux-en-gpios: hdmi mux enable pin 25 + - qcom,hdmi-tx-mux-sel-gpios: hdmi mux select pin 26 + - qcom,hdmi-tx-mux-lpm-gpios: hdmi mux lpm pin 28 27 - power-domains: reference to the power domain(s), if available. 29 28 - pinctrl-names: the pin control state names; should contain "default" 30 29 - pinctrl-0: the default pinctrl state (active)
+19 -2
drivers/gpu/drm/msm/hdmi/hdmi.c
··· 422 422 423 423 static int msm_hdmi_get_gpio(struct device_node *of_node, const char *name) 424 424 { 425 - int gpio = of_get_named_gpio(of_node, name, 0); 425 + int gpio; 426 + 427 + /* try with the gpio names as in the table (downstream bindings) */ 428 + gpio = of_get_named_gpio(of_node, name, 0); 426 429 if (gpio < 0) { 427 430 char name2[32]; 428 - snprintf(name2, sizeof(name2), "%s-gpio", name); 431 + 432 + /* try with the gpio names as in the upstream bindings */ 433 + snprintf(name2, sizeof(name2), "%s-gpios", name); 429 434 gpio = of_get_named_gpio(of_node, name2, 0); 435 + if (gpio < 0) { 436 + char name3[32]; 437 + 438 + /* 439 + * try again after stripping out the "qcom,hdmi-tx" 440 + * prefix. This is mainly to match "hpd-gpios" used 441 + * in the upstream bindings 442 + */ 443 + if (sscanf(name2, "qcom,hdmi-tx-%s", name3)) 444 + gpio = of_get_named_gpio(of_node, name3, 0); 445 + } 446 + 430 447 if (gpio < 0) { 431 448 DBG("failed to get gpio: %s (%d)", name, gpio); 432 449 gpio = -1;