summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/dib7000m.c
diff options
context:
space:
mode:
authorOlivier Grenie <olivier.grenie@dibcom.fr>2011-01-14 13:58:59 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-02 13:45:12 -0300
commite192a7cf0effe7680264a5bc35c0ad1bdcdc921c (patch)
tree586ca0b3d8c77be1d8cd418641e30f26e0d09766 /drivers/media/dvb/frontends/dib7000m.c
parent0a91be40ed67ca72a81cfd842d5c2604ff1a54a4 (diff)
downloadblackbird-op-linux-e192a7cf0effe7680264a5bc35c0ad1bdcdc921c.tar.gz
blackbird-op-linux-e192a7cf0effe7680264a5bc35c0ad1bdcdc921c.zip
[media] DiB7000M: add pid filtering
This patch adds the pid filtering for the dib7000M demod. It also corrects the pid filtering for the dib7700 based board. It should prevent an oops, when using dib7700p based board. References: https://bugzilla.novell.com/show_bug.cgi?id=644807 Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr> Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr> Tested-by: Pavel SKARKA <paul.sp@seznam.cz> Cc: stable@kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/dib7000m.c')
-rw-r--r--drivers/media/dvb/frontends/dib7000m.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/dib7000m.c b/drivers/media/dvb/frontends/dib7000m.c
index c7f5ccf54aa5..289a79837f24 100644
--- a/drivers/media/dvb/frontends/dib7000m.c
+++ b/drivers/media/dvb/frontends/dib7000m.c
@@ -1285,6 +1285,25 @@ struct i2c_adapter * dib7000m_get_i2c_master(struct dvb_frontend *demod, enum di
}
EXPORT_SYMBOL(dib7000m_get_i2c_master);
+int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff)
+{
+ struct dib7000m_state *state = fe->demodulator_priv;
+ u16 val = dib7000m_read_word(state, 294 + state->reg_offs) & 0xffef;
+ val |= (onoff & 0x1) << 4;
+ dprintk("PID filter enabled %d", onoff);
+ return dib7000m_write_word(state, 294 + state->reg_offs, val);
+}
+EXPORT_SYMBOL(dib7000m_pid_filter_ctrl);
+
+int dib7000m_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff)
+{
+ struct dib7000m_state *state = fe->demodulator_priv;
+ dprintk("PID filter: index %x, PID %d, OnOff %d", id, pid, onoff);
+ return dib7000m_write_word(state, 300 + state->reg_offs + id,
+ onoff ? (1 << 13) | pid : 0);
+}
+EXPORT_SYMBOL(dib7000m_pid_filter);
+
#if 0
/* used with some prototype boards */
int dib7000m_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods,
OpenPOWER on IntegriCloud