diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-02-22 08:53:46 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-03-11 08:46:23 -0500 |
commit | 5f42f2ce63f5ecbd9bc744b9c25d9786e9a8e3b4 (patch) | |
tree | 8ed7158d7e8b39cb184ade1bed6794963f44b9fc /drivers/video/omap2/dss/sdi.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/sdi.c')
-rw-r--r-- | drivers/video/omap2/dss/sdi.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index 8272fc1f3279..9f10a0d9e760 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c | |||
@@ -157,6 +157,19 @@ int sdi_init_display(struct omap_dss_device *dssdev) | |||
157 | { | 157 | { |
158 | DSSDBG("SDI init\n"); | 158 | DSSDBG("SDI init\n"); |
159 | 159 | ||
160 | if (sdi.vdds_sdi_reg == NULL) { | ||
161 | struct regulator *vdds_sdi; | ||
162 | |||
163 | vdds_sdi = dss_get_vdds_sdi(); | ||
164 | |||
165 | if (IS_ERR(vdds_sdi)) { | ||
166 | DSSERR("can't get VDDS_SDI regulator\n"); | ||
167 | return PTR_ERR(vdds_sdi); | ||
168 | } | ||
169 | |||
170 | sdi.vdds_sdi_reg = vdds_sdi; | ||
171 | } | ||
172 | |||
160 | return 0; | 173 | return 0; |
161 | } | 174 | } |
162 | 175 | ||
@@ -165,11 +178,6 @@ int sdi_init(bool skip_init) | |||
165 | /* we store this for first display enable, then clear it */ | 178 | /* we store this for first display enable, then clear it */ |
166 | sdi.skip_init = skip_init; | 179 | sdi.skip_init = skip_init; |
167 | 180 | ||
168 | sdi.vdds_sdi_reg = dss_get_vdds_sdi(); | ||
169 | if (IS_ERR(sdi.vdds_sdi_reg)) { | ||
170 | DSSERR("can't get VDDS_SDI regulator\n"); | ||
171 | return PTR_ERR(sdi.vdds_sdi_reg); | ||
172 | } | ||
173 | /* | 181 | /* |
174 | * Enable clocks already here, otherwise there would be a toggle | 182 | * Enable clocks already here, otherwise there would be a toggle |
175 | * of them until sdi_display_enable is called. | 183 | * of them until sdi_display_enable is called. |