aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/af9013.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2011-03-19 16:18:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 03:55:01 -0400
commit109a29900a36b2b1e7b7f83a561c6af7e343461f (patch)
tree415b6225487712f66cb57ab2935796c468f39259 /drivers/media/dvb/frontends/af9013.c
parent582e565caeaccf145e2256b84d4fde827fede72e (diff)
[media] af9013: download FW earlier in attach()
Quick test shows that FW must be running before other checks so make it happen earlier. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/af9013.c')
-rw-r--r--drivers/media/dvb/frontends/af9013.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/media/dvb/frontends/af9013.c b/drivers/media/dvb/frontends/af9013.c
index ba25fa0b0fc2..6f50f0673994 100644
--- a/drivers/media/dvb/frontends/af9013.c
+++ b/drivers/media/dvb/frontends/af9013.c
@@ -1466,20 +1466,6 @@ struct dvb_frontend *af9013_attach(const struct af9013_config *config,
1466 state->i2c = i2c; 1466 state->i2c = i2c;
1467 memcpy(&state->config, config, sizeof(struct af9013_config)); 1467 memcpy(&state->config, config, sizeof(struct af9013_config));
1468 1468
1469 /* chip version */
1470 ret = af9013_read_reg_bits(state, 0xd733, 4, 4, &buf[2]);
1471 if (ret)
1472 goto error;
1473
1474 /* ROM version */
1475 for (i = 0; i < 2; i++) {
1476 ret = af9013_read_reg(state, 0x116b + i, &buf[i]);
1477 if (ret)
1478 goto error;
1479 }
1480 deb_info("%s: chip version:%d ROM version:%d.%d\n", __func__,
1481 buf[2], buf[0], buf[1]);
1482
1483 /* download firmware */ 1469 /* download firmware */
1484 if (state->config.output_mode != AF9013_OUTPUT_MODE_USB) { 1470 if (state->config.output_mode != AF9013_OUTPUT_MODE_USB) {
1485 ret = af9013_download_firmware(state); 1471 ret = af9013_download_firmware(state);
@@ -1495,6 +1481,20 @@ struct dvb_frontend *af9013_attach(const struct af9013_config *config,
1495 } 1481 }
1496 info("firmware version:%d.%d.%d.%d", buf[0], buf[1], buf[2], buf[3]); 1482 info("firmware version:%d.%d.%d.%d", buf[0], buf[1], buf[2], buf[3]);
1497 1483
1484 /* chip version */
1485 ret = af9013_read_reg_bits(state, 0xd733, 4, 4, &buf[2]);
1486 if (ret)
1487 goto error;
1488
1489 /* ROM version */
1490 for (i = 0; i < 2; i++) {
1491 ret = af9013_read_reg(state, 0x116b + i, &buf[i]);
1492 if (ret)
1493 goto error;
1494 }
1495 deb_info("%s: chip version:%d ROM version:%d.%d\n", __func__,
1496 buf[2], buf[0], buf[1]);
1497
1498 /* settings for mp2if */ 1498 /* settings for mp2if */
1499 if (state->config.output_mode == AF9013_OUTPUT_MODE_USB) { 1499 if (state->config.output_mode == AF9013_OUTPUT_MODE_USB) {
1500 /* AF9015 split PSB to 1.5k + 0.5k */ 1500 /* AF9015 split PSB to 1.5k + 0.5k */