From patchwork Mon Dec 8 20:31:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Larsson X-Patchwork-Id: 5458461 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 22F349F30B for ; Mon, 8 Dec 2014 20:31:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5DEE82015E for ; Mon, 8 Dec 2014 20:31:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82C6320131 for ; Mon, 8 Dec 2014 20:31:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754033AbaLHUbM (ORCPT ); Mon, 8 Dec 2014 15:31:12 -0500 Received: from smtp.bredband2.com ([83.219.192.166]:34863 "EHLO smtp.bredband2.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754737AbaLHUbK (ORCPT ); Mon, 8 Dec 2014 15:31:10 -0500 Received: from localhost.localdomain (92-244-23-216.customers.ownit.se [92.244.23.216]) (Authenticated sender: ed8153) by smtp.bredband2.com (Postfix) with ESMTPA id D7B87105C06; Mon, 8 Dec 2014 21:31:07 +0100 (CET) From: Benjamin Larsson To: Antti Palosaari Cc: Linux Media Mailing List Subject: [PATCH 1/2] mn88472: fix firmware downloading Date: Mon, 8 Dec 2014 21:31:06 +0100 Message-Id: <1418070667-13349-1-git-send-email-benjamin@southpole.se> X-Mailer: git-send-email 2.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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 The max amount of payload bytes in each i2c transfer when loading the demodulator firmware is 16 bytes. Signed-off-by: Benjamin Larsson --- drivers/staging/media/mn88472/mn88472.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c index ffee187..df7dbe9 100644 --- a/drivers/staging/media/mn88472/mn88472.c +++ b/drivers/staging/media/mn88472/mn88472.c @@ -15,6 +15,7 @@ */ #include "mn88472_priv.h" +#define FW_BUF_SIZE 16 static int mn88472_get_tune_settings(struct dvb_frontend *fe, struct dvb_frontend_tune_settings *s) @@ -331,10 +332,10 @@ static int mn88472_init(struct dvb_frontend *fe) goto err; for (remaining = fw->size; remaining > 0; - remaining -= (dev->i2c_wr_max - 1)) { + remaining -= FW_BUF_SIZE) { len = remaining; - if (len > (dev->i2c_wr_max - 1)) - len = (dev->i2c_wr_max - 1); + if (len > FW_BUF_SIZE) + len = FW_BUF_SIZE; ret = regmap_bulk_write(dev->regmap[0], 0xf6, &fw->data[fw->size - remaining], len);