diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-01-12 08:12:07 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-02-24 07:31:28 -0500 |
commit | 37ac60e414052f1d9301368437db8f0cb9e323fe (patch) | |
tree | d6b30b58deae82a6d5f2ac2f4d9cf18ed3bc57da /drivers/video/omap2/dss/sdi.c | |
parent | 18946f62c6cc8cf051bafca8b7fa72309e8a1067 (diff) |
OMAP: DSS2: move enable/disable/suspend/resume
Move enable/disable/suspend/resume from omap_dss_device to
omap_dss_driver.
This is part of a larger patch-set, which moves the control from omapdss
driver to the display driver.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video/omap2/dss/sdi.c')
-rw-r--r-- | drivers/video/omap2/dss/sdi.c | 75 |
1 files changed, 4 insertions, 71 deletions
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index 6bd9b0cf76a8..929ceb3ddd9d 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c | |||
@@ -41,7 +41,7 @@ static void sdi_basic_init(void) | |||
41 | dispc_lcd_enable_signal_polarity(1); | 41 | dispc_lcd_enable_signal_polarity(1); |
42 | } | 42 | } |
43 | 43 | ||
44 | static int sdi_display_enable(struct omap_dss_device *dssdev) | 44 | int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) |
45 | { | 45 | { |
46 | struct omap_video_timings *t = &dssdev->panel.timings; | 46 | struct omap_video_timings *t = &dssdev->panel.timings; |
47 | struct dss_clock_info dss_cinfo; | 47 | struct dss_clock_info dss_cinfo; |
@@ -57,12 +57,6 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) | |||
57 | goto err0; | 57 | goto err0; |
58 | } | 58 | } |
59 | 59 | ||
60 | if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) { | ||
61 | DSSERR("dssdev already enabled\n"); | ||
62 | r = -EINVAL; | ||
63 | goto err1; | ||
64 | } | ||
65 | |||
66 | /* In case of skip_init sdi_init has already enabled the clocks */ | 60 | /* In case of skip_init sdi_init has already enabled the clocks */ |
67 | if (!sdi.skip_init) | 61 | if (!sdi.skip_init) |
68 | dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); | 62 | dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); |
@@ -127,8 +121,6 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) | |||
127 | goto err3; | 121 | goto err3; |
128 | } | 122 | } |
129 | 123 | ||
130 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | ||
131 | |||
132 | sdi.skip_init = 0; | 124 | sdi.skip_init = 0; |
133 | 125 | ||
134 | return 0; | 126 | return 0; |
@@ -141,18 +133,10 @@ err1: | |||
141 | err0: | 133 | err0: |
142 | return r; | 134 | return r; |
143 | } | 135 | } |
136 | EXPORT_SYMBOL(omapdss_sdi_display_enable); | ||
144 | 137 | ||
145 | static int sdi_display_resume(struct omap_dss_device *dssdev); | 138 | void omapdss_sdi_display_disable(struct omap_dss_device *dssdev) |
146 | |||
147 | static void sdi_display_disable(struct omap_dss_device *dssdev) | ||
148 | { | 139 | { |
149 | if (dssdev->state == OMAP_DSS_DISPLAY_DISABLED) | ||
150 | return; | ||
151 | |||
152 | if (dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED) | ||
153 | if (sdi_display_resume(dssdev)) | ||
154 | return; | ||
155 | |||
156 | if (dssdev->driver->disable) | 140 | if (dssdev->driver->disable) |
157 | dssdev->driver->disable(dssdev); | 141 | dssdev->driver->disable(dssdev); |
158 | 142 | ||
@@ -162,56 +146,9 @@ static void sdi_display_disable(struct omap_dss_device *dssdev) | |||
162 | 146 | ||
163 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); | 147 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); |
164 | 148 | ||
165 | dssdev->state = OMAP_DSS_DISPLAY_DISABLED; | ||
166 | |||
167 | omap_dss_stop_device(dssdev); | 149 | omap_dss_stop_device(dssdev); |
168 | } | 150 | } |
169 | 151 | EXPORT_SYMBOL(omapdss_sdi_display_disable); | |
170 | static int sdi_display_suspend(struct omap_dss_device *dssdev) | ||
171 | { | ||
172 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | ||
173 | return -EINVAL; | ||
174 | |||
175 | if (dssdev->driver->suspend) | ||
176 | dssdev->driver->suspend(dssdev); | ||
177 | |||
178 | dssdev->manager->disable(dssdev->manager); | ||
179 | |||
180 | dss_sdi_disable(); | ||
181 | |||
182 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); | ||
183 | |||
184 | dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; | ||
185 | |||
186 | return 0; | ||
187 | } | ||
188 | |||
189 | static int sdi_display_resume(struct omap_dss_device *dssdev) | ||
190 | { | ||
191 | int r; | ||
192 | |||
193 | if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED) | ||
194 | return -EINVAL; | ||
195 | |||
196 | dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); | ||
197 | |||
198 | r = dss_sdi_enable(); | ||
199 | if (r) | ||
200 | goto err; | ||
201 | mdelay(2); | ||
202 | |||
203 | dssdev->manager->enable(dssdev->manager); | ||
204 | |||
205 | if (dssdev->driver->resume) | ||
206 | dssdev->driver->resume(dssdev); | ||
207 | |||
208 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | ||
209 | |||
210 | return 0; | ||
211 | err: | ||
212 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); | ||
213 | return r; | ||
214 | } | ||
215 | 152 | ||
216 | static void sdi_get_timings(struct omap_dss_device *dssdev, | 153 | static void sdi_get_timings(struct omap_dss_device *dssdev, |
217 | struct omap_video_timings *timings) | 154 | struct omap_video_timings *timings) |
@@ -223,10 +160,6 @@ int sdi_init_display(struct omap_dss_device *dssdev) | |||
223 | { | 160 | { |
224 | DSSDBG("SDI init\n"); | 161 | DSSDBG("SDI init\n"); |
225 | 162 | ||
226 | dssdev->enable = sdi_display_enable; | ||
227 | dssdev->disable = sdi_display_disable; | ||
228 | dssdev->suspend = sdi_display_suspend; | ||
229 | dssdev->resume = sdi_display_resume; | ||
230 | dssdev->get_timings = sdi_get_timings; | 163 | dssdev->get_timings = sdi_get_timings; |
231 | 164 | ||
232 | return 0; | 165 | return 0; |