diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-08-15 08:55:04 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-07 13:02:04 -0400 |
commit | 174869435eaaf2bf253b6958331dbce632c3023b (patch) | |
tree | 5984b1180ff0b4f3da58e888fa26f890a29863c9 /drivers | |
parent | 8a3d895bfe409f3cae398c0788e8639260c81754 (diff) |
OMAPDSS: HDMI: use vdda_hdmi_dac
The HDMI driver requires vdda_hdmi_dac power for operation, but does not
enable it. This has worked because the regulator has been always
enabled.
But this may not always be the case, as I encountered when implementing
HDMI device tree support.
This patch changes the HDMI driver to use the vdda_hdmi_dac.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 96a6e298873b..ccfc677c910a 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/pm_runtime.h> | 33 | #include <linux/pm_runtime.h> |
34 | #include <linux/clk.h> | 34 | #include <linux/clk.h> |
35 | #include <linux/gpio.h> | 35 | #include <linux/gpio.h> |
36 | #include <linux/regulator/consumer.h> | ||
36 | #include <video/omapdss.h> | 37 | #include <video/omapdss.h> |
37 | 38 | ||
38 | #include "ti_hdmi.h" | 39 | #include "ti_hdmi.h" |
@@ -62,6 +63,7 @@ static struct { | |||
62 | struct hdmi_ip_data ip_data; | 63 | struct hdmi_ip_data ip_data; |
63 | 64 | ||
64 | struct clk *sys_clk; | 65 | struct clk *sys_clk; |
66 | struct regulator *vdda_hdmi_dac_reg; | ||
65 | 67 | ||
66 | int ct_cp_hpd_gpio; | 68 | int ct_cp_hpd_gpio; |
67 | int ls_oe_gpio; | 69 | int ls_oe_gpio; |
@@ -331,6 +333,19 @@ static int __init hdmi_init_display(struct omap_dss_device *dssdev) | |||
331 | 333 | ||
332 | dss_init_hdmi_ip_ops(&hdmi.ip_data); | 334 | dss_init_hdmi_ip_ops(&hdmi.ip_data); |
333 | 335 | ||
336 | if (hdmi.vdda_hdmi_dac_reg == NULL) { | ||
337 | struct regulator *reg; | ||
338 | |||
339 | reg = devm_regulator_get(&hdmi.pdev->dev, "vdda_hdmi_dac"); | ||
340 | |||
341 | if (IS_ERR(reg)) { | ||
342 | DSSERR("can't get VDDA_HDMI_DAC regulator\n"); | ||
343 | return PTR_ERR(reg); | ||
344 | } | ||
345 | |||
346 | hdmi.vdda_hdmi_dac_reg = reg; | ||
347 | } | ||
348 | |||
334 | r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); | 349 | r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); |
335 | if (r) | 350 | if (r) |
336 | return r; | 351 | return r; |
@@ -495,6 +510,10 @@ static int hdmi_power_on(struct omap_dss_device *dssdev) | |||
495 | /* wait 300us after CT_CP_HPD for the 5V power output to reach 90% */ | 510 | /* wait 300us after CT_CP_HPD for the 5V power output to reach 90% */ |
496 | udelay(300); | 511 | udelay(300); |
497 | 512 | ||
513 | r = regulator_enable(hdmi.vdda_hdmi_dac_reg); | ||
514 | if (r) | ||
515 | goto err_vdac_enable; | ||
516 | |||
498 | r = hdmi_runtime_get(); | 517 | r = hdmi_runtime_get(); |
499 | if (r) | 518 | if (r) |
500 | goto err_runtime_get; | 519 | goto err_runtime_get; |
@@ -562,6 +581,8 @@ err_phy_enable: | |||
562 | err_pll_enable: | 581 | err_pll_enable: |
563 | hdmi_runtime_put(); | 582 | hdmi_runtime_put(); |
564 | err_runtime_get: | 583 | err_runtime_get: |
584 | regulator_disable(hdmi.vdda_hdmi_dac_reg); | ||
585 | err_vdac_enable: | ||
565 | gpio_set_value(hdmi.ct_cp_hpd_gpio, 0); | 586 | gpio_set_value(hdmi.ct_cp_hpd_gpio, 0); |
566 | gpio_set_value(hdmi.ls_oe_gpio, 0); | 587 | gpio_set_value(hdmi.ls_oe_gpio, 0); |
567 | return -EIO; | 588 | return -EIO; |
@@ -576,6 +597,8 @@ static void hdmi_power_off(struct omap_dss_device *dssdev) | |||
576 | hdmi.ip_data.ops->pll_disable(&hdmi.ip_data); | 597 | hdmi.ip_data.ops->pll_disable(&hdmi.ip_data); |
577 | hdmi_runtime_put(); | 598 | hdmi_runtime_put(); |
578 | 599 | ||
600 | regulator_disable(hdmi.vdda_hdmi_dac_reg); | ||
601 | |||
579 | gpio_set_value(hdmi.ct_cp_hpd_gpio, 0); | 602 | gpio_set_value(hdmi.ct_cp_hpd_gpio, 0); |
580 | gpio_set_value(hdmi.ls_oe_gpio, 0); | 603 | gpio_set_value(hdmi.ls_oe_gpio, 0); |
581 | } | 604 | } |