Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (7575): mt312: add attach-time setting to invert lnb-voltage

Add a setting to config struct for inversion of lnb-voltage.
Needed for support of Avermedia A700 cards.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by

Matthias Schwarzott and committed by
Mauro Carvalho Chehab
11d3f323 6a5cbd59

+9 -1
+6 -1
drivers/media/dvb/frontends/mt312.c
··· 422 422 { 423 423 struct mt312_state *state = fe->demodulator_priv; 424 424 const u8 volt_tab[3] = { 0x00, 0x40, 0x00 }; 425 + u8 val; 425 426 426 427 if (v > SEC_VOLTAGE_OFF) 427 428 return -EINVAL; 428 429 429 - return mt312_writereg(state, DISEQC_MODE, volt_tab[v]); 430 + val = volt_tab[v]; 431 + if (state->config->voltage_inverted) 432 + val ^= 0x40; 433 + 434 + return mt312_writereg(state, DISEQC_MODE, val); 430 435 } 431 436 432 437 static int mt312_read_status(struct dvb_frontend *fe, fe_status_t *s)
+3
drivers/media/dvb/frontends/mt312.h
··· 31 31 struct mt312_config { 32 32 /* the demodulator's i2c address */ 33 33 u8 demod_address; 34 + 35 + /* inverted voltage setting */ 36 + int voltage_inverted:1; 34 37 }; 35 38 36 39 #if defined(CONFIG_DVB_MT312) || (defined(CONFIG_DVB_MT312_MODULE) && defined(MODULE))