Commit 365fe4e0 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] mn88472: fix chip id check on probe

A register used to identify chip during probe was overwritten during
firmware download and due to that later probe's for warm chip were
failing. Detect chip from the another register, which is located on
different register bank 2.

Fixes: 94d0eaa4 ("[media] mn88472: move out of staging to media")

Cc: <stable@vger.kernel.org> # v4.8+
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent d930b5b5
...@@ -488,18 +488,6 @@ static int mn88472_probe(struct i2c_client *client, ...@@ -488,18 +488,6 @@ static int mn88472_probe(struct i2c_client *client,
goto err_kfree; goto err_kfree;
} }
/* Check demod answers with correct chip id */
ret = regmap_read(dev->regmap[0], 0xff, &utmp);
if (ret)
goto err_regmap_0_regmap_exit;
dev_dbg(&client->dev, "chip id=%02x\n", utmp);
if (utmp != 0x02) {
ret = -ENODEV;
goto err_regmap_0_regmap_exit;
}
/* /*
* Chip has three I2C addresses for different register banks. Used * Chip has three I2C addresses for different register banks. Used
* addresses are 0x18, 0x1a and 0x1c. We register two dummy clients, * addresses are 0x18, 0x1a and 0x1c. We register two dummy clients,
...@@ -536,6 +524,18 @@ static int mn88472_probe(struct i2c_client *client, ...@@ -536,6 +524,18 @@ static int mn88472_probe(struct i2c_client *client,
} }
i2c_set_clientdata(dev->client[2], dev); i2c_set_clientdata(dev->client[2], dev);
/* Check demod answers with correct chip id */
ret = regmap_read(dev->regmap[2], 0xff, &utmp);
if (ret)
goto err_regmap_2_regmap_exit;
dev_dbg(&client->dev, "chip id=%02x\n", utmp);
if (utmp != 0x02) {
ret = -ENODEV;
goto err_regmap_2_regmap_exit;
}
/* Sleep because chip is active by default */ /* Sleep because chip is active by default */
ret = regmap_write(dev->regmap[2], 0x05, 0x3e); ret = regmap_write(dev->regmap[2], 0x05, 0x3e);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment