Received: by 10.213.65.68 with SMTP id h4csp1797599imn; Thu, 29 Mar 2018 11:12:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx48bvQT4UzD3K0f9hSSeEQ+OJpLnenP0Ss6LSHpM4w4wHNLIgEF7C9b2D7OK4WAjo/B8+Vo3 X-Received: by 10.101.87.201 with SMTP id q9mr6338170pgr.215.1522347155951; Thu, 29 Mar 2018 11:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522347155; cv=none; d=google.com; s=arc-20160816; b=asRW06LzwqFq3VHSmynp2sQ4U4buoqwXz1nl+uunJmvegw2exVu95RELpkzNoT8ynm k8P7HxZMCW2GVgJ0m1l/KN6thCGBCvmywgmdhMnkAmwfg8Xuyfa99T/ydyRCe0TXZknW dR0sqRyWeiySrar/UDNWzZIEY6u1jbeUsFi1PyY6Ha09FSLECdNJtyPUdOPsoWI9Suxe HMzHP8DUEtftNwS3xJXwBC/Zob164Fp1qeC1g9ISJooPBWWBQbxBD+zGjUqgDbVa3Lon BSE83u/KmqQXebCyG+A66qYPLJ+8i4jMY1nzvZ3RConjo7KCrBKW7egpV/pTessn6MCL q2iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=PGcHWn2gvr8XDCjeMl8JEz3gTEpm5Sazn5t6DVFFq74=; b=doys5NptLw4pcmbLrxA4ED7GLtV93n33D6Rtc6pypeVMtNNOtqgUvhQyE5z82WHhWN 811IT3cEI+sU3SC4RYi7tE1WWFl8f8uuoKkb620S36tOgiFB7iBDrvpZj2hBhbgV2DrM Wkh9uXl6Oroh6q0eIlM8i0el5K9kxzjYqBExieTUTnbdeMmwPlJcy2rSajfwsL57ZamJ y5/vEI7LijY2mWCJo6aWn/Gujv1//8h9HfUqDa+Zi6r93CCgsSBXj0ntmMW6ZFviDsH2 BTSxM38Wl3SIPuyghMH2cgQT40jbkFHpCPijIwPBIQudl7v7H7UoVH4Q0NF+nUqHO0qU jgbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=omqCcQRr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e91-v6si6337898plb.73.2018.03.29.11.12.22; Thu, 29 Mar 2018 11:12:35 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=omqCcQRr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754511AbeC2SKy (ORCPT + 99 others); Thu, 29 Mar 2018 14:10:54 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:38178 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754202AbeC2SII (ORCPT ); Thu, 29 Mar 2018 14:08:08 -0400 Received: by mail-wr0-f194.google.com with SMTP id m13so6184743wrj.5; Thu, 29 Mar 2018 11:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PGcHWn2gvr8XDCjeMl8JEz3gTEpm5Sazn5t6DVFFq74=; b=omqCcQRr6wiz1PLSmf+MxO082D84mdtn64+5YNIums9/IDz384EKWv1iXFpkI3m2c6 m/oFk5uYJcktyGf7hGD7aO761zzLMWf6KcKYZSt3dcWbUmvvGPkMY5Cu35D3GZiN7cAT DYJSWDkT2cdd/jYEzmcJeefmdrns3zkdjJSDUwDhRXanRwdNqqg97t5Q4jPrXiUr8jdn XoAYi6rgbSCAvAQhHK3xTA3X/4rXvevmrsTCvnq40LT6Z/J93T2Xbeu1SvI700+itNe2 XX+L36nRO4k5/qVL7JcehcMQI/zlWEVLZ+8q3ZWd5/oMFSUAzT+KCqR8fhckVyLkbGi+ OZ8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PGcHWn2gvr8XDCjeMl8JEz3gTEpm5Sazn5t6DVFFq74=; b=OR3V+z2j7U1wagAoh1N5J/hCc269nRXrWmPL8gvEmknuSfQQHdSw1LBkRfHfabhmvn gR7+uigfelI8x0BLp96fSVwWtSCp12/UQuVA+hs3ldavXKw6CBtIal58Pyx+BFe3xyVo iUPf/4fjHsLXZHfRsN914+N77zAIaK8vysURZBj7N/HN3v97lmyq3f3U+i4CuDbf7aZw H5mFPICl2U8AN8zezNo+TZgWUaV0x1xZKSthHAV3WnwSoNqS1u3yErAmG7meylS5KziR nsCOjhjKMcU6/hoWwuC6YX+FmcoJ6+apZdX3VYwkF01C1pfxnfhPb66Z3VsetYlhK6Jb BYhQ== X-Gm-Message-State: AElRT7Ea6qf0Emdm16ULtsEVnOPz9vc8mQt3gvuqmR4pJwDZR9Wsdrv5 ciOUacXhMJVDRfuy9PyqWJM= X-Received: by 10.223.173.207 with SMTP id w73mr7696738wrc.234.1522346886519; Thu, 29 Mar 2018 11:08:06 -0700 (PDT) Received: from smart-ThinkPad-T410 ([107.182.226.13]) by smtp.gmail.com with ESMTPSA id d28sm6020682wra.37.2018.03.29.11.08.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 11:08:05 -0700 (PDT) Date: Thu, 29 Mar 2018 22:37:57 +0430 From: Nasser To: Mauro Carvalho Chehab Cc: p.zabel@pengutronix.de, sakari.ailus@linux.intel.com, hans.verkuil@cisco.com, bparrot@ti.com, garsilva@embeddedor.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: i2c: tvp5150: fix color burst lock instability on some hardware Message-ID: <20180329180757.GA27220@smart-ThinkPad-T410> References: <20180325225633.5899-1-Afshin.Nasser@gmail.com> <20180326064353.187f752c@vento.lan> <20180326222921.GA5373@smart-ThinkPad-T410> <20180329143435.GA4392@smart-ThinkPad-T410> <20180329120240.169a5f33@vento.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180329120240.169a5f33@vento.lan> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 29, 2018 at 12:02:40PM -0300, Mauro Carvalho Chehab wrote: > Em Thu, 29 Mar 2018 19:04:35 +0430 > Nasser escreveu: > > > On Tue, Mar 27, 2018 at 02:59:21AM +0430, Nasser wrote: > > Hi Mauro, > > > > Thank you for taking time to review my patch. > > > > May be I should rephrase the commit message to something like: > > Use the default register values as suggested in TVP5150AM1 datasheet > > > > As this is not a hardware-dependent issue. Am I missing something? > > It is not a matter of rephasing, but, instead, to be sure that it won't > cause regressions on existing hardware. > > Yet, it would worth if you could describe at the patch what hardware > did you test it, and if VBI was tested too. > Does this means that I should resend the patch with this additional info? Sorry for not being clear about that. This was a custom board based on ARM. The VBI was not used. > Anyway, I'll try to find some time to run some tests on the hardware > I have with tvp5150 too. It sounds great. > > Regards, > Mauro > > > > > > On Mon, Mar 26, 2018 at 06:43:53AM -0300, Mauro Carvalho Chehab wrote: > > > > Hi Nasser, > > > > > > > > Em Mon, 26 Mar 2018 03:26:33 +0430 > > > > Nasser Afshin escreveu: > > > > > > > > > According to the datasheet, INTREQ/GPCL/VBLK should have a pull-up/down > > > > > resistor if it's been disabled. On hardware that does not have such > > > > > resistor, we should use the default output enable value. > > > > > This prevents the color burst lock instability problem. > > > > > > > > > > Color burst lock instability is just a side effect of not using the > > > recommended value for this bit. If we use the recommended setting, we > > > will support more hardware while not breaking anything. > > > > > > > If this is hardware-dependent, you should instead store it at > > > > OF (for SoC) or pass via platform_data (for PCI/USB devices). > > > > > > > > > > We have used the recommended value for this bit (as the datasheet > > > suggests) while we are in tvp5150_init_enable but in tvp5150_s_stream > > > we are using the wrong value. > > > > > > Also we have this comment at line 319: > > > /* Default values as sugested at TVP5150AM1 datasheet */ > > > But as you see, TVP5150_MISC_CTL is not set to its suggested default > > > value. > > > Any way the assignment to tvp5150_init_default after the above comment seems not to be correct according to the "3.21.4 Miscellaneous Controls Register" part in the datasheet. While following the same comment phrase on line 455, we see the correct assignment as the default values to tvp5150_init_enable. Sorry this is so lengthy. Thank you, Nasser > > > > > > > > > > Signed-off-by: Nasser Afshin > > > > > --- > > > > > drivers/media/i2c/tvp5150.c | 5 +++-- > > > > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > > > > > > > diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c > > > > > index 2476d812f669..0e9713814816 100644 > > > > > --- a/drivers/media/i2c/tvp5150.c > > > > > +++ b/drivers/media/i2c/tvp5150.c > > > > > @@ -328,7 +328,7 @@ static const struct i2c_reg_value tvp5150_init_default[] = { > > > > > TVP5150_OP_MODE_CTL,0x00 > > > > > }, > > > > > { /* 0x03 */ > > > > > - TVP5150_MISC_CTL,0x01 > > > > > + TVP5150_MISC_CTL,0x21 > > > > > }, > > > > > { /* 0x06 */ > > > > > TVP5150_COLOR_KIL_THSH_CTL,0x10 > > > > > @@ -1072,7 +1072,8 @@ static int tvp5150_s_stream(struct v4l2_subdev *sd, int enable) > > > > > * Enable the YCbCr and clock outputs. In discrete sync mode > > > > > * (non-BT.656) additionally enable the the sync outputs. > > > > > */ > > > > > - val |= TVP5150_MISC_CTL_YCBCR_OE | TVP5150_MISC_CTL_CLOCK_OE; > > > > > + val |= TVP5150_MISC_CTL_YCBCR_OE | TVP5150_MISC_CTL_CLOCK_OE | > > > > > + TVP5150_MISC_CTL_INTREQ_OE; > > > > > if (decoder->mbus_type == V4L2_MBUS_PARALLEL) > > > > > val |= TVP5150_MISC_CTL_SYNC_OE; > > > > > } > > > > > > > > > > > > > > > > Thanks, > > > > Mauro > > > > Thanks, > > Nasser > > > > Thanks, > Mauro