From patchwork Mon Dec 8 18:54:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Larsson X-Patchwork-Id: 27393 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Xy3Rr-0006cT-Bf; Mon, 08 Dec 2014 19:54:19 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-8) with esmtp id 1Xy3Ro-0007VH-m3; Mon, 08 Dec 2014 19:54:18 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756259AbaLHSyP (ORCPT + 1 other); Mon, 8 Dec 2014 13:54:15 -0500 Received: from smtp.bredband2.com ([83.219.192.166]:59695 "EHLO smtp.bredband2.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756168AbaLHSyO (ORCPT ); Mon, 8 Dec 2014 13:54:14 -0500 Received: from [192.168.1.8] (92-244-23-216.customers.ownit.se [92.244.23.216]) (Authenticated sender: ed8153) by smtp.bredband2.com (Postfix) with ESMTPA id C562E105C06; Mon, 8 Dec 2014 19:54:11 +0100 (CET) Message-ID: <5485F3D3.50403@southpole.se> Date: Mon, 08 Dec 2014 19:54:11 +0100 From: Benjamin Larsson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Antti Palosaari CC: Linux Media Mailing List Subject: Re: [PATCH 2/2] mn88472: fix firmware loading References: <1417990203-758-1-git-send-email-benjamin@southpole.se> <1417990203-758-2-git-send-email-benjamin@southpole.se> <5484D666.6060605@iki.fi> <5485CC0E.2090201@southpole.se> <5485E3E4.80005@iki.fi> In-Reply-To: <5485E3E4.80005@iki.fi> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.12.8.183919 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, REFERENCES 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FORWARDED_MSG 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __MOZILLA_USER_AGENT 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __SUBJ_ALPHA_NEGATE 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' On 12/08/2014 06:46 PM, Antti Palosaari wrote: > Hello! > [...] >> regmap_bulk_write(): Write multiple registers to the device >> >> In this case we want to write multiple bytes to the same register. So I >> think that my patch is correct in principle. > > You haven't make any test whether it is possible to write that > firmware in a large chunks *or* writing one byte (smallest possible > ~chuck) at the time? I think it does not matter. I suspect you could > even download whole firmware as one go - but rtl2832p I2C adapter does > support only 22 bytes on one xfer. > > Even those are written to one register, chip knows how many bytes one > message has and could increase its internal address counter. That is > usually called register address auto-increment. > > A) writing: > f6 00 > f6 01 > f6 02 > f6 03 > f6 04 > f6 05 > f6 06 > f6 07 > f6 08 > f6 09 > > B) writing: > f6 00 01 02 03 04 > f6 05 06 07 08 09 > > will likely end up same. B is better as only 2 xfers are done - much > less IO. > > regards > Antti > Hello Antti. I have now tried the following patch on top of my load defaults patch. index a7d35bb..fd9796d With this patch I get data, without it I don't. Based on that info I started testing different i2c wr max values. When I got to 18 it stopped working. So it seams like both you and me where right. We can write several values at once but only a maximum of 16. I have a patch that adds parity check of the firmware and all the times the check succeeded but the demodulator didn't deliver data. So I guess that the parity checker is before the 16 byte buffer and if you write more the data is just ignored. I will send an updated patch based on this. MvH Benjamin Larsson --- 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 --- a/drivers/staging/media/mn88472/mn88472.c +++ b/drivers/staging/media/mn88472/mn88472.c @@ -467,7 +467,7 @@ static int mn88472_probe(struct i2c_client *client, goto err; } - dev->i2c_wr_max = config->i2c_wr_max; + dev->i2c_wr_max = 2; dev->xtal = config->xtal; dev->ts_mode = config->ts_mode; dev->ts_clock = config->ts_clock;