devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Archit Taneja <architt@codeaurora.org>
To: robdclark@gmail.com, andy.gross@linaro.org
Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	Archit Taneja <architt@codeaurora.org>,
	Rob Herring <robh@kernel.org>,
	devicetree@vger.kernel.org
Subject: [PATCH 2/4] drm/msm/hdmi: Use more DT friendly GPIO names
Date: Fri,  8 Jul 2016 11:25:52 +0530	[thread overview]
Message-ID: <1467957354-7620-3-git-send-email-architt@codeaurora.org> (raw)
In-Reply-To: <1467957354-7620-1-git-send-email-architt@codeaurora.org>

Update the gpio name parsing code to try to search for without the
"qcom,hdmi-tx-" prefix. The older downstream bindings that expect
"qcom,hdmi-tx-xyz" or "qcom,hdmi-tx-xyz-gpio" would work as the
property name would work as before.

Update the binding doc. Add an entry for the missing hpd and lpm
gpios.

Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org

Signed-off-by: Archit Taneja <architt@codeaurora.org>
---
 Documentation/devicetree/bindings/display/msm/hdmi.txt |  6 ++++--
 drivers/gpu/drm/msm/hdmi/hdmi.c                        | 16 ++++++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/msm/hdmi.txt b/Documentation/devicetree/bindings/display/msm/hdmi.txt
index b63f614..4da1abd 100644
--- a/Documentation/devicetree/bindings/display/msm/hdmi.txt
+++ b/Documentation/devicetree/bindings/display/msm/hdmi.txt
@@ -23,8 +23,10 @@ Required properties:
 - 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-gpio: hdmi hpd pin
+- mux-en-gpio: hdmi mux enable pin
+- mux-sel-gpio: hdmi mux select pin
+- mux-lpm-gpio: 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)
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 51b9ea5..d48305f 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -422,11 +422,27 @@ 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);
+
+	/*
+	 * This is complicated mainly because we want the downstream kernel
+	 * DT files working with the upstream kernel. We first try with the
+	 * names as listed above in the table. We then append "gpio" to it and
+	 * try again. We finally try the DT bindings as they would be in
+	 * upstream dtsi files by stripping off the "qcom,hdmi-tx-" prefix.
+	 * We'll get rid of this when we don't rely on downstream bindings.
+	 */
 	if (gpio < 0) {
 		char name2[32];
 		snprintf(name2, sizeof(name2), "%s-gpio", name);
 		gpio = of_get_named_gpio(of_node, name2, 0);
 		if (gpio < 0) {
+			char name3[32];
+
+			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;
 		}
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

       reply	other threads:[~2016-07-08  5:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1467957354-7620-1-git-send-email-architt@codeaurora.org>
2016-07-08  5:55 ` Archit Taneja [this message]
2016-07-13 13:45   ` [PATCH 2/4] drm/msm/hdmi: Use more DT friendly GPIO names Rob Herring
2016-07-14  8:34     ` Archit Taneja
2016-07-08  5:55 ` [PATCH 3/4] arm: dts: qcom: apq8064: Add display DT nodes Archit Taneja
2016-07-08  5:55 ` [PATCH 4/4] arm: dts: qcom: apq8064-ifc6410: Add HDMI support Archit Taneja
     [not found] ` <1472737015-29382-1-git-send-email-architt@codeaurora.org>
2016-09-01 13:36   ` [PATCH v2 2/4] drm/msm/hdmi: Clean up HDMI gpio DT bindings Archit Taneja
     [not found]     ` <1472737015-29382-3-git-send-email-architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-09-07 22:18       ` John Stultz
2016-09-12 13:19       ` Rob Herring
2016-09-13  7:12         ` Archit Taneja
2016-09-13 13:15           ` Archit Taneja
2016-09-01 13:36   ` [PATCH v2 3/4] arm: dts: qcom: apq8064: Add display DT nodes Archit Taneja
2016-09-07 22:19     ` John Stultz
2016-09-01 13:36   ` [PATCH v2 4/4] arm: dts: qcom: apq8064-ifc6410: Add HDMI support Archit Taneja
     [not found]   ` <1473780097-11388-1-git-send-email-architt@codeaurora.org>
     [not found]     ` <1473780097-11388-1-git-send-email-architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-09-13 15:21       ` [PATCH v3 2/4] drm/msm/hdmi: Clean up HDMI gpio DT bindings Archit Taneja
2016-09-13 19:31         ` Rob Herring
2016-09-13 15:21       ` [PATCH v3 4/4] arm: dts: qcom: apq8064-ifc6410: Add HDMI support Archit Taneja
2016-09-13 15:21     ` [PATCH v3 3/4] arm: dts: qcom: apq8064: Add display DT nodes Archit Taneja
     [not found]       ` <1473780097-11388-4-git-send-email-architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-09-13 21:44         ` Stephen Boyd
2016-09-14 17:57           ` Archit Taneja
     [not found]     ` <1474612387-21762-1-git-send-email-architt@codeaurora.org>
2016-09-23  6:33       ` [PATCH v4 1/2] " Archit Taneja
2016-09-23  6:33       ` [PATCH v4 2/2] arm: dts: qcom: apq8064-ifc6410: Add HDMI support Archit Taneja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467957354-7620-3-git-send-email-architt@codeaurora.org \
    --to=architt@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).