From patchwork Mon May 5 20:46:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CrazyCat X-Patchwork-Id: 4117271 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7699CBFF02 for ; Mon, 5 May 2014 20:53:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FF2A20222 for ; Mon, 5 May 2014 20:53:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 53DF420221 for ; Mon, 5 May 2014 20:53:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756294AbaEEUxc (ORCPT ); Mon, 5 May 2014 16:53:32 -0400 Received: from forward14.mail.yandex.net ([95.108.130.92]:37747 "EHLO forward14.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755686AbaEEUxb (ORCPT ); Mon, 5 May 2014 16:53:31 -0400 X-Greylist: delayed 384 seconds by postgrey-1.27 at vger.kernel.org; Mon, 05 May 2014 16:53:31 EDT Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68]) by forward14.mail.yandex.net (Yandex) with ESMTP id EFF281981B71 for ; Tue, 6 May 2014 00:47:03 +0400 (MSK) Received: from smtp13.mail.yandex.net (localhost [127.0.0.1]) by smtp13.mail.yandex.net (Yandex) with ESMTP id CBF28E4014E for ; Tue, 6 May 2014 00:47:03 +0400 (MSK) Received: from 46-211-181-25-gprs.kyivstar.net (46-211-181-25-gprs.kyivstar.net [46.211.181.25]) by smtp13.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rGKHAHhAX9-l2hisMWs; Tue, 6 May 2014 00:47:02 +0400 (using TLSv1.1 with cipher AES256-SHA (256/256 bits)) (Client certificate not present) X-Yandex-Uniq: c4cf7da1-2346-44a4-877d-5120a48fd22d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narod.ru; s=mail; t=1399322823; bh=1qxjGBX1wuhVQsavod3/8B8Wa7eGsXHHWg9E+TnrzwA=; h=From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Transfer-Encoding:Content-Type; b=NflYVJ7hOs4Kq3gOu00/XdqAj0nXxwqpXvoLmhpTPYopV8DnhTFnk7oQcJqPFftTm Vzrhq/pW93lQfsoyIVn0OQYtM6j5wHrWW+pYScjoIHzXvOJystS5ddasdw0MC6vVFV vYFUTyu6bp/MtyaNnmTFwYODk8btdpgn3n9Kh8iI= Authentication-Results: smtp13.mail.yandex.net; dkim=pass header.i=@narod.ru From: CrazyCat To: linux-media@vger.kernel.org Subject: [PATCH] cxd2820r: TS clock inversion in config Date: Mon, 05 May 2014 23:46:59 +0300 Message-ID: <6929939.mWPG6Zt5A4@ubuntu> User-Agent: KMail/4.8.5 (Linux/3.2.0-48-generic-pae; KDE/4.8.5; i686; ; ) MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP TS clock inversion in config. Signed-off-by: Evgeny Plehov --- 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 --git a/drivers/media/dvb-frontends/cxd2820r.h b/drivers/media/dvb-frontends/cxd2820r.h index 82b3d93..6095dbc 100644 --- a/drivers/media/dvb-frontends/cxd2820r.h +++ b/drivers/media/dvb-frontends/cxd2820r.h @@ -52,6 +52,12 @@ struct cxd2820r_config { */ u8 ts_mode; + /* TS clock inverted. + * Default: 0 + * Values: 0, 1 + */ + bool ts_clock_inv; + /* IF AGC polarity. * Default: 0 * Values: 0, 1 diff --git a/drivers/media/dvb-frontends/cxd2820r_c.c b/drivers/media/dvb-frontends/cxd2820r_c.c index 5c6ab49..0f4657e 100644 --- a/drivers/media/dvb-frontends/cxd2820r_c.c +++ b/drivers/media/dvb-frontends/cxd2820r_c.c @@ -45,6 +45,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe) { 0x1008b, 0x07, 0xff }, { 0x1001f, priv->cfg.if_agc_polarity << 7, 0x80 }, { 0x10070, priv->cfg.ts_mode, 0xff }, + { 0x10071, !priv->cfg.ts_clock_inv << 4, 0x10 }, }; dev_dbg(&priv->i2c->dev, "%s: frequency=%d symbol_rate=%d\n", __func__, diff --git a/drivers/media/dvb-frontends/cxd2820r_t.c b/drivers/media/dvb-frontends/cxd2820r_t.c index fa184ca..9b5a45b 100644 --- a/drivers/media/dvb-frontends/cxd2820r_t.c +++ b/drivers/media/dvb-frontends/cxd2820r_t.c @@ -46,6 +46,7 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe) { 0x00088, 0x01, 0xff }, { 0x00070, priv->cfg.ts_mode, 0xff }, + { 0x00071, !priv->cfg.ts_clock_inv << 4, 0x10 }, { 0x000cb, priv->cfg.if_agc_polarity << 6, 0x40 }, { 0x000a5, 0x00, 0x01 }, { 0x00082, 0x20, 0x60 }, diff --git a/drivers/media/dvb-frontends/cxd2820r_t2.c b/drivers/media/dvb-frontends/cxd2820r_t2.c index 2ba130e..9c0c4f4 100644 --- a/drivers/media/dvb-frontends/cxd2820r_t2.c +++ b/drivers/media/dvb-frontends/cxd2820r_t2.c @@ -47,6 +47,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe) { 0x02083, 0x0a, 0xff }, { 0x020cb, priv->cfg.if_agc_polarity << 6, 0x40 }, { 0x02070, priv->cfg.ts_mode, 0xff }, + { 0x02071, !priv->cfg.ts_clock_inv << 6, 0x40 }, { 0x020b5, priv->cfg.spec_inv << 4, 0x10 }, { 0x02567, 0x07, 0x0f }, { 0x02569, 0x03, 0x03 }, diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c index ae0f56a..7135a3e 100644 --- a/drivers/media/usb/dvb-usb/dw2102.c +++ b/drivers/media/usb/dvb-usb/dw2102.c @@ -1109,6 +1109,7 @@ static struct ds3000_config su3000_ds3000_config = { static struct cxd2820r_config cxd2820r_config = { .i2c_address = 0x6c, /* (0xd8 >> 1) */ .ts_mode = 0x38, + .ts_clock_inv = 1, }; static struct tda18271_config tda18271_config = { @@ -1387,20 +1388,27 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d) static int t220_frontend_attach(struct dvb_usb_adapter *d) { - u8 obuf[3] = { 0xe, 0x80, 0 }; + u8 obuf[3] = { 0xe, 0x87, 0 }; u8 ibuf[] = { 0 }; if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0) err("command 0x0e transfer failed."); obuf[0] = 0xe; - obuf[1] = 0x83; + obuf[1] = 0x86; + obuf[2] = 1; + + if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0) + err("command 0x0e transfer failed."); + + obuf[0] = 0xe; + obuf[1] = 0x80; obuf[2] = 0; if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0) err("command 0x0e transfer failed."); - msleep(100); + msleep(50); obuf[0] = 0xe; obuf[1] = 0x80;