From patchwork Sun Sep 21 10:53:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olli Salonen X-Patchwork-Id: 4943341 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 CCBD1BEEA5 for ; Sun, 21 Sep 2014 10:54:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D2BF520218 for ; Sun, 21 Sep 2014 10:54:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E99ED20212 for ; Sun, 21 Sep 2014 10:54:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751179AbaIUKxv (ORCPT ); Sun, 21 Sep 2014 06:53:51 -0400 Received: from mail-la0-f54.google.com ([209.85.215.54]:54150 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751111AbaIUKxi (ORCPT ); Sun, 21 Sep 2014 06:53:38 -0400 Received: by mail-la0-f54.google.com with SMTP id ge10so5352454lab.27 for ; Sun, 21 Sep 2014 03:53:37 -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=r2kpJt6os3zCjx5Tfz8pMoOQhHgpLhkKygMOj3gBGVc=; b=gMwn/gniWuNgxgx+cnK8SEQ9LgyLtKgbGzdwvgGrm6QlYgzRp7e1kqNbYTQFTThDkc c7LGuGJIKb6o9F1ZAbpreDdox0V+IvtT6ME143YrxCL6QUab4nF9KXccoCplpGNQAB4W e9lblclQ4t3dWvzexhlh4CbRSc2wMq8FL/YnG71ofYYRAiTVRDyP+KbsRqaBCMXZAtvP +pePBN4niT9gwIHIA2hZZdEbEUD3DK1K04ONvrhRQZqEE/ik0TW7TZrqUufauwg+s5Qm oy3Ki7i91UHlE613ebCZwGOUdir1RFwU+Qfatg+0+r6I0COecJ0uMB9xSNSDdIhdrYuz VgxQ== X-Gm-Message-State: ALoCoQnEhSC0k7mi2PYjD1JylGsRojQ/xT3/1SVs14BSqHU+qlWSbc8Xx4QtYhkCFKdQWH4iLDhu X-Received: by 10.152.9.200 with SMTP id c8mr18951757lab.76.1411296817086; Sun, 21 Sep 2014 03:53:37 -0700 (PDT) Received: from localhost.localdomain (87-93-145-93.bb.dnainternet.fi. [87.93.145.93]) by mx.google.com with ESMTPSA id zt1sm2535017lbc.31.2014.09.21.03.53.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Sep 2014 03:53:36 -0700 (PDT) From: Olli Salonen To: linux-media@vger.kernel.org Cc: Olli Salonen , crope@iki.fi Subject: [PATCH 1/3] si2157: Add support for Si2147-A30 Date: Sun, 21 Sep 2014 13:53:17 +0300 Message-Id: <1411296799-3525-2-git-send-email-olli.salonen@iki.fi> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411296799-3525-1-git-send-email-olli.salonen@iki.fi> References: <1411296799-3525-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=-7.7 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. Signed-off-by: Olli Salonen Cc: crope@iki.fi Acked-by: Antti Palosaari Reviewed-by: Antti Palosaari --- 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 efb5cce..41965c7 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 * @@ -110,12 +110,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: @@ -258,7 +260,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 3ddab5e..02350f8 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 *