From patchwork Sun May 23 18:31:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Ringel X-Patchwork-Id: 101758 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4NIXXfS016765 for ; Sun, 23 May 2010 18:33:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755198Ab0EWSdb (ORCPT ); Sun, 23 May 2010 14:33:31 -0400 Received: from mail-in-18.arcor-online.net ([151.189.21.58]:44249 "EHLO mail-in-18.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754997Ab0EWSda (ORCPT ); Sun, 23 May 2010 14:33:30 -0400 Received: from mail-in-11-z2.arcor-online.net (mail-in-11-z2.arcor-online.net [151.189.8.28]) by mx.arcor.de (Postfix) with ESMTP id E31373DC5D9; Sun, 23 May 2010 20:33:28 +0200 (CEST) Received: from mail-in-17.arcor-online.net (mail-in-17.arcor-online.net [151.189.21.57]) by mail-in-11-z2.arcor-online.net (Postfix) with ESMTP id C61CC1CBAFB; Sun, 23 May 2010 20:33:28 +0200 (CEST) Received: from localhost.localdomain (unknown [188.106.95.190]) (Authenticated sender: stefan.ringel@arcor.de) by mail-in-17.arcor-online.net (Postfix) with ESMTPA id 3C28BCBEEC; Sun, 23 May 2010 20:33:28 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-17.arcor-online.net 3C28BCBEEC DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1274639608; bh=nSxAK8ITw51PDSM39rKRg7drScupxe45n4kqLpVME4A=; h=From:To:Cc:Subject:Date:Message-Id; b=MOYay7XvW1dSHqL+JJjWHeTZS7u0UnBmAC+DsB6U5vESYPD0JIfvVmBNFQCz1j9VF Q2I127pmiVQgIzjMRACP+a1uKihvxczROnKI8uUGsE7yyxtaSZozESZr797UJoEavZ nUq91oddiJIwstqFu3MMIqTJHIKJ8maRJOaKGO5I= From: stefan.ringel@arcor.de To: linux-media@vger.kernel.org Cc: mchehab@redhat.com, d.belimov@gmail.com, Stefan Ringel Subject: [PATCH 4/5] tm6000: add frontend tuner xc5000 Date: Sun, 23 May 2010 20:31:44 +0200 Message-Id: <1274639505-2674-1-git-send-email-stefan.ringel@arcor.de> X-Mailer: git-send-email 1.7.0.3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 23 May 2010 18:33:44 +0000 (UTC) diff --git a/drivers/staging/tm6000/tm6000-dvb.c b/drivers/staging/tm6000/tm6000-dvb.c index e6a802e..b504a90 100644 --- a/drivers/staging/tm6000/tm6000-dvb.c +++ b/drivers/staging/tm6000/tm6000-dvb.c @@ -257,27 +257,53 @@ int tm6000_dvb_register(struct tm6000_core *dev) dvb->adapter.priv = dev; if (dvb->frontend) { - struct xc2028_config cfg = { - .i2c_adap = &dev->i2c_adap, - .i2c_addr = dev->tuner_addr, - }; - - dvb->frontend->callback = tm6000_tuner_callback; - ret = dvb_register_frontend(&dvb->adapter, dvb->frontend); - if (ret < 0) { - printk(KERN_ERR - "tm6000: couldn't register frontend\n"); - goto adapter_err; + switch (dev->tuner_type) { + case TUNER_XC2028: + struct xc2028_config cfg = { + .i2c_adap = &dev->i2c_adap, + .i2c_addr = dev->tuner_addr, + }; + + dvb->frontend->callback = tm6000_tuner_callback; + ret = dvb_register_frontend(&dvb->adapter, dvb->frontend); + if (ret < 0) { + printk(KERN_ERR + "tm6000: couldn't register frontend\n"); + goto adapter_err; + } + + if (!dvb_attach(xc2028_attach, dvb->frontend, &cfg)) { + printk(KERN_ERR "tm6000: couldn't register " + "frontend (xc3028)\n"); + ret = -EINVAL; + goto frontend_err; + } + printk(KERN_INFO "tm6000: XC2028/3028 asked to be " + "attached to frontend!\n"); + break; + case TUNER_XC5000: + struct xc5000_config cfg = { + .i2c_address = dev->tuner_addr, + }; + + dvb->frontend->callback = tm6000_xc5000_callback; + ret = dvb_register_frontend(&dvb->adapter, dvb->frontend); + if (ret < 0) { + printk(KERN_ERR + "tm6000: couldn't register frontend\n"); + goto adapter_err; + } + + if (!dvb_attach(xc5000_attach, dvb->frontend, &dev->i2c_adap, &cfg)) { + printk(KERN_ERR "tm6000: couldn't register " + "frontend (xc5000)\n"); + ret = -EINVAL; + goto frontend_err; + } + printk(KERN_INFO "tm6000: XC5000 asked to be " + "attached to frontend!\n"); + break; } - - if (!dvb_attach(xc2028_attach, dvb->frontend, &cfg)) { - printk(KERN_ERR "tm6000: couldn't register " - "frontend (xc3028)\n"); - ret = -EINVAL; - goto frontend_err; - } - printk(KERN_INFO "tm6000: XC2028/3028 asked to be " - "attached to frontend!\n"); } else { printk(KERN_ERR "tm6000: no frontend found\n"); }