[PATCH] DSS2: DISPC: extend fields in DISPC_TIMING_H and DISPC_TIMING_V

15 views
Skip to first unread message

Matthieu Poullet

unread,
Mar 4, 2009, 5:57:11 PM3/4/09
to beagl...@googlegroups.com, tomi.va...@nokia.com, Matthieu Poullet
These timing registers have been extended on OMAP3 ES3.0

Signed-off-by: Matthieu Poullet <matthieu...@gmail.com>
---
drivers/video/omap2/dss/dispc.c | 35 +++++++++++++++++++++++++----------
1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 4994027..65d78e5 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1589,19 +1589,34 @@ static void _dispc_set_lcd_timings(int hsw, int hfp, int hbp,
{
u32 timing_h, timing_v;

- BUG_ON(hsw < 1 || hsw > 64);
- BUG_ON(hfp < 1 || hfp > 256);
- BUG_ON(hbp < 1 || hbp > 256);
+ if (omap_rev() < OMAP3430_REV_ES3_0) {
+ BUG_ON(hsw < 1 || hsw > 64);
+ BUG_ON(hfp < 1 || hfp > 256);
+ BUG_ON(hbp < 1 || hbp > 256);
+
+ BUG_ON(vsw < 1 || vsw > 64);
+ BUG_ON(vfp < 0 || vfp > 255);
+ BUG_ON(vbp < 0 || vbp > 255);
+
+ timing_h = FLD_VAL(hsw-1, 5, 0) | FLD_VAL(hfp-1, 15, 8) |
+ FLD_VAL(hbp-1, 27, 20);
+ timing_v = FLD_VAL(vsw-1, 5, 0) | FLD_VAL(vfp, 15, 8) |
+ FLD_VAL(vbp, 27, 20);
+ } else {
+ BUG_ON(hsw < 1 || hsw > 256);
+ BUG_ON(hfp < 1 || hfp > 4096);
+ BUG_ON(hbp < 1 || hbp > 4096);

- BUG_ON(vsw < 1 || vsw > 64);
- BUG_ON(vfp < 0 || vfp > 255);
- BUG_ON(vbp < 0 || vbp > 255);
+ BUG_ON(vsw < 1 || vsw > 256);
+ BUG_ON(vfp < 0 || vfp > 4096);
+ BUG_ON(vbp < 0 || vbp > 4096);

- timing_h = FLD_VAL(hsw-1, 5, 0) | FLD_VAL(hfp-1, 15, 8) |
- FLD_VAL(hbp-1, 27, 20);
+ timing_h = FLD_VAL(hsw-1, 7, 0) | FLD_VAL(hfp-1, 19, 8) |
+ FLD_VAL(hbp-1, 31, 20);

- timing_v = FLD_VAL(vsw-1, 5, 0) | FLD_VAL(vfp, 15, 8) |
- FLD_VAL(vbp, 27, 20);
+ timing_v = FLD_VAL(vsw-1, 7, 0) | FLD_VAL(vfp, 19, 8) |
+ FLD_VAL(vbp, 31, 20);
+ }

enable_clocks(1);
dispc_write_reg(DISPC_TIMING_H, timing_h);
--
1.5.6.3

Reply all
Reply to author
Forward
0 new messages