40 .addr = state->
config.demod_address,
51 dev_warn(&state->
i2c->dev,
"%s: i2c wr failed=%d reg=%02x\n",
52 KBUILD_MODNAME, ret, reg);
70 .addr = state->
config.demod_address,
81 dev_warn(&state->
i2c->dev,
"%s: i2c rd failed=%d reg=%02x\n",
82 KBUILD_MODNAME, ret, reg);
96 dev_dbg(&state->
i2c->dev,
"%s: frequency=%d bandwidth_hz=%d\n",
100 if (fe->
ops.tuner_ops.set_params)
101 fe->
ops.tuner_ops.set_params(fe);
103 ret = ec100_write_reg(state, 0x04, 0x06);
106 ret = ec100_write_reg(state, 0x67, 0x58);
109 ret = ec100_write_reg(state, 0x05, 0x18);
136 ret = ec100_write_reg(state, 0x1b, tmp);
139 ret = ec100_write_reg(state, 0x1c, tmp2);
143 ret = ec100_write_reg(state, 0x0c, 0xbb);
146 ret = ec100_write_reg(state, 0x0d, 0x31);
150 ret = ec100_write_reg(state, 0x08, 0x24);
154 ret = ec100_write_reg(state, 0x00, 0x00);
157 ret = ec100_write_reg(state, 0x00, 0x20);
163 dev_dbg(&state->
i2c->dev,
"%s: failed=%d\n", __func__, ret);
167 static int ec100_get_tune_settings(
struct dvb_frontend *fe,
184 ret = ec100_read_reg(state, 0x42, &tmp);
193 ret = ec100_read_reg(state, 0x01, &tmp);
209 dev_dbg(&state->
i2c->dev,
"%s: failed=%d\n", __func__, ret);
222 ret = ec100_read_reg(state, 0x65, &tmp);
225 ret = ec100_read_reg(state, 0x66, &tmp2);
229 ber2 = (tmp2 << 8) | tmp;
232 if (ber2 < state->ber)
235 *ber = ber2 - state->
ber;
241 dev_dbg(&state->
i2c->dev,
"%s: failed=%d\n", __func__, ret);
245 static int ec100_read_signal_strength(
struct dvb_frontend *fe,
u16 *strength)
251 ret = ec100_read_reg(state, 0x24, &tmp);
257 *strength = ((tmp << 8) | tmp);
261 dev_dbg(&state->
i2c->dev,
"%s: failed=%d\n", __func__, ret);
302 ret = ec100_read_reg(state, 0x33, &tmp);
303 if (ret || tmp != 0x0b)
321 .name =
"E3C EC100 DVB-T",
333 .release = ec100_release,
334 .set_frontend = ec100_set_frontend,
335 .get_tune_settings = ec100_get_tune_settings,
336 .read_status = ec100_read_status,
337 .read_ber = ec100_read_ber,
338 .read_signal_strength = ec100_read_signal_strength,
339 .read_snr = ec100_read_snr,
340 .read_ucblocks = ec100_read_ucblocks,