Received: by 10.213.65.68 with SMTP id h4csp75345imn; Mon, 26 Mar 2018 15:31:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELt2R8eJBImkURFTfiovzK4JWeiqUI0DBW2h+7EfDDpXNOrIEeNKnOJ6ZtNGaE23xMpmYLGc X-Received: by 2002:a17:902:146:: with SMTP id 64-v6mr41968049plb.30.1522103479140; Mon, 26 Mar 2018 15:31:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522103479; cv=none; d=google.com; s=arc-20160816; b=OYNDcRyUtyPB81kxJ+UCVXFMw+jmhEAzB0Fqh/bCx+OLlNPHUwNTWtu2rc7J5f2w09 11iuis8wzQn6QMIrDK9PRUQy5lEfn0PvHSCzWdxZhB4UVOZjknSTmDANt92z8kHECbIJ V7zomZ7qjE4EcaRlcfI79yIPc3LXMDazSlnqMauwg7VLV+ZRZTucf/NBbC/C9KsyJ1UP b9CJq+3ywAx3wUR4afNlzFKJ2bLLDEWK4KlSEC0DpY+E20hjQYoBwjOVSDq6mqndTfch bJ0jkkPtYmKS+zMMoLcQuwo7C69WgSCfotzZNgIjqFT17TYDU4OToP1kBCH/U3YeBTCd 9J9w== 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=U1nx66HU2rCqaTXusGcUQzEkoHKDavLi/GEkB7f+7LI=; b=cLKqoPmtWVDJI6F52ct7Tok3BWkFiM6tDLim0TmR9d0E1npb0D/nWRhzVyTdzmppdL SUGjQkK6LnTlutMmvY7dWJWnU/pvU4xa2Gx/XZl6JlJw87IYPdIHCHli9w9q62yZV5Ih A/weoL+y1tTfMi+0OP+QQpMp7iCIzhRi6KO9fHVRf9R3qqKt2yzK1eqzbohPEaEdeem8 Dw7eikEiaxaf2em92wD1kNzCfkTWhzSbVSVYWPOk6O/q42MlU+RcZ6pFxK8w7577tOlb QBBXh5ApwlHGvnul2Nk6XtaUC5Luj6+iErZnkNjoTJFlM2b7lX6E6TXFqVGG/5uPghGN VlJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yuq4uP+m; 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 h1-v6si15499017pln.216.2018.03.26.15.31.04; Mon, 26 Mar 2018 15:31:19 -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=Yuq4uP+m; 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 S1752792AbeCZW3b (ORCPT + 99 others); Mon, 26 Mar 2018 18:29:31 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:45734 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751913AbeCZW32 (ORCPT ); Mon, 26 Mar 2018 18:29:28 -0400 Received: by mail-wr0-f193.google.com with SMTP id u11so8126544wri.12; Mon, 26 Mar 2018 15:29:28 -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=U1nx66HU2rCqaTXusGcUQzEkoHKDavLi/GEkB7f+7LI=; b=Yuq4uP+m3JV4m9rDXD1w4xYW5EalFgOmUBma0VnMJ7ZzhgKJ5iFevm5HRo7FKhUJWN SakjpsDXE+PqfQCTkfwZ495cbKlb8veNhsu5fK23cCgFP0ViSiM12u8IlHpJx+ps57gD Q0q3nuDMo26DQB1+cRN8ajmP2s+cKZlcH1yLMqNxY13+TIR0ndyEHFcB2s45ylD61x9b 3s02atW/Loea2nsxdQwT9dFnsiDylNRUjD+epaqe4oP00Ai46Cx3TDgK34lpjnYPnoN4 9jJkDtXXHqUqQ1huZQ/RseEOXNSNIDQkAnci1iKC2MjJySFEDXnTT4eL6FIwYVAAZVwQ 33vg== 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=U1nx66HU2rCqaTXusGcUQzEkoHKDavLi/GEkB7f+7LI=; b=bqwsuWGSJ+bt/b8vPevJsCbjMapzenMQOCFa1Aj0M8ncvgveG94CDvYRJE96CiGztD 7NVyfXGBS/emKsQ177sQaGq7qiRrCFl4LgM4qJrNAXnP5EN9D7n9TYX7CGMAbHEbI1Wo 2q3lG0XydOm8Cm0ZzkLlKmPRZ2Uz1ADhTdhcnDgqsVXRs5d7k3S9yk/wyoiHvIe3iCVr 1jd63y06BiqRymfoJ2wddojIhgmzxpLfv8ZvIuK2Q+bGOba7I2ZKmzWDoYmkZfhOH61N Q/qMTd6kx0OwNyNZ6JLkyZE8wwaaIRD1wX+dtLEG5Au4iNWtNhOIQojJME1xVvBXI3Kk Nl6Q== X-Gm-Message-State: AElRT7E0tnMjXKrnMWWyX/WewUPITDXQuWOfdSN79mAWzsG4uOftUgt9 O7SUJMEaLEyA5udwmkqysDI= X-Received: by 10.223.130.246 with SMTP id 109mr31838913wrc.45.1522103367298; Mon, 26 Mar 2018 15:29:27 -0700 (PDT) Received: from smart-ThinkPad-T410 ([151.238.227.148]) by smtp.gmail.com with ESMTPSA id q21sm53432wmd.12.2018.03.26.15.29.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 15:29:26 -0700 (PDT) Date: Tue, 27 Mar 2018 02:59:21 +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: <20180326222921.GA5373@smart-ThinkPad-T410> References: <20180325225633.5899-1-Afshin.Nasser@gmail.com> <20180326064353.187f752c@vento.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180326064353.187f752c@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 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. > > > > 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