aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-09-07 08:23:38 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-26 07:58:33 -0400
commit5d512fcdf6dc27ea34734fbdcab812d207b89ebb (patch)
tree3ef5afc1bb9a87a6fe9c73a0e97c763f096fded0 /drivers
parent3224827630f1823c1181e562af9d36951f6cbd11 (diff)
OMAPDSS: DPI: Replace dssdev->manager with dssdev->output->manager references
With addition of output entities, a device connects to an output, and an output connects to overlay manager. Replace the dssdev->manager references with dssdev->output->manager to access the manager correctly. When enabling the DPI output, check whether the output entity connected to display is not NULL. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/dss/dpi.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index ee1fa1e1a015..d73a549050e4 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -128,6 +128,7 @@ static int dpi_set_dispc_clk(struct omap_dss_device *dssdev,
128static int dpi_set_mode(struct omap_dss_device *dssdev) 128static int dpi_set_mode(struct omap_dss_device *dssdev)
129{ 129{
130 struct omap_video_timings *t = &dpi.timings; 130 struct omap_video_timings *t = &dpi.timings;
131 struct omap_overlay_manager *mgr = dssdev->output->manager;
131 int lck_div = 0, pck_div = 0; 132 int lck_div = 0, pck_div = 0;
132 unsigned long fck = 0; 133 unsigned long fck = 0;
133 unsigned long pck; 134 unsigned long pck;
@@ -152,13 +153,15 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
152 t->pixel_clock = pck; 153 t->pixel_clock = pck;
153 } 154 }
154 155
155 dss_mgr_set_timings(dssdev->manager, t); 156 dss_mgr_set_timings(mgr, t);
156 157
157 return 0; 158 return 0;
158} 159}
159 160
160static void dpi_config_lcd_manager(struct omap_dss_device *dssdev) 161static void dpi_config_lcd_manager(struct omap_dss_device *dssdev)
161{ 162{
163 struct omap_overlay_manager *mgr = dssdev->output->manager;
164
162 dpi.mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS; 165 dpi.mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;
163 166
164 dpi.mgr_config.stallmode = false; 167 dpi.mgr_config.stallmode = false;
@@ -168,11 +171,12 @@ static void dpi_config_lcd_manager(struct omap_dss_device *dssdev)
168 171
169 dpi.mgr_config.lcden_sig_polarity = 0; 172 dpi.mgr_config.lcden_sig_polarity = 0;
170 173
171 dss_mgr_set_lcd_config(dssdev->manager, &dpi.mgr_config); 174 dss_mgr_set_lcd_config(mgr, &dpi.mgr_config);
172} 175}
173 176
174int omapdss_dpi_display_enable(struct omap_dss_device *dssdev) 177int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
175{ 178{
179 struct omap_dss_output *out = dssdev->output;
176 int r; 180 int r;
177 181
178 mutex_lock(&dpi.lock); 182 mutex_lock(&dpi.lock);
@@ -183,10 +187,10 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
183 goto err_no_reg; 187 goto err_no_reg;
184 } 188 }
185 189
186 if (dssdev->manager == NULL) { 190 if (out == NULL || out->manager == NULL) {
187 DSSERR("failed to enable display: no manager\n"); 191 DSSERR("failed to enable display: no output/manager\n");
188 r = -ENODEV; 192 r = -ENODEV;
189 goto err_no_mgr; 193 goto err_no_out_mgr;
190 } 194 }
191 195
192 r = omap_dss_start_device(dssdev); 196 r = omap_dss_start_device(dssdev);
@@ -227,7 +231,7 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
227 231
228 mdelay(2); 232 mdelay(2);
229 233
230 r = dss_mgr_enable(dssdev->manager); 234 r = dss_mgr_enable(out->manager);
231 if (r) 235 if (r)
232 goto err_mgr_enable; 236 goto err_mgr_enable;
233 237
@@ -251,7 +255,7 @@ err_get_dispc:
251err_reg_enable: 255err_reg_enable:
252 omap_dss_stop_device(dssdev); 256 omap_dss_stop_device(dssdev);
253err_start_dev: 257err_start_dev:
254err_no_mgr: 258err_no_out_mgr:
255err_no_reg: 259err_no_reg:
256 mutex_unlock(&dpi.lock); 260 mutex_unlock(&dpi.lock);
257 return r; 261 return r;
@@ -260,9 +264,11 @@ EXPORT_SYMBOL(omapdss_dpi_display_enable);
260 264
261void omapdss_dpi_display_disable(struct omap_dss_device *dssdev) 265void omapdss_dpi_display_disable(struct omap_dss_device *dssdev)
262{ 266{
267 struct omap_overlay_manager *mgr = dssdev->output->manager;
268
263 mutex_lock(&dpi.lock); 269 mutex_lock(&dpi.lock);
264 270
265 dss_mgr_disable(dssdev->manager); 271 dss_mgr_disable(mgr);
266 272
267 if (dpi_use_dsi_pll(dssdev)) { 273 if (dpi_use_dsi_pll(dssdev)) {
268 dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); 274 dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK);
@@ -298,12 +304,13 @@ int dpi_check_timings(struct omap_dss_device *dssdev,
298 struct omap_video_timings *timings) 304 struct omap_video_timings *timings)
299{ 305{
300 int r; 306 int r;
307 struct omap_overlay_manager *mgr = dssdev->output->manager;
301 int lck_div, pck_div; 308 int lck_div, pck_div;
302 unsigned long fck; 309 unsigned long fck;
303 unsigned long pck; 310 unsigned long pck;
304 struct dispc_clock_info dispc_cinfo; 311 struct dispc_clock_info dispc_cinfo;
305 312
306 if (dss_mgr_check_timings(dssdev->manager, timings)) 313 if (dss_mgr_check_timings(mgr, timings))
307 return -EINVAL; 314 return -EINVAL;
308 315
309 if (timings->pixel_clock == 0) 316 if (timings->pixel_clock == 0)