aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/mt312.c7
-rw-r--r--drivers/media/dvb/frontends/mt312.h3
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/dvb/frontends/mt312.c b/drivers/media/dvb/frontends/mt312.c
index e17a36180f9c..081ca3398c76 100644
--- a/drivers/media/dvb/frontends/mt312.c
+++ b/drivers/media/dvb/frontends/mt312.c
@@ -422,11 +422,16 @@ static int mt312_set_voltage(struct dvb_frontend *fe, const fe_sec_voltage_t v)
422{ 422{
423 struct mt312_state *state = fe->demodulator_priv; 423 struct mt312_state *state = fe->demodulator_priv;
424 const u8 volt_tab[3] = { 0x00, 0x40, 0x00 }; 424 const u8 volt_tab[3] = { 0x00, 0x40, 0x00 };
425 u8 val;
425 426
426 if (v > SEC_VOLTAGE_OFF) 427 if (v > SEC_VOLTAGE_OFF)
427 return -EINVAL; 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
432static int mt312_read_status(struct dvb_frontend *fe, fe_status_t *s) 437static int mt312_read_status(struct dvb_frontend *fe, fe_status_t *s)
diff --git a/drivers/media/dvb/frontends/mt312.h b/drivers/media/dvb/frontends/mt312.h
index afe24fd822bd..96338f0c4dd4 100644
--- a/drivers/media/dvb/frontends/mt312.h
+++ b/drivers/media/dvb/frontends/mt312.h
@@ -31,6 +31,9 @@
31struct mt312_config { 31struct mt312_config {
32 /* the demodulator's i2c address */ 32 /* the demodulator's i2c address */
33 u8 demod_address; 33 u8 demod_address;
34
35 /* inverted voltage setting */
36 int voltage_inverted:1;
34}; 37};
35 38
36#if defined(CONFIG_DVB_MT312) || (defined(CONFIG_DVB_MT312_MODULE) && defined(MODULE)) 39#if defined(CONFIG_DVB_MT312) || (defined(CONFIG_DVB_MT312_MODULE) && defined(MODULE))