Commit e25001d8 authored by Tomi Valkeinen's avatar Tomi Valkeinen

OMAPDSS: HDMI: add hdmi_init_regulator

Separate regulator init code into its own function for clarity.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 00df43b8
...@@ -328,6 +328,29 @@ static void hdmi_runtime_put(void) ...@@ -328,6 +328,29 @@ static void hdmi_runtime_put(void)
WARN_ON(r < 0 && r != -ENOSYS); WARN_ON(r < 0 && r != -ENOSYS);
} }
static int hdmi_init_regulator(void)
{
struct regulator *reg;
if (hdmi.vdda_hdmi_dac_reg != NULL)
return 0;
reg = devm_regulator_get(&hdmi.pdev->dev, "vdda_hdmi_dac");
/* DT HACK: try VDAC to make omapdss work for o4 sdp/panda */
if (IS_ERR(reg))
reg = devm_regulator_get(&hdmi.pdev->dev, "VDAC");
if (IS_ERR(reg)) {
DSSERR("can't get VDDA_HDMI_DAC regulator\n");
return PTR_ERR(reg);
}
hdmi.vdda_hdmi_dac_reg = reg;
return 0;
}
static int hdmi_init_display(struct omap_dss_device *dssdev) static int hdmi_init_display(struct omap_dss_device *dssdev)
{ {
int r; int r;
...@@ -342,22 +365,9 @@ static int hdmi_init_display(struct omap_dss_device *dssdev) ...@@ -342,22 +365,9 @@ static int hdmi_init_display(struct omap_dss_device *dssdev)
dss_init_hdmi_ip_ops(&hdmi.ip_data, omapdss_get_version()); dss_init_hdmi_ip_ops(&hdmi.ip_data, omapdss_get_version());
if (hdmi.vdda_hdmi_dac_reg == NULL) { r = hdmi_init_regulator();
struct regulator *reg; if (r)
return r;
reg = devm_regulator_get(&hdmi.pdev->dev, "vdda_hdmi_dac");
/* DT HACK: try VDAC to make omapdss work for o4 sdp/panda */
if (IS_ERR(reg))
reg = devm_regulator_get(&hdmi.pdev->dev, "VDAC");
if (IS_ERR(reg)) {
DSSERR("can't get VDDA_HDMI_DAC regulator\n");
return PTR_ERR(reg);
}
hdmi.vdda_hdmi_dac_reg = reg;
}
r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
if (r) if (r)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment