[PATCH 2/2] mn88472: fix firmware loading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The firmware must be loaded one byte at a time via the 0xf6 register.

Signed-off-by: Benjamin Larsson <benjamin@xxxxxxxxxxxx>
---
 drivers/staging/media/mn88472/mn88472.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c
index ffee187..ba1bc8d 100644
--- a/drivers/staging/media/mn88472/mn88472.c
+++ b/drivers/staging/media/mn88472/mn88472.c
@@ -290,7 +290,7 @@ static int mn88472_init(struct dvb_frontend *fe)
 {
 	struct i2c_client *client = fe->demodulator_priv;
 	struct mn88472_dev *dev = i2c_get_clientdata(client);
-	int ret, len, remaining;
+	int ret, i;
 	const struct firmware *fw = NULL;
 	u8 *fw_file = MN88472_FIRMWARE;
 
@@ -330,19 +330,12 @@ static int mn88472_init(struct dvb_frontend *fe)
 	if (ret)
 		goto err;
 
-	for (remaining = fw->size; remaining > 0;
-			remaining -= (dev->i2c_wr_max - 1)) {
-		len = remaining;
-		if (len > (dev->i2c_wr_max - 1))
-			len = (dev->i2c_wr_max - 1);
-
-		ret = regmap_bulk_write(dev->regmap[0], 0xf6,
-				&fw->data[fw->size - remaining], len);
-		if (ret) {
-			dev_err(&client->dev,
-					"firmware download failed=%d\n", ret);
-			goto err;
-		}
+	for (i = 0 ; i < fw->size ; i++)
+		ret |= regmap_write(dev->regmap[0], 0xf6, fw->data[i]);
+	if (ret) {
+		dev_err(&client->dev,
+				"firmware download failed=%d\n", ret);
+		goto err;
 	}
 
 	ret = regmap_write(dev->regmap[0], 0xf5, 0x00);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux