From patchwork Thu Oct 1 05:08:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiro TSUKADA X-Patchwork-Id: 50816 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n915Fcat016362 for ; Thu, 1 Oct 2009 05:15:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751915AbZJAFPd (ORCPT ); Thu, 1 Oct 2009 01:15:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751690AbZJAFPd (ORCPT ); Thu, 1 Oct 2009 01:15:33 -0400 Received: from smtp08.mail.tnz.yahoo.co.jp ([203.216.226.136]:40176 "HELO smtp08.mail.tnz.yahoo.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751612AbZJAFPc (ORCPT ); Thu, 1 Oct 2009 01:15:32 -0400 X-Greylist: delayed 398 seconds by postgrey-1.27 at vger.kernel.org; Thu, 01 Oct 2009 01:15:32 EDT Received: (qmail 31792 invoked by alias); 1 Oct 2009 05:08:56 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=yj20050223; d=yahoo.co.jp; h=Received:X-Apparently-From:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:Content-Transfer-Encoding; b=R1172om4TNYWQ5zfkrzF70KlUfXUskt5m+3gbJudIfWRtpx4G7bPBjDjSyskLdQkcjejyV2g0jR3Xft8mKEKdFlNkpVJAXvZ250n5gR5+H+mtmAEJhTs4DNiv6n1lJ39 ; Received: from unknown (HELO ribot.localdomain) (tskd2@220.28.115.38 with plain) by smtp08.mail.tnz.yahoo.co.jp with SMTP; 1 Oct 2009 05:08:56 -0000 X-Apparently-From: Message-ID: <4AC43967.6070108@yahoo.co.jp> Date: Thu, 01 Oct 2009 14:08:55 +0900 From: Akihiro TSUKADA User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Thunderbird/3.0b3 MIME-Version: 1.0 To: Linux Media Mailing List CC: Mauro Carvalho Chehab Subject: [PATCH 1/2] dvb-usb-friio: return the correct DTV_DELIVERY_SYSTEM Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/linux/drivers/media/dvb/dvb-usb/friio-fe.c b/linux/drivers/media/dvb/dvb-usb/friio-fe.c --- a/linux/drivers/media/dvb/dvb-usb/friio-fe.c +++ b/linux/drivers/media/dvb/dvb-usb/friio-fe.c @@ -286,6 +286,27 @@ static int jdvbt90502_get_tune_settings( return 0; } +/* filter out un-supported properties to notify users */ +static int jdvbt90502_set_property(struct dvb_frontend *fe, + struct dtv_property *tvp) +{ + int r = 0; + + switch (tvp->cmd) { + case DTV_DELIVERY_SYSTEM: + if (tvp->u.data != SYS_ISDBT) + r = -EINVAL; + break; + case DTV_CLEAR: + case DTV_TUNE: + case DTV_FREQUENCY: + break; + default: + r = -EINVAL; + } + return r; +} + static int jdvbt90502_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) { @@ -314,6 +335,9 @@ static int jdvbt90502_set_frontend(struc deb_fe("%s: Freq:%d\n", __func__, p->frequency); + /* for recovery from DTV_CLEAN */ + fe->dtv_property_cache.delivery_system = SYS_ISDBT; + ret = jdvbt90502_pll_set_freq(state, p->frequency); if (ret) { deb_fe("%s:ret == %d\n", __func__, ret); @@ -394,6 +418,7 @@ static int jdvbt90502_init(struct dvb_fr if (ret != 1) goto error; } + fe->dtv_property_cache.delivery_system = SYS_ISDBT; msleep(100); return 0; @@ -471,6 +496,8 @@ static struct dvb_frontend_ops jdvbt9050 .sleep = jdvbt90502_sleep, .write = _jdvbt90502_write, + .set_property = jdvbt90502_set_property, + .set_frontend = jdvbt90502_set_frontend, .get_frontend = jdvbt90502_get_frontend, .get_tune_settings = jdvbt90502_get_tune_settings,