From patchwork Mon May 9 19:53:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Ringel X-Patchwork-Id: 770612 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p49JsEmD020604 for ; Mon, 9 May 2011 19:54:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754459Ab1EITyL (ORCPT ); Mon, 9 May 2011 15:54:11 -0400 Received: from mail-in-08.arcor-online.net ([151.189.21.48]:44904 "EHLO mail-in-08.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754102Ab1EITyK (ORCPT ); Mon, 9 May 2011 15:54:10 -0400 Received: from mail-in-19-z2.arcor-online.net (mail-in-19-z2.arcor-online.net [151.189.8.36]) by mx.arcor.de (Postfix) with ESMTP id 6371C205934; Mon, 9 May 2011 21:54:09 +0200 (CEST) Received: from mail-in-14.arcor-online.net (mail-in-14.arcor-online.net [151.189.21.54]) by mail-in-19-z2.arcor-online.net (Postfix) with ESMTP id 713DCD7980; Mon, 9 May 2011 21:54:09 +0200 (CEST) Received: from localhost.localdomain (dslb-178-000-053-073.pools.arcor-ip.net [178.0.53.73]) (Authenticated sender: stefan.ringel@arcor.de) by mail-in-14.arcor-online.net (Postfix) with ESMTPA id EE4079C5F4; Mon, 9 May 2011 21:54:08 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-14.arcor-online.net EE4079C5F4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1304970849; bh=er9uZCKKncW8pfJuCWKgdCCBfpd/a6yVbMyZ7iQxD8g=; h=From:To:Cc:Subject:Date:Message-Id; b=Bjn49iyLJfpyPnNUggrb2am0A5spxTkjwfcc+7fd9UDtaCHebvH7fzmE+/pqtJjcM PDMwA7wfPbV8lMa/EIrY4hH1C/m0Ug5QuzDY3a3Sk7aedny5DHmSigmqhhLurSz/7F SZaBmyASSLyjqecmmLSueuJFW96+Uwt/8hjyHrgU= From: stefan.ringel@arcor.de To: linux-media@vger.kernel.org Cc: mchehab@redhat.com, d.belimov@gmail.com, Stefan Ringel Subject: [PATCH 01/16] tm6000: add radio capabilities Date: Mon, 9 May 2011 21:53:49 +0200 Message-Id: <1304970844-20955-1-git-send-email-stefan.ringel@arcor.de> X-Mailer: git-send-email 1.7.4.2 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.6 (demeter2.kernel.org [140.211.167.43]); Mon, 09 May 2011 19:54:14 +0000 (UTC) From: Stefan Ringel add radio capabilities Signed-off-by: Stefan Ringel --- drivers/staging/tm6000/tm6000-cards.c | 4 +++ drivers/staging/tm6000/tm6000-video.c | 34 +++++++++++++++++--------------- drivers/staging/tm6000/tm6000.h | 1 + 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c index 6e51486..31ccd2f 100644 --- a/drivers/staging/tm6000/tm6000-cards.c +++ b/drivers/staging/tm6000/tm6000-cards.c @@ -254,6 +254,7 @@ struct tm6000_board tm6000_boards[] = { .has_zl10353 = 1, .has_eeprom = 1, .has_remote = 1, + .has_radio = 1. .has_input_comp = 1, .has_input_svid = 1, }, @@ -276,6 +277,7 @@ struct tm6000_board tm6000_boards[] = { .has_zl10353 = 0, .has_eeprom = 1, .has_remote = 1, + .has_radio = 1, .has_input_comp = 1, .has_input_svid = 1, }, @@ -350,6 +352,7 @@ struct tm6000_board tm6000_boards[] = { .has_zl10353 = 1, .has_eeprom = 1, .has_remote = 0, + .has_radio = 1, .has_input_comp = 0, .has_input_svid = 0, }, @@ -372,6 +375,7 @@ struct tm6000_board tm6000_boards[] = { .has_zl10353 = 0, .has_eeprom = 1, .has_remote = 0, + .has_radio = 1, .has_input_comp = 0, .has_input_svid = 0, }, diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c index f82edfa..a434a32 100644 --- a/drivers/staging/tm6000/tm6000-video.c +++ b/drivers/staging/tm6000/tm6000-video.c @@ -1730,24 +1730,26 @@ int tm6000_v4l2_register(struct tm6000_core *dev) printk(KERN_INFO "%s: registered device %s\n", dev->name, video_device_node_name(dev->vfd)); - dev->radio_dev = vdev_init(dev, &tm6000_radio_template, - "radio"); - if (!dev->radio_dev) { - printk(KERN_INFO "%s: can't register radio device\n", - dev->name); - return ret; /* FIXME release resource */ - } + if (dev->caps.has_radio) { + dev->radio_dev = vdev_init(dev, &tm6000_radio_template, + "radio"); + if (!dev->radio_dev) { + printk(KERN_INFO "%s: can't register radio device\n", + dev->name); + return ret; /* FIXME release resource */ + } - ret = video_register_device(dev->radio_dev, VFL_TYPE_RADIO, - radio_nr); - if (ret < 0) { - printk(KERN_INFO "%s: can't register radio device\n", - dev->name); - return ret; /* FIXME release resource */ - } + ret = video_register_device(dev->radio_dev, VFL_TYPE_RADIO, + radio_nr); + if (ret < 0) { + printk(KERN_INFO "%s: can't register radio device\n", + dev->name); + return ret; /* FIXME release resource */ + } - printk(KERN_INFO "%s: registered device %s\n", - dev->name, video_device_node_name(dev->radio_dev)); + printk(KERN_INFO "%s: registered device %s\n", + dev->name, video_device_node_name(dev->radio_dev)); + } printk(KERN_INFO "Trident TVMaster TM5600/TM6000/TM6010 USB2 board (Load status: %d)\n", ret); return ret; diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h index fdd6d30..8cdc992 100644 --- a/drivers/staging/tm6000/tm6000.h +++ b/drivers/staging/tm6000/tm6000.h @@ -129,6 +129,7 @@ struct tm6000_capabilities { unsigned int has_zl10353:1; unsigned int has_eeprom:1; unsigned int has_remote:1; + unsigned int has_radio:1; unsigned int has_input_comp:1; unsigned int has_input_svid:1; };