summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Gusakov <andrey.gusakov@cogentembedded.com>2017-07-05 20:18:13 +0300
committerLucas Stach <l.stach@pengutronix.de>2017-07-06 14:43:17 +0200
commit8c692e0726c316becd8a3e1de078bdeda7a00698 (patch)
tree5ef1d8829ae131835b330c4cf2425b8f1b2764bb
parent54d0c16a4f0b126f65ad77dcfce666feb29410ff (diff)
downloadbarebox-8c692e0726c316becd8a3e1de078bdeda7a00698.tar.gz
barebox-8c692e0726c316becd8a3e1de078bdeda7a00698.tar.xz
video: tc358767: accept any hsync and vsync polatiry
Do not fix modes. Instead set any sync polarity passed through VPL_PREPARE and fb_videomode. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
-rw-r--r--drivers/video/tc358767.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/video/tc358767.c b/drivers/video/tc358767.c
index 0ef9e642d6..619f259ff4 100644
--- a/drivers/video/tc358767.c
+++ b/drivers/video/tc358767.c
@@ -725,6 +725,7 @@ err_dpcd_inval:
static int tc_set_video_mode(struct tc_data *tc, struct fb_videomode *mode)
{
int ret;
+ u32 reg;
int htotal;
int vtotal;
int vid_sync_dly;
@@ -785,8 +786,12 @@ static int tc_set_video_mode(struct tc_data *tc, struct fb_videomode *mode)
tc_write(DP0_SYNCVAL, (mode->vsync_len << 16) | (mode->hsync_len << 0));
- tc_write(DPIPXLFMT, VS_POL_ACTIVE_LOW | HS_POL_ACTIVE_LOW |
- DE_POL_ACTIVE_HIGH | SUB_CFG_TYPE_CONFIG1 | DPI_BPP_RGB888);
+ reg = DE_POL_ACTIVE_HIGH | SUB_CFG_TYPE_CONFIG1 | DPI_BPP_RGB888;
+ if (!(mode->sync & FB_SYNC_VERT_HIGH_ACT))
+ reg |= VS_POL_ACTIVE_LOW;
+ if (!(mode->sync & FB_SYNC_HOR_HIGH_ACT))
+ reg |= HS_POL_ACTIVE_LOW;
+ tc_write(DPIPXLFMT, reg);
/*
* Recommended maximum number of symbols transferred in a transfer unit:
@@ -1301,10 +1306,6 @@ static int tc_get_videomodes(struct tc_data *tc, struct display_timings *timings
return ret;
}
- /* hsync, vsync active low */
- timings->modes->sync &= ~(FB_SYNC_HOR_HIGH_ACT |
- FB_SYNC_VERT_HIGH_ACT);
-
return ret;
}