From patchwork Tue Apr 17 16:39:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Love X-Patchwork-Id: 10345925 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 342DD601D7 for ; Tue, 17 Apr 2018 16:40:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2187A2853E for ; Tue, 17 Apr 2018 16:40:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2034928560; Tue, 17 Apr 2018 16:40:41 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 78B8A28571 for ; Tue, 17 Apr 2018 16:40:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754349AbeDQQkf (ORCPT ); Tue, 17 Apr 2018 12:40:35 -0400 Received: from sub5.mail.dreamhost.com ([208.113.200.129]:51048 "EHLO homiemail-a48.g.dreamhost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755304AbeDQQk0 (ORCPT ); Tue, 17 Apr 2018 12:40:26 -0400 Received: from homiemail-a48.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a48.g.dreamhost.com (Postfix) with ESMTP id DD04170A0D0C; Tue, 17 Apr 2018 09:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=nextdimension.cc; h=from :to:cc:subject:date:message-id:in-reply-to:references; s= nextdimension.cc; bh=TKb5iacZWLwpv1zkhRPE3JF/NKE=; b=I5o5ltv2OBu 9FvolpkXVGtgDsMt+1990t0dbRcSY4r7OwYiRGpx6txnwkOVAY2k9fupioU82cU7 9b+//JPh4I4BLHV656N0e6wWjaH6dEqEp4jekfkL5CITcrXz0aWCRjPCgqdwbqxZ dyGxZgE/CI7WFhDd7UKyuPRSWdecK4W0= Received: from localhost.localdomain (66-90-189-166.dyn.grandenetworks.net [66.90.189.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: brad@nextdimension.ws) by homiemail-a48.g.dreamhost.com (Postfix) with ESMTPSA id 96F3870A0D0E; Tue, 17 Apr 2018 09:40:25 -0700 (PDT) From: Brad Love To: linux-media@vger.kernel.org, mchehab@s-opensource.com Cc: Brad Love Subject: [PATCH 6/9] cx231xx: Update 955Q from dvb attach to i2c device Date: Tue, 17 Apr 2018 11:39:52 -0500 Message-Id: <1523983195-28691-7-git-send-email-brad@nextdimension.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523983195-28691-1-git-send-email-brad@nextdimension.cc> References: <1523983195-28691-1-git-send-email-brad@nextdimension.cc> 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 Trim out some unused config params. Use the i2c mux adapter returned by frontend with the tuner. Signed-off-by: Brad Love --- drivers/media/usb/cx231xx/cx231xx-dvb.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c index f5903e6..ac1d8e6 100644 --- a/drivers/media/usb/cx231xx/cx231xx-dvb.c +++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c @@ -156,10 +156,8 @@ static struct tda18271_config pv_tda18271_config = { }; static struct lgdt3306a_config hauppauge_955q_lgdt3306a_config = { - .i2c_addr = 0x59, .qam_if_khz = 4000, .vsb_if_khz = 3250, - .deny_i2c_rptr = 1, .spectral_inversion = 1, .mpeg_mode = LGDT3306A_MPEG_SERIAL, .tpclk_edge = LGDT3306A_TPCLK_RISING_EDGE, @@ -860,18 +858,22 @@ static int dvb_init(struct cx231xx *dev) case CX231XX_BOARD_HAUPPAUGE_955Q: { struct si2157_config si2157_config = {}; + struct lgdt3306a_config lgdt3306a_config = {}; - dev->dvb->frontend[0] = dvb_attach(lgdt3306a_attach, - &hauppauge_955q_lgdt3306a_config, - demod_i2c - ); + /* attach first demodulator chip */ + lgdt3306a_config = hauppauge_955q_lgdt3306a_config; + lgdt3306a_config.fe = &dev->dvb->frontend[0]; + lgdt3306a_config.i2c_adapter = &adapter; - if (!dev->dvb->frontend[0]) { - dev_err(dev->dev, - "Failed to attach LGDT3306A frontend.\n"); - result = -EINVAL; + /* perform tuner probe/init/attach */ + client = dvb_module_probe("lgdt3306a", NULL, demod_i2c, + dev->board.demod_addr, + &lgdt3306a_config); + if (!client) { + result = -ENODEV; goto out_free; } + dvb->i2c_client_demod[0] = client; dev->dvb->frontend[0]->ops.i2c_gate_ctrl = NULL;