static int budget_read_fe_status(struct dvb_frontend *fe, fe_status_t *status) { struct budget *budget = (struct budget *) fe->dvb->priv; int synced; int ret; if (budget->read_fe_status) ret = budget->read_fe_status(fe, status); else ret = -EINVAL; if (!ret) { synced = (*status & FE_HAS_LOCK); if (synced != budget->fe_synced) { budget->fe_synced = synced; spin_lock(&budget->feedlock); if (synced) start_ts_capture(budget); else stop_ts_capture(budget); spin_unlock(&budget->feedlock); } } return ret; }
void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port) { struct budget *budget = (struct budget *) dev->ext_priv; spin_lock(&budget->feedlock); budget->video_port = video_port; if (budget->feeding) { stop_ts_capture(budget); start_ts_capture(budget); } spin_unlock(&budget->feedlock); }
static int budget_start_feed(struct dvb_demux_feed *feed) { struct dvb_demux *demux = feed->demux; struct budget *budget = (struct budget*) demux->priv; int status; DEB_EE(("budget: %p\n",budget)); if (!demux->dmx.frontend) return -EINVAL; spin_lock(&budget->feedlock); status = start_ts_capture (budget); spin_unlock(&budget->feedlock); return status; }
static int budget_start_feed(struct dvb_demux_feed *feed) { struct dvb_demux *demux = feed->demux; struct budget *budget = (struct budget *) demux->priv; int status = 0; dprintk(2, "budget: %p\n", budget); if (!demux->dmx.frontend) return -EINVAL; spin_lock(&budget->feedlock); feed->pusi_seen = 0; /* have a clean section start */ if (budget->feeding++ == 0) status = start_ts_capture(budget); spin_unlock(&budget->feedlock); return status; }