aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2016-11-30 19:08:27 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-09 02:32:23 -0500
commiteb9afff9513dff7862eba01679fb6587e97fc2b7 (patch)
tree8f4ab0db5701374f2a48db67f7bf4b65a1b47191 /drivers/media/dvb-frontends
parent9aff8b170fe01cb01cdcce2590dd135925570f1b (diff)
mn88472: fix chip id check on probe
commit 365fe4e0ce218dc5ad10df17b150a366b6015499 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: 94d0eaa41987 ("[media] mn88472: move out of staging to media") 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>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r--drivers/media/dvb-frontends/mn88472.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/media/dvb-frontends/mn88472.c b/drivers/media/dvb-frontends/mn88472.c
index 18fb2df1e2bd..72650116732c 100644
--- a/drivers/media/dvb-frontends/mn88472.c
+++ b/drivers/media/dvb-frontends/mn88472.c
@@ -488,18 +488,6 @@ static int mn88472_probe(struct i2c_client *client,
488 goto err_kfree; 488 goto err_kfree;
489 } 489 }
490 490
491 /* Check demod answers with correct chip id */
492 ret = regmap_read(dev->regmap[0], 0xff, &utmp);
493 if (ret)
494 goto err_regmap_0_regmap_exit;
495
496 dev_dbg(&client->dev, "chip id=%02x\n", utmp);
497
498 if (utmp != 0x02) {
499 ret = -ENODEV;
500 goto err_regmap_0_regmap_exit;
501 }
502
503 /* 491 /*
504 * Chip has three I2C addresses for different register banks. Used 492 * Chip has three I2C addresses for different register banks. Used
505 * addresses are 0x18, 0x1a and 0x1c. We register two dummy clients, 493 * addresses are 0x18, 0x1a and 0x1c. We register two dummy clients,
@@ -536,6 +524,18 @@ static int mn88472_probe(struct i2c_client *client,
536 } 524 }
537 i2c_set_clientdata(dev->client[2], dev); 525 i2c_set_clientdata(dev->client[2], dev);
538 526
527 /* Check demod answers with correct chip id */
528 ret = regmap_read(dev->regmap[2], 0xff, &utmp);
529 if (ret)
530 goto err_regmap_2_regmap_exit;
531
532 dev_dbg(&client->dev, "chip id=%02x\n", utmp);
533
534 if (utmp != 0x02) {
535 ret = -ENODEV;
536 goto err_regmap_2_regmap_exit;
537 }
538
539 /* Sleep because chip is active by default */ 539 /* Sleep because chip is active by default */
540 ret = regmap_write(dev->regmap[2], 0x05, 0x3e); 540 ret = regmap_write(dev->regmap[2], 0x05, 0x3e);
541 if (ret) 541 if (ret)