From patchwork Thu Sep 11 20:01:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olli Salonen X-Patchwork-Id: 4890081 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 C12839F32F for ; Thu, 11 Sep 2014 20:01:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF64720179 for ; Thu, 11 Sep 2014 20:01:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F00B2015D for ; Thu, 11 Sep 2014 20:01:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756269AbaIKUBy (ORCPT ); Thu, 11 Sep 2014 16:01:54 -0400 Received: from mail-la0-f52.google.com ([209.85.215.52]:56105 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754625AbaIKUBx (ORCPT ); Thu, 11 Sep 2014 16:01:53 -0400 Received: by mail-la0-f52.google.com with SMTP id b8so12211598lan.25 for ; Thu, 11 Sep 2014 13:01:49 -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; bh=fwtyDYJwKhENG8Zk6LEK0vfYHVQM53UTnWiVvytAgjI=; b=OsRn3dGk665C/VYBNdVWq6WzRjfqC5nXfJKAabfClfwe6xIux97aJTBFlY/xe49CFZ VnRSz71R4IeGFzt8La3E6WQ6mlpAEMGAujqqAh2zH114yQIwwLHEQixix9tTilYh4QHC OR2K/r5N8qiSumeZhh6Yz0/Fm75Ytijd24d+A1Kj1jqtIGBcs6Hr8YXPoY24FzU6J4Um LtcmudZomQClg7FtfO5aC8KOvosn8UiRMsOGO0GuvkweiGF7LbMdrK1fDGVyqA3ORub3 rcPm6bzk3ahTObzchEtMSalHQOYOAxXaaPHOl2iyI6bxKh3Yem77kyxlMmMb4BRKM/6A dzZQ== X-Gm-Message-State: ALoCoQmVADrHg72Z1472cuV9pFLTK1Jkn3sCF6Ty+nFJFrNxqyLwSC78fGBYYQbM7p73sWg94uhw X-Received: by 10.112.7.72 with SMTP id h8mr3594464lba.64.1410465709860; Thu, 11 Sep 2014 13:01:49 -0700 (PDT) Received: from olli-desktop.c.hospitality.swisscom.com (scandic812.host.songnetworks.se. [212.214.188.42]) by mx.google.com with ESMTPSA id a2sm622868lbg.19.2014.09.11.13.01.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Sep 2014 13:01:49 -0700 (PDT) From: Olli Salonen To: linux-media@vger.kernel.org Cc: crope@iki.fi, Olli Salonen Subject: [PATCH] si2157: Add support for Si2147-A30 tuner Date: Thu, 11 Sep 2014 23:01:38 +0300 Message-Id: <1410465698-12873-1-git-send-email-olli.salonen@iki.fi> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 This patch adds support for Si2147-A30 tuner. Fairly trivial, no firmware needed for this tuner. However, command 14 00 02 07 01 00 seems to be mandatory. On Si2157 and Si2158 the value 0x0100 is the default value, so this patch does not impact the existing tuners/devices. On Si2147 the default is 0x0000 and I can't get a lock with that value. While here, fix the return length of the previous set command to 4 bytes. Signed-off-by: Olli Salonen --- drivers/media/tuners/si2157.c | 13 +++++++++++-- drivers/media/tuners/si2157.h | 2 +- drivers/media/tuners/si2157_priv.h | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 5901484..cf97142 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -1,5 +1,5 @@ /* - * Silicon Labs Si2157/2158 silicon tuner driver + * Silicon Labs Si2147/2157/2158 silicon tuner driver * * Copyright (C) 2014 Antti Palosaari * @@ -113,12 +113,14 @@ static int si2157_init(struct dvb_frontend *fe) #define SI2158_A20 ('A' << 24 | 58 << 16 | '2' << 8 | '0' << 0) #define SI2157_A30 ('A' << 24 | 57 << 16 | '3' << 8 | '0' << 0) + #define SI2147_A30 ('A' << 24 | 47 << 16 | '3' << 8 | '0' << 0) switch (chip_id) { case SI2158_A20: fw_file = SI2158_A20_FIRMWARE; break; case SI2157_A30: + case SI2147_A30: goto skip_fw_download; break; default: @@ -265,7 +267,14 @@ static int si2157_set_params(struct dvb_frontend *fe) if (s->inversion) cmd.args[5] = 0x01; cmd.wlen = 6; - cmd.rlen = 1; + cmd.rlen = 4; + ret = si2157_cmd_execute(s, &cmd); + if (ret) + goto err; + + memcpy(cmd.args, "\x14\x00\x02\x07\x01\x00", 6); + cmd.wlen = 6; + cmd.rlen = 4; ret = si2157_cmd_execute(s, &cmd); if (ret) goto err; diff --git a/drivers/media/tuners/si2157.h b/drivers/media/tuners/si2157.h index 6da4d5d..d3b19ca 100644 --- a/drivers/media/tuners/si2157.h +++ b/drivers/media/tuners/si2157.h @@ -1,5 +1,5 @@ /* - * Silicon Labs Si2157/2158 silicon tuner driver + * Silicon Labs Si2147/2157/2158 silicon tuner driver * * Copyright (C) 2014 Antti Palosaari * diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h index 4080a57..e71ffaf 100644 --- a/drivers/media/tuners/si2157_priv.h +++ b/drivers/media/tuners/si2157_priv.h @@ -1,5 +1,5 @@ /* - * Silicon Labs Si2157/2158 silicon tuner driver + * Silicon Labs Si2147/2157/2158 silicon tuner driver * * Copyright (C) 2014 Antti Palosaari *