diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-02-22 15:53:46 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-03-11 15:46:23 +0200 |
commit | 5f42f2ce63f5ecbd9bc744b9c25d9786e9a8e3b4 (patch) | |
tree | 8ed7158d7e8b39cb184ade1bed6794963f44b9fc /drivers/video/omap2/dss/dpi.c | |
parent | ac425ed5fb0b6564d4eeee9fb13ef0c1f6da8e8f (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/dpi.c')
-rw-r--r-- | drivers/video/omap2/dss/dpi.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 746f1b6dd89..026702b921e 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c @@ -303,22 +303,27 @@ int dpi_init_display(struct omap_dss_device *dssdev) { DSSDBG("init_display\n"); - return 0; -} + if (cpu_is_omap34xx() && dpi.vdds_dsi_reg == NULL) { + struct regulator *vdds_dsi; -int dpi_init(struct platform_device *pdev) -{ - if (cpu_is_omap34xx()) { - dpi.vdds_dsi_reg = dss_get_vdds_dsi(); - if (IS_ERR(dpi.vdds_dsi_reg)) { + vdds_dsi = dss_get_vdds_dsi(); + + if (IS_ERR(vdds_dsi)) { DSSERR("can't get VDDS_DSI regulator\n"); - return PTR_ERR(dpi.vdds_dsi_reg); + return PTR_ERR(vdds_dsi); } + + dpi.vdds_dsi_reg = vdds_dsi; } return 0; } +int dpi_init(struct platform_device *pdev) +{ + return 0; +} + void dpi_exit(void) { } |