aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/dib8000.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/dib8000.c')
-rw-r--r--drivers/media/dvb/frontends/dib8000.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/dib8000.c b/drivers/media/dvb/frontends/dib8000.c
index 852c790d09d..898400d331a 100644
--- a/drivers/media/dvb/frontends/dib8000.c
+++ b/drivers/media/dvb/frontends/dib8000.c
@@ -954,7 +954,7 @@ static void dib8000_set_channel(struct dib8000_state *state, u8 seq, u8 autosear
954 u8 guard, crate, constellation, timeI; 954 u8 guard, crate, constellation, timeI;
955 u8 permu_seg[] = { 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0, 12 }; 955 u8 permu_seg[] = { 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0, 12 };
956 u16 i, coeff[4], P_cfr_left_edge = 0, P_cfr_right_edge = 0, seg_mask13 = 0x1fff; // All 13 segments enabled 956 u16 i, coeff[4], P_cfr_left_edge = 0, P_cfr_right_edge = 0, seg_mask13 = 0x1fff; // All 13 segments enabled
957 const s16 *ncoeff, *ana_fe; 957 const s16 *ncoeff = NULL, *ana_fe;
958 u16 tmcc_pow = 0; 958 u16 tmcc_pow = 0;
959 u16 coff_pow = 0x2800; 959 u16 coff_pow = 0x2800;
960 u16 init_prbs = 0xfff; 960 u16 init_prbs = 0xfff;
@@ -2121,7 +2121,7 @@ static int dib8000_read_snr(struct dvb_frontend *fe, u16 * snr)
2121 else 2121 else
2122 result -= intlog10(2) * 10 * noise_exp - 100; 2122 result -= intlog10(2) * 10 * noise_exp - 100;
2123 2123
2124 *snr = result / (1 << 24); 2124 *snr = result / ((1 << 24) / 10);
2125 return 0; 2125 return 0;
2126} 2126}
2127 2127
@@ -2195,6 +2195,25 @@ struct i2c_adapter *dib8000_get_i2c_master(struct dvb_frontend *fe, enum dibx000
2195 2195
2196EXPORT_SYMBOL(dib8000_get_i2c_master); 2196EXPORT_SYMBOL(dib8000_get_i2c_master);
2197 2197
2198int dib8000_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff)
2199{
2200 struct dib8000_state *st = fe->demodulator_priv;
2201 u16 val = dib8000_read_word(st, 299) & 0xffef;
2202 val |= (onoff & 0x1) << 4;
2203
2204 dprintk("pid filter enabled %d", onoff);
2205 return dib8000_write_word(st, 299, val);
2206}
2207EXPORT_SYMBOL(dib8000_pid_filter_ctrl);
2208
2209int dib8000_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff)
2210{
2211 struct dib8000_state *st = fe->demodulator_priv;
2212 dprintk("Index %x, PID %d, OnOff %d", id, pid, onoff);
2213 return dib8000_write_word(st, 305 + id, onoff ? (1 << 13) | pid : 0);
2214}
2215EXPORT_SYMBOL(dib8000_pid_filter);
2216
2198static const struct dvb_frontend_ops dib8000_ops = { 2217static const struct dvb_frontend_ops dib8000_ops = {
2199 .info = { 2218 .info = {
2200 .name = "DiBcom 8000 ISDB-T", 2219 .name = "DiBcom 8000 ISDB-T",