Skip to contentSkip to conversation

video: meson: hdmi-supply regulator should be optional

PATCH New Maxime Jourdan 4 participants 4 messages Jun 4, 2019 – Jun 5, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: meson: hdmi-supply regulator should be optional

Some boards don't have such a regulator, and don't need one to enable HDMI display. Make it optional, fixing hdmi display for those boards.

Also surround the regulator code with a config check on DM_REGULATOR.

---
 drivers/video/meson/meson_dw_hdmi.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/video/meson/meson_dw_hdmi.c +10 -4
index 7a1c060856..483c93f6b6 100644
@@ -361,13 +361,19 @@ static int meson_dw_hdmi_probe(struct udevice *dev)
 	priv->hdmi.i2c_clk_high = 0x67;
 	priv->hdmi.i2c_clk_low = 0x78;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
 	ret = device_get_supply_regulator(dev, "hdmi-supply", &supply);
-	if (ret)
+	if (ret && ret != -ENOENT) {
+		pr_err("Failed to get HDMI regulator\n");
 		return ret;
+	}
 
-	ret = regulator_set_enable(supply, true);
-	if (ret)
-		return ret;
+	if (!ret) {
+		ret = regulator_set_enable(supply, true);
+		if (ret)
+			return ret;
+	}
+#endif
 
 	ret = reset_get_bulk(dev, &resets);
 	if (ret)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/1 video: meson: hdmi-supply regulator should be optional

Quoted 30 lines · Maxime Jourdan

Some boards don't have such a regulator, and don't need one to enable HDMI display. Make it optional, fixing hdmi display for those boards.

Also surround the regulator code with a config check on DM_REGULATOR.

---
 drivers/video/meson/meson_dw_hdmi.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/video/meson/meson_dw_hdmi.c +4 -3
index 7a1c060856..483c93f6b6 100644
@@ -361,13 +361,19 @@ static int meson_dw_hdmi_probe(struct udevice *dev)
 	priv->hdmi.i2c_clk_high = 0x67;
 	priv->hdmi.i2c_clk_low = 0x78;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
 	ret = device_get_supply_regulator(dev, "hdmi-supply", &supply);
-	if (ret)
+	if (ret && ret != -ENOENT) {
+		pr_err("Failed to get HDMI regulator\n");
 		return ret;
+	}
 
-	ret = regulator_set_enable(supply, true);
-	if (ret)

drivers/video/meson/meson_dw_hdmi.c static int meson_dw_hdmi_probe(struct udevice *dev) · line 379

Quoted 10 lines
drivers/video/meson/meson_dw_hdmi.c +6 -1
-		return ret;
+	if (!ret) {
+		ret = regulator_set_enable(supply, true);
+		if (ret)
+			return ret;
+	}
+#endif
 
 	ret = reset_get_bulk(dev, &resets);
 	if (ret)

Good catch !

#2 lore raw

PATCH 1/1 video: meson: hdmi-supply regulator should be optional

In reply to Maxime Jourdan
Quoted 40 lines · Maxime Jourdan

Some boards don't have such a regulator, and don't need one to enable HDMI display. Make it optional, fixing hdmi display for those boards.

Also surround the regulator code with a config check on DM_REGULATOR.

---
 drivers/video/meson/meson_dw_hdmi.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/video/meson/meson_dw_hdmi.c +10 -5
index 7a1c060856..483c93f6b6 100644
@@ -361,13 +361,19 @@ static int meson_dw_hdmi_probe(struct udevice *dev)
 	priv->hdmi.i2c_clk_high = 0x67;
 	priv->hdmi.i2c_clk_low = 0x78;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
 	ret = device_get_supply_regulator(dev, "hdmi-supply", &supply);
-	if (ret)
+	if (ret && ret != -ENOENT) {
+		pr_err("Failed to get HDMI regulator\n");
 		return ret;
+	}
 
-	ret = regulator_set_enable(supply, true);
-	if (ret)
-		return ret;
+	if (!ret) {
+		ret = regulator_set_enable(supply, true);
+		if (ret)
+			return ret;
+	}
+#endif
 
 	ret = reset_get_bulk(dev, &resets);
 	if (ret)
--
Quoted 2 lines

2.21.0

#3 lore raw

PATCH 1/1 video: meson: hdmi-supply regulator should be optional

In reply to Maxime Jourdan
Quoted 3 lines · On Tue, 4 Jun 2019 22:26:19 +0200 Maxime Jourdan mjourdan at baylibre.com…
---
 drivers/video/meson/meson_dw_hdmi.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Applied to u-boot-video/master, thanks!

--
Anatolij