mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-22 11:19:33 +07:00
V4L/DVB (6628): zl10353: Improve support for boards without a tuner on secondary i2c
Issue FSM_GO instead of TUNER_GO if there is no tuner attached to the secondary i2c bus. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
a644e4a3e9
commit
58d834ea89
@ -183,35 +183,31 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
|
|||||||
if (fe->ops.i2c_gate_ctrl)
|
if (fe->ops.i2c_gate_ctrl)
|
||||||
fe->ops.i2c_gate_ctrl(fe, 0);
|
fe->ops.i2c_gate_ctrl(fe, 0);
|
||||||
|
|
||||||
// if there is no attached secondary tuner, we call set_params to program
|
/*
|
||||||
// a potential tuner attached somewhere else
|
* If there is no tuner attached to the secondary I2C bus, we call
|
||||||
|
* set_params to program a potential tuner attached somewhere else.
|
||||||
|
* Otherwise, we update the PLL registers via calc_regs.
|
||||||
|
*/
|
||||||
if (state->config.no_tuner) {
|
if (state->config.no_tuner) {
|
||||||
if (fe->ops.tuner_ops.set_params) {
|
if (fe->ops.tuner_ops.set_params) {
|
||||||
fe->ops.tuner_ops.set_params(fe, param);
|
fe->ops.tuner_ops.set_params(fe, param);
|
||||||
if (fe->ops.i2c_gate_ctrl)
|
if (fe->ops.i2c_gate_ctrl)
|
||||||
fe->ops.i2c_gate_ctrl(fe, 0);
|
fe->ops.i2c_gate_ctrl(fe, 0);
|
||||||
}
|
}
|
||||||
}
|
} else if (fe->ops.tuner_ops.calc_regs) {
|
||||||
|
fe->ops.tuner_ops.calc_regs(fe, param, pllbuf + 1, 5);
|
||||||
// if pllbuf is defined, retrieve the settings
|
|
||||||
if (fe->ops.tuner_ops.calc_regs) {
|
|
||||||
fe->ops.tuner_ops.calc_regs(fe, param, pllbuf+1, 5);
|
|
||||||
pllbuf[1] <<= 1;
|
pllbuf[1] <<= 1;
|
||||||
} else {
|
zl10353_write(fe, pllbuf, sizeof(pllbuf));
|
||||||
// fake pllbuf settings
|
|
||||||
pllbuf[1] = 0x61 << 1;
|
|
||||||
pllbuf[2] = 0;
|
|
||||||
pllbuf[3] = 0;
|
|
||||||
pllbuf[3] = 0;
|
|
||||||
pllbuf[4] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// there is no call to _just_ start decoding, so we send the pllbuf anyway
|
|
||||||
// even if there isn't a PLL attached to the secondary bus
|
|
||||||
zl10353_write(fe, pllbuf, sizeof(pllbuf));
|
|
||||||
|
|
||||||
zl10353_single_write(fe, 0x5F, 0x13);
|
zl10353_single_write(fe, 0x5F, 0x13);
|
||||||
zl10353_single_write(fe, 0x70, 0x01);
|
|
||||||
|
/* If no attached tuner or invalid PLL registers, just start the FSM. */
|
||||||
|
if (state->config.no_tuner || fe->ops.tuner_ops.calc_regs == NULL)
|
||||||
|
zl10353_single_write(fe, FSM_GO, 0x01);
|
||||||
|
else
|
||||||
|
zl10353_single_write(fe, TUNER_GO, 0x01);
|
||||||
|
|
||||||
udelay(250);
|
udelay(250);
|
||||||
zl10353_single_write(fe, 0xE4, 0x00);
|
zl10353_single_write(fe, 0xE4, 0x00);
|
||||||
zl10353_single_write(fe, 0xE5, 0x2A);
|
zl10353_single_write(fe, 0xE5, 0x2A);
|
||||||
|
@ -48,6 +48,8 @@ enum zl10353_reg_addr {
|
|||||||
RS_UBC_0 = 0x15,
|
RS_UBC_0 = 0x15,
|
||||||
TRL_NOMINAL_RATE_1 = 0x65,
|
TRL_NOMINAL_RATE_1 = 0x65,
|
||||||
TRL_NOMINAL_RATE_0 = 0x66,
|
TRL_NOMINAL_RATE_0 = 0x66,
|
||||||
|
TUNER_GO = 0x70,
|
||||||
|
FSM_GO = 0x71,
|
||||||
CHIP_ID = 0x7F,
|
CHIP_ID = 0x7F,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user