From patchwork Tue Jul 15 19:34:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schwarzott X-Patchwork-Id: 4558011 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E86939F295 for ; Tue, 15 Jul 2014 19:35:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2903020123 for ; Tue, 15 Jul 2014 19:35:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F8F92018A for ; Tue, 15 Jul 2014 19:35:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933490AbaGOTfJ (ORCPT ); Tue, 15 Jul 2014 15:35:09 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:45851 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933304AbaGOTfG (ORCPT ); Tue, 15 Jul 2014 15:35:06 -0400 Received: from gauss.fritz.box (host-188-174-204-36.customer.m-online.net [188.174.204.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zzam) by smtp.gentoo.org (Postfix) with ESMTPSA id 0683233FA9F; Tue, 15 Jul 2014 19:35:04 +0000 (UTC) From: Matthias Schwarzott To: crope@iki.fi, linux-media@vger.kernel.org Cc: Matthias Schwarzott Subject: [PATCH 3/3] si2157: Add support for spectral inversion Date: Tue, 15 Jul 2014 21:34:36 +0200 Message-Id: <1405452876-8543-3-git-send-email-zzam@gentoo.org> X-Mailer: git-send-email 2.0.0 In-Reply-To: <53C58067.8000601@gentoo.org> References: <53C58067.8000601@gentoo.org> 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 This is needed for PCTV 522e support. Signed-off-by: Matthias Schwarzott --- drivers/media/tuners/si2157.c | 3 +++ drivers/media/tuners/si2157.h | 5 +++++ drivers/media/tuners/si2157_priv.h | 1 + 3 files changed, 9 insertions(+) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 91808e8..06153fa 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -253,6 +253,8 @@ static int si2157_set_params(struct dvb_frontend *fe) memcpy(cmd.args, "\x14\x00\x03\x07\x00\x00", 6); cmd.args[4] = delivery_system | bandwidth; + if (s->inversion) + cmd.args[5] = 0x01; cmd.wlen = 6; cmd.rlen = 1; ret = si2157_cmd_execute(s, &cmd); @@ -314,6 +316,7 @@ static int si2157_probe(struct i2c_client *client, s->client = client; s->fe = cfg->fe; + s->inversion = cfg->inversion; mutex_init(&s->i2c_mutex); /* check if the tuner is there */ diff --git a/drivers/media/tuners/si2157.h b/drivers/media/tuners/si2157.h index 4465c46..6da4d5d 100644 --- a/drivers/media/tuners/si2157.h +++ b/drivers/media/tuners/si2157.h @@ -29,6 +29,11 @@ struct si2157_config { * frontend */ struct dvb_frontend *fe; + + /* + * Spectral Inversion + */ + bool inversion; }; #endif diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h index db79f3c..3ddab5e 100644 --- a/drivers/media/tuners/si2157_priv.h +++ b/drivers/media/tuners/si2157_priv.h @@ -26,6 +26,7 @@ struct si2157 { struct i2c_client *client; struct dvb_frontend *fe; bool active; + bool inversion; }; /* firmare command struct */