Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1847803imm; Tue, 22 May 2018 10:15:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqTC9Dkmjsp4q0DQgLi5uO5TbfQggi5UHRJC2h0wDDg44lnQTPhkUIwp22k52dZhaJSumb4 X-Received: by 2002:a65:4d08:: with SMTP id i8-v6mr7657233pgt.51.1527009328447; Tue, 22 May 2018 10:15:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527009328; cv=none; d=google.com; s=arc-20160816; b=AfZ2Bu4SXGIwlhhfu1Qri6JGbyV5kkKZzY6JaM6aJxYgmdgfjkGQ05Cd7EBJX2ArmB Cl7WrHNPLzcioh3WFzuWrWD4byhFSVvrNhDEclleXaWDqPT3iGVENBzQH1bx6FGDGtmY MSWdbmlrCGk38hfQY+wl64pqRL7tXazjmFGaDV3BIDb4Ri+um/0izK3iPp+luDm3n5kc YBNnABMrnDOzTICW5x95dbsD7PF7TcqkhyFQxnLdf3pyc+PwUWPzR51l87c4fGVaZ9z0 q/pGFYXP7z9MxuQCvjr1FU5CjBK64KkTcNq6f+iiLlL8Xfirfj64MDBYcEqNKIYOrWYb k2lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=U8XPldsQ5D9scwEewpFJ1Rni118Ya/4JCVOhLtRhf58=; b=B/lKpu97yJ1YJDk5cBUCXo81QSaMt6EfSeUMpTx8qaMSh2NCNiw3EoH3YDQ7p4Mha+ 2BNTORC4tK4BDY2iVZIRHPYSm8SzrP5PyD6UG7BrFL9KLh/KBrJc6e6CnjKpZMeabJ1A C4iKaRqBRXAWSWdd5rwSOSa10b+X/797qj5rlVL/IrypI1MH/nCLIzdejTPhSHSQFfGI eWar5mJ4YZTcttsSO81NMTbQHJcH5pCBAZT3nkOWiUgjOjsdumKoIp2s8GwIrHTaG0nY dFCeHdKOX2Xlgut4Wn5UoyH1uEm1fckXWHUQzdxsUNChy9F/yNT+HW1HeRNQVNb6GGa7 shGw== 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 a17-v6si13257678pgf.15.2018.05.22.10.15.12; Tue, 22 May 2018 10:15:28 -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 S1751411AbeEVRL5 (ORCPT + 99 others); Tue, 22 May 2018 13:11:57 -0400 Received: from gateway21.websitewelcome.com ([192.185.45.89]:39881 "EHLO gateway21.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751279AbeEVRL4 (ORCPT ); Tue, 22 May 2018 13:11:56 -0400 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway21.websitewelcome.com (Postfix) with ESMTP id B3D3D400D3D65 for ; Tue, 22 May 2018 12:11:55 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id LApHfoKUMBcCXLApHfitf6; Tue, 22 May 2018 12:11:55 -0500 X-Authority-Reason: nr=8 Received: from [187.192.46.223] (port=55344 helo=[192.168.1.70]) by gator4166.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1fLApH-003LKK-5y; Tue, 22 May 2018 12:11:55 -0500 Subject: Re: [media] duplicate code in media drivers To: Devin Heitmueller , Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel , Devin Heitmueller References: <20180521193951.GA16659@embeddedor.com> <20180521171415.00c56487@vento.lan> From: "Gustavo A. R. Silva" Message-ID: Date: Tue, 22 May 2018 12:11:26 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.192.46.223 X-Source-L: No X-Exim-ID: 1fLApH-003LKK-5y X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.1.70]) [187.192.46.223]:55344 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 9 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/21/2018 03:44 PM, Devin Heitmueller wrote: >>> diff -u -p drivers/media/dvb-frontends/au8522_decoder.c /tmp/nothing/media/dvb-frontends/au8522_decoder.c >>> --- drivers/media/dvb-frontends/au8522_decoder.c >>> +++ /tmp/nothing/media/dvb-frontends/au8522_decoder.c >>> @@ -280,14 +280,9 @@ static void setup_decoder_defaults(struc >>> AU8522_TOREGAAGC_REG0E5H_CVBS); >>> au8522_writereg(state, AU8522_REG016H, AU8522_REG016H_CVBS); >>> >>> - if (is_svideo) { >>> /* Despite what the table says, for the HVR-950q we still need >>> to be in CVBS mode for the S-Video input (reason unknown). */ >>> /* filter_coef_type = 3; */ >>> - filter_coef_type = 5; >>> - } else { >>> - filter_coef_type = 5; >>> - } >> >> Better ask Devin about this (c/c). > > This was a case where the implementation didn't match the datasheet, > and it wasn't clear why the filter coefficients weren't working > properly. Essentially I should have labeled that as a TODO or FIXME > when I disabled the "right" value and forced it to always be five. It > was also likely that the filter coefficients would need to differ if > taking video over the IF interface as opposed to CVBS/S-video, which > is why I didn't want to get rid of the logic entirely. That said, the > only product I've ever seen with the tda18271 mated to the au8522 will > likely never be supported for analog video under Linux for unrelated > reasons. > > That said, it's worked "good enough" since I wrote the code nine years > ago, so if somebody wants to submit a patch to either get rid of the > if() statement or mark it as a FIXME that will likely never actually > get fixed, I wouldn't have an objection to either. > Devin, I've sent a patch based on your feedback. Thanks! -- Gustavo