[media] af9013: download FW earlier in attach()
authorAntti Palosaari <crope@iki.fi>
Sat, 19 Mar 2011 20:18:18 +0000 (17:18 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 22 Mar 2011 07:55:01 +0000 (04:55 -0300)
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>
drivers/media/dvb/frontends/af9013.c

index ba25fa0b0fc2a5bfb098a94c258f9d913c1806c5..6f50f06739947b9f1e1b96b292c5747c2fc33c5f 100644 (file)
@@ -1466,20 +1466,6 @@ struct dvb_frontend *af9013_attach(const struct af9013_config *config,
        state->i2c = i2c;
        memcpy(&state->config, config, sizeof(struct af9013_config));
 
-       /* chip version */
-       ret = af9013_read_reg_bits(state, 0xd733, 4, 4, &buf[2]);
-       if (ret)
-               goto error;
-
-       /* ROM version */
-       for (i = 0; i < 2; i++) {
-               ret = af9013_read_reg(state, 0x116b + i, &buf[i]);
-               if (ret)
-                       goto error;
-       }
-       deb_info("%s: chip version:%d ROM version:%d.%d\n", __func__,
-               buf[2], buf[0], buf[1]);
-
        /* download firmware */
        if (state->config.output_mode != AF9013_OUTPUT_MODE_USB) {
                ret = af9013_download_firmware(state);
@@ -1495,6 +1481,20 @@ struct dvb_frontend *af9013_attach(const struct af9013_config *config,
        }
        info("firmware version:%d.%d.%d.%d", buf[0], buf[1], buf[2], buf[3]);
 
+       /* chip version */
+       ret = af9013_read_reg_bits(state, 0xd733, 4, 4, &buf[2]);
+       if (ret)
+               goto error;
+
+       /* ROM version */
+       for (i = 0; i < 2; i++) {
+               ret = af9013_read_reg(state, 0x116b + i, &buf[i]);
+               if (ret)
+                       goto error;
+       }
+       deb_info("%s: chip version:%d ROM version:%d.%d\n", __func__,
+               buf[2], buf[0], buf[1]);
+
        /* settings for mp2if */
        if (state->config.output_mode == AF9013_OUTPUT_MODE_USB) {
                /* AF9015 split PSB to 1.5k + 0.5k */