From patchwork Wed May 9 20:08:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 10390801 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 41E2F60318 for ; Wed, 9 May 2018 20:08:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3196F28113 for ; Wed, 9 May 2018 20:08:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2682C28138; Wed, 9 May 2018 20:08:17 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 B2E7927CEA for ; Wed, 9 May 2018 20:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965107AbeEIUIN (ORCPT ); Wed, 9 May 2018 16:08:13 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:46343 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965000AbeEIUIK (ORCPT ); Wed, 9 May 2018 16:08:10 -0400 Received: by mail-wr0-f193.google.com with SMTP id a12-v6so5826071wrn.13 for ; Wed, 09 May 2018 13:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=5BhrLInceNTYHcp8T6BNZPTSYKOuwm9Mzwg9gaSgxho=; b=pBazfy6hOtN3qmZZazCkdLh6xJvSMTxyscNDa6qGH8NhCHqm17xHtE6Ugbqz52B8Ch K+YL4JMGdl2OukBp1a3zi6bWFZuQZNM73fRbtiqdkVri2BmuANDRRH+e28e+HPi+q16/ NFpOqTaVlSbX+Vn0bd5VNil6zFetEL4owNxYSQJUmdSfKskapl78JiS7gJHY2rgbbWLy 6KLNaFoXDP3xRN2qCs4GofdbbSR/sX/P6rDufJNSI2nBAH3JCnw06M97eUIQGLd2Xjo3 fSma6i4l9vcJk++aXOiqis3IxmXKsFBEHdMFTZgj4+2cfl4AIkjduOLC9+UnoU1maE9W bJdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=5BhrLInceNTYHcp8T6BNZPTSYKOuwm9Mzwg9gaSgxho=; b=b54ipWH9Dub84VzhCQlzFt0nMu6d9zQc8L2ixlOxIGNtnmmUfGxThtr2C/MRWsmCXN gfLKrpT5EWmFDLTLSpTsuhf5bC8oHEcZdKy3VQYrGBv4XZWP4xqKyRxipskBBd+dY5EB PIGBPsjuhDLhg7QBCuwT6wwG+EsDFtb2dsvH8QNRQ6RdF1LW1IZVz3H2A5qJf2Ru0hbu omWfu493Uy5wFTYaVTNP94vN/6OJbsj6GzZehJ/hi39k4gFxVXkDUNkeT/t2ybB/Xg2l grrQmFRM7ypnnsl57wfBkJb/pmBZUES89DpfjAH4kiAVLnJQ46xRI21tC2/HBvEwG3Rc N/4w== X-Gm-Message-State: ALQs6tCZDbElMSR0wuIhU5LcWd8UVY2Tl9kDpN8QX8Jb+qslURmvwrEf lnz82zjOqpHatnDXBjs4/CwMog== X-Google-Smtp-Source: AB8JxZpFo4hVM04BnyiV1zwAqsE6UGwvEdEWyYUBNHODDlrJcduPfELq7YsWUDfrOUNsv7BTiv4hYA== X-Received: by 2002:adf:8644:: with SMTP id 4-v6mr40517572wrw.73.1525896489320; Wed, 09 May 2018 13:08:09 -0700 (PDT) Received: from dvbdev.wuest.de (ip-176-199-71-134.hsi06.unitymediagroup.de. [176.199.71.134]) by smtp.gmail.com with ESMTPSA id b66sm17813037wma.48.2018.05.09.13.08.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 May 2018 13:08:08 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com, mchehab+samsung@kernel.org Subject: [PATCH 4/4] [media] ddbridge: conditionally enable fast TS for stv0910-equipped bridges Date: Wed, 9 May 2018 22:08:03 +0200 Message-Id: <20180509200803.5253-5-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180509200803.5253-1-d.scheller.oss@gmail.com> References: <20180509200803.5253-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 CineS2 V7(A) and Octopus CI S2 Pro/Advanced cards support faster TS speeds on the card's contained stv0910 demodulator when their FPGA was updated with a recent (>= 1.7, version number applies to all mentioned cards) vendor firmware. Enable this faster TS speed on card port 0 (contained demod) and parallel stv0910 connections when the card firmware is at least 1.7 or later. Note: The mentioned cards and their demods are handled via the STV0910_PR and STV0910_P tuner types. DuoFlex modules with such demodulators are handled via the STV0910 (without suffix) types where such TS speed increase doesn't technically make sense. Signed-off-by: Daniel Scheller Tested-by: Richard Scobie Tested-by: Helmut Auer --- drivers/media/pci/ddbridge/ddbridge-core.c | 34 +++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index 6c2341642017..d5b0d1eaf3ad 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -1191,7 +1191,7 @@ static const struct lnbh25_config lnbh25_cfg = { .data2_config = LNBH25_TEN }; -static int demod_attach_stv0910(struct ddb_input *input, int type) +static int demod_attach_stv0910(struct ddb_input *input, int type, int tsfast) { struct i2c_adapter *i2c = &input->port->i2c->adap; struct ddb_dvb *dvb = &input->port->dvb[input->nr & 1]; @@ -1204,6 +1204,12 @@ static int demod_attach_stv0910(struct ddb_input *input, int type) if (type) cfg.parallel = 2; + + if (tsfast) { + dev_info(dev, "Enabling stv0910 higher speed TS\n"); + cfg.tsspeed = 0x10; + } + dvb->fe = dvb_attach(stv0910_attach, i2c, &cfg, (input->nr & 1)); if (!dvb->fe) { cfg.adr = 0x6c; @@ -1439,7 +1445,25 @@ static int dvb_input_attach(struct ddb_input *input) struct ddb_port *port = input->port; struct dvb_adapter *adap = dvb->adap; struct dvb_demux *dvbdemux = &dvb->demux; - int par = 0, osc24 = 0; + struct ddb_ids *devids = &input->port->dev->link[input->port->lnr].ids; + int par = 0, osc24 = 0, tsfast = 0; + + /* + * Determine if bridges with stv0910 demods can run with fast TS and + * thus support high bandwidth transponders. + * STV0910_PR and STV0910_P tuner types covers all relevant bridges, + * namely the CineS2 V7(A) and the Octopus CI S2 Pro/Advanced. All + * DuoFlex S2 V4(A) have type=DDB_TUNER_DVBS_STV0910 without any suffix + * and are limited by the serial link to the bridge, thus won't work + * in fast TS mode. + */ + if (port->nr == 0 && + (port->type == DDB_TUNER_DVBS_STV0910_PR || + port->type == DDB_TUNER_DVBS_STV0910_P)) { + /* fast TS on port 0 requires FPGA version >= 1.7 */ + if ((devids->hwid & 0x00ffffff) >= 0x00010007) + tsfast = 1; + } dvb->attached = 0x01; @@ -1496,19 +1520,19 @@ static int dvb_input_attach(struct ddb_input *input) goto err_tuner; break; case DDB_TUNER_DVBS_STV0910: - if (demod_attach_stv0910(input, 0) < 0) + if (demod_attach_stv0910(input, 0, tsfast) < 0) goto err_detach; if (tuner_attach_stv6111(input, 0) < 0) goto err_tuner; break; case DDB_TUNER_DVBS_STV0910_PR: - if (demod_attach_stv0910(input, 1) < 0) + if (demod_attach_stv0910(input, 1, tsfast) < 0) goto err_detach; if (tuner_attach_stv6111(input, 1) < 0) goto err_tuner; break; case DDB_TUNER_DVBS_STV0910_P: - if (demod_attach_stv0910(input, 0) < 0) + if (demod_attach_stv0910(input, 0, tsfast) < 0) goto err_detach; if (tuner_attach_stv6111(input, 1) < 0) goto err_tuner;