Skip to content

Commit 9fd64b8

Browse files
palosaarigregkh
authored andcommitted
mn88473: fix chip id check on probe
commit d930b5b 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: 7908fad ("[media] mn88473: finalize driver") Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent eb9afff commit 9fd64b8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

drivers/media/dvb-frontends/mn88473.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -485,18 +485,6 @@ static int mn88473_probe(struct i2c_client *client,
485485
goto err_kfree;
486486
}
487487

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-
500488
/*
501489
* Chip has three I2C addresses for different register banks. Used
502490
* addresses are 0x18, 0x1a and 0x1c. We register two dummy clients,
@@ -533,6 +521,18 @@ static int mn88473_probe(struct i2c_client *client,
533521
}
534522
i2c_set_clientdata(dev->client[2], dev);
535523

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+
536536
/* Sleep because chip is active by default */
537537
ret = regmap_write(dev->regmap[2], 0x05, 0x3e);
538538
if (ret)

0 commit comments

Comments
 (0)