1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

add IQ output rate property

This commit is contained in:
Ralph Metzler 2019-08-05 16:00:23 +02:00
parent 83344e1349
commit 4196458803

View File

@ -1477,12 +1477,46 @@ static int mod3_set_ari(struct ddb_mod *mod, u32 rate)
} }
static int mod3_set_sample_rate(struct ddb_mod *mod, u32 rate)
{
u32 cic, inc;
switch (rate) {
case SYS_DVBT_6:
inc = 1917396114;
cic = 8;
break;
case SYS_DVBT_7:
inc = 1957341867;
cic = 7;
break;
case SYS_DVBT_8:
//rate = 8126984;
inc = 1917396114;
cic = 6;
break;
case SYS_ISDBT_6:
inc = 1988410754;
cic = 7;
break;
default:
return -EINVAL;
}
ddbwritel(mod->port->dev, inc, SDR_CHANNEL_ARICW(mod->port->nr));
ddbwritel(mod->port->dev, cic << 8, SDR_CHANNEL_CONFIG(mod->port->nr));
return 0;
}
static int mod3_prop_proc(struct ddb_mod *mod, struct dtv_property *tvp) static int mod3_prop_proc(struct ddb_mod *mod, struct dtv_property *tvp)
{ {
switch (tvp->cmd) { switch (tvp->cmd) {
case MODULATOR_OUTPUT_ARI: case MODULATOR_OUTPUT_ARI:
return mod3_set_ari(mod, tvp->u.data); return mod3_set_ari(mod, tvp->u.data);
case MODULATOR_OUTPUT_RATE:
return mod3_set_sample_rate(mod, tvp->u.data);
case MODULATOR_FREQUENCY: case MODULATOR_FREQUENCY:
return mod3_set_frequency(mod, tvp->u.data); return mod3_set_frequency(mod, tvp->u.data);
@ -1550,6 +1584,9 @@ static int mod_prop_get3(struct ddb_mod *mod, struct dtv_property *tvp)
case MODULATOR_INFO: case MODULATOR_INFO:
tvp->u.data = dev->link[0].info->version; tvp->u.data = dev->link[0].info->version;
return 0; return 0;
case MODULATOR_GAIN:
tvp->u.data = 0xff & ddbreadl(dev, RF_VGA);
return 0;
default: default:
return -1; return -1;
} }
@ -1569,7 +1606,7 @@ static int mod_prop_get(struct ddb_mod *mod, struct dtv_property *tvp)
return 0; return 0;
case MODULATOR_GAIN: case MODULATOR_GAIN:
tvp->u.data = 0xff & ddbreadl(dev, RF_VGA);; tvp->u.data = 0xff & ddbreadl(dev, RF_VGA);
return 0; return 0;
case MODULATOR_ATTENUATOR: case MODULATOR_ATTENUATOR: