From patchwork Sun Apr 9 19:38:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9671729 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 DCEE9600CB for ; Sun, 9 Apr 2017 19:38:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C95C226E8A for ; Sun, 9 Apr 2017 19:38:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE47B27F10; Sun, 9 Apr 2017 19:38:49 +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 6B0ED26E8A for ; Sun, 9 Apr 2017 19:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752615AbdDITis (ORCPT ); Sun, 9 Apr 2017 15:38:48 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35880 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752440AbdDITil (ORCPT ); Sun, 9 Apr 2017 15:38:41 -0400 Received: by mail-wm0-f68.google.com with SMTP id q125so6399675wmd.3 for ; Sun, 09 Apr 2017 12:38:40 -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=Y8J64Uat+GPp33ddzf9sJN9dPUBmQJ7YDRqZmBaC1VA=; b=YlatB543jKuskVFDtQIzsuqsf7KGRdTFYfy+XslGOR9c4HXTGnKMyLJXOCk+sYHSWo kMIZNrN4H5WAVBa2oudAW0ok5CT90frz5SL9f1YIoIcghE4rsPZMnmKsTThXsJXErZEP +eIuSO8i1dnQ+s35t5gw7D8sU7apW8zT233fBslPUHh1hnsrfLEOhw+HQLklL6TATmXe t7nUjLB8SHnXxwUbkE7+CCIlEM6h8QzMYS0YAZXpUnQL059aOCUI81sS4o2fziSyOfzF GwYowAlLvlUjjDfJYn7akF0iGu1Ln8KnvmY/BWyFp3JKZjmMHGAW/zHXGdAoHBjTcOaE OleA== 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=Y8J64Uat+GPp33ddzf9sJN9dPUBmQJ7YDRqZmBaC1VA=; b=hoZvLMOcO1Y/WbFAjiEAfbseq+JP7eJaFb4Dvpy8apiQhpcxk2k0Ab1KgGJbfx3NGP JGWvF87iAhrbZz7w7dPp45KYCI7bh7f6fAgOgiZBHfrSotY7YpMzIKuDg2WDVbLLaE9R 8IKrvCeU0vbyUZ2CHy788usEegUHWOlvXET1yy/8ekLfrVURavU33/+3lrgmtXsEfauj obkV/bfH5hanIJA+LwQVwKIm8blFGQ5W2E49SAx1kg0xOyyVeG82VWf4QUfNRqXzWW7v hwpabz3cb6fHqAar3uJqlMMVJH2BTxcBmyTzvo9F0Tf7yhFJcp2dIp5Ha8sTvoUYN4Yh wv+g== X-Gm-Message-State: AN3rC/7n9opnLVGc0uvv5my01u9MjpypY8TZDASL1+HTsUZ6ZRWWqEcI gYrxD/kwGbNvzQ== X-Received: by 10.28.17.11 with SMTP id 11mr7359550wmr.32.1491766719497; Sun, 09 Apr 2017 12:38:39 -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 f135sm7441407wmd.7.2017.04.09.12.38.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 09 Apr 2017 12:38:38 -0700 (PDT) From: Daniel Scheller To: aospan@netup.ru, serjk@netup.ru, mchehab@kernel.org, linux-media@vger.kernel.org Cc: rjkm@metzlerbros.de Subject: [PATCH 09/19] [media] dvb-frontends/cxd2841er: TS_SERIAL config flag Date: Sun, 9 Apr 2017 21:38:18 +0200 Message-Id: <20170409193828.18458-10-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170409193828.18458-1-d.scheller.oss@gmail.com> References: <20170409193828.18458-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 Some constellations work/need a serial TS transport mode. This adds a flag that will toggle set up of such mode. Signed-off-by: Daniel Scheller Acked-by: Abylay Ospan --- drivers/media/dvb-frontends/cxd2841er.c | 18 ++++++++++++++++-- drivers/media/dvb-frontends/cxd2841er.h | 5 +++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c index fa6a963..1df95c4 100644 --- a/drivers/media/dvb-frontends/cxd2841er.c +++ b/drivers/media/dvb-frontends/cxd2841er.c @@ -912,6 +912,18 @@ static void cxd2841er_set_ts_clock_mode(struct cxd2841er_priv *priv, /* * slave Bank Addr Bit default Name + * 00h C4h [1:0] 2'b?? OSERCKMODE + */ + cxd2841er_set_reg_bits(priv, I2C_SLVT, 0xc4, + ((priv->flags & CXD2841ER_TS_SERIAL) ? 0x01 : 0x00), 0x03); + /* + * slave Bank Addr Bit default Name + * 00h D1h [1:0] 2'b?? OSERDUTYMODE + */ + cxd2841er_set_reg_bits(priv, I2C_SLVT, 0xd1, + ((priv->flags & CXD2841ER_TS_SERIAL) ? 0x01 : 0x00), 0x03); + /* + * slave Bank Addr Bit default Name * 00h D9h [7:0] 8'h08 OTSCKPERIOD */ cxd2841er_write_reg(priv, I2C_SLVT, 0xd9, 0x08); @@ -925,7 +937,8 @@ static void cxd2841er_set_ts_clock_mode(struct cxd2841er_priv *priv, * slave Bank Addr Bit default Name * 00h 33h [1:0] 2'b01 OREG_CKSEL_TSIF */ - cxd2841er_set_reg_bits(priv, I2C_SLVT, 0x33, 0x00, 0x03); + cxd2841er_set_reg_bits(priv, I2C_SLVT, 0x33, + ((priv->flags & CXD2841ER_TS_SERIAL) ? 0x01 : 0x00), 0x03); /* * Enable TS IF Clock * slave Bank Addr Bit default Name @@ -3745,7 +3758,8 @@ static int cxd2841er_init_tc(struct dvb_frontend *fe) cxd2841er_write_reg(priv, I2C_SLVT, 0xcd, 0x50); /* SONY_DEMOD_CONFIG_PARALLEL_SEL = 1 */ cxd2841er_write_reg(priv, I2C_SLVT, 0x00, 0x00); - cxd2841er_set_reg_bits(priv, I2C_SLVT, 0xc4, 0x00, 0x80); + cxd2841er_set_reg_bits(priv, I2C_SLVT, 0xc4, + ((priv->flags & CXD2841ER_TS_SERIAL) ? 0x80 : 0x00), 0x80); cxd2841er_init_stats(fe); diff --git a/drivers/media/dvb-frontends/cxd2841er.h b/drivers/media/dvb-frontends/cxd2841er.h index 38d7f9f..58fbd98 100644 --- a/drivers/media/dvb-frontends/cxd2841er.h +++ b/drivers/media/dvb-frontends/cxd2841er.h @@ -24,8 +24,9 @@ #include -#define CXD2841ER_USE_GATECTRL 1 -#define CXD2841ER_AUTO_IFHZ 2 +#define CXD2841ER_USE_GATECTRL 1 /* bit 0 */ +#define CXD2841ER_AUTO_IFHZ 2 /* bit 1 */ +#define CXD2841ER_TS_SERIAL 4 /* bit 2 */ enum cxd2841er_xtal { SONY_XTAL_20500, /* 20.5 MHz */