From patchwork Wed Mar 29 16:43:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9651971 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7B43A602C8 for ; Wed, 29 Mar 2017 16:43:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DD3F2845F for ; Wed, 29 Mar 2017 16:43:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6108428497; Wed, 29 Mar 2017 16:43:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13B342845F for ; Wed, 29 Mar 2017 16:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932250AbdC2Qnb (ORCPT ); Wed, 29 Mar 2017 12:43:31 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:32897 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753174AbdC2QnW (ORCPT ); Wed, 29 Mar 2017 12:43:22 -0400 Received: by mail-wr0-f195.google.com with SMTP id u18so4576172wrc.0 for ; Wed, 29 Mar 2017 09:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=25JIINX9BwGV3ZByN+Vgmx6VB/ncINm9mpNXNxE/Ius=; b=eXJy+XPF2EoQqLas8XAoiurLxovmzOKxEf2c7SmZ37AaQMHWew2fvRFd35Js8ePJzr JnGEcGISb8hk2gXO2PjGrgGBVK3KlDgehhXme6SeZy3n9ruS3arNSko/JIJsyCnpLS0+ Gt3BGK+7D2b2AtzN5UhUg6bcVhdc2ZVQNUNf/6OeyaG0/zF320ZUcanNZETPRksSakv/ i5+TgY6EOXo1k0DzOH4TVErqbs/xYEzhNWCF9FXmk4dWv7MjU788ng5YsLkuYg5k/9lu 3CDAbv20/OjpnvqRZVZ2Bv5dUdGxzJvrAfKMERDBDux+pC1RZIMIVGH6XlcN2/zyxSJk 5OVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=25JIINX9BwGV3ZByN+Vgmx6VB/ncINm9mpNXNxE/Ius=; b=hhqmCvMZxh3OWU3bOsVyV0mSgvb0FS2DS2GZCISUzNqBiqriLmFmPaVvp59YiUBlu4 HarWXPB+uOhMaJnZ+fgsHTV7NlBJT8JDSkpAMMEyfK25JcLTtEKdsTDRcmNX6+p8VMYa c2SozzGp4Pa0jMZ1fNUiubIlnWQ27R/PeiIagEcjqV9EPWCicNRiMID9VT1RoAzQlEc2 AxPTenCCaDbN34hLEKCqTS+Z70Y6OWipXumPzQEx4yMsnvIJ6e+reDyVVijjos776sTF HSWtWeH09g/7XHJ+HkbYvD1Xt2fXXsju7hvH+F/UScXoXru3V29ETDEneRmye8sTQ4I8 qCgg== X-Gm-Message-State: AFeK/H360Qj4RjLaUWyugG288Cb5lilquuz3/agvvE4z1NtPOqfePWyJHzFpbxJmqZXs+A== X-Received: by 10.223.173.165 with SMTP id w34mr1406808wrc.125.1490805800936; Wed, 29 Mar 2017 09:43:20 -0700 (PDT) Received: from dvbdev.wuest.de (ip-37-24-178-151.hsi14.unitymediagroup.de. [37.24.178.151]) by smtp.gmail.com with ESMTPSA id x127sm8835277wmf.31.2017.03.29.09.43.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Mar 2017 09:43:20 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org Cc: liplianin@netup.ru, rjkm@metzlerbros.de, crope@iki.fi Subject: [PATCH v3 06/13] [media] dvb-frontends/stv0367: make full reinit on set_frontend() optional Date: Wed, 29 Mar 2017 18:43:06 +0200 Message-Id: <20170329164313.14636-7-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170329164313.14636-1-d.scheller.oss@gmail.com> References: <20170329164313.14636-1-d.scheller.oss@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Scheller Every time dvb_frontend_ops.set_frontend() is called, an almost full reinit of the demodulator will be performed. While this might cause a slight delay when switching channels due to all involved tables being rewritten, it can even be dangerous in certain causes in that the demod may lock up and requires to be powercycled (this can happen on Digital Devices hardware). So this adds a flag if it should be done, and to not change behaviour with existing card support, it'll be enabled in all cases. Signed-off-by: Daniel Scheller --- drivers/media/dvb-frontends/stv0367.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index da10d9a..9370afa 100644 --- a/drivers/media/dvb-frontends/stv0367.c +++ b/drivers/media/dvb-frontends/stv0367.c @@ -93,6 +93,7 @@ struct stv0367_state { /* flags for operation control */ u8 use_i2c_gatectrl; u8 deftabs; + u8 reinit_on_setfrontend; }; #define RF_LOOKUP_TABLE_SIZE 31 @@ -1217,7 +1218,8 @@ static int stv0367ter_set_frontend(struct dvb_frontend *fe) s8 num_trials, index; u8 SenseTrials[] = { INVERSION_ON, INVERSION_OFF }; - stv0367ter_init(fe); + if (state->reinit_on_setfrontend) + stv0367ter_init(fe); if (fe->ops.tuner_ops.set_params) { if (state->use_i2c_gatectrl && fe->ops.i2c_gate_ctrl) @@ -1717,6 +1719,7 @@ struct dvb_frontend *stv0367ter_attach(const struct stv0367_config *config, /* demod operation options */ state->use_i2c_gatectrl = 1; state->deftabs = STV0367_DEFTAB_GENERIC; + state->reinit_on_setfrontend = 1; dprintk("%s: chip_id = 0x%x\n", __func__, state->chip_id); @@ -2511,7 +2514,8 @@ static int stv0367cab_set_frontend(struct dvb_frontend *fe) break; } - stv0367cab_init(fe); + if (state->reinit_on_setfrontend) + stv0367cab_init(fe); /* Tuner Frequency Setting */ if (fe->ops.tuner_ops.set_params) { @@ -2835,6 +2839,7 @@ struct dvb_frontend *stv0367cab_attach(const struct stv0367_config *config, /* demod operation options */ state->use_i2c_gatectrl = 1; state->deftabs = STV0367_DEFTAB_GENERIC; + state->reinit_on_setfrontend = 1; dprintk("%s: chip_id = 0x%x\n", __func__, state->chip_id);