Skip to content

Commit

Permalink
[media] mn88473: fix chip id check on probe
Browse files Browse the repository at this point in the history
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: 7908fad ("[media] mn88473: finalize driver")

Cc: <[email protected]> # v4.8+
Signed-off-by: Antti Palosaari <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
palosaari authored and mchehab committed Dec 1, 2016
1 parent b40769e commit d930b5b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions drivers/media/dvb-frontends/mn88473.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,18 +648,6 @@ static int mn88473_probe(struct i2c_client *client,
goto err_kfree;
}

/* Check demod answers with correct chip id */
ret = regmap_read(dev->regmap[0], 0xff, &uitmp);
if (ret)
goto err_regmap_0_regmap_exit;

dev_dbg(&client->dev, "chip id=%02x\n", uitmp);

if (uitmp != 0x03) {
ret = -ENODEV;
goto err_regmap_0_regmap_exit;
}

/*
* Chip has three I2C addresses for different register banks. Used
* addresses are 0x18, 0x1a and 0x1c. We register two dummy clients,
Expand Down Expand Up @@ -696,6 +684,18 @@ static int mn88473_probe(struct i2c_client *client,
}
i2c_set_clientdata(dev->client[2], dev);

/* Check demod answers with correct chip id */
ret = regmap_read(dev->regmap[2], 0xff, &uitmp);
if (ret)
goto err_regmap_2_regmap_exit;

dev_dbg(&client->dev, "chip id=%02x\n", uitmp);

if (uitmp != 0x03) {
ret = -ENODEV;
goto err_regmap_2_regmap_exit;
}

/* Sleep because chip is active by default */
ret = regmap_write(dev->regmap[2], 0x05, 0x3e);
if (ret)
Expand Down

0 comments on commit d930b5b

Please sign in to comment.