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

translate old attenuator propert to new MCI API

This commit is contained in:
rjkm 2022-02-20 23:16:52 +01:00
parent 69fcf5d649
commit cdc5395996

View File

@ -634,6 +634,25 @@ static int mod_set_attenuator(struct ddb *dev, u32 Value)
{ {
if (Value > 31) if (Value > 31)
return -EINVAL; return -EINVAL;
if (dev->link[0].ids.revision == 1) {
struct ddb_link *link = &dev->link[0];
struct mci_result res;
struct mci_command cmd = {
.mod_command = MOD_SETUP_OUTPUT,
.mod_channel = 0,
.mod_stream = 0,
.mod_setup_output = {
.connector = MOD_CONNECTOR_F,
.num_channels = 24,
.unit = MOD_UNIT_DBUV,
.channel_power = 9000 - Value * 100,
},
};
if (!link->mci_ok) {
return -EFAULT;
}
return ddb_mci_cmd_link(link, &cmd, &res);
} else
ddbwritel(dev, Value, RF_ATTENUATOR); ddbwritel(dev, Value, RF_ATTENUATOR);
return 0; return 0;
} }