Commit 36cb557a authored by Andrew de Quincey's avatar Andrew de Quincey Committed by Mauro Carvalho Chehab

DVB (2444): Implement frontend-specific tuning and the ability to disable zigzag

- Implement frontend-specific tuning and the ability to disable zigzag
Signed-off-by: default avatarAndrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
parent 47f36920
...@@ -1341,30 +1341,40 @@ static int dst_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -1341,30 +1341,40 @@ static int dst_read_snr(struct dvb_frontend *fe, u16 *snr)
return 0; return 0;
} }
static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) static int dst_set_frontend(struct dvb_frontend* fe,
struct dvb_frontend_parameters* p,
unsigned int mode_flags,
int *delay,
fe_status_t *status)
{ {
struct dst_state *state = fe->demodulator_priv; struct dst_state *state = fe->demodulator_priv;
dst_set_freq(state, p->frequency); if (p != NULL) {
dprintk(verbose, DST_DEBUG, 1, "Set Frequency=[%d]", p->frequency); dst_set_freq(state, p->frequency);
dprintk(verbose, DST_DEBUG, 1, "Set Frequency=[%d]", p->frequency);
if (state->dst_type == DST_TYPE_IS_SAT) { if (state->dst_type == DST_TYPE_IS_SAT) {
if (state->type_flags & DST_TYPE_HAS_OBS_REGS) if (state->type_flags & DST_TYPE_HAS_OBS_REGS)
dst_set_inversion(state, p->inversion); dst_set_inversion(state, p->inversion);
dst_set_fec(state, p->u.qpsk.fec_inner); dst_set_fec(state, p->u.qpsk.fec_inner);
dst_set_symbolrate(state, p->u.qpsk.symbol_rate); dst_set_symbolrate(state, p->u.qpsk.symbol_rate);
dst_set_polarization(state); dst_set_polarization(state);
dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->u.qpsk.symbol_rate); dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->u.qpsk.symbol_rate);
} else if (state->dst_type == DST_TYPE_IS_TERR) } else if (state->dst_type == DST_TYPE_IS_TERR)
dst_set_bandwidth(state, p->u.ofdm.bandwidth); dst_set_bandwidth(state, p->u.ofdm.bandwidth);
else if (state->dst_type == DST_TYPE_IS_CABLE) { else if (state->dst_type == DST_TYPE_IS_CABLE) {
dst_set_fec(state, p->u.qam.fec_inner); dst_set_fec(state, p->u.qam.fec_inner);
dst_set_symbolrate(state, p->u.qam.symbol_rate); dst_set_symbolrate(state, p->u.qam.symbol_rate);
dst_set_modulation(state, p->u.qam.modulation); dst_set_modulation(state, p->u.qam.modulation);
}
dst_write_tuna(fe);
} }
dst_write_tuna(fe);
if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
dst_read_status(fe, status);
*delay = HZ/10;
return 0; return 0;
} }
...@@ -1445,7 +1455,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = { ...@@ -1445,7 +1455,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
.release = dst_release, .release = dst_release,
.init = dst_init, .init = dst_init,
.set_frontend = dst_set_frontend, .tune = dst_set_frontend,
.get_frontend = dst_get_frontend, .get_frontend = dst_get_frontend,
.read_status = dst_read_status, .read_status = dst_read_status,
.read_signal_strength = dst_read_signal_strength, .read_signal_strength = dst_read_signal_strength,
...@@ -1469,7 +1479,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = { ...@@ -1469,7 +1479,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
.release = dst_release, .release = dst_release,
.init = dst_init, .init = dst_init,
.set_frontend = dst_set_frontend, .tune = dst_set_frontend,
.get_frontend = dst_get_frontend, .get_frontend = dst_get_frontend,
.read_status = dst_read_status, .read_status = dst_read_status,
.read_signal_strength = dst_read_signal_strength, .read_signal_strength = dst_read_signal_strength,
...@@ -1496,7 +1506,7 @@ static struct dvb_frontend_ops dst_dvbc_ops = { ...@@ -1496,7 +1506,7 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
.release = dst_release, .release = dst_release,
.init = dst_init, .init = dst_init,
.set_frontend = dst_set_frontend, .tune = dst_set_frontend,
.get_frontend = dst_get_frontend, .get_frontend = dst_get_frontend,
.read_status = dst_read_status, .read_status = dst_read_status,
.read_signal_strength = dst_read_signal_strength, .read_signal_strength = dst_read_signal_strength,
......
This diff is collapsed.
...@@ -58,10 +58,19 @@ struct dvb_frontend_ops { ...@@ -58,10 +58,19 @@ struct dvb_frontend_ops {
int (*init)(struct dvb_frontend* fe); int (*init)(struct dvb_frontend* fe);
int (*sleep)(struct dvb_frontend* fe); int (*sleep)(struct dvb_frontend* fe);
/* if this is set, it overrides the default swzigzag */
int (*tune)(struct dvb_frontend* fe,
struct dvb_frontend_parameters* params,
unsigned int mode_flags,
int *delay,
fe_status_t *status);
/* these two are only used for the swzigzag code */
int (*set_frontend)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); int (*set_frontend)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
int (*get_frontend)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
int (*get_tune_settings)(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* settings); int (*get_tune_settings)(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* settings);
int (*get_frontend)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
int (*read_status)(struct dvb_frontend* fe, fe_status_t* status); int (*read_status)(struct dvb_frontend* fe, fe_status_t* status);
int (*read_ber)(struct dvb_frontend* fe, u32* ber); int (*read_ber)(struct dvb_frontend* fe, u32* ber);
int (*read_signal_strength)(struct dvb_frontend* fe, u16* strength); int (*read_signal_strength)(struct dvb_frontend* fe, u16* strength);
......
...@@ -240,6 +240,15 @@ struct dvb_frontend_event { ...@@ -240,6 +240,15 @@ struct dvb_frontend_event {
}; };
/**
* When set, this flag will disable any zigzagging or other "normal" tuning
* behaviour. Additionally, there will be no automatic monitoring of the lock
* status, and hence no frontend events will be generated. If a frontend device
* is closed, this flag will be automatically turned off when the device is
* reopened read-write.
*/
#define FE_TUNE_MODE_ONESHOT 0x01
#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) #define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info)
...@@ -260,6 +269,7 @@ struct dvb_frontend_event { ...@@ -260,6 +269,7 @@ struct dvb_frontend_event {
#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters) #define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)
#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) #define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)
#define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */
#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event) #define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)
#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment