From patchwork Thu Apr 23 21:11:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olli Salonen X-Patchwork-Id: 6265301 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id ACE3ABF4A6 for ; Thu, 23 Apr 2015 21:11:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9D72201C8 for ; Thu, 23 Apr 2015 21:11:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE02C202F2 for ; Thu, 23 Apr 2015 21:11:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031265AbbDWVLq (ORCPT ); Thu, 23 Apr 2015 17:11:46 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:34583 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758415AbbDWVLd (ORCPT ); Thu, 23 Apr 2015 17:11:33 -0400 Received: by laat2 with SMTP id t2so21980859laa.1 for ; Thu, 23 Apr 2015 14:11:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=90OoozHMoOD78EDwfhSCnSFRVoSRqhAiZsbifwGb1z8=; b=YxTqWmxJYVxE6tJZTT1SRXrebFNqUvPZttTnL2kbRxMCRFrlwcgYoHs9B6JixPBSRK LZ8Lwgz3Y7izEBy9fB/5BeMy2kaRC++A7axT4Z5Pc0HGKY9Ht9MPQh5mBButvgSZwR4U SiioCF8lBsqXLhnZytYhZWaKsOhgrCZH3RsC0A339JmK/TZJph1X50ZgMMG2DIaBosSn EWW8DjKKIezivArPVINgKmZtIxcbsIMjskSZY5K2uaVLrm+jqeVx1+QtjDcc69jbyveK /w6YiWQ+XJVCRDq8j4iC7NV8c0WR8cFtyypnau9bbsArt83ZfdBNU9ftdagN37kydreo rlaA== X-Gm-Message-State: ALoCoQn9bKXHNEwGtOxfTbjw4gpjXOMD1XL9MQi9Tq0UxHHEREm15iUxuVMLC46DBgjXFuXejpmG X-Received: by 10.112.161.197 with SMTP id xu5mr4108353lbb.69.1429823491833; Thu, 23 Apr 2015 14:11:31 -0700 (PDT) Received: from dl160.lan (188-67-88-189.bb.dnainternet.fi. [188.67.88.189]) by mx.google.com with ESMTPSA id i3sm2121712lbs.21.2015.04.23.14.11.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Apr 2015 14:11:30 -0700 (PDT) From: Olli Salonen To: linux-media@vger.kernel.org Cc: Olli Salonen Subject: [PATCH 03/12] si2157: support selection of IF interface Date: Fri, 24 Apr 2015 00:11:02 +0300 Message-Id: <1429823471-21835-3-git-send-email-olli.salonen@iki.fi> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429823471-21835-1-git-send-email-olli.salonen@iki.fi> References: <1429823471-21835-1-git-send-email-olli.salonen@iki.fi> 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, 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 The chips supported by the si2157 driver have two IF outputs (either pins 12+13 or pins 9+11). Instead of hardcoding the output to be used add an option to choose which output shall be used. Signed-off-by: Olli Salonen --- drivers/media/tuners/si2157.c | 4 +++- drivers/media/tuners/si2157.h | 6 ++++++ drivers/media/tuners/si2157_priv.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index d74ae26..cdaf687 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -298,7 +298,8 @@ static int si2157_set_params(struct dvb_frontend *fe) if (dev->chiptype == SI2157_CHIPTYPE_SI2146) memcpy(cmd.args, "\x14\x00\x02\x07\x00\x01", 6); else - memcpy(cmd.args, "\x14\x00\x02\x07\x01\x00", 6); + memcpy(cmd.args, "\x14\x00\x02\x07\x00\x00", 6); + cmd.args[4] = dev->if_port; cmd.wlen = 6; cmd.rlen = 4; ret = si2157_cmd_execute(client, &cmd); @@ -378,6 +379,7 @@ static int si2157_probe(struct i2c_client *client, i2c_set_clientdata(client, dev); dev->fe = cfg->fe; dev->inversion = cfg->inversion; + dev->if_port = cfg->if_port; dev->fw_loaded = false; dev->chiptype = (u8)id->driver_data; dev->if_frequency = 5000000; /* default value of property 0x0706 */ diff --git a/drivers/media/tuners/si2157.h b/drivers/media/tuners/si2157.h index a564c4a..4db97ab 100644 --- a/drivers/media/tuners/si2157.h +++ b/drivers/media/tuners/si2157.h @@ -34,6 +34,12 @@ struct si2157_config { * Spectral Inversion */ bool inversion; + + /* + * Port selection + * Select the RF interface to use (pins 9+11 or 12+13) + */ + u8 if_port; }; #endif diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h index cd8fa5b..71a5f8c 100644 --- a/drivers/media/tuners/si2157_priv.h +++ b/drivers/media/tuners/si2157_priv.h @@ -28,6 +28,7 @@ struct si2157_dev { bool fw_loaded; bool inversion; u8 chiptype; + u8 if_port; u32 if_frequency; };