aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2016-11-30 16:36:14 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-09 02:32:23 -0500
commit9fd64b8302593a6398e4e05571e84309b017fd55 (patch)
tree81de766ce033ec4a031800226015e4b8353d46af
parenteb9afff9513dff7862eba01679fb6587e97fc2b7 (diff)
mn88473: fix chip id check on probe
commit d930b5b5bf122a61952cfebabb1e618682a2631a upstream. 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: 7908fad99a6c ("[media] mn88473: finalize driver") Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/media/dvb-frontends/mn88473.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/media/dvb-frontends/mn88473.c b/drivers/media/dvb-frontends/mn88473.c
index 451974a1d7ed..2932bdc8fa94 100644
--- a/drivers/media/dvb-frontends/mn88473.c
+++ b/drivers/media/dvb-frontends/mn88473.c
@@ -485,18 +485,6 @@ static int mn88473_probe(struct i2c_client *client,
485 goto err_kfree; 485 goto err_kfree;
486 } 486 }
487 487
488 /* Check demod answers with correct chip id */
489 ret = regmap_read(dev->regmap[0], 0xff, &uitmp);
490 if (ret)
491 goto err_regmap_0_regmap_exit;
492
493 dev_dbg(&client->dev, "chip id=%02x\n", uitmp);
494
495 if (uitmp != 0x03) {
496 ret = -ENODEV;
497 goto err_regmap_0_regmap_exit;
498 }
499
500 /* 488 /*
501 * Chip has three I2C addresses for different register banks. Used 489 * Chip has three I2C addresses for different register banks. Used
502 * addresses are 0x18, 0x1a and 0x1c. We register two dummy clients, 490 * addresses are 0x18, 0x1a and 0x1c. We register two dummy clients,
@@ -533,6 +521,18 @@ static int mn88473_probe(struct i2c_client *client,
533 } 521 }
534 i2c_set_clientdata(dev->client[2], dev); 522 i2c_set_clientdata(dev->client[2], dev);
535 523
524 /* Check demod answers with correct chip id */
525 ret = regmap_read(dev->regmap[2], 0xff, &uitmp);
526 if (ret)
527 goto err_regmap_2_regmap_exit;
528
529 dev_dbg(&client->dev, "chip id=%02x\n", uitmp);
530
531 if (uitmp != 0x03) {
532 ret = -ENODEV;
533 goto err_regmap_2_regmap_exit;
534 }
535
536 /* Sleep because chip is active by default */ 536 /* Sleep because chip is active by default */
537 ret = regmap_write(dev->regmap[2], 0x05, 0x3e); 537 ret = regmap_write(dev->regmap[2], 0x05, 0x3e);
538 if (ret) 538 if (ret)