Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2251456yba; Fri, 10 May 2019 08:32:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTjJKohGxSUiOS75Z7s+7OFIarltGtCJ/FisMy0j4YiCNaMrsOs+dItygVTs6u6IGwCLyr X-Received: by 2002:a17:902:7594:: with SMTP id j20mr14032810pll.78.1557502326152; Fri, 10 May 2019 08:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557502326; cv=none; d=google.com; s=arc-20160816; b=ab9ahkSoBG6ynasmjjvqhElmWORqRijCFbmKPSvo27/B8ZcYHjZ7pZPwA185ZzpKy7 7ZJdeEpWuJ5tHM1bLyb+za/WNQDOHNyPE7EmCleM32jzlEXmUqV2Q3s5Ue80iqwGWJ2I Zkc8JX5lU759PpTW8A0D1FaHHkxRI+SSx85tfAU4M/FP8YKgiTJMJHU5ShIi0N69OKFW EiuxteYZUCxtE2VKrZdgkU2fIifhGD+OUWY4HfGt3L5H1okuRmPtyu6S9X38qpR5MbNY QRV1Kpkc6fOAHvFDR3wnAZ9pIncl0LaHJql6ZK834A/he68RPXZnicWiUj4s098uEP8/ 0dAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=olGPp88lAGBFgCMkXTpFd0N7ob92q1mrVBEfjdfbsV4=; b=QI4Ptpj4s0rqghlOGqYqeDWEwVOm6f1g6zYQVfdle5dFgC7S46BqJ/6SRnt4C53qFC s/ZFQiIHJgaVv+J5Dvu6YCsNSi3X2gFMmnOVRiW4Hhqiibn/KJqdnQFoH2rqC0m8FgcV CtRZuFjfhLdHuBD8TVev36p2Ab5EK+ID9Xspc0jPVInyply+G76QAqLNg/xLlTW7lsDv 8BuAM7xD8qa355Ii8fmkS3TJVKJQRXJ2ENieRmAqGmgwzkUqBHEJzbFpWmtph42a2tbi yagPxRyLnRUQTETtTIroEbXq4nvOcECbtiWYuJkVPn9lOEFwsmUyEg+mg9UQGtC4zGha H7mA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si7871802pgm.302.2019.05.10.08.31.49; Fri, 10 May 2019 08:32:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727606AbfEJPa5 (ORCPT + 99 others); Fri, 10 May 2019 11:30:57 -0400 Received: from smtp1.de.adit-jv.com ([93.241.18.167]:54416 "EHLO smtp1.de.adit-jv.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727144AbfEJPa4 (ORCPT ); Fri, 10 May 2019 11:30:56 -0400 Received: from localhost (smtp1.de.adit-jv.com [127.0.0.1]) by smtp1.de.adit-jv.com (Postfix) with ESMTP id A1AC63C00D1; Fri, 10 May 2019 17:30:54 +0200 (CEST) Received: from smtp1.de.adit-jv.com ([127.0.0.1]) by localhost (smtp1.de.adit-jv.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9nHt6qMwHxly; Fri, 10 May 2019 17:30:47 +0200 (CEST) Received: from HI2EXCH01.adit-jv.com (hi2exch01.adit-jv.com [10.72.92.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.de.adit-jv.com (Postfix) with ESMTPS id 91B4A3C004C; Fri, 10 May 2019 17:30:47 +0200 (CEST) Received: from vmlxhi-121.adit-jv.com (10.72.93.65) by HI2EXCH01.adit-jv.com (10.72.92.24) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 10 May 2019 17:30:47 +0200 From: Michael Rodin To: , , CC: , , Subject: [PATCH] media: i2c: adv748x: initialize bit 7 of csi_tx_top_reg_1f Date: Fri, 10 May 2019 17:30:40 +0200 Message-ID: <1557502240-16274-1-git-send-email-mrodin@de.adit-jv.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.72.93.65] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to pages 188 and 193 of the "UG-747: ADV7481 Reference Manual" [1], the bit 7 (FRAMENUMBER_INTERLACED) of the register csi_tx_top_reg_1f "sets association of frame number in the FS and FE packets with the F bit in the EAV/SAV codes". EAV/SAV codes are defined in [2]. According to [2]: F=0 for field 1 F=1 for field 2 The bit FRAMENUMBER_INTERLACED is not initialized anywhere in the current version of the adv748x driver and therefore it is always 0, which is the default value according to [1]. Therefore the current association of field number from EAV/SAV code with the frame number in CSI FS and FE packets is: field 1 (top field for PAL, bottom field for NTSC) -> CSI frame number 2 field 2 (bottom field for PAL, top field for NTSC) -> CSI frame number 1 But this breaks frame number based field detection of top/bottom fields in CSI receivers. Therefore it makes sense to initialize the FRAMENUMBER_INTERLACED bit to 1 so the association is as expected: field 1 -> frame number 1 field 2 -> frame number 2 [1] https://www.analog.com/en/products/adv7481.html [2] https://www.itu.int/rec/R-REC-BT.656-5-200712-I/en Suggested-by: Steve Longerbeam Signed-off-by: Michael Rodin --- drivers/media/i2c/adv748x/adv748x-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c index f57cd77..4dd1a13 100644 --- a/drivers/media/i2c/adv748x/adv748x-core.c +++ b/drivers/media/i2c/adv748x/adv748x-core.c @@ -278,6 +278,9 @@ static int adv748x_power_up_tx(struct adv748x_csi2 *tx) usleep_range(1000, 1500); adv748x_write_check(state, page, 0x31, 0x80, &ret); + /* set bit 7 (FRAMENUMBER_INTERLACED) in csi_tx_top_reg_1f */ + adv748x_write_check(state, page, 0x1f, 0x80, &ret); + return ret; } -- 2.7.4