提交 307e95c9 编写于 作者: B Benjamin Larsson 提交者: Mauro Carvalho Chehab

[media] mn88472: implement firmware parity check

Signed-off-by: NBenjamin Larsson <benjamin@southpole.se>
Signed-off-by: NAntti Palosaari <crope@iki.fi>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 ba6d6d8a
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册