From patchwork Wed May 9 20:08:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 10390799 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 9365D60318 for ; Wed, 9 May 2018 20:08:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 824AD27CEA for ; Wed, 9 May 2018 20:08:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7726C28113; Wed, 9 May 2018 20:08:16 +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 AE0BC27CEA for ; Wed, 9 May 2018 20:08:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965120AbeEIUIO (ORCPT ); Wed, 9 May 2018 16:08:14 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:51543 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964892AbeEIUIK (ORCPT ); Wed, 9 May 2018 16:08:10 -0400 Received: by mail-wm0-f67.google.com with SMTP id j4-v6so507408wme.1 for ; Wed, 09 May 2018 13:08:09 -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=q/KacYBl5KnxoNTWjcF9N1GMD3W4lGmsTFMezbxp29c=; b=tvIriCNlOaOdJs6H1qFJ5irMDMsLm27KKfjsypGeGmYITyf1TeNdXfcqLk2exoA7y8 j4yeQPtiMo5iow51KZnpsBq440gc8sWLozpAOk4Dyj2dwACrLOkWXdMz6uH3BY7tjLRb EBVw4tZdUelEM4ORJiyYN6peMKK38Oz0XNqbmk3m/OaUOIuj3p66HYMVEBDjKtFBrxfN 9eOQLualjKNjiylm8se81sy5Cxu84mLWsUKmjRP2nf4lo61KmWWThfERzGJ348JDyjAz ctJcJ9B2TN/wNnmUp1O0q8PfvH/lAiWzJ8pvujP4ddBST14gIlaveFV+EGNLGqIEYMkS Jguw== 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=q/KacYBl5KnxoNTWjcF9N1GMD3W4lGmsTFMezbxp29c=; b=HyjiSlN3Gc35zdaJ6xiD1LGv1lAcIK+kppeSZ7Ra0XyaRv1XuxZalfJzMIkwMwEiO7 knNghMJbvWszpAy/eFPFlaR1kfsaNIUO6jsPx2XhB1iZs6No82cmF3KDBO6wXE4671cc L55mb+V5yya3icmJA+U1CWQ+A/aNIF2G1At4wwAEsl/ZuiRAdk6xDbZSgkuYikvK15Xb A2w4aqG0kAbd2rCTeE+RajyGTDeMsysdHFuJM80oGkF1hZNfcVydGc1gQIb22rgi1nO3 s99tDijEvKI7M4S0Wp3MGkfx9Rpg5JUpwPBcJaWbKlsPjyCxKEYGP+8Mi6vcnp3FZh/O 5CVw== X-Gm-Message-State: ALKqPwd01kbV6yelen0+i6E+RMVB95NZIT6QVhB5KTJlOpOC38TBkAWK hmHc4iJpJ5T+lZWuFbQDPl6ZwA== X-Google-Smtp-Source: AB8JxZplyCSpszAjJ+OIoNp2pBmwZsRI0uANGX1TtWESzwiIoseAXzDTYHQ5O+tULSY13/pUWl775A== X-Received: by 10.28.229.74 with SMTP id c71mr6185240wmh.55.1525896488504; Wed, 09 May 2018 13:08:08 -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.07 (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 3/4] [media] dvb-frontends/stv0910: make TS speed configurable Date: Wed, 9 May 2018 22:08:02 +0200 Message-Id: <20180509200803.5253-4-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 Add a tsspeed config option to struct stv0910_cfg which can be used by users of the driver to set the (parallel) TS speed (higher speeds enable support for higher bitrate transponders). If tsspeed isn't set in the config, it'll default to a sane value. This commit also updates the two consumers of the stv0910 driver (ngene and ddbridge) to have a default tsspeed in their stv0910_cfg templates. Signed-off-by: Daniel Scheller Tested-by: Richard Scobie Tested-by: Helmut Auer --- drivers/media/dvb-frontends/stv0910.c | 5 ++--- drivers/media/dvb-frontends/stv0910.h | 1 + drivers/media/pci/ddbridge/ddbridge-core.c | 1 + drivers/media/pci/ngene/ngene-cards.c | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/dvb-frontends/stv0910.c b/drivers/media/dvb-frontends/stv0910.c index 7e9b016b3b28..41444fa1c0bb 100644 --- a/drivers/media/dvb-frontends/stv0910.c +++ b/drivers/media/dvb-frontends/stv0910.c @@ -1200,7 +1200,6 @@ static int probe(struct stv *state) write_reg(state, RSTV0910_P1_TSCFGM, 0xC0); /* Manual speed */ write_reg(state, RSTV0910_P1_TSCFGL, 0x20); - /* Speed = 67.5 MHz */ write_reg(state, RSTV0910_P1_TSSPEED, state->tsspeed); write_reg(state, RSTV0910_P2_TSCFGH, state->tscfgh | 0x01); @@ -1208,7 +1207,6 @@ static int probe(struct stv *state) write_reg(state, RSTV0910_P2_TSCFGM, 0xC0); /* Manual speed */ write_reg(state, RSTV0910_P2_TSCFGL, 0x20); - /* Speed = 67.5 MHz */ write_reg(state, RSTV0910_P2_TSSPEED, state->tsspeed); /* Reset stream merger */ @@ -1790,7 +1788,8 @@ struct dvb_frontend *stv0910_attach(struct i2c_adapter *i2c, state->tscfgh = 0x20 | (cfg->parallel ? 0 : 0x40); state->tsgeneral = (cfg->parallel == 2) ? 0x02 : 0x00; state->i2crpt = 0x0A | ((cfg->rptlvl & 0x07) << 4); - state->tsspeed = 0x28; + /* use safe tsspeed value if unspecified through stv0910_cfg */ + state->tsspeed = (cfg->tsspeed ? cfg->tsspeed : 0x28); state->nr = nr; state->regoff = state->nr ? 0 : 0x200; state->search_range = 16000000; diff --git a/drivers/media/dvb-frontends/stv0910.h b/drivers/media/dvb-frontends/stv0910.h index fccd8d9b665f..f37171b7a2de 100644 --- a/drivers/media/dvb-frontends/stv0910.h +++ b/drivers/media/dvb-frontends/stv0910.h @@ -10,6 +10,7 @@ struct stv0910_cfg { u8 parallel; u8 rptlvl; u8 single; + u8 tsspeed; }; #if IS_REACHABLE(CONFIG_DVB_STV0910) diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index 377269c64449..6c2341642017 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -1183,6 +1183,7 @@ static const struct stv0910_cfg stv0910_p = { .parallel = 1, .rptlvl = 4, .clk = 30000000, + .tsspeed = 0x28, }; static const struct lnbh25_config lnbh25_cfg = { diff --git a/drivers/media/pci/ngene/ngene-cards.c b/drivers/media/pci/ngene/ngene-cards.c index 7738565193d6..7a106bc11a2b 100644 --- a/drivers/media/pci/ngene/ngene-cards.c +++ b/drivers/media/pci/ngene/ngene-cards.c @@ -327,6 +327,7 @@ static struct stv0910_cfg stv0910_p = { .parallel = 1, .rptlvl = 4, .clk = 30000000, + .tsspeed = 0x28, }; static struct lnbh25_config lnbh25_cfg = {