From patchwork Tue Jul 5 13:21:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hans Verkuil (hansverk)" X-Patchwork-Id: 9214267 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 464DA60752 for ; Tue, 5 Jul 2016 13:21:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3714B20587 for ; Tue, 5 Jul 2016 13:21:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B365205AD; Tue, 5 Jul 2016 13:21:21 +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=-14.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL 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 A3A6920587 for ; Tue, 5 Jul 2016 13:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755387AbcGENVR (ORCPT ); Tue, 5 Jul 2016 09:21:17 -0400 Received: from aer-iport-4.cisco.com ([173.38.203.54]:49825 "EHLO aer-iport-4.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755384AbcGENVO (ORCPT ); Tue, 5 Jul 2016 09:21:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=889; q=dns/txt; s=iport; t=1467724874; x=1468934474; h=to:from:subject:message-id:date:mime-version: content-transfer-encoding; bh=dqpwIqUwa3wvS1ws5AQXAj5O2fw/fIHlF2H1DG/LyCA=; b=JZe2KZai0AnNnL9sUA960kc/Ckd7dNZLQkpjzqL4tMkJwgvZSfCUlMCw raaNV081hMWm2BuZabo7XZVP+ISux+MgXCBZA6vh6Xv56PlypMnFOnRZM OLVaIq4pcgqU0gg7pntmzXoRIaiMXZs1n+2v4jhyv71Vz1B3e5eEtVdBQ Q=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CnBAAas3tX/xbLJq1chRC3NoQGiBcBA?= =?us-ascii?q?QEBAQFmJ4R2BIEHAgUhAhECTA0GAgKILJsej2KPMAEBAQcCASSBAYUmjA6CWgE?= =?us-ascii?q?EmROOR4Fqh2GFXQKGV4kzVINyOjKIeQEBAQ?= X-IronPort-AV: E=Sophos;i="5.26,579,1459814400"; d="scan'208";a="638382464" Received: from aer-iport-nat.cisco.com (HELO aer-core-2.cisco.com) ([173.38.203.22]) by aer-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2016 13:21:12 +0000 Received: from [10.47.79.81] ([10.47.79.81]) (authenticated bits=0) by aer-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id u65DL9Q1030120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Tue, 5 Jul 2016 13:21:11 GMT To: linux-media From: Hans Verkuil Subject: [PATCH] adv7511: the h/vsync polarities were always positive Message-ID: <577BB445.10402@cisco.com> Date: Tue, 5 Jul 2016 15:21:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 X-Authenticated-User: hansverk 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 Correctly set the h/vsync polarities instead of keeping to the default (positive). Signed-off-by: Hans Verkuil --- drivers/media/i2c/adv7511.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c index 161cbdb..f062694 100644 --- a/drivers/media/i2c/adv7511.c +++ b/drivers/media/i2c/adv7511.c @@ -763,6 +763,11 @@ static int adv7511_s_dv_timings(struct v4l2_subdev *sd, /* save timings */ state->dv_timings = *timings; + /* set h/vsync polarities */ + adv7511_wr_and_or(sd, 0x17, 0x9f, + ((timings->bt.polarities & V4L2_DV_VSYNC_POS_POL) ? 0 : 0x40) | + ((timings->bt.polarities & V4L2_DV_HSYNC_POS_POL) ? 0 : 0x20)); + /* update quantization range based on new dv_timings */ adv7511_set_rgb_quantization_mode(sd, state->rgb_quantization_range_ctrl);