aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-03-05 09:29:36 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-03 08:19:17 -0400
commit478d7df8af89f449bacc4e67ff35dc630400c0ca (patch)
tree5184c805b789e956eb34919bfdb07e4a8603b921
parent99322577e80da240cebc087da9ea328bb0960be1 (diff)
OMAPDSS: DSI: add enum omap_dss_dsi_trans_mode
Instead of managing DSI sync ends with booleans, add an enum for the DSI transfer mode. This is much cleaner way to handle the DSI syncs. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/dsi.c15
-rw-r--r--include/video/omapdss.h13
2 files changed, 20 insertions, 8 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 590da06e6a82..e8f5bdb2796c 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3813,18 +3813,22 @@ static void dsi_config_vp_num_line_buffers(struct platform_device *dsidev)
3813static void dsi_config_vp_sync_events(struct platform_device *dsidev) 3813static void dsi_config_vp_sync_events(struct platform_device *dsidev)
3814{ 3814{
3815 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 3815 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
3816 bool vsync_end = dsi->vm_timings.vp_vsync_end; 3816 bool sync_end;
3817 bool hsync_end = dsi->vm_timings.vp_hsync_end;
3818 u32 r; 3817 u32 r;
3819 3818
3819 if (dsi->vm_timings.trans_mode == OMAP_DSS_DSI_PULSE_MODE)
3820 sync_end = true;
3821 else
3822 sync_end = false;
3823
3820 r = dsi_read_reg(dsidev, DSI_CTRL); 3824 r = dsi_read_reg(dsidev, DSI_CTRL);
3821 r = FLD_MOD(r, 1, 9, 9); /* VP_DE_POL */ 3825 r = FLD_MOD(r, 1, 9, 9); /* VP_DE_POL */
3822 r = FLD_MOD(r, 1, 10, 10); /* VP_HSYNC_POL */ 3826 r = FLD_MOD(r, 1, 10, 10); /* VP_HSYNC_POL */
3823 r = FLD_MOD(r, 1, 11, 11); /* VP_VSYNC_POL */ 3827 r = FLD_MOD(r, 1, 11, 11); /* VP_VSYNC_POL */
3824 r = FLD_MOD(r, 1, 15, 15); /* VP_VSYNC_START */ 3828 r = FLD_MOD(r, 1, 15, 15); /* VP_VSYNC_START */
3825 r = FLD_MOD(r, vsync_end, 16, 16); /* VP_VSYNC_END */ 3829 r = FLD_MOD(r, sync_end, 16, 16); /* VP_VSYNC_END */
3826 r = FLD_MOD(r, 1, 17, 17); /* VP_HSYNC_START */ 3830 r = FLD_MOD(r, 1, 17, 17); /* VP_HSYNC_START */
3827 r = FLD_MOD(r, hsync_end, 18, 18); /* VP_HSYNC_END */ 3831 r = FLD_MOD(r, sync_end, 18, 18); /* VP_HSYNC_END */
3828 dsi_write_reg(dsidev, DSI_CTRL, r); 3832 dsi_write_reg(dsidev, DSI_CTRL, r);
3829} 3833}
3830 3834
@@ -4171,11 +4175,12 @@ static void dsi_proto_timings(struct platform_device *dsidev)
4171 int vfp = dsi->vm_timings.vfp; 4175 int vfp = dsi->vm_timings.vfp;
4172 int vbp = dsi->vm_timings.vbp; 4176 int vbp = dsi->vm_timings.vbp;
4173 int window_sync = dsi->vm_timings.window_sync; 4177 int window_sync = dsi->vm_timings.window_sync;
4174 bool hsync_end = dsi->vm_timings.vp_hsync_end; 4178 bool hsync_end;
4175 struct omap_video_timings *timings = &dsi->timings; 4179 struct omap_video_timings *timings = &dsi->timings;
4176 int bpp = dsi_get_pixel_size(dsi->pix_fmt); 4180 int bpp = dsi_get_pixel_size(dsi->pix_fmt);
4177 int tl, t_he, width_bytes; 4181 int tl, t_he, width_bytes;
4178 4182
4183 hsync_end = dsi->vm_timings.trans_mode == OMAP_DSS_DSI_PULSE_MODE;
4179 t_he = hsync_end ? 4184 t_he = hsync_end ?
4180 ((hsa == 0 && ndl == 3) ? 1 : DIV_ROUND_UP(4, ndl)) : 0; 4185 ((hsa == 0 && ndl == 3) ? 1 : DIV_ROUND_UP(4, ndl)) : 0;
4181 4186
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 4dd4cea41bd4..7f774c5f8b6b 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -257,6 +257,15 @@ void rfbi_bus_unlock(void);
257 257
258/* DSI */ 258/* DSI */
259 259
260enum omap_dss_dsi_trans_mode {
261 /* Sync Pulses: both sync start and end packets sent */
262 OMAP_DSS_DSI_PULSE_MODE,
263 /* Sync Events: only sync start packets sent */
264 OMAP_DSS_DSI_EVENT_MODE,
265 /* Burst: only sync start packets sent, pixels are time compressed */
266 OMAP_DSS_DSI_BURST_MODE,
267};
268
260struct omap_dss_dsi_videomode_timings { 269struct omap_dss_dsi_videomode_timings {
261 /* DSI video mode blanking data */ 270 /* DSI video mode blanking data */
262 /* Unit: byte clock cycles */ 271 /* Unit: byte clock cycles */
@@ -274,9 +283,7 @@ struct omap_dss_dsi_videomode_timings {
274 int hbp_blanking_mode; 283 int hbp_blanking_mode;
275 int hfp_blanking_mode; 284 int hfp_blanking_mode;
276 285
277 /* Video port sync events */ 286 enum omap_dss_dsi_trans_mode trans_mode;
278 bool vp_vsync_end;
279 bool vp_hsync_end;
280 287
281 bool ddr_clk_always_on; 288 bool ddr_clk_always_on;
282 int window_sync; 289 int window_sync;