From patchwork Sun Feb 3 22:30:38 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: 2088241 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 6CB5B3FCD5 for ; Sun, 3 Feb 2013 22:30:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753718Ab3BCWat (ORCPT ); Sun, 3 Feb 2013 17:30:49 -0500 Received: from impaqm2.telefonica.net ([213.4.138.18]:53955 "EHLO telefonica.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753380Ab3BCWat (ORCPT ); Sun, 3 Feb 2013 17:30:49 -0500 Received: from IMPmailhost1.adm.correo ([10.20.102.38]) by IMPaqm2.telefonica.net with bizsmtp id vxrN1k00m0piX6q3NyWlMp; Sun, 03 Feb 2013 23:30:45 +0100 Received: from jar7.dominio ([83.42.127.26]) by IMPmailhost1.adm.correo with BIZ IMP id vyWk1k00A0aJ3lP1hyWkVe; Sun, 03 Feb 2013 23:30:45 +0100 X-CMAE-Analysis: v=1.1 cv=8z4mVNkgHKLw40hQy/fAEIvQy1KghtMuD2tMRNZbokg= c=1 sm=1 a=D9TBEWTEldkA:10 a=iAkapVsz_sgA:10 a=VY-2JVJxNB4A:10 a=kj9zAlcOel0A:10 a=uPY472C+ydhKdlOjkJsQgQ==:17 a=WYd5oxahAAAA:8 a=-gOtnhdiETdJt7fHxXkA:9 a=CjuIK1q_8ugA:10 a=SIgZ-KYG32UA:10 a=uPY472C+ydhKdlOjkJsQgQ==:117 X-original-sender: jareguero@telefonica.net From: Jose Alberto Reguero To: Michael Krufky , Antti Palosaari , Gianluca Gennari , LMML Subject: [PATH 1/2] mxl5007 move reset to attach Date: Sun, 03 Feb 2013 23:30:38 +0100 Message-ID: <2289340.7RydykYGjZ@jar7.dominio> User-Agent: KMail/4.9.5 (Linux/3.6.7-4.fc17.x86_64; KDE/4.9.5; x86_64; ; ) 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 soft reset to the attach function because with dual tuners, when one tuner do reset, the other one is perturbed, and the stream has errors. 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 2012-08-14 05:45:22.000000000 +0200 +++ linux.new/drivers/media/tuners/mxl5007t.c 2013-02-03 23:03:03.784525410 +0100 @@ -531,10 +531,6 @@ static int mxl5007t_tuner_init(struct mx struct reg_pair_t *init_regs; int ret; - ret = mxl5007t_soft_reset(state); - if (mxl_fail(ret)) - goto fail; - /* calculate initialization reg array */ init_regs = mxl5007t_calc_init_regs(state, mode); @@ -900,7 +896,20 @@ struct dvb_frontend *mxl5007t_attach(str /* existing tuner instance */ break; } + + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); + + ret = mxl5007t_soft_reset(state); + + 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); memcpy(&fe->ops.tuner_ops, &mxl5007t_tuner_ops,