drm/msm/hdmi: Clean up HDMI gpio DT bindings
authorArchit Taneja <architt@codeaurora.org>
Tue, 13 Sep 2016 15:21:35 +0000 (20:51 +0530)
committerRob Clark <robdclark@gmail.com>
Thu, 15 Sep 2016 17:02:02 +0000 (13:02 -0400)
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>
Documentation/devicetree/bindings/display/msm/hdmi.txt
drivers/gpu/drm/msm/hdmi/hdmi.c

index b63f614..2ad5789 100644 (file)
@@ -14,17 +14,16 @@ Required properties:
 - power-domains: Should be <&mmcc MDSS_GDSC>.
 - clocks: device clocks
   See ../clocks/clock-bindings.txt for details.
-- qcom,hdmi-tx-ddc-clk-gpio: ddc clk pin
-- qcom,hdmi-tx-ddc-data-gpio: ddc data pin
-- qcom,hdmi-tx-hpd-gpio: hpd pin
 - core-vdda-supply: phandle to supply regulator
 - hdmi-mux-supply: phandle to mux regulator
 - phys: the phandle for the HDMI PHY device
 - phy-names: the name of the corresponding PHY device
 
 Optional properties:
-- qcom,hdmi-tx-mux-en-gpio: hdmi mux enable pin
-- qcom,hdmi-tx-mux-sel-gpio: hdmi mux select pin
+- hpd-gpios: hpd pin
+- qcom,hdmi-tx-mux-en-gpios: hdmi mux enable pin
+- qcom,hdmi-tx-mux-sel-gpios: hdmi mux select pin
+- qcom,hdmi-tx-mux-lpm-gpios: hdmi mux lpm pin
 - power-domains: reference to the power domain(s), if available.
 - pinctrl-names: the pin control state names; should contain "default"
 - pinctrl-0: the default pinctrl state (active)
index 9737207..a968cad 100644 (file)
@@ -422,11 +422,28 @@ static const struct {
 
 static int msm_hdmi_get_gpio(struct device_node *of_node, const char *name)
 {
-       int gpio = of_get_named_gpio(of_node, name, 0);
+       int gpio;
+
+       /* try with the gpio names as in the table (downstream bindings) */
+       gpio = of_get_named_gpio(of_node, name, 0);
        if (gpio < 0) {
                char name2[32];
-               snprintf(name2, sizeof(name2), "%s-gpio", name);
+
+               /* try with the gpio names as in the upstream bindings */
+               snprintf(name2, sizeof(name2), "%s-gpios", name);
                gpio = of_get_named_gpio(of_node, name2, 0);
+               if (gpio < 0) {
+                       char name3[32];
+
+                       /*
+                        * try again after stripping out the "qcom,hdmi-tx"
+                        * prefix. This is mainly to match "hpd-gpios" used
+                        * in the upstream bindings
+                        */
+                       if (sscanf(name2, "qcom,hdmi-tx-%s", name3))
+                               gpio = of_get_named_gpio(of_node, name3, 0);
+               }
+
                if (gpio < 0) {
                        DBG("failed to get gpio: %s (%d)", name, gpio);
                        gpio = -1;