From patchwork Sun Feb 3 22:40:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Alberto Reguero X-Patchwork-Id: 2088251 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id AA2CAE00C6 for ; Sun, 3 Feb 2013 22:40:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753854Ab3BCWk3 (ORCPT ); Sun, 3 Feb 2013 17:40:29 -0500 Received: from impaqm1.telefonica.net ([213.4.138.17]:20794 "EHLO telefonica.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753760Ab3BCWk2 (ORCPT ); Sun, 3 Feb 2013 17:40:28 -0500 Received: from IMPmailhost6.adm.correo ([10.20.102.127]) by IMPaqm1.telefonica.net with bizsmtp id vsFg1k00g2kvMAa3MygSmv; Sun, 03 Feb 2013 23:40:27 +0100 Received: from jar7.dominio ([83.42.127.26]) by IMPmailhost6.adm.correo with BIZ IMP id vygS1k0010aJ3lP1mygS58; Sun, 03 Feb 2013 23:40:26 +0100 X-Brightmail-Tracker: AAAAAA== X-original-sender: jareguero@telefonica.net From: Jose Alberto Reguero To: Michael Krufky Cc: Antti Palosaari , Gianluca Gennari , LMML Subject: [PATH 2/2] mxl5007 move loop_thru to attach Date: Sun, 03 Feb 2013 23:40:24 +0100 Message-ID: <3605279.72np2izzp3@jar7.dominio> User-Agent: KMail/4.9.5 (Linux/3.6.7-4.fc17.x86_64; KDE/4.9.5; x86_64; ; ) In-Reply-To: <2289340.7RydykYGjZ@jar7.dominio> References: <2289340.7RydykYGjZ@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 This patch move the loop_thru configuration to the attach function, because with dual tuners until loop_tru configuration the other tuner don't work. Signed-off-by: Jose Alberto Reguero Reviewed-by: Antti Palosaari --- 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 2013-02-03 23:16:08.031628907 +0100 +++ linux.new/drivers/media/tuners/mxl5007t.c 2013-02-03 23:14:12.196089297 +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); @@ -908,6 +907,18 @@ struct dvb_frontend *mxl5007t_attach(str if (mxl_fail(ret)) goto fail; + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); + + ret = mxl5007t_write_reg(state, 0x04, + state->config->loop_thru_enable); + + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 0); + + if (mxl_fail(ret)) + goto fail; + fe->tuner_priv = state; mutex_unlock(&mxl5007t_list_mutex);