From patchwork Fri Nov 14 21:22:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CrazyCat X-Patchwork-Id: 5309621 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 1722BC11AC for ; Fri, 14 Nov 2014 21:29:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4862020145 for ; Fri, 14 Nov 2014 21:29:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5FCD320138 for ; Fri, 14 Nov 2014 21:29:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161949AbaKNV3i (ORCPT ); Fri, 14 Nov 2014 16:29:38 -0500 Received: from forward8l.mail.yandex.net ([84.201.143.141]:48798 "EHLO forward8l.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754335AbaKNV3g (ORCPT ); Fri, 14 Nov 2014 16:29:36 -0500 Received: from smtp1m.mail.yandex.net (smtp1m.mail.yandex.net [77.88.61.132]) by forward8l.mail.yandex.net (Yandex) with ESMTP id 598E31A41270 for ; Sat, 15 Nov 2014 00:22:14 +0300 (MSK) Received: from smtp1m.mail.yandex.net (localhost [127.0.0.1]) by smtp1m.mail.yandex.net (Yandex) with ESMTP id F0BB267401E4 for ; Sat, 15 Nov 2014 00:22:13 +0300 (MSK) Received: from 46-211-129-192-gprs.kyivstar.net (46-211-129-192-gprs.kyivstar.net [46.211.129.192]) by smtp1m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id HQVWKzqeRZ-MDP0S9VR; Sat, 15 Nov 2014 00:22:13 +0300 (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (Client certificate not present) X-Yandex-Uniq: d0e70b41-cd01-49be-bb83-aca29f9ceddd DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narod.ru; s=mail; t=1416000133; bh=6Yju1EbHKHlRLpFzHdVp8rxAs3DtjlB4Vy9DIAfIN7E=; h=From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Transfer-Encoding:Content-Type; b=K24hm0XWZeFeDvrRtj2zFEH0Fxq4ZtuuCIPwAmiGsKMxDkCdepEi20hS4R1/GyRNv OK2WzJsU7HjvQ8or/nDvmZfowoKlzNUV8K4kFTH0Frvkxm+ywasq9P6sVMrjTIZJYW M27pkgbJYwOdkW1Fuf0wwwRO83OOszsuISzhtqwM= Authentication-Results: smtp1m.mail.yandex.net; dkim=pass header.i=@narod.ru From: CrazyCat To: linux-media Subject: [PATCH 2/3] si2168: TS clock inversion control. Date: Fri, 14 Nov 2014 23:22:10 +0200 Message-ID: <2586479.jPeNbxzlMS@computer> User-Agent: KMail/4.13.1 (Linux/3.13.0-24-generic; KDE/4.13.1; x86_64; ; ) 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=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 polarity control implemented. Signed-off-by: Evgeny Plehov Reviewed-by: Olli Salonen --- drivers/media/dvb-frontends/si2168.c | 7 +++++-- drivers/media/dvb-frontends/si2168.h | 4 ++++ drivers/media/dvb-frontends/si2168_priv.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index 7bac748..16a347a 100644 --- a/drivers/media/dvb-frontends/si2168.c +++ b/drivers/media/dvb-frontends/si2168.c @@ -308,14 +308,16 @@ static int si2168_set_frontend(struct dvb_frontend *fe) if (ret) goto err; - memcpy(cmd.args, "\x14\x00\x09\x10\xe3\x18", 6); + memcpy(cmd.args, "\x14\x00\x09\x10\xe3\x08", 6); + cmd.args[5] |= s->ts_clock_inv ? 0x00 : 0x10; cmd.wlen = 6; cmd.rlen = 4; ret = si2168_cmd_execute(s, &cmd); if (ret) goto err; - memcpy(cmd.args, "\x14\x00\x08\x10\xd7\x15", 6); + memcpy(cmd.args, "\x14\x00\x08\x10\xd7\x05", 6); + cmd.args[5] |= s->ts_clock_inv ? 0x00 : 0x10; cmd.wlen = 6; cmd.rlen = 4; ret = si2168_cmd_execute(s, &cmd); @@ -669,6 +671,7 @@ static int si2168_probe(struct i2c_client *client, *config->i2c_adapter = s->adapter; *config->fe = &s->fe; s->ts_mode = config->ts_mode; + s->ts_clock_inv = config->ts_clock_inv; s->fw_loaded = false; i2c_set_clientdata(client, s); diff --git a/drivers/media/dvb-frontends/si2168.h b/drivers/media/dvb-frontends/si2168.h index e086d67..87bc121 100644 --- a/drivers/media/dvb-frontends/si2168.h +++ b/drivers/media/dvb-frontends/si2168.h @@ -37,6 +37,10 @@ struct si2168_config { /* TS mode */ u8 ts_mode; + + /* TS clock inverted */ + bool ts_clock_inv; + }; #define SI2168_TS_PARALLEL 0x06 diff --git a/drivers/media/dvb-frontends/si2168_priv.h b/drivers/media/dvb-frontends/si2168_priv.h index 132df67..66ed675 100644 --- a/drivers/media/dvb-frontends/si2168_priv.h +++ b/drivers/media/dvb-frontends/si2168_priv.h @@ -36,6 +36,7 @@ struct si2168 { fe_delivery_system_t delivery_system; fe_status_t fe_status; u8 ts_mode; + bool ts_clock_inv; bool active; bool fw_loaded; };