Commit 8aa3b2b7 authored by Steven Toth's avatar Steven Toth Committed by Greg Kroah-Hartman

DVB: s5h1411: bugfix: Setting serial or parallel mode could destroy bits

commit 1af46b45 upstream.

DVB: s5h1411: bugfix: Setting serial or parallel mode could destroy bits

Adding a serialmode function to read/and/or/write the register for safety.
Signed-off-by: default avatarSteven Toth <stoth@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bcf3b9fc
...@@ -472,6 +472,20 @@ static int s5h1411_set_spectralinversion(struct dvb_frontend *fe, int inversion) ...@@ -472,6 +472,20 @@ static int s5h1411_set_spectralinversion(struct dvb_frontend *fe, int inversion)
return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x24, val); return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x24, val);
} }
static int s5h1411_set_serialmode(struct dvb_frontend *fe, int serial)
{
struct s5h1411_state *state = fe->demodulator_priv;
u16 val;
dprintk("%s(%d)\n", __func__, serial);
val = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xbd) & ~0x100;
if (serial == 1)
val |= 0x100;
return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xbd, val);
}
static int s5h1411_enable_modulation(struct dvb_frontend *fe, static int s5h1411_enable_modulation(struct dvb_frontend *fe,
fe_modulation_t m) fe_modulation_t m)
{ {
...@@ -612,10 +626,10 @@ static int s5h1411_init(struct dvb_frontend *fe) ...@@ -612,10 +626,10 @@ static int s5h1411_init(struct dvb_frontend *fe)
if (state->config->output_mode == S5H1411_SERIAL_OUTPUT) if (state->config->output_mode == S5H1411_SERIAL_OUTPUT)
/* Serial */ /* Serial */
s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xbd, 0x1101); s5h1411_set_serialmode(fe, 1);
else else
/* Parallel */ /* Parallel */
s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xbd, 0x1001); s5h1411_set_serialmode(fe, 0);
s5h1411_set_spectralinversion(fe, state->config->inversion); s5h1411_set_spectralinversion(fe, state->config->inversion);
s5h1411_set_if_freq(fe, state->config->vsb_if); s5h1411_set_if_freq(fe, state->config->vsb_if);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment