diff options
author | Roger Quadros <roger.quadros@nokia.com> | 2010-03-17 08:35:21 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-05-18 07:14:29 -0400 |
commit | 508886cf98c81cee73cd75943b3d0039801327ab (patch) | |
tree | 66c9a651c352e633f0c5521133b0444e2711c5af | |
parent | b1d145b6d3c07cb9ccb6afb224c78a9d61f8cd17 (diff) |
OMAP: DSS2: Use vdds_sdi regulator supply in SDI
This patch enables the use of vdds_sdi regulator in SDI subsystem.
We can disable the vdds_sdi voltage when not in use to save
power.
Signed-off-by: Roger Quadros <roger.quadros@nokia.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
-rw-r--r-- | drivers/video/omap2/dss/sdi.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index 3de3c1e559aa..ee07a3cc22ef 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c | |||
@@ -23,13 +23,16 @@ | |||
23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
26 | #include <linux/regulator/consumer.h> | ||
26 | 27 | ||
27 | #include <plat/display.h> | 28 | #include <plat/display.h> |
29 | #include <plat/cpu.h> | ||
28 | #include "dss.h" | 30 | #include "dss.h" |
29 | 31 | ||
30 | static struct { | 32 | static struct { |
31 | bool skip_init; | 33 | bool skip_init; |
32 | bool update_enabled; | 34 | bool update_enabled; |
35 | struct regulator *vdds_sdi_reg; | ||
33 | } sdi; | 36 | } sdi; |
34 | 37 | ||
35 | static void sdi_basic_init(void) | 38 | static void sdi_basic_init(void) |
@@ -57,6 +60,10 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
57 | goto err0; | 60 | goto err0; |
58 | } | 61 | } |
59 | 62 | ||
63 | r = regulator_enable(sdi.vdds_sdi_reg); | ||
64 | if (r) | ||
65 | goto err1; | ||
66 | |||
60 | /* In case of skip_init sdi_init has already enabled the clocks */ | 67 | /* In case of skip_init sdi_init has already enabled the clocks */ |
61 | if (!sdi.skip_init) | 68 | if (!sdi.skip_init) |
62 | dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); | 69 | dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); |
@@ -120,6 +127,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
120 | return 0; | 127 | return 0; |
121 | err2: | 128 | err2: |
122 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); | 129 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); |
130 | regulator_disable(sdi.vdds_sdi_reg); | ||
123 | err1: | 131 | err1: |
124 | omap_dss_stop_device(dssdev); | 132 | omap_dss_stop_device(dssdev); |
125 | err0: | 133 | err0: |
@@ -135,6 +143,8 @@ void omapdss_sdi_display_disable(struct omap_dss_device *dssdev) | |||
135 | 143 | ||
136 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); | 144 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); |
137 | 145 | ||
146 | regulator_disable(sdi.vdds_sdi_reg); | ||
147 | |||
138 | omap_dss_stop_device(dssdev); | 148 | omap_dss_stop_device(dssdev); |
139 | } | 149 | } |
140 | EXPORT_SYMBOL(omapdss_sdi_display_disable); | 150 | EXPORT_SYMBOL(omapdss_sdi_display_disable); |
@@ -151,6 +161,11 @@ int sdi_init(bool skip_init) | |||
151 | /* we store this for first display enable, then clear it */ | 161 | /* we store this for first display enable, then clear it */ |
152 | sdi.skip_init = skip_init; | 162 | sdi.skip_init = skip_init; |
153 | 163 | ||
164 | sdi.vdds_sdi_reg = dss_get_vdds_sdi(); | ||
165 | if (IS_ERR(sdi.vdds_sdi_reg)) { | ||
166 | DSSERR("can't get VDDS_SDI regulator\n"); | ||
167 | return PTR_ERR(sdi.vdds_sdi_reg); | ||
168 | } | ||
154 | /* | 169 | /* |
155 | * Enable clocks already here, otherwise there would be a toggle | 170 | * Enable clocks already here, otherwise there would be a toggle |
156 | * of them until sdi_display_enable is called. | 171 | * of them until sdi_display_enable is called. |