aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/omap2/dss/venc.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-02-22 15:53:46 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-03-11 15:46:23 +0200
commit5f42f2ce63f5ecbd9bc744b9c25d9786e9a8e3b4 (patch)
tree8ed7158d7e8b39cb184ade1bed6794963f44b9fc /drivers/video/omap2/dss/venc.c
parentac425ed5fb0b6564d4eeee9fb13ef0c1f6da8e8f (diff)
OMAP: DSS2: Delay regulator_get() calls
DSS submodules DPI/SDI/DSI/VENC require a regulator to function. However, if the board doesn't use, say, SDI, the board shouldn't need to configure vdds_sdi regulator required by the SDI module. Currently the regulators are acquired when the DSS driver is loaded. This means that if the kernel is configured with SDI, vdds_sdi regulator is needed for all boards. This patch changes the DSS driver to acquire the regulators only when a display of particular type is initialized. For example, vdds_sdi is acquired when sdi_init_display() is called. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/venc.c')
-rw-r--r--drivers/video/omap2/dss/venc.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 1aadceb76e1d..43009e57cd3e 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -305,17 +305,6 @@ static inline u32 venc_read_reg(int idx)
return l;
}
-static struct regulator *venc_get_vdda_dac(void)
-{
- struct regulator *reg;
-
- reg = regulator_get(&venc.pdev->dev, "vdda_dac");
- if (!IS_ERR(reg))
- venc.vdda_dac_reg = reg;
-
- return reg;
-}
-
static void venc_write_config(const struct venc_config *config)
{
DSSDBG("write venc conf\n");
@@ -655,6 +644,19 @@ int venc_init_display(struct omap_dss_device *dssdev)
{
DSSDBG("init_display\n");
+ if (venc.vdda_dac_reg == NULL) {
+ struct regulator *vdda_dac;
+
+ vdda_dac = regulator_get(&venc.pdev->dev, "vdda_dac");
+
+ if (IS_ERR(vdda_dac)) {
+ DSSERR("can't get VDDA_DAC regulator\n");
+ return PTR_ERR(vdda_dac);
+ }
+
+ venc.vdda_dac_reg = vdda_dac;
+ }
+
return 0;
}
@@ -734,13 +736,6 @@ static int omap_venchw_probe(struct platform_device *pdev)
return -ENOMEM;
}
- venc.vdda_dac_reg = venc_get_vdda_dac();
- if (IS_ERR(venc.vdda_dac_reg)) {
- iounmap(venc.base);
- DSSERR("can't get VDDA_DAC regulator\n");
- return PTR_ERR(venc.vdda_dac_reg);
- }
-
venc_enable_clocks(1);
rev_id = (u8)(venc_read_reg(VENC_REV_ID) & 0xff);