Commit 5fa88151 authored by CrazyCat's avatar CrazyCat Committed by Mauro Carvalho Chehab

[media] dvb-usb-cxusb: Geniatech T230 - resync TS FIFO after lock

This patch fix streaming issue for Geniatech T230/PT360.
Signed-off-by: default avatarCrazyCat <crazycat69@narod.ru>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent bfc303e7
...@@ -369,6 +369,26 @@ static int cxusb_aver_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) ...@@ -369,6 +369,26 @@ static int cxusb_aver_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
return 0; return 0;
} }
static int cxusb_read_status(struct dvb_frontend *fe,
enum fe_status *status)
{
struct dvb_usb_adapter *adap = (struct dvb_usb_adapter *)fe->dvb->priv;
struct cxusb_state *state = (struct cxusb_state *)adap->dev->priv;
int ret;
ret = state->fe_read_status(fe, status);
/* it need resync slave fifo when signal change from unlock to lock.*/
if ((*status & FE_HAS_LOCK) && (!state->last_lock)) {
mutex_lock(&state->stream_mutex);
cxusb_streaming_ctrl(adap, 1);
mutex_unlock(&state->stream_mutex);
}
state->last_lock = (*status & FE_HAS_LOCK) ? 1 : 0;
return ret;
}
static void cxusb_d680_dmb_drain_message(struct dvb_usb_device *d) static void cxusb_d680_dmb_drain_message(struct dvb_usb_device *d)
{ {
int ep = d->props.generic_bulk_ctrl_endpoint; int ep = d->props.generic_bulk_ctrl_endpoint;
...@@ -1372,6 +1392,12 @@ static int cxusb_mygica_t230_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -1372,6 +1392,12 @@ static int cxusb_mygica_t230_frontend_attach(struct dvb_usb_adapter *adap)
st->i2c_client_tuner = client_tuner; st->i2c_client_tuner = client_tuner;
/* hook fe: need to resync the slave fifo when signal locks. */
mutex_init(&st->stream_mutex);
st->last_lock = 0;
st->fe_read_status = adap->fe_adap[0].fe->ops.read_status;
adap->fe_adap[0].fe->ops.read_status = cxusb_read_status;
return 0; return 0;
} }
......
...@@ -37,6 +37,11 @@ struct cxusb_state { ...@@ -37,6 +37,11 @@ struct cxusb_state {
struct i2c_client *i2c_client_tuner; struct i2c_client *i2c_client_tuner;
unsigned char data[MAX_XFER_SIZE]; unsigned char data[MAX_XFER_SIZE];
struct mutex stream_mutex;
u8 last_lock;
int (*fe_read_status)(struct dvb_frontend *fe,
enum fe_status *status);
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment