From patchwork Sun Feb 9 13:02:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 3613021 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 BEEEEBF418 for ; Sun, 9 Feb 2014 13:03:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EDA6A20171 for ; Sun, 9 Feb 2014 13:03:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 03FA320117 for ; Sun, 9 Feb 2014 13:03:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751966AbaBINDE (ORCPT ); Sun, 9 Feb 2014 08:03:04 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:54519 "EHLO mail-we0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751886AbaBINDD (ORCPT ); Sun, 9 Feb 2014 08:03:03 -0500 Received: by mail-we0-f169.google.com with SMTP id t61so3542526wes.14 for ; Sun, 09 Feb 2014 05:03:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; bh=fczdJjA7p2z4rYnusuuCxlkfahrhaXrSagjXc2tMuwY=; b=JAqby7M0CUceh1Rov1v5DysFhm6p+OxdYAm/sqPXxJIY0a3orEMHxW2cnAljmekcyG NYtutnFGXC+PPtRppfsT0gTHjxmq4t45GBmJ9YNSvCu2elQcz6fLH7KeOpafn/IUJ8p0 9Lx5Pu1TeL12/aDgavv+EIzThkSYe5wCEtj0qSdio7Wj1TnSHMCd6mS3qWWc3lkeFbFA dri1QOIqSbBJRa53R1Xqs83cGg2wIgmR/OE1Os7UMXt37CQn//pFJOsVqEGp5OHFgSlM 9++g9kyGiZGp42jmcSQ+u1OrdBWepqG/Tfa1SY/cKxPARP8Vn5IKrGhZSNAKorIyDNz9 P34w== X-Received: by 10.180.72.195 with SMTP id f3mr6558889wiv.61.1391950981439; Sun, 09 Feb 2014 05:03:01 -0800 (PST) Received: from [192.168.1.100] (92.40.105.47.threembb.co.uk. [92.40.105.47]) by mx.google.com with ESMTPSA id fb6sm22506233wib.2.2014.02.09.05.02.59 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sun, 09 Feb 2014 05:03:00 -0800 (PST) Message-ID: <1391950969.13992.14.camel@canaries32-MCP7A> Subject: [PATCH 1/2] af9035: add default 0x9135 slave I2C address From: Malcolm Priestley To: linux-media@vger.kernel.org Cc: Antti Palosaari Date: Sun, 09 Feb 2014 13:02:49 +0000 X-Mailer: Evolution 3.10.3-0ubuntu3 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=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 On some devices the vendor has not set EEPROM_2ND_DEMOD_ADDR. Checks tmp is not zero after call to get EEPROM_2ND_DEMOD_ADDR and sets the default slave address of 0x3a on 0x9135 devices. Signed-off-by: Malcolm Priestley --- drivers/media/usb/dvb-usb-v2/af9035.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 3825c2f..4f682ad 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c @@ -576,6 +576,10 @@ static int af9035_download_firmware(struct dvb_usb_device *d, goto err; if (state->chip_type == 0x9135) { + if (!tmp) + /* default 0x9135 slave I2C address */ + tmp = 0x3a; + ret = af9035_wr_reg(d, 0x004bfb, tmp); if (ret < 0) goto err; @@ -684,6 +688,10 @@ static int af9035_read_config(struct dvb_usb_device *d) if (ret < 0) goto err; + if (!tmp && state->chip_type == 0x9135) + /* default 0x9135 slave I2C address */ + tmp = 0x3a; + state->af9033_config[1].i2c_addr = tmp; dev_dbg(&d->udev->dev, "%s: 2nd demod I2C addr=%02x\n", __func__, tmp);