summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBenjamin Larsson <benjamin@southpole.se>2015-03-15 19:57:51 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-02 21:52:36 -0300
commit307e95c92257fe2602b457ab6df56d9ef9a7444e (patch)
tree681da8047106f0083c2c5f187b0c54e5321edbb3 /drivers
parentba6d6d8a06c323782badf8cbead6e4ec1c742235 (diff)
[media] mn88472: implement firmware parity check
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/media/mn88472/mn88472.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c
index 6f0cac44d273..85ef4f694c8b 100644
--- a/drivers/staging/media/mn88472/mn88472.c
+++ b/drivers/staging/media/mn88472/mn88472.c
@@ -258,6 +258,7 @@ static int mn88472_init(struct dvb_frontend *fe)
int ret, len, remaining;
const struct firmware *fw = NULL;
u8 *fw_file = MN88472_FIRMWARE;
+ unsigned int csum;
dev_dbg(&client->dev, "\n");
@@ -303,6 +304,20 @@ static int mn88472_init(struct dvb_frontend *fe)
}
}
+ /* parity check of firmware */
+ ret = regmap_read(dev->regmap[0], 0xf8, &csum);
+ if (ret) {
+ dev_err(&client->dev,
+ "parity reg read failed=%d\n", ret);
+ goto err;
+ }
+ if (csum & 0x10) {
+ dev_err(&client->dev,
+ "firmware parity check failed=0x%x\n", csum);
+ goto err;
+ }
+ dev_err(&client->dev, "firmware parity check succeeded=0x%x\n", csum);
+
ret = regmap_write(dev->regmap[0], 0xf5, 0x00);
if (ret)
goto firmware_release;