From patchwork Sun Apr 1 18:11:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Frieder Vogt X-Patchwork-Id: 10529 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SEPFf-0007yH-G5 for patchwork@linuxtv.org; Sun, 01 Apr 2012 20:11:43 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp for id 1SEPFe-0007MN-Bc; Sun, 01 Apr 2012 20:11:43 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752709Ab2DASLi (ORCPT ); Sun, 1 Apr 2012 14:11:38 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:58709 "HELO mailout-de.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752266Ab2DASLh (ORCPT ); Sun, 1 Apr 2012 14:11:37 -0400 Received: (qmail invoked by alias); 01 Apr 2012 18:11:35 -0000 Received: from p4FC088B4.dip0.t-ipconnect.de (EHLO maximilian.localnet) [79.192.136.180] by mail.gmx.net (mp037) with SMTP; 01 Apr 2012 20:11:35 +0200 X-Authenticated: #24390674 X-Provags-ID: V01U2FsdGVkX18c5ag6YiscRU6BN15cm6ADd20GhBV28yOhUXA3VQ qzV7kfiyC25IQW From: "Hans-Frieder Vogt" To: Antti Palosaari Subject: [PATCH][GIT PULL FOR 3.5] AF9035/AF9033/TUA9001 i2c read fix Date: Sun, 1 Apr 2012 20:11:29 +0200 User-Agent: KMail/1.13.7 (Linux/3.3.0-a64; KDE/4.7.4; x86_64; ; ) Cc: linux-media@vger.kernel.org References: <4F75A7FE.8090405@iki.fi> <201204011915.47265.hfvogt@gmx.net> <4F788F49.202@iki.fi> In-Reply-To: <4F788F49.202@iki.fi> MIME-Version: 1.0 Message-Id: <201204012011.29830.hfvogt@gmx.net> X-Y-GMX-Trusted: 0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.4.1.180026 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' Antti, attached is the i2c read fix (necessary e.g. for mxl5007t tuner, because it sends a 2 bytes for a read request, thus msg[0].len != msg[1].len). Am Sonntag, 1. April 2012 schrieb Antti Palosaari: > On 01.04.2012 20:15, Hans-Frieder Vogt wrote: > > Support of AVerMedia AVerTV HD Volar, with tuner MxL5007t (needs the i2c > > read bug fixed patch send earlier). > > Could you sent separate patch for I2C read fix? > > The only functional comment I has is about ADC frequency. There is > Xtal/ADC lookup table already in af9033_priv.h. You could use it instead > of adding new configuration parameter. Demodulator driver generally > needs only Xtal frequency as a parameter, other can be usually > discovered by driver. > > But if you would not like to fix it, I will apply that as it is. It is > not so important issue after all. > > regards > Antti Enable i2c read requests. Signed-off-by: Hans-Frieder Vogt drivers/media/dvb/dvb-usb/af9035.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) Hans-Frieder Vogt e-mail: hfvogt gmx .dot. net --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -Nupr a/drivers/media/dvb/dvb-usb/af9035.c b/drivers/media/dvb/dvb- usb/af9035.c --- a/drivers/media/dvb/dvb-usb/af9035.c 2012-04-01 16:41:53.694103691 +0200 +++ b/drivers/media/dvb/dvb-usb/af9035.c 2012-04-01 18:22:25.026930784 +0200 @@ -209,24 +209,15 @@ static int af9035_i2c_master_xfer(struct msg[1].len); } else { /* I2C */ -#if 0 - /* - * FIXME: Keep that code. It should work but as it is - * not tested I left it disabled and return -EOPNOTSUPP - * for the sure. - */ u8 buf[4 + msg[0].len]; struct usb_req req = { CMD_I2C_RD, 0, sizeof(buf), buf, msg[1].len, msg[1].buf }; - buf[0] = msg[0].len; + buf[0] = msg[1].len; buf[1] = msg[0].addr << 1; buf[2] = 0x01; buf[3] = 0x00; memcpy(&buf[4], msg[0].buf, msg[0].len); ret = af9035_ctrl_msg(d->udev, &req); -#endif - pr_debug("%s: I2C operation not supported\n", __func__); - ret = -EOPNOTSUPP; } } else if (num == 1 && !(msg[0].flags & I2C_M_RD)) { if (msg[0].len > 40) {