From: Evoke Zhang Date: Thu, 15 Aug 2019 10:52:18 +0000 (+0800) Subject: cvbsout: fix cgms config mistake for NTSC [1/1] X-Git-Tag: hardkernel-4.9.236-104~729 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a477f52caf87ff8ba5f674f4c719a75a6dc4002b;p=platform%2Fkernel%2Flinux-amlogic.git cvbsout: fix cgms config mistake for NTSC [1/1] PD#OTT-5683 Problem: NTSC cgms signal is incorrect Solution: fix cgms config mistake Verify: u212 Change-Id: I4a3dce8d6b3439be974a8aea48ca1d445feee25b Signed-off-by: Evoke Zhang --- diff --git a/drivers/amlogic/media/vout/cvbs/wss.c b/drivers/amlogic/media/vout/cvbs/wss.c index 8876955..fb73223 100644 --- a/drivers/amlogic/media/vout/cvbs/wss.c +++ b/drivers/amlogic/media/vout/cvbs/wss.c @@ -38,8 +38,9 @@ static const char * const wss_576i_cmd[] = {"ar", "mode", "coding", "helper", static void wss_set_output(unsigned int cmd, unsigned int mode, unsigned int line, unsigned int data, - unsigned int start, unsigned int length) { - int value; + unsigned int start, unsigned int length) +{ + unsigned int value; pr_info("[%s], line = %d, data = 0x%x, start_bit = %d, length = %d\n", __func__, line, data, start, length); @@ -58,6 +59,21 @@ static void wss_set_output(unsigned int cmd, unsigned int mode, #endif cvbs_out_reg_setb(ENCI_VBI_SETTING, 0x1, 0, 2); break; + case WSS_480I_CMD_CGMS_A: + value = cvbs_out_reg_read(ENCI_VBI_CGMSDT_L); + value |= (cvbs_out_reg_read(ENCI_VBI_CGMSDT_H) << 16); + + value = ((value & (~(((1L << length) - 1) << start))) | + ((data & ((1L << length) - 1)) << start)); + + cvbs_out_reg_write(ENCI_VBI_CGMSDT_L, (value & 0xffff)); + cvbs_out_reg_write(ENCI_VBI_CGMSDT_H, ((value >> 16) & 0xff)); + cvbs_out_reg_write(ENCI_VBI_CGMS_LN, (line - 4)); + cvbs_out_reg_setb(ENCI_VBI_SETTING, 0x3, 4, 2); + /*480i, enable even field for line 20*/ + /*enable odd field for line 283 */ + break; + case WSS_576I_CMD_CGMS_A: default: cvbs_out_reg_setb(ENCI_VBI_WSSDT, data, start, length); value = cvbs_out_reg_read(ENCI_VBI_WSSDT);