From patchwork Sun Jan 16 20:44:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mariusz Bialonczyk X-Patchwork-Id: 5603 Return-path: Envelope-to: mchehab@pedra Delivery-date: Sun, 16 Jan 2011 18:50:40 -0200 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1PeZYd-0004HJ-OY for mchehab@pedra; Sun, 16 Jan 2011 18:50:40 -0200 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Sun, 16 Jan 2011 18:50:39 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PeZTM-0007hb-Ah; Sun, 16 Jan 2011 20:45:12 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753864Ab1APUpJ (ORCPT + 1 other); Sun, 16 Jan 2011 15:45:09 -0500 Received: from skyboo.net ([82.160.187.4]:35242 "EHLO skyboo.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753666Ab1APUpI (ORCPT ); Sun, 16 Jan 2011 15:45:08 -0500 Received: from [2001:470:1f0b:1af:f000::2] by skyboo.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1PeZTC-0003n2-S6; Sun, 16 Jan 2011 21:45:03 +0100 Message-ID: <4D3358C5.5080706@skyboo.net> Date: Sun, 16 Jan 2011 21:44:53 +0100 From: Mariusz Bialonczyk User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101226 Icedove/3.0.11 MIME-Version: 1.0 To: Mauro Carvalho Chehab CC: linux-media@vger.kernel.org X-SA-Exim-Connect-IP: 2001:470:1f0b:1af:f000::2 X-SA-Exim-Mail-From: manio@skyboo.net X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on draco.skyboo.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.1 Subject: [PATCH] Prof 7301: switching frontend to stv090x, fixing "LOCK FAILED" issue X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:26:47 +0000) X-SA-Exim-Scanned: Yes (on skyboo.net) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Fixing the very annoying tunning issue. When switching from DVB-S2 to DVB-S, it often took minutes to have a lock. This issue is known to Igor M. Liplianin and was also reported ie. in the following posts: http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/24573 http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/25275 The patch is changing the frontend from stv0900 to stv090x. The card now works much more reliable. There is no problem with switching from DVB-S2 to DVB-S, tunning works flawless. Signed-off-by: Mariusz Bialonczyk Tested-by: Warpme Tested-by: Michal Wegrzynek --- drivers/media/video/cx88/Kconfig | 2 +- drivers/media/video/cx88/cx88-dvb.c | 56 ++++++++++++---------------- 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig index 5c42abd..57316bb 100644 --- a/drivers/media/video/cx88/Kconfig +++ b/drivers/media/video/cx88/Kconfig @@ -60,7 +60,7 @@ config VIDEO_CX88_DVB select DVB_STV0299 if !DVB_FE_CUSTOMISE select DVB_STV0288 if !DVB_FE_CUSTOMISE select DVB_STB6000 if !DVB_FE_CUSTOMISE - select DVB_STV0900 if !DVB_FE_CUSTOMISE + select DVB_STV090x if !DVB_FE_CUSTOMISE select DVB_STB6100 if !DVB_FE_CUSTOMISE select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE ---help--- diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 90717ee..3f25872 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -53,9 +53,9 @@ #include "stv0288.h" #include "stb6000.h" #include "cx24116.h" -#include "stv0900.h" +#include "stv090x.h" #include "stb6100.h" -#include "stb6100_proc.h" +#include "stb6100_cfg.h" #include "mb86a16.h" MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); @@ -611,15 +611,6 @@ static int cx24116_set_ts_param(struct dvb_frontend *fe, return 0; } -static int stv0900_set_ts_param(struct dvb_frontend *fe, - int is_punctured) -{ - struct cx8802_dev *dev = fe->dvb->priv; - dev->ts_gen_cntrl = 0; - - return 0; -} - static int cx24116_reset_device(struct dvb_frontend *fe) { struct cx8802_dev *dev = fe->dvb->priv; @@ -648,16 +639,21 @@ static const struct cx24116_config tevii_s460_config = { .reset_device = cx24116_reset_device, }; -static const struct stv0900_config prof_7301_stv0900_config = { - .demod_address = 0x6a, -/* demod_mode = 0,*/ - .xtal = 27000000, - .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */ - .diseqc_mode = 2,/* 2/3 PWM */ - .tun1_maddress = 0,/* 0x60 */ - .tun1_adc = 0,/* 2 Vpp */ - .path1_mode = 3, - .set_ts_params = stv0900_set_ts_param, +static struct stv090x_config prof_7301_stv090x_config = { + .device = STV0903, + .demod_mode = STV090x_SINGLE, + .clk_mode = STV090x_CLK_EXT, + .xtal = 27000000, + .address = 0x6A, + .ts1_mode = STV090x_TSMODE_PARALLEL_PUNCTURED, + .repeater_level = STV090x_RPTLEVEL_64, + .adc1_range = STV090x_ADC_2Vpp, + .diseqc_envelope_mode = false, + + .tuner_get_frequency = stb6100_get_frequency, + .tuner_set_frequency = stb6100_set_frequency, + .tuner_set_bandwidth = stb6100_set_bandwidth, + .tuner_get_bandwidth = stb6100_get_bandwidth, }; static const struct stb6100_config prof_7301_stb6100_config = { @@ -1402,23 +1398,19 @@ static int dvb_register(struct cx8802_dev *dev) } break; case CX88_BOARD_PROF_7301:{ - struct dvb_tuner_ops *tuner_ops = NULL; + dev->ts_gen_cntrl = 0x00; - fe0->dvb.frontend = dvb_attach(stv0900_attach, - &prof_7301_stv0900_config, - &core->i2c_adap, 0); + fe0->dvb.frontend = dvb_attach(stv090x_attach, + &prof_7301_stv090x_config, + &core->i2c_adap, + STV090x_DEMODULATOR_0); if (fe0->dvb.frontend != NULL) { - if (!dvb_attach(stb6100_attach, fe0->dvb.frontend, + if (!dvb_attach(stb6100_attach, + fe0->dvb.frontend, &prof_7301_stb6100_config, &core->i2c_adap)) goto frontend_detach; - tuner_ops = &fe0->dvb.frontend->ops.tuner_ops; - tuner_ops->set_frequency = stb6100_set_freq; - tuner_ops->get_frequency = stb6100_get_freq; - tuner_ops->set_bandwidth = stb6100_set_bandw; - tuner_ops->get_bandwidth = stb6100_get_bandw; - core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage; fe0->dvb.frontend->ops.set_voltage =