summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/dvb-usb/dw2102.c
diff options
context:
space:
mode:
authorOlli Salonen <olli.salonen@iki.fi>2015-05-05 13:33:55 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-05-13 17:12:42 -0300
commit356484cabe44984d2dc66a90bd5e3465ba1f64fb (patch)
treedc47169ea48cc215149f13d56f1e56e6a04a7f6b /drivers/media/usb/dvb-usb/dw2102.c
parentc636bd0bce374f3beed8a071032d807f61f0f5c4 (diff)
downloadlinux-356484cabe44984d2dc66a90bd5e3465ba1f64fb.tar.bz2
[media] dw2102: resync fifo when demod locks
If the streaming_ctrl is called to enable TS before demod has locked the TS will be empty. Copied the solution from the dvbsky driver for the TechnoTrend S2-4600 device: when the state changes from unlock to lock, call su3000_streaming_ctrl again. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/dvb-usb/dw2102.c')
-rw-r--r--drivers/media/usb/dvb-usb/dw2102.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
index d10c72c522b3..c2632bc9e530 100644
--- a/drivers/media/usb/dvb-usb/dw2102.c
+++ b/drivers/media/usb/dvb-usb/dw2102.c
@@ -117,8 +117,13 @@
struct dw2102_state {
u8 initialized;
+ u8 last_lock;
struct i2c_client *i2c_client_tuner;
+
+ /* fe hook functions*/
int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v);
+ int (*fe_read_status)(struct dvb_frontend *fe,
+ fe_status_t *status);
};
/* debug */
@@ -999,6 +1004,23 @@ static void dw210x_led_ctrl(struct dvb_frontend *fe, int offon)
i2c_transfer(&udev_adap->dev->i2c_adap, &msg, 1);
}
+static int tt_s2_4600_read_status(struct dvb_frontend *fe, fe_status_t *status)
+{
+ struct dvb_usb_adapter *d =
+ (struct dvb_usb_adapter *)(fe->dvb->priv);
+ struct dw2102_state *st = (struct dw2102_state *)d->dev->priv;
+ int ret;
+
+ ret = st->fe_read_status(fe, status);
+
+ /* resync slave fifo when signal change from unlock to lock */
+ if ((*status & FE_HAS_LOCK) && (!st->last_lock))
+ su3000_streaming_ctrl(d, 1);
+
+ st->last_lock = (*status & FE_HAS_LOCK) ? 1 : 0;
+ return ret;
+}
+
static struct stv0299_config sharp_z0194a_config = {
.demod_address = 0x68,
.inittab = sharp_z0194a_inittab,
@@ -1551,6 +1573,12 @@ static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap)
state->i2c_client_tuner = client;
+ /* hook fe: need to resync the slave fifo when signal locks */
+ state->fe_read_status = adap->fe_adap[0].fe->ops.read_status;
+ adap->fe_adap[0].fe->ops.read_status = tt_s2_4600_read_status;
+
+ state->last_lock = 0;
+
return 0;
}