From patchwork Sun Jan 13 20:19:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jose Alberto Reguero X-Patchwork-Id: 1970661 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 AC3B33FCDE for ; Sun, 13 Jan 2013 20:20:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755462Ab3AMUTy (ORCPT ); Sun, 13 Jan 2013 15:19:54 -0500 Received: from impaqm3.telefonica.net ([213.4.138.19]:63447 "EHLO telefonica.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755392Ab3AMUTx convert rfc822-to-8bit (ORCPT ); Sun, 13 Jan 2013 15:19:53 -0500 Received: from IMPmailhost5.adm.correo ([10.20.102.126]) by IMPaqm3.telefonica.net with bizsmtp id nXlV1k00D2jdgqJ3PYKpii; Sun, 13 Jan 2013 21:19:49 +0100 Received: from jar7.dominio ([88.15.142.18]) by IMPmailhost5.adm.correo with BIZ IMP id nYKn1k00b0Q1CC81lYKoGw; Sun, 13 Jan 2013 21:19:49 +0100 X-Brightmail-Tracker: AAAAAA== X-original-sender: jareguero@telefonica.net From: Jose Alberto Reguero To: Antti Palosaari Cc: Gianluca Gennari , LMML , Michael Krufky Subject: Re: af9035 test needed! Date: Sun, 13 Jan 2013 21:19:42 +0100 Message-ID: <2975217.iWIPt6bt0t@jar7.dominio> User-Agent: KMail/4.9.3 (Linux/3.6.7-4.fc17.x86_64; KDE/4.9.3; x86_64; ; ) In-Reply-To: <1399201.n4JJjs39sT@jar7.dominio> References: <50F05C09.3010104@iki.fi> <50F0A501.5000103@iki.fi> <1399201.n4JJjs39sT@jar7.dominio> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Sábado, 12 de enero de 2013 22:14:07 Jose Alberto Reguero escribió: > On Sábado, 12 de enero de 2013 01:49:21 Antti Palosaari escribió: > > On 01/12/2013 01:45 AM, Jose Alberto Reguero wrote: > > > On Viernes, 11 de enero de 2013 20:38:01 Antti Palosaari escribió: > > >> Hello Jose and Gianluca > > >> > > >> Could you test that (tda18218 & mxl5007t): > > >> http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/it9135_t > > >> une r > > >> > > >> I wonder if ADC config logic still works for superheterodyne tuners > > >> (tuner having IF). I changed it to adc / 2 always due to IT9135 tuner. > > >> That makes me wonder it possible breaks tuners having IF, as ADC was > > >> clocked just over 20MHz and if it is half then it is 10MHz. For BB that > > >> is enough, but I think that having IF, which is 4MHz at least for 8MHz > > >> BW it is too less. > > >> > > >> F*ck I hate to maintain driver without a hardware! Any idea where I can > > >> get AF9035 device having tda18218 or mxl5007t? > > >> > > >> regards > > >> Antti > > > > > > Still pending the changes for mxl5007t. Attached is a patch for that. > > > > > > Changes to make work Avermedia Twinstar with the af9035 driver. > > > > > > Signed-off-by: Jose Alberto Reguero > > > > I cannot do much about this as it changes mxl5007t driver which is not > > maintained by me. :) > > > > regards > > Antti > > > > Adding CC to Michael Krufky because it is the maintainer of mxl5007t driver. > Michael, any chance to get this patch merged? > > Jose Alberto > > > > Jose Alberto > > > > > > diff -upr linux/drivers/media/tuners/mxl5007t.c > > > linux.new/drivers/media/tuners/mxl5007t.c > > > --- linux/drivers/media/tuners/mxl5007t.c 2012-08-14 05:45:22.000000000 > > > +0200 +++ linux.new/drivers/media/tuners/mxl5007t.c 2013-01-10 > > > 19:23:09.247556275 +0100 > > > @@ -374,7 +374,6 @@ static struct reg_pair_t *mxl5007t_calc_ > > > > > > mxl5007t_set_if_freq_bits(state, cfg->if_freq_hz, cfg->invert_if); > > > mxl5007t_set_xtal_freq_bits(state, cfg->xtal_freq_hz); > > > > > > - set_reg_bits(state->tab_init, 0x04, 0x01, cfg->loop_thru_enable); > > > > > > set_reg_bits(state->tab_init, 0x03, 0x08, cfg->clk_out_enable << 3); > > > set_reg_bits(state->tab_init, 0x03, 0x07, cfg->clk_out_amp); > > > > > > @@ -531,9 +530,12 @@ static int mxl5007t_tuner_init(struct mx > > > > > > struct reg_pair_t *init_regs; > > > int ret; > > > > > > - ret = mxl5007t_soft_reset(state); > > > - if (mxl_fail(ret)) > > > + if (!state->config->no_reset) { > > > + ret = mxl5007t_soft_reset(state); > > > + if (mxl_fail(ret)) > > > > > > goto fail; > > > > > > + } > > > + > > > > > > /* calculate initialization reg array */ > > > init_regs = mxl5007t_calc_init_regs(state, mode); > > > > > > @@ -887,7 +889,12 @@ struct dvb_frontend *mxl5007t_attach(str > > > > > > if (fe->ops.i2c_gate_ctrl) > > > > > > fe->ops.i2c_gate_ctrl(fe, 1); > > > > > > - ret = mxl5007t_get_chip_id(state); > > > + if (!state->config->no_probe) > > > + ret = mxl5007t_get_chip_id(state); > > > + > > > + ret = mxl5007t_write_reg(state, 0x04, > > > + state->config->loop_thru_enable); > > > + > > > > > > if (fe->ops.i2c_gate_ctrl) > > > > > > fe->ops.i2c_gate_ctrl(fe, 0); > > > > > > diff -upr linux/drivers/media/tuners/mxl5007t.h > > > linux.new/drivers/media/tuners/mxl5007t.h > > > --- linux/drivers/media/tuners/mxl5007t.h 2012-08-14 05:45:22.000000000 > > > +0200 +++ linux.new/drivers/media/tuners/mxl5007t.h 2013-01-10 > > > 19:19:11.204379581 +0100 > > > @@ -73,8 +73,10 @@ struct mxl5007t_config { > > > > > > enum mxl5007t_xtal_freq xtal_freq_hz; > > > enum mxl5007t_if_freq if_freq_hz; > > > unsigned int invert_if:1; > > > > > > - unsigned int loop_thru_enable:1; > > > + unsigned int loop_thru_enable:3; > > > > > > unsigned int clk_out_enable:1; > > > > > > + unsigned int no_probe:1; > > > + unsigned int no_reset:1; > > > > > > }; > > > > > > #if defined(CONFIG_MEDIA_TUNER_MXL5007T) || > > > > > > (defined(CONFIG_MEDIA_TUNER_MXL5007T_MODULE) && defined(MODULE)) > > > diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.c > > > linux.new/drivers/media/usb/dvb-usb-v2/af9035.c > > > --- linux/drivers/media/usb/dvb-usb-v2/af9035.c 2013-01-07 > > > 05:45:57.000000000 +0100 > > > +++ linux.new/drivers/media/usb/dvb-usb-v2/af9035.c 2013-01-12 > > > 00:30:57.557310465 +0100 > > > @@ -886,13 +886,17 @@ static struct mxl5007t_config af9035_mxl > > > > > > .loop_thru_enable = 0, > > > .clk_out_enable = 0, > > > .clk_out_amp = MxL_CLKOUT_AMP_0_94V, > > > > > > + .no_probe = 1, > > > + .no_reset = 1, > > > > > > }, { > > > > > > .xtal_freq_hz = MxL_XTAL_24_MHZ, > > > .if_freq_hz = MxL_IF_4_57_MHZ, > > > .invert_if = 0, > > > > > > - .loop_thru_enable = 1, > > > + .loop_thru_enable = 3, > > > > > > .clk_out_enable = 1, > > > .clk_out_amp = MxL_CLKOUT_AMP_0_94V, > > > > > > + .no_probe = 1, > > > + .no_reset = 1, > > > > > > } > > > > > > }; > -- Sending again because some lines are mangled. Changes to make work Avermedia Twinstar with the af9035 driver. Signed-off-by: Jose Alberto Reguero --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -upr linux/drivers/media/tuners/mxl5007t.c linux.new/drivers/media/tuners/mxl5007t.c --- linux/drivers/media/tuners/mxl5007t.c 2012-08-14 05:45:22.000000000 +0200 +++ linux.new/drivers/media/tuners/mxl5007t.c 2013-01-10 19:23:09.247556275 +0100 @@ -374,7 +374,6 @@ static struct reg_pair_t *mxl5007t_calc_ mxl5007t_set_if_freq_bits(state, cfg->if_freq_hz, cfg->invert_if); mxl5007t_set_xtal_freq_bits(state, cfg->xtal_freq_hz); - set_reg_bits(state->tab_init, 0x04, 0x01, cfg->loop_thru_enable); set_reg_bits(state->tab_init, 0x03, 0x08, cfg->clk_out_enable << 3); set_reg_bits(state->tab_init, 0x03, 0x07, cfg->clk_out_amp); @@ -531,9 +530,12 @@ static int mxl5007t_tuner_init(struct mx struct reg_pair_t *init_regs; int ret; - ret = mxl5007t_soft_reset(state); - if (mxl_fail(ret)) + if (!state->config->no_reset) { + ret = mxl5007t_soft_reset(state); + if (mxl_fail(ret)) goto fail; + } + /* calculate initialization reg array */ init_regs = mxl5007t_calc_init_regs(state, mode); @@ -887,7 +889,12 @@ struct dvb_frontend *mxl5007t_attach(str if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); - ret = mxl5007t_get_chip_id(state); + if (!state->config->no_probe) + ret = mxl5007t_get_chip_id(state); + + ret = mxl5007t_write_reg(state, 0x04, + state->config->loop_thru_enable); + if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); diff -upr linux/drivers/media/tuners/mxl5007t.h linux.new/drivers/media/tuners/mxl5007t.h --- linux/drivers/media/tuners/mxl5007t.h 2012-08-14 05:45:22.000000000 +0200 +++ linux.new/drivers/media/tuners/mxl5007t.h 2013-01-10 19:19:11.204379581 +0100 @@ -73,8 +73,10 @@ struct mxl5007t_config { enum mxl5007t_xtal_freq xtal_freq_hz; enum mxl5007t_if_freq if_freq_hz; unsigned int invert_if:1; - unsigned int loop_thru_enable:1; + unsigned int loop_thru_enable:3; unsigned int clk_out_enable:1; + unsigned int no_probe:1; + unsigned int no_reset:1; }; #if defined(CONFIG_MEDIA_TUNER_MXL5007T) || (defined(CONFIG_MEDIA_TUNER_MXL5007T_MODULE) && defined(MODULE)) diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.c linux.new/drivers/media/usb/dvb-usb-v2/af9035.c --- linux/drivers/media/usb/dvb-usb-v2/af9035.c 2013-01-07 05:45:57.000000000 +0100 +++ linux.new/drivers/media/usb/dvb-usb-v2/af9035.c 2013-01-12 00:30:57.557310465 +0100 @@ -886,13 +886,17 @@ static struct mxl5007t_config af9035_mxl .loop_thru_enable = 0, .clk_out_enable = 0, .clk_out_amp = MxL_CLKOUT_AMP_0_94V, + .no_probe = 1, + .no_reset = 1, }, { .xtal_freq_hz = MxL_XTAL_24_MHZ, .if_freq_hz = MxL_IF_4_57_MHZ, .invert_if = 0, - .loop_thru_enable = 1, + .loop_thru_enable = 3, .clk_out_enable = 1, .clk_out_amp = MxL_CLKOUT_AMP_0_94V, + .no_probe = 1, + .no_reset = 1, } };