[media] af9033: fix firmware version logging
authorAntti Palosaari <crope@iki.fi>
Sun, 31 Aug 2014 05:03:05 +0000 (02:03 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 21 Sep 2014 21:30:21 +0000 (18:30 -0300)
AF9030 and IT9130 series has different memory location for firmware
version. Choose correct location according to chip type.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-frontends/af9033.c

index 7f22f011f8f50537076b8c572775129d91004a01..7d637b92ff2541e39a2ae3ef996509a51dfaf933 100644 (file)
@@ -1061,6 +1061,7 @@ struct dvb_frontend *af9033_attach(const struct af9033_config *config,
        int ret;
        struct af9033_state *state;
        u8 buf[8];
+       u32 reg;
 
        dev_dbg(&i2c->dev, "%s:\n", __func__);
 
@@ -1081,7 +1082,21 @@ struct dvb_frontend *af9033_attach(const struct af9033_config *config,
        }
 
        /* firmware version */
-       ret = af9033_rd_regs(state, 0x0083e9, &buf[0], 4);
+       switch (state->cfg.tuner) {
+       case AF9033_TUNER_IT9135_38:
+       case AF9033_TUNER_IT9135_51:
+       case AF9033_TUNER_IT9135_52:
+       case AF9033_TUNER_IT9135_60:
+       case AF9033_TUNER_IT9135_61:
+       case AF9033_TUNER_IT9135_62:
+               reg = 0x004bfc;
+               break;
+       default:
+               reg = 0x0083e9;
+               break;
+       }
+
+       ret = af9033_rd_regs(state, reg, &buf[0], 4);
        if (ret < 0)
                goto err;