@@ -32,9 +32,9 @@
#include "qm1d1c0042.h"
#define QM1D1C0042_NUM_REGS 0x20
-#define QM1D1C0042_NUM_REG_ROWS 2
+#define QM1D1C0042_NUM_CHIP_IDS 2
-static const u8 reg_initval[QM1D1C0042_NUM_REG_ROWS][QM1D1C0042_NUM_REGS] = { {
+static const u8 reg_initval[QM1D1C0042_NUM_CHIP_IDS][QM1D1C0042_NUM_REGS] = { {
0x48, 0x1c, 0xa0, 0x10, 0xbc, 0xc5, 0x20, 0x33,
0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0xff, 0xf3, 0x00, 0x2a, 0x64, 0xa6, 0x86,
@@ -47,8 +47,6 @@ static const u8 reg_initval[QM1D1C0042_NUM_REG_ROWS][QM1D1C0042_NUM_REGS] = { {
}
};
-static int reg_index;
-
static const struct qm1d1c0042_config default_cfg = {
.xtal_freq = 16000,
.lpf = 1,
@@ -326,7 +324,7 @@ static int qm1d1c0042_init(struct dvb_frontend *fe)
{
struct qm1d1c0042_state *state;
u8 val;
- int i, ret;
+ int i, ret, reg_index;
state = fe->tuner_priv;
@@ -346,9 +344,9 @@ static int qm1d1c0042_init(struct dvb_frontend *fe)
ret = reg_read(state, 0x00, &val);
if (ret < 0)
goto failed;
- for (reg_index = 0; reg_index < QM1D1C0042_NUM_REG_ROWS; reg_index++)
+ for (reg_index = 0; reg_index < QM1D1C0042_NUM_CHIP_IDS; reg_index++)
if (val == reg_initval[reg_index][0x00]) break;
- if (reg_index >= QM1D1C0042_NUM_REG_ROWS)
+ if (reg_index >= QM1D1C0042_NUM_CHIP_IDS)
goto failed;
memcpy(state->regs, reg_initval[reg_index], QM1D1C0042_NUM_REGS);
usleep_range(2000, 3000);