From patchwork Wed Jan 17 21:32:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Love X-Patchwork-Id: 10172009 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 AC5F8603ED for ; Wed, 17 Jan 2018 21:32:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D25D23201 for ; Wed, 17 Jan 2018 21:32:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9203323B32; Wed, 17 Jan 2018 21:32:45 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 1320D23201 for ; Wed, 17 Jan 2018 21:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753452AbeAQVcn (ORCPT ); Wed, 17 Jan 2018 16:32:43 -0500 Received: from sub5.mail.dreamhost.com ([208.113.200.129]:38012 "EHLO homiemail-a123.g.dreamhost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753031AbeAQVcj (ORCPT ); Wed, 17 Jan 2018 16:32:39 -0500 Received: from homiemail-a123.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a123.g.dreamhost.com (Postfix) with ESMTP id 9B98060005206; Wed, 17 Jan 2018 13:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=nextdimension.cc; h=from :to:cc:subject:date:message-id:in-reply-to:references; s= nextdimension.cc; bh=LIc8FKwNdm7dq6FnwLm+cqBQ9xk=; b=wIwbe6ERHet 0GZHXf8LKM/pT4D6U4tKT2/mNZ2CL0jugf9vdyJaOU8COWtU0oFnZo4X3+VBhPkg mYKPq/NPOdCq1ih2iM9sQlPYnHaWq2Qtmfs3b0iCpK3W7x67gkTwoGVzWMTodCii Zp8psHuFHeXGTSCGce/lsaGMqYRvXniY= Received: from localhost.localdomain (66-90-189-166.dyn.grandenetworks.net [66.90.189.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: brad@nextdimension.ws) by homiemail-a123.g.dreamhost.com (Postfix) with ESMTPSA id 5A1636000520A; Wed, 17 Jan 2018 13:32:39 -0800 (PST) From: Brad Love To: linux-media@vger.kernel.org Cc: Brad Love Subject: [PATCH 1/2] si2168: Add spectrum inversion property Date: Wed, 17 Jan 2018 15:32:35 -0600 Message-Id: <1516224756-1649-2-git-send-email-brad@nextdimension.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516224756-1649-1-git-send-email-brad@nextdimension.cc> References: <1516224756-1649-1-git-send-email-brad@nextdimension.cc> 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 Some tuners produce inverted spectrum, but the si2168 is not currently set up to accept it. This adds an optional parameter to set the frontend up to receive inverted spectrum. Parameter is optional and only boards who enable inversion will utilize this. Signed-off-by: Brad Love --- drivers/media/dvb-frontends/si2168.c | 2 ++ drivers/media/dvb-frontends/si2168.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index c041e79..46a597f 100644 --- a/drivers/media/dvb-frontends/si2168.c +++ b/drivers/media/dvb-frontends/si2168.c @@ -339,6 +339,8 @@ static int si2168_set_frontend(struct dvb_frontend *fe) memcpy(cmd.args, "\x14\x00\x0a\x10\x00\x00", 6); cmd.args[4] = delivery_system | bandwidth; + if (config->spectral_inversion) + cmd.args[5] |= 1; cmd.wlen = 6; cmd.rlen = 4; ret = si2168_cmd_execute(client, &cmd); diff --git a/drivers/media/dvb-frontends/si2168.h b/drivers/media/dvb-frontends/si2168.h index f48f0fb..978854f 100644 --- a/drivers/media/dvb-frontends/si2168.h +++ b/drivers/media/dvb-frontends/si2168.h @@ -46,6 +46,9 @@ struct si2168_config { /* TS clock gapped */ bool ts_clock_gapped; + + /* Inverted spectrum */ + bool spectral_inversion; }; #endif