OSDN Git Service

[media] mn88473: check if firmware is already running before loading it
authorBenjamin Larsson <benjamin@southpole.se>
Sun, 15 Mar 2015 22:57:53 +0000 (19:57 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 3 Apr 2015 00:53:18 +0000 (21:53 -0300)
Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/staging/media/mn88473/mn88473.c

index 607ce4d..a23e59e 100644 (file)
@@ -196,8 +196,19 @@ static int mn88473_init(struct dvb_frontend *fe)
 
        dev_dbg(&client->dev, "\n");
 
-       if (dev->warm)
+       /* set cold state by default */
+       dev->warm = false;
+
+       /* check if firmware is already running */
+       ret = regmap_read(dev->regmap[0], 0xf5, &tmp);
+       if (ret)
+               goto err;
+
+       if (!(tmp & 0x1)) {
+               dev_info(&client->dev, "firmware already running\n");
+               dev->warm = true;
                return 0;
+       }
 
        /* request the firmware, this will block and timeout */
        ret = request_firmware(&fw, fw_file, &client->dev);