[PATCH RFC 2/5] drm/msm/hdmi: make use of standard gpio properties.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch modifies the driver to support standard gpio properties along
with deprecated properties. This will help us upstream and cleanup the
non-standard properties over the time.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
---
 drivers/gpu/drm/msm/hdmi/hdmi.c | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 8145362..e918889 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -339,19 +339,34 @@ static const struct of_device_id dt_match[] = {
 };
 
 #ifdef CONFIG_OF
+/* This code will be removed once we move to gpiod based calls */
 static int get_gpio(struct device *dev, struct device_node *of_node, const char *name)
 {
+	char name2[32];
 	int gpio = of_get_named_gpio(of_node, name, 0);
-	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) {
-			dev_err(dev, "failed to get gpio: %s (%d)\n",
-					name, gpio);
-			gpio = -1;
-		}
-	}
+
+	if (gpio_is_valid(gpio))
+		goto deprecated;
+
+	snprintf(name2, sizeof(name2), "%s-gpio", name);
+	gpio = of_get_named_gpio(of_node, name2, 0);
+
+	if (gpio_is_valid(gpio))
+		goto deprecated;
+
+
+	snprintf(name2, sizeof(name2), "%s-gpios", name);
+	gpio = of_get_named_gpio(of_node, name2, 0);
+
+	if (gpio_is_valid(gpio))
+		return gpio;
+
+	dev_err(dev, "failed to get gpio: %s (%d)\n", name, gpio);
+
+	return -1;
+
+deprecated:
+	dev_warn(dev, "binding deprecated for %s\n", name);
 	return gpio;
 }
 #endif
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux