diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-05-10 08:20:52 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-06-17 07:00:46 -0400 |
commit | e25001d8be225b09a9a660f121892961bb58a09a (patch) | |
tree | ba8540d7f861c9498df28ae409d0f85bbc68fe6e | |
parent | 00df43b8227dbb0100625b279ccbd66d4a03110c (diff) |
OMAPDSS: HDMI: add hdmi_init_regulator
Separate regulator init code into its own function for clarity.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index fe72746411e1..98341fe32056 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
@@ -328,6 +328,29 @@ static void hdmi_runtime_put(void) | |||
328 | WARN_ON(r < 0 && r != -ENOSYS); | 328 | WARN_ON(r < 0 && r != -ENOSYS); |
329 | } | 329 | } |
330 | 330 | ||
331 | static int hdmi_init_regulator(void) | ||
332 | { | ||
333 | struct regulator *reg; | ||
334 | |||
335 | if (hdmi.vdda_hdmi_dac_reg != NULL) | ||
336 | return 0; | ||
337 | |||
338 | reg = devm_regulator_get(&hdmi.pdev->dev, "vdda_hdmi_dac"); | ||
339 | |||
340 | /* DT HACK: try VDAC to make omapdss work for o4 sdp/panda */ | ||
341 | if (IS_ERR(reg)) | ||
342 | reg = devm_regulator_get(&hdmi.pdev->dev, "VDAC"); | ||
343 | |||
344 | if (IS_ERR(reg)) { | ||
345 | DSSERR("can't get VDDA_HDMI_DAC regulator\n"); | ||
346 | return PTR_ERR(reg); | ||
347 | } | ||
348 | |||
349 | hdmi.vdda_hdmi_dac_reg = reg; | ||
350 | |||
351 | return 0; | ||
352 | } | ||
353 | |||
331 | static int hdmi_init_display(struct omap_dss_device *dssdev) | 354 | static int hdmi_init_display(struct omap_dss_device *dssdev) |
332 | { | 355 | { |
333 | int r; | 356 | int r; |
@@ -342,22 +365,9 @@ static int hdmi_init_display(struct omap_dss_device *dssdev) | |||
342 | 365 | ||
343 | dss_init_hdmi_ip_ops(&hdmi.ip_data, omapdss_get_version()); | 366 | dss_init_hdmi_ip_ops(&hdmi.ip_data, omapdss_get_version()); |
344 | 367 | ||
345 | if (hdmi.vdda_hdmi_dac_reg == NULL) { | 368 | r = hdmi_init_regulator(); |
346 | struct regulator *reg; | 369 | if (r) |
347 | 370 | return r; | |
348 | reg = devm_regulator_get(&hdmi.pdev->dev, "vdda_hdmi_dac"); | ||
349 | |||
350 | /* DT HACK: try VDAC to make omapdss work for o4 sdp/panda */ | ||
351 | if (IS_ERR(reg)) | ||
352 | reg = devm_regulator_get(&hdmi.pdev->dev, "VDAC"); | ||
353 | |||
354 | if (IS_ERR(reg)) { | ||
355 | DSSERR("can't get VDDA_HDMI_DAC regulator\n"); | ||
356 | return PTR_ERR(reg); | ||
357 | } | ||
358 | |||
359 | hdmi.vdda_hdmi_dac_reg = reg; | ||
360 | } | ||
361 | 371 | ||
362 | r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); | 372 | r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); |
363 | if (r) | 373 | if (r) |