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

drm/meson: dw_hdmi: Add support for an optional external 5V regulator

On reference boards and derivatives, the HDMI Logic is powered by an external
5V regulator.
This regulator was set by the Vendor U-Boot, add optional support for it.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1512561268-29806-4-git-send-email-narmstrong@baylibre.com

+13
+13
drivers/gpu/drm/meson/meson_dw_hdmi.c
··· 23 23 #include <linux/of_graph.h> 24 24 #include <linux/reset.h> 25 25 #include <linux/clk.h> 26 + #include <linux/regulator/consumer.h> 26 27 27 28 #include <drm/drmP.h> 28 29 #include <drm/drm_edid.h> ··· 138 137 struct reset_control *hdmitx_phy; 139 138 struct clk *hdmi_pclk; 140 139 struct clk *venci_clk; 140 + struct regulator *hdmi_supply; 141 141 u32 irq_stat; 142 142 }; 143 143 #define encoder_to_meson_dw_hdmi(x) \ ··· 752 750 meson_dw_hdmi->dev = dev; 753 751 dw_plat_data = &meson_dw_hdmi->dw_plat_data; 754 752 encoder = &meson_dw_hdmi->encoder; 753 + 754 + meson_dw_hdmi->hdmi_supply = devm_regulator_get_optional(dev, "hdmi"); 755 + if (IS_ERR(meson_dw_hdmi->hdmi_supply)) { 756 + if (PTR_ERR(meson_dw_hdmi->hdmi_supply) == -EPROBE_DEFER) 757 + return -EPROBE_DEFER; 758 + meson_dw_hdmi->hdmi_supply = NULL; 759 + } else { 760 + ret = regulator_enable(meson_dw_hdmi->hdmi_supply); 761 + if (ret) 762 + return ret; 763 + } 755 764 756 765 meson_dw_hdmi->hdmitx_apb = devm_reset_control_get_exclusive(dev, 757 766 "hdmitx_apb");