From patchwork Sat Dec 15 23:11:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice Chotard X-Patchwork-Id: 1884191 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 90D3F3FCA5 for ; Sat, 15 Dec 2012 23:11:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752055Ab2LOXL5 (ORCPT ); Sat, 15 Dec 2012 18:11:57 -0500 Received: from smtp23.services.sfr.fr ([93.17.128.20]:4102 "EHLO smtp23.services.sfr.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869Ab2LOXL4 (ORCPT ); Sat, 15 Dec 2012 18:11:56 -0500 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2308.sfr.fr (SMTP Server) with ESMTP id F41277000631; Sun, 16 Dec 2012 00:11:55 +0100 (CET) Received: from [192.168.1.83] (unknown [84.7.13.97]) by msfrf2308.sfr.fr (SMTP Server) with ESMTP id A81B2700062E; Sun, 16 Dec 2012 00:11:55 +0100 (CET) X-SFR-UUID: 20121215231155688.A81B2700062E@msfrf2308.sfr.fr Message-ID: <50CD03AF.3080602@sfr.fr> Date: Sun, 16 Dec 2012 00:11:43 +0100 From: Patrice Chotard User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Linux Media Mailing List , Antti Palosaari , Devin Heitmueller CC: =?iso-8859-1?b?RnLpZOlyaWM=?= , Mauro Carvalho Chehab Subject: [PATCH 2/2] [media] ngene: separate demodulator and tuner attach Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Previously, demodulator and tuner attach was done in the demod_attach callback. Migrate the tuner part in the tuner_attach callback in ngene_info to do thing in right place. Signed-off-by: Patrice Chotard Reviewed-by: Antti Palosaari --- drivers/media/pci/ngene/ngene-cards.c | 10 ++++++++++ 1 file changed, 10 insertions(+) feconf->pll_type)) { @@ -722,6 +731,7 @@ static struct ngene_info ngene_info_terratec = { .name = "Terratec Integra/Cinergy2400i Dual DVB-T", .io_type = {NGENE_IO_TSIN, NGENE_IO_TSIN}, .demod_attach = {demod_attach_drxd, demod_attach_drxd}, + .tuner_attach = {tuner_attach_dtt7520x, tuner_attach_dtt7520x}, .fe_config = {&fe_terratec_dvbt_0, &fe_terratec_dvbt_1}, .i2c_access = 1, }; diff --git a/drivers/media/pci/ngene/ngene-cards.c b/drivers/media/pci/ngene/ngene-cards.c index 96a13ed..8db3fa1 100644 --- a/drivers/media/pci/ngene/ngene-cards.c +++ b/drivers/media/pci/ngene/ngene-cards.c @@ -328,6 +328,15 @@ static int demod_attach_drxd(struct ngene_channel *chan) return -ENODEV; } + return 0; +} + +static int tuner_attach_dtt7520x(struct ngene_channel *chan) +{ + struct drxd_config *feconf; + + feconf = chan->dev->card_info->fe_config[chan->number]; + if (!dvb_attach(dvb_pll_attach, chan->fe, feconf->pll_address, &chan->i2c_adapter,