diff mbox

media: platform/xilinx: Set VTC VSYNC/VBLANK values

Message ID d9d1fcdd495c25beff71d54f44fb1ec48e6c94f4.1467188641.git.joabreu@synopsys.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jose Abreu June 29, 2016, 8:27 a.m. UTC
This patch sets the values of VSYNC and VBLANK in
Xilinx VTC.

The patch was tested using a modified version of this
driver and using an HDMI compliance equipment. There
is still missing the polarity settings for H/V which
would require a change in the interface of this driver.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: Hyun Kwon <hyun.kwon@xilinx.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: linux-media@vger.kernel.org
---
 drivers/media/platform/xilinx/xilinx-vtc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/media/platform/xilinx/xilinx-vtc.c b/drivers/media/platform/xilinx/xilinx-vtc.c
index 01c750e..49e82f2 100644
--- a/drivers/media/platform/xilinx/xilinx-vtc.c
+++ b/drivers/media/platform/xilinx/xilinx-vtc.c
@@ -211,11 +211,15 @@  int xvtc_generator_start(struct xvtc_device *xvtc,
 	xvtc_gen_write(xvtc, XVTC_HSYNC,
 		       (config->hsync_end << XVTC_HSYNC_END_SHIFT) |
 		       (config->hsync_start << XVTC_HSYNC_START_SHIFT));
-	xvtc_gen_write(xvtc, XVTC_F0_VBLANK_H, 0);
+	xvtc_gen_write(xvtc, XVTC_F0_VBLANK_H,
+		       (config->hsync_start << XVTC_F0_VBLANK_HEND_SHIFT) |
+		       (config->hsync_start << XVTC_F0_VBLANK_HSTART_SHIFT));
 	xvtc_gen_write(xvtc, XVTC_F0_VSYNC_V,
 		       (config->vsync_end << XVTC_F0_VSYNC_VEND_SHIFT) |
 		       (config->vsync_start << XVTC_F0_VSYNC_VSTART_SHIFT));
-	xvtc_gen_write(xvtc, XVTC_F0_VSYNC_H, 0);
+	xvtc_gen_write(xvtc, XVTC_F0_VSYNC_H,
+		       (config->hsync_start << XVTC_F0_VSYNC_HEND_SHIFT) |
+		       (config->hsync_start << XVTC_F0_VSYNC_HSTART_SHIFT));
 
 	/* Enable the generator. Set the source of all generator parameters to
 	 * generator registers.