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

add MODULATOR_RESET property

This commit is contained in:
Ralph Metzler 2017-10-11 13:47:50 +02:00
parent 6bdfe43958
commit 3778a64de5
2 changed files with 15 additions and 10 deletions

View File

@ -474,17 +474,16 @@ static int mod_fsm_setup(struct ddb *dev, u32 MaxUsedChannels)
u32 Capacity; u32 Capacity;
u32 tmp = ddbreadl(dev, FSM_STATUS); u32 tmp = ddbreadl(dev, FSM_STATUS);
if ((tmp & FSM_STATUS_READY) == 0) { status = mod_setup_max2871(dev, max2871_fsm);
status = mod_setup_max2871(dev, max2871_fsm); if (status)
if (status) return status;
return status; ddbwritel(dev, FSM_CMD_RESET, FSM_CONTROL);
ddbwritel(dev, FSM_CMD_RESET, FSM_CONTROL); msleep(20);
msleep(20);
tmp = ddbreadl(dev, FSM_STATUS);
if ((tmp & FSM_STATUS_READY) == 0)
return -1;
tmp = ddbreadl(dev, FSM_STATUS);
if ((tmp & FSM_STATUS_READY) == 0)
return -1;
}
Capacity = ddbreadl(dev, FSM_CAPACITY); Capacity = ddbreadl(dev, FSM_CAPACITY);
if (((tmp & FSM_STATUS_QAMREADY) != 0) && if (((tmp & FSM_STATUS_QAMREADY) != 0) &&
((Capacity & FSM_CAPACITY_INUSE) != 0)) ((Capacity & FSM_CAPACITY_INUSE) != 0))
@ -1529,6 +1528,11 @@ static int mod_prop_proc(struct ddb_mod *mod, struct dtv_property *tvp)
if (mod->port->dev->link[0].info->version == 2) if (mod->port->dev->link[0].info->version == 2)
return mod_set_vga(mod->port->dev, tvp->u.data); return mod_set_vga(mod->port->dev, tvp->u.data);
return -EINVAL; return -EINVAL;
case MODULATOR_RESET:
if (mod->port->dev->link[0].info->version == 2)
return mod_fsm_setup(mod->port->dev,0 );
return -EINVAL;
} }
return 0; return 0;
} }

View File

@ -30,6 +30,7 @@ struct dvb_mod_channel_params {
#define MODULATOR_INPUT_BITRATE 33 /* Hz */ #define MODULATOR_INPUT_BITRATE 33 /* Hz */
#define MODULATOR_PCR_MODE 34 /* 1=pcr correction enabled */ #define MODULATOR_PCR_MODE 34 /* 1=pcr correction enabled */
#define MODULATOR_GAIN 35 #define MODULATOR_GAIN 35
#define MODULATOR_RESET 36
#define MODULATOR_OUTPUT_ARI 64 #define MODULATOR_OUTPUT_ARI 64
#endif /*_UAPI_DVBMOD_H_*/ #endif /*_UAPI_DVBMOD_H_*/