From patchwork Sat Nov 12 10:34:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 9424041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D03706047D for ; Sat, 12 Nov 2016 10:35:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B76702990E for ; Sat, 12 Nov 2016 10:35:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC1B329919; Sat, 12 Nov 2016 10:35:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59C182990E for ; Sat, 12 Nov 2016 10:35:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756810AbcKLKfF (ORCPT ); Sat, 12 Nov 2016 05:35:05 -0500 Received: from mail.kapsi.fi ([217.30.184.167]:33200 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754713AbcKLKey (ORCPT ); Sat, 12 Nov 2016 05:34:54 -0500 Received: from [82.128.187.197] (helo=localhost.localdomain.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1c5Vdb-0007mH-4S; Sat, 12 Nov 2016 12:34:19 +0200 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: Antti Palosaari Subject: [PATCH 9/9] af9035: correct demod i2c addresses Date: Sat, 12 Nov 2016 12:34:01 +0200 Message-Id: <1478946841-2807-9-git-send-email-crope@iki.fi> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478946841-2807-1-git-send-email-crope@iki.fi> References: <1478946841-2807-1-git-send-email-crope@iki.fi> X-SA-Exim-Connect-IP: 82.128.187.197 X-SA-Exim-Mail-From: crope@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Chip uses so called 8-bit i2c addresses, but on bus there is of course correct 7-bit addresses with rw bit as lsb - verified with oscilloscope. Lets still use correct addresses in driver. Signed-off-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/af9035.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index da29b6f..166ce09 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c @@ -772,9 +772,9 @@ static int af9035_download_firmware(struct dvb_usb_device *d, /* tell the slave I2C address */ tmp = state->eeprom[EEPROM_2ND_DEMOD_ADDR]; - /* use default I2C address if eeprom has no address set */ + /* Use default I2C address if eeprom has no address set */ if (!tmp) - tmp = 0x3a; + tmp = 0x1d << 1; /* 8-bit format used by chip */ if ((state->chip_type == 0x9135) || (state->chip_type == 0x9306)) { @@ -837,9 +837,9 @@ static int af9035_read_config(struct dvb_usb_device *d) u8 tmp; u16 tmp16; - /* demod I2C "address" */ - state->af9033_i2c_addr[0] = 0x38; - state->af9033_i2c_addr[1] = 0x3a; + /* Demod I2C address */ + state->af9033_i2c_addr[0] = 0x1c; + state->af9033_i2c_addr[1] = 0x1d; state->af9033_config[0].adc_multiplier = AF9033_ADC_MULTIPLIER_2X; state->af9033_config[1].adc_multiplier = AF9033_ADC_MULTIPLIER_2X; state->af9033_config[0].ts_mode = AF9033_TS_MODE_USB; @@ -878,12 +878,13 @@ static int af9035_read_config(struct dvb_usb_device *d) state->ir_type = state->eeprom[EEPROM_IR_TYPE]; if (state->dual_mode) { - /* read 2nd demodulator I2C address */ + /* Read 2nd demodulator I2C address. 8-bit format on eeprom */ tmp = state->eeprom[EEPROM_2ND_DEMOD_ADDR]; if (tmp) - state->af9033_i2c_addr[1] = tmp; + state->af9033_i2c_addr[1] = tmp >> 1; - dev_dbg(&intf->dev, "2nd demod I2C addr=%02x\n", tmp); + dev_dbg(&intf->dev, "2nd demod I2C addr=%02x\n", + state->af9033_i2c_addr[1]); } for (i = 0; i < state->dual_mode + 1; i++) {