From patchwork Tue Jun 9 11:44:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 6571571 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E006D9F2F4 for ; Tue, 9 Jun 2015 11:45:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FB1E204DE for ; Tue, 9 Jun 2015 11:45:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 155C320481 for ; Tue, 9 Jun 2015 11:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbbFILpV (ORCPT ); Tue, 9 Jun 2015 07:45:21 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:35043 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751841AbbFILpT (ORCPT ); Tue, 9 Jun 2015 07:45:19 -0400 Received: by wiga1 with SMTP id a1so13932589wig.0; Tue, 09 Jun 2015 04:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=RDey7mLT4sgpxkipX3fhsXl/wbwygtDrya8NV/zBvHA=; b=qqDw//rDztqgTAnb3LXEAp3AqImuyQTBLoQ95R65sRlo+cFB04i+hk54KklENI7HyW Zqmm2NsuSEqfy+H1U6lnjVaLQuuNPMgC7lKRcEF9R7FVIVipKe4Hm+AH/hjGV6M2Damj rt0k6GNtxIFLFBM6qNfVgLsBevmZHrt8o3lx5HDRIwGuZA8GoJB+HaV1BUUZTqGt4CHx vqYW2bxsf8c0uz2gGP8mtqeQfU0ZFJSS2C5Mkn6H3t5mNfDpWTbcfZMaxv8j1nAfGRi0 kUn38zPoLJJ6KTco5Z7XxVz9JTRbaN305nySKboZadPrfLr16SX01Rw2LcUjnQvshlmX azoA== X-Received: by 10.180.77.193 with SMTP id u1mr7460866wiw.50.1433850318417; Tue, 09 Jun 2015 04:45:18 -0700 (PDT) Received: from atrey.karlin.mff.cuni.cz (atrey.karlin.mff.cuni.cz. [195.113.26.193]) by mx.google.com with ESMTPSA id 12sm9015506wjw.17.2015.06.09.04.45.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jun 2015 04:45:17 -0700 (PDT) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Hans Verkuil Cc: Mauro Carvalho Chehab , Greg Kroah-Hartman , Hans Verkuil , Pavel Machek , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Jan Roemisch Subject: [PATCH v2] radio-bcm2048: Fix region selection Date: Tue, 9 Jun 2015 13:44:33 +0200 Message-Id: <1433850273-32223-1-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <557189C8.7040203@xs4all.nl> References: <557189C8.7040203@xs4all.nl> MIME-Version: 1.0 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 From: Jan Roemisch This patch fixes region selection for lower bottom_frequency in BCM2048 FM receiver. It also removes "Japan wide band" region since this is impossible to do just like that. Signed-off-by: Jan Roemisch Acked-by: Pali Rohár --- drivers/staging/media/bcm2048/radio-bcm2048.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c index e9d0691..134e2af 100644 --- a/drivers/staging/media/bcm2048/radio-bcm2048.c +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c @@ -342,14 +342,6 @@ static struct region_info region_configs[] = { .deemphasis = 50, .region = 3, }, - /* Japan wide band */ - { - .channel_spacing = 10, - .bottom_frequency = 76000, - .top_frequency = 108000, - .deemphasis = 50, - .region = 4, - }, }; /* @@ -741,6 +733,18 @@ static int bcm2048_set_region(struct bcm2048_device *bdev, u8 region) mutex_lock(&bdev->mutex); bdev->region_info = region_configs[region]; + + if (region_configs[region].bottom_frequency < 87500) + bdev->cache_fm_ctrl |= BCM2048_BAND_SELECT; + else + bdev->cache_fm_ctrl &= ~BCM2048_BAND_SELECT; + + err = bcm2048_send_command(bdev, BCM2048_I2C_FM_CTRL, + bdev->cache_fm_ctrl); + if (err) { + mutex_unlock(&bdev->mutex); + goto done; + } mutex_unlock(&bdev->mutex); if (bdev->frequency < region_configs[region].bottom_frequency ||