From patchwork Wed Jun 29 08:27:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 9204375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9CD5260757 for ; Wed, 29 Jun 2016 08:28:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8ACCE28635 for ; Wed, 29 Jun 2016 08:28:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C27028648; Wed, 29 Jun 2016 08:28:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01C0828635 for ; Wed, 29 Jun 2016 08:28:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750873AbcF2I2E (ORCPT ); Wed, 29 Jun 2016 04:28:04 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:51045 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750802AbcF2I2D (ORCPT ); Wed, 29 Jun 2016 04:28:03 -0400 Received: from dc8secmta2.synopsys.com (dc8secmta2.synopsys.com [10.13.218.202]) by smtprelay.synopsys.com (Postfix) with ESMTP id CC15710C07F5; Wed, 29 Jun 2016 01:27:51 -0700 (PDT) Received: from dc8secmta2.internal.synopsys.com (dc8secmta2.internal.synopsys.com [127.0.0.1]) by dc8secmta2.internal.synopsys.com (Service) with ESMTP id A6C7DA4112; Wed, 29 Jun 2016 01:27:51 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by dc8secmta2.internal.synopsys.com (Service) with ESMTP id 7BFD2A4102; Wed, 29 Jun 2016 01:27:51 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 6467F865; Wed, 29 Jun 2016 01:27:51 -0700 (PDT) Received: from synopsys-Macmini.internal.synopsys.com (synopsys-macmini.internal.synopsys.com [10.107.25.47]) by mailhost.synopsys.com (Postfix) with ESMTP id AFCAF862; Wed, 29 Jun 2016 01:27:49 -0700 (PDT) From: Jose Abreu To: linux-media@vger.kernel.org Cc: Jose Abreu , Carlos Palminha , Hyun Kwon , Laurent Pinchart , Mauro Carvalho Chehab Subject: [PATCH] media: platform/xilinx: Set VTC VSYNC/VBLANK values Date: Wed, 29 Jun 2016 09:27:30 +0100 Message-Id: X-Mailer: git-send-email 2.1.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Carlos Palminha Cc: Hyun Kwon Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org --- drivers/media/platform/xilinx/xilinx-vtc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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.