From 4de414351ca745c6699bd6819e832ec164768789 Mon Sep 17 00:00:00 2001 From: Ralph Metzler Date: Mon, 8 Jul 2019 10:08:59 +0200 Subject: [PATCH] separate property function for SDR type modulators --- ddbridge/ddbridge-modulator.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ddbridge/ddbridge-modulator.c b/ddbridge/ddbridge-modulator.c index 4106cf8..e2bc3a5 100644 --- a/ddbridge/ddbridge-modulator.c +++ b/ddbridge/ddbridge-modulator.c @@ -1542,13 +1542,32 @@ static int mod_prop_proc(struct ddb_mod *mod, struct dtv_property *tvp) return 0; } +static int mod_prop_get3(struct ddb_mod *mod, struct dtv_property *tvp) +{ + struct ddb *dev = mod->port->dev; + + switch (tvp->cmd) { + case MODULATOR_INFO: + tvp->u.data = dev->link[0].info->version; + return 0; + default: + return -1; + } +} + static int mod_prop_get(struct ddb_mod *mod, struct dtv_property *tvp) { struct ddb *dev = mod->port->dev; + if (mod->port->dev->link[0].info->version >= 16) + return mod_prop_get3(mod, tvp); if (mod->port->dev->link[0].info->version != 2) return -1; switch (tvp->cmd) { + case MODULATOR_INFO: + tvp->u.data = 2; + return 0; + case MODULATOR_GAIN: tvp->u.data = 0xff & ddbreadl(dev, RF_VGA);; return 0;