Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113960
b: refs/heads/master
c: ee33c52
h: refs/heads/master
v: v3
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent f54fda7 commit 22aa020
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 65af619d84ee2d3a1faacbbeded374d0b313d3a9
refs/heads/master: ee33c525c4d09756156cd4c18e6586da900eb310
38 changes: 38 additions & 0 deletions trunk/drivers/media/dvb/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,42 @@ int is_legacy_delivery_system(fe_delivery_system_t s)
return 0;
}

/* Synchronise the legacy tuning parameters into the cache, so that demodulator
* drivers can use a single set_frontend tuning function, regardless of whether
* it's being used for the legacy or new API, reducing code and complexity.
*/
void dtv_property_cache_sync(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;

c->frequency = p->frequency;
c->inversion = p->inversion;

switch (fe->ops.info.type) {
case FE_QPSK:
c->symbol_rate = p->u.qpsk.symbol_rate;
c->fec_inner = p->u.qpsk.fec_inner;
break;
case FE_QAM:
c->symbol_rate = p->u.qam.symbol_rate;
c->fec_inner = p->u.qam.fec_inner;
c->modulation = p->u.qam.modulation;
break;
case FE_OFDM:
c->bandwidth = p->u.ofdm.bandwidth;
c->code_rate_HP = p->u.ofdm.code_rate_HP;
c->code_rate_LP = p->u.ofdm.code_rate_LP;
c->modulation = p->u.ofdm.constellation;
c->transmission_mode = p->u.ofdm.transmission_mode;
c->guard_interval = p->u.ofdm.guard_interval;
c->hierarchy = p->u.ofdm.hierarchy_information;
break;
case FE_ATSC:
c->modulation = p->u.vsb.modulation;
break;
}
}

int dtv_property_cache_submit(struct dvb_frontend *fe)
{

Expand Down Expand Up @@ -1548,6 +1584,8 @@ static int dvb_frontend_ioctl_legacy(struct inode *inode, struct file *file,
case FE_SET_FRONTEND: {
struct dvb_frontend_tune_settings fetunesettings;

dtv_property_cache_sync(fe, &fepriv->parameters);

if(fe->dtv_property_cache.state == DTV_TUNE) {
if (dvb_frontend_check_parameters(fe, &fepriv->parameters) < 0) {
err = -EINVAL;
Expand Down

0 comments on commit 22aa020

Please sign in to comment.