Skip to contentSkip to conversation

Only use DVBv5 internally on frontend drivers

RFC PATCH Superseded Mauro Carvalho Chehab 6 participants 122 messages Dec 27, 2011 – Jan 2, 2012 Page 2 of 2

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#82 lore raw

RFC PATCH 82/91 tlg2300: convert set_fontend to use DVBv5 parameters

In reply to Mauro Carvalho Chehab

Instead of using dvb_frontend_parameters struct, that were designed for a subset of the supported standards, use the DVBv5 cache information.

Also, fill the supported delivery systems at dvb_frontend_ops struct.

---
 drivers/media/video/tlg2300/pd-common.h |    2 +-
 drivers/media/video/tlg2300/pd-dvb.c    |   23 ++++++++++++-----------
 2 files changed, 13 insertions(+), 12 deletions(-)
drivers/media/video/tlg2300/pd-common.h +1 -1
index 56564e6..5dd73b7 100644
@@ -140,7 +140,7 @@ struct pd_dvb_adapter {
 	u8			reserved[3];
 
 	/* data for power resume*/
-	struct dvb_frontend_parameters fe_param;
+	struct dtv_frontend_properties fe_param;
 
 	/* for channel scanning */
 	int		prev_freq;
drivers/media/video/tlg2300/pd-dvb.c +12 -11
index f864c17..7998811 100644
@@ -12,9 +12,9 @@
 static void dvb_urb_cleanup(struct pd_dvb_adapter *pd_dvb);
 
 static int dvb_bandwidth[][2] = {
-	{ TLG_BW_8, BANDWIDTH_8_MHZ },
-	{ TLG_BW_7, BANDWIDTH_7_MHZ },
-	{ TLG_BW_6, BANDWIDTH_6_MHZ }
+	{ TLG_BW_8, 8000000 },
+	{ TLG_BW_7, 7000000 },
+	{ TLG_BW_6, 6000000 }
 };
 static int dvb_bandwidth_length = ARRAY_SIZE(dvb_bandwidth);
 
@@ -146,9 +146,9 @@ static int fw_delay_overflow(struct pd_dvb_adapter *adapter)
 	return msec > 800 ? true : false;
 }
 
-static int poseidon_set_fe(struct dvb_frontend *fe,
-			struct dvb_frontend_parameters *fep)
+static int poseidon_set_fe(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	s32 ret = 0, cmd_status = 0;
 	s32 i, bandwidth = -1;
 	struct poseidon *pd = fe->demodulator_priv;
@@ -159,7 +159,7 @@ static int poseidon_set_fe(struct dvb_frontend *fe,
 
 	mutex_lock(&pd->lock);
 	for (i = 0; i < dvb_bandwidth_length; i++)
-		if (fep->u.ofdm.bandwidth == dvb_bandwidth[i][1])
+		if (fep->bandwidth_hz == dvb_bandwidth[i][1])
 			bandwidth = dvb_bandwidth[i][0];
 
 	if (check_scan_ok(fep->frequency, bandwidth, pd_dvb)) {
@@ -210,7 +210,7 @@ static int pm_dvb_resume(struct poseidon *pd)
 
 	poseidon_check_mode_dvbt(pd);
 	msleep(300);
-	poseidon_set_fe(&pd_dvb->dvb_fe, &pd_dvb->fe_param);
+	poseidon_set_fe(&pd_dvb->dvb_fe);
 
 	dvb_start_streaming(pd_dvb);
 	return 0;
@@ -227,12 +227,12 @@ static s32 poseidon_fe_init(struct dvb_frontend *fe)
 	pd->pm_resume  = pm_dvb_resume;
 #endif
 	memset(&pd_dvb->fe_param, 0,
-			sizeof(struct dvb_frontend_parameters));
+			sizeof(struct dtv_frontend_properties));
 	return 0;
 }
 
 static int poseidon_get_fe(struct dvb_frontend *fe,
-			struct dvb_frontend_parameters *fep)
+			struct dtv_frontend_properties *fep)
 {
 	struct poseidon *pd = fe->demodulator_priv;
 	struct pd_dvb_adapter *pd_dvb = &pd->dvb_data;
@@ -332,6 +332,7 @@ static int poseidon_read_unc_blocks(struct dvb_frontend *fe, u32 *unc)
 }
 
 static struct dvb_frontend_ops poseidon_frontend_ops = {
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name		= "Poseidon DVB-T",
 		.type		= FE_OFDM,
@@ -353,8 +354,8 @@ static struct dvb_frontend_ops poseidon_frontend_ops = {
 	.init = poseidon_fe_init,
 	.sleep = poseidon_fe_sleep,
 
-	.set_frontend_legacy = poseidon_set_fe,
-	.get_frontend_legacy = poseidon_get_fe,
+	.set_frontend = poseidon_set_fe,
+	.get_frontend = poseidon_get_fe,
 	.get_tune_settings = poseidon_fe_get_tune_settings,
 
 	.read_status	= poseidon_read_status,
Signature · 1 line
1.7.8.352.g876a6
#83 lore raw

RFC PATCH 83/91 dvb-core: remove get|set_frontend_legacy

Now that all drivers were converted, we can get rid of those emulation calls.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   24 ++++--------------------
 drivers/media/dvb/dvb-core/dvb_frontend.h |    2 --
 2 files changed, 4 insertions(+), 22 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +4 -20
index 1eefb91..5bb6c1d 100644
@@ -145,7 +145,7 @@ static int dtv_get_frontend(struct dvb_frontend *fe,
 
 static bool has_get_frontend(struct dvb_frontend *fe)
 {
-	return fe->ops.get_frontend || fe->ops.get_frontend_legacy;
+	return fe->ops.get_frontend;
 }
 
 static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
@@ -361,8 +361,6 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 		fepriv->parameters_in.inversion = fepriv->inversion;
 	if (fe->ops.set_frontend)
 		fe_set_err = fe->ops.set_frontend(fe);
-	else if (fe->ops.set_frontend_legacy)
-		fe_set_err = fe->ops.set_frontend_legacy(fe, &fepriv->parameters_in);
 	fepriv->parameters_out = fepriv->parameters_in;
 	if (fe_set_err < 0) {
 		fepriv->state = FESTATE_ERROR;
@@ -394,9 +392,6 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 		if (fepriv->state & FESTATE_RETUNE) {
 			if (fe->ops.set_frontend)
 				retval = fe->ops.set_frontend(fe);
-			else if (fe->ops.set_frontend_legacy)
-				retval = fe->ops.set_frontend_legacy(fe,
-							&fepriv->parameters_in);
 			fepriv->parameters_out = fepriv->parameters_in;
 			if (retval < 0)
 				fepriv->state = FESTATE_ERROR;
@@ -1271,7 +1266,6 @@ static int dtv_get_frontend(struct dvb_frontend *fe,
 	const struct dtv_frontend_properties *cache = &fe->dtv_property_cache;
 	struct dtv_frontend_properties tmp_cache;
 	struct dvb_frontend_parameters tmp_out;
-	bool fill_cache = (c != NULL);
 	bool fill_params = (p_out != NULL);
 	int r;
 
@@ -1283,7 +1277,6 @@ static int dtv_get_frontend(struct dvb_frontend *fe,
 	else
 		memcpy(c, cache, sizeof(*c));
 
-	/* Then try the DVBv5 one */
 	if (fe->ops.get_frontend) {
 		r = fe->ops.get_frontend(fe, c);
 		if (unlikely(r < 0))
@@ -1293,17 +1286,8 @@ static int dtv_get_frontend(struct dvb_frontend *fe,
 		return 0;
 	}
 
-	/* As no DVBv5 call exists, use the DVBv3 one */
-	if (fe->ops.get_frontend_legacy) {
-		r = fe->ops.get_frontend_legacy(fe, p_out);
-		if (unlikely(r < 0))
-			return r;
-		if (fill_cache)
-			dtv_property_cache_sync(fe, c, p_out);
-		return 0;
-	}
-
-	return -EOPNOTSUPP;
+	/* As everything is in cache, this is always supported */
+	return 0;
 }
 
 static int dvb_frontend_ioctl_legacy(struct file *file,
@@ -1758,7 +1742,7 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 
 		/*
 		 * Fills the cache out struct with the cache contents, plus
-		 * the data retrieved from get_frontend/get_frontend_legacy.
+		 * the data retrieved from get_frontend.
 		 */
 		dtv_get_frontend(fe, &cache_out, NULL);
 		for (i = 0; i < tvps->num; i++) {
drivers/media/dvb/dvb-core/dvb_frontend.h +0 -2
index 06ec17a..23456b3 100644
@@ -282,11 +282,9 @@ struct dvb_frontend_ops {
 	enum dvbfe_algo (*get_frontend_algo)(struct dvb_frontend *fe);
 
 	/* these two are only used for the swzigzag code */
-	int (*set_frontend_legacy)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
 	int (*set_frontend)(struct dvb_frontend* fe);
 	int (*get_tune_settings)(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* settings);
 
-	int (*get_frontend_legacy)(struct dvb_frontend *fe, struct dvb_frontend_parameters *params);
 	int (*get_frontend)(struct dvb_frontend *fe, struct dtv_frontend_properties *props);
 
 	int (*read_status)(struct dvb_frontend* fe, fe_status_t* status);
Signature · 1 line
1.7.8.352.g876a6
#84 lore raw

RFC PATCH 84/91 dvb: simplify get_tune_settings() struct

In the past, dvb_frontent_parameters were passed inside the struct where get_tuner_settings should store their result.

This is not needed anymore, as all parameters needed are stored already at the fe property cache. So, use it, where needed.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c |    3 ---
 drivers/media/dvb/dvb-core/dvb_frontend.h |    1 -
 drivers/media/dvb/frontends/s5h1420.c     |   16 ++++++++--------
 drivers/media/dvb/frontends/stv0299.c     |    9 +++++----
 drivers/media/dvb/frontends/tda10086.c    |   16 +++++++++-------
 5 files changed, 22 insertions(+), 23 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +0 -3
index 5bb6c1d..bf733c4 100644
@@ -1977,13 +1977,10 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 		fepriv->parameters_out = fepriv->parameters_in;
 
 		memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings));
-		memcpy(&fetunesettings.parameters, parg,
-		       sizeof (struct dvb_frontend_parameters));
 
 		/* force auto frequency inversion if requested */
 		if (dvb_force_auto_inversion) {
 			fepriv->parameters_in.inversion = INVERSION_AUTO;
-			fetunesettings.parameters.inversion = INVERSION_AUTO;
 		}
 		if (fe->ops.info.type == FE_OFDM) {
 			/* without hierarchical coding code_rate_LP is irrelevant,
drivers/media/dvb/dvb-core/dvb_frontend.h +0 -1
index 23456b3..4b49bcd 100644
@@ -52,7 +52,6 @@ struct dvb_frontend_tune_settings {
 	int min_delay_ms;
 	int step_size;
 	int max_drift;
-	struct dvb_frontend_parameters parameters;
 };
 
 struct dvb_frontend;
drivers/media/dvb/frontends/s5h1420.c +8 -8
index 3bdfcbe..0726494 100644
@@ -639,7 +639,6 @@ static int s5h1420_set_frontend(struct dvb_frontend* fe)
 	dprintk("enter %s\n", __func__);
 
 	/* check if we should do a fast-tune */
-	memcpy(&fesettings.parameters, p, sizeof(struct dtv_frontend_properties));
 	s5h1420_get_tune_settings(fe, &fesettings);
 	frequency_delta = p->frequency - state->tunedfreq;
 	if ((frequency_delta > -fesettings.max_drift) &&
@@ -782,29 +781,30 @@ static int s5h1420_get_frontend(struct dvb_frontend* fe,
 static int s5h1420_get_tune_settings(struct dvb_frontend* fe,
 				     struct dvb_frontend_tune_settings* fesettings)
 {
-	if (fesettings->parameters.u.qpsk.symbol_rate > 20000000) {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
+	if (p->symbol_rate > 20000000) {
 		fesettings->min_delay_ms = 50;
 		fesettings->step_size = 2000;
 		fesettings->max_drift = 8000;
-	} else if (fesettings->parameters.u.qpsk.symbol_rate > 12000000) {
+	} else if (p->symbol_rate > 12000000) {
 		fesettings->min_delay_ms = 100;
 		fesettings->step_size = 1500;
 		fesettings->max_drift = 9000;
-	} else if (fesettings->parameters.u.qpsk.symbol_rate > 8000000) {
+	} else if (p->symbol_rate > 8000000) {
 		fesettings->min_delay_ms = 100;
 		fesettings->step_size = 1000;
 		fesettings->max_drift = 8000;
-	} else if (fesettings->parameters.u.qpsk.symbol_rate > 4000000) {
+	} else if (p->symbol_rate > 4000000) {
 		fesettings->min_delay_ms = 100;
 		fesettings->step_size = 500;
 		fesettings->max_drift = 7000;
-	} else if (fesettings->parameters.u.qpsk.symbol_rate > 2000000) {
+	} else if (p->symbol_rate > 2000000) {
 		fesettings->min_delay_ms = 200;
-		fesettings->step_size = (fesettings->parameters.u.qpsk.symbol_rate / 8000);
+		fesettings->step_size = (p->symbol_rate / 8000);
 		fesettings->max_drift = 14 * fesettings->step_size;
 	} else {
 		fesettings->min_delay_ms = 200;
-		fesettings->step_size = (fesettings->parameters.u.qpsk.symbol_rate / 8000);
+		fesettings->step_size = (p->symbol_rate / 8000);
 		fesettings->max_drift = 18 * fesettings->step_size;
 	}
 
drivers/media/dvb/frontends/stv0299.c +5 -4
index abf4bff..ad6f3a6 100644
@@ -647,14 +647,15 @@ static int stv0299_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
 static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)
 {
 	struct stv0299_state* state = fe->demodulator_priv;
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 
 	fesettings->min_delay_ms = state->config->min_delay_ms;
-	if (fesettings->parameters.u.qpsk.symbol_rate < 10000000) {
-		fesettings->step_size = fesettings->parameters.u.qpsk.symbol_rate / 32000;
+	if (p->symbol_rate < 10000000) {
+		fesettings->step_size = p->symbol_rate / 32000;
 		fesettings->max_drift = 5000;
 	} else {
-		fesettings->step_size = fesettings->parameters.u.qpsk.symbol_rate / 16000;
-		fesettings->max_drift = fesettings->parameters.u.qpsk.symbol_rate / 2000;
+		fesettings->step_size = p->symbol_rate / 16000;
+		fesettings->max_drift = p->symbol_rate / 2000;
 	}
 	return 0;
 }
drivers/media/dvb/frontends/tda10086.c +9 -7
index 81fa57b..cfc6e0e 100644
@@ -664,29 +664,31 @@ static int tda10086_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
 
 static int tda10086_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)
 {
-	if (fesettings->parameters.u.qpsk.symbol_rate > 20000000) {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
+
+	if (p->symbol_rate > 20000000) {
 		fesettings->min_delay_ms = 50;
 		fesettings->step_size = 2000;
 		fesettings->max_drift = 8000;
-	} else if (fesettings->parameters.u.qpsk.symbol_rate > 12000000) {
+	} else if (p->symbol_rate > 12000000) {
 		fesettings->min_delay_ms = 100;
 		fesettings->step_size = 1500;
 		fesettings->max_drift = 9000;
-	} else if (fesettings->parameters.u.qpsk.symbol_rate > 8000000) {
+	} else if (p->symbol_rate > 8000000) {
 		fesettings->min_delay_ms = 100;
 		fesettings->step_size = 1000;
 		fesettings->max_drift = 8000;
-	} else if (fesettings->parameters.u.qpsk.symbol_rate > 4000000) {
+	} else if (p->symbol_rate > 4000000) {
 		fesettings->min_delay_ms = 100;
 		fesettings->step_size = 500;
 		fesettings->max_drift = 7000;
-	} else if (fesettings->parameters.u.qpsk.symbol_rate > 2000000) {
+	} else if (p->symbol_rate > 2000000) {
 		fesettings->min_delay_ms = 200;
-		fesettings->step_size = (fesettings->parameters.u.qpsk.symbol_rate / 8000);
+		fesettings->step_size = p->symbol_rate / 8000;
 		fesettings->max_drift = 14 * fesettings->step_size;
 	} else {
 		fesettings->min_delay_ms = 200;
-		fesettings->step_size = (fesettings->parameters.u.qpsk.symbol_rate / 8000);
+		fesettings->step_size =  p->symbol_rate / 8000;
 		fesettings->max_drift = 18 * fesettings->step_size;
 	}
 
Signature · 1 line
1.7.8.352.g876a6
#85 lore raw

RFC PATCH 85/91 dvb-core: Don't pass DVBv3 parameters on tune() fops

As all parameters are passed via DVBv5 to the frontends, there's no need to pass them again via fops. Also, most drivers weren't using it anyway. So, instead, just pass a parameter to indicate if the hardware algorithm wants the driver to re-tune or not.

---
 drivers/media/dvb/bt8xx/dst.c             |   19 ++++++++++---------
 drivers/media/dvb/dvb-core/dvb_frontend.c |    9 +++------
 drivers/media/dvb/dvb-core/dvb_frontend.h |    2 +-
 drivers/media/dvb/frontends/cx24116.c     |    4 ++--
 drivers/media/dvb/frontends/cx24123.c     |    4 ++--
 drivers/media/dvb/frontends/ds3000.c      |    4 ++--
 drivers/media/dvb/frontends/mb86a20s.c    |    4 ++--
 drivers/media/dvb/frontends/s921.c        |    4 ++--
 drivers/media/dvb/pt1/va1j5jf8007s.c      |    4 ++--
 drivers/media/dvb/pt1/va1j5jf8007t.c      |    4 ++--
 10 files changed, 28 insertions(+), 30 deletions(-)
drivers/media/dvb/bt8xx/dst.c +10 -9
index 7d60893..80b1f2a 100644
@@ -1643,31 +1643,32 @@ static int dst_set_frontend(struct dvb_frontend *fe)
 }
 
 static int dst_tune_frontend(struct dvb_frontend* fe,
-			    struct dvb_frontend_parameters* p,
+			    bool re_tune,
 			    unsigned int mode_flags,
 			    unsigned int *delay,
 			    fe_status_t *status)
 {
 	struct dst_state *state = fe->demodulator_priv;
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 
-	if (p != NULL) {
+	if (re_tune) {
 		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->type_flags & DST_TYPE_HAS_OBS_REGS)
 				dst_set_inversion(state, p->inversion);
-			dst_set_fec(state, p->u.qpsk.fec_inner);
-			dst_set_symbolrate(state, p->u.qpsk.symbol_rate);
+			dst_set_fec(state, p->fec_inner);
+			dst_set_symbolrate(state, p->symbol_rate);
 			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->symbol_rate);
 
 		} else if (state->dst_type == DST_TYPE_IS_TERR)
-			dst_set_bandwidth(state, p->u.ofdm.bandwidth);
+			dst_set_bandwidth(state, p->bandwidth_hz);
 		else if (state->dst_type == DST_TYPE_IS_CABLE) {
-			dst_set_fec(state, p->u.qam.fec_inner);
-			dst_set_symbolrate(state, p->u.qam.symbol_rate);
-			dst_set_modulation(state, p->u.qam.modulation);
+			dst_set_fec(state, p->fec_inner);
+			dst_set_symbolrate(state, p->symbol_rate);
+			dst_set_modulation(state, p->modulation);
 		}
 		dst_write_tuna(fe);
 	}
drivers/media/dvb/dvb-core/dvb_frontend.c +3 -6
index bf733c4..8cdc666 100644
@@ -547,7 +547,7 @@ static int dvb_frontend_thread(void *data)
 	fe_status_t s;
 	enum dvbfe_algo algo;
 
-	struct dvb_frontend_parameters *params;
+	bool re_tune = false;
 
 	dprintk("%s\n", __func__);
 
@@ -596,18 +596,15 @@ restart:
 			switch (algo) {
 			case DVBFE_ALGO_HW:
 				dprintk("%s: Frontend ALGO = DVBFE_ALGO_HW\n", __func__);
-				params = NULL; /* have we been asked to RETUNE ? */
 
 				if (fepriv->state & FESTATE_RETUNE) {
 					dprintk("%s: Retune requested, FESTATE_RETUNE\n", __func__);
-					params = &fepriv->parameters_in;
+					re_tune = true;
 					fepriv->state = FESTATE_TUNED;
 				}
 
 				if (fe->ops.tune)
-					fe->ops.tune(fe, params, fepriv->tune_mode_flags, &fepriv->delay, &s);
-				if (params)
-					fepriv->parameters_out = *params;
+					fe->ops.tune(fe, re_tune, fepriv->tune_mode_flags, &fepriv->delay, &s);
 
 				if (s != fepriv->status && !(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT)) {
 					dprintk("%s: state changed, adding current state\n", __func__);
drivers/media/dvb/dvb-core/dvb_frontend.h +1 -1
index 4b49bcd..e10fe77 100644
@@ -273,7 +273,7 @@ struct dvb_frontend_ops {
 
 	/* if this is set, it overrides the default swzigzag */
 	int (*tune)(struct dvb_frontend* fe,
-		    struct dvb_frontend_parameters* params,
+		    bool re_tune,
 		    unsigned int mode_flags,
 		    unsigned int *delay,
 		    fe_status_t *status);
drivers/media/dvb/frontends/cx24116.c +2 -2
index f24819a..e29de1c 100644
@@ -1440,7 +1440,7 @@ tuned:  /* Set/Reset B/W */
 	return cx24116_cmd_execute(fe, &cmd);
 }
 
-static int cx24116_tune(struct dvb_frontend *fe, struct dvb_frontend_parameters *params,
+static int cx24116_tune(struct dvb_frontend *fe, bool re_tune,
 	unsigned int mode_flags, unsigned int *delay, fe_status_t *status)
 {
 	/*
@@ -1452,7 +1452,7 @@ static int cx24116_tune(struct dvb_frontend *fe, struct dvb_frontend_parameters
 	 */
 
 	*delay = HZ / 5;
-	if (params) {
+	if (re_tune) {
 		int ret = cx24116_set_frontend(fe);
 		if (ret)
 			return ret;
drivers/media/dvb/frontends/cx24123.c +2 -2
index a8af0bd..faafb1f 100644
@@ -1006,14 +1006,14 @@ static int cx24123_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
 }
 
 static int cx24123_tune(struct dvb_frontend *fe,
-			struct dvb_frontend_parameters *params,
+			bool re_tune,
 			unsigned int mode_flags,
 			unsigned int *delay,
 			fe_status_t *status)
 {
 	int retval = 0;
 
-	if (params != NULL)
+	if (re_tune)
 		retval = cx24123_set_frontend(fe);
 
 	if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
drivers/media/dvb/frontends/ds3000.c +2 -2
index f8fa80a..c6a43c4 100644
@@ -1205,12 +1205,12 @@ static int ds3000_set_frontend(struct dvb_frontend *fe)
 }
 
 static int ds3000_tune(struct dvb_frontend *fe,
-			struct dvb_frontend_parameters *p,
+			bool re_tune,
 			unsigned int mode_flags,
 			unsigned int *delay,
 			fe_status_t *status)
 {
-	if (p) {
+	if (re_tune) {
 		int ret = ds3000_set_frontend(fe);
 		if (ret)
 			return ret;
drivers/media/dvb/frontends/mb86a20s.c +2 -2
index a67d7ef..d71d6ee 100644
@@ -540,7 +540,7 @@ static int mb86a20s_get_frontend(struct dvb_frontend *fe,
 }
 
 static int mb86a20s_tune(struct dvb_frontend *fe,
-			struct dvb_frontend_parameters *params,
+			bool re_tune,
 			unsigned int mode_flags,
 			unsigned int *delay,
 			fe_status_t *status)
@@ -549,7 +549,7 @@ static int mb86a20s_tune(struct dvb_frontend *fe,
 
 	dprintk("\n");
 
-	if (params != NULL)
+	if (re_tune)
 		rc = mb86a20s_set_frontend(fe);
 
 	if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
drivers/media/dvb/frontends/s921.c +2 -2
index 4c452f4..2e15f92 100644
@@ -445,7 +445,7 @@ static int s921_get_frontend(struct dvb_frontend *fe,
 }
 
 static int s921_tune(struct dvb_frontend *fe,
-			struct dvb_frontend_parameters *params,
+			bool re_tune,
 			unsigned int mode_flags,
 			unsigned int *delay,
 			fe_status_t *status)
@@ -454,7 +454,7 @@ static int s921_tune(struct dvb_frontend *fe,
 
 	dprintk("\n");
 
-	if (params != NULL)
+	if (re_tune)
 		rc = s921_set_frontend(fe);
 
 	if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
drivers/media/dvb/pt1/va1j5jf8007s.c +2 -2
index 451641c..78344e3 100644
@@ -385,7 +385,7 @@ va1j5jf8007s_check_ts_id(struct va1j5jf8007s_state *state, int *lock)
 
 static int
 va1j5jf8007s_tune(struct dvb_frontend *fe,
-		  struct dvb_frontend_parameters *params,
+		  bool re_tune,
 		  unsigned int mode_flags,  unsigned int *delay,
 		  fe_status_t *status)
 {
@@ -395,7 +395,7 @@ va1j5jf8007s_tune(struct dvb_frontend *fe,
 
 	state = fe->demodulator_priv;
 
-	if (params != NULL)
+	if (re_tune)
 		state->tune_state = VA1J5JF8007S_SET_FREQUENCY_1;
 
 	switch (state->tune_state) {
drivers/media/dvb/pt1/va1j5jf8007t.c +2 -2
index 0f085c3..c642820 100644
@@ -264,7 +264,7 @@ static int va1j5jf8007t_check_modulation(struct va1j5jf8007t_state *state,
 
 static int
 va1j5jf8007t_tune(struct dvb_frontend *fe,
-		  struct dvb_frontend_parameters *params,
+		  bool re_tune,
 		  unsigned int mode_flags,  unsigned int *delay,
 		  fe_status_t *status)
 {
@@ -274,7 +274,7 @@ va1j5jf8007t_tune(struct dvb_frontend *fe,
 
 	state = fe->demodulator_priv;
 
-	if (params != NULL)
+	if (re_tune)
 		state->tune_state = VA1J5JF8007T_SET_FREQUENCY;
 
 	switch (state->tune_state) {
Signature · 1 line
1.7.8.352.g876a6
#86 lore raw

RFC PATCH 86/91 dvb: don't pass a DVBv3 parameter for search() fops

Just like the other DVB algorithms, drivers should use the DVBv5 way to retrieve parameters: via the cache struct.

Actually, several drivers were partially using the DVBv3 struct and partially using the DVBv5 way, with is confusing and may lead into troubles.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c   |    2 +-
 drivers/media/dvb/dvb-core/dvb_frontend.h   |    2 +-
 drivers/media/dvb/frontends/cxd2820r_core.c |    3 +--
 drivers/media/dvb/frontends/mb86a16.c       |    6 +++---
 drivers/media/dvb/frontends/stb0899_drv.c   |    6 +++---
 drivers/media/dvb/frontends/stv0900_core.c  |    3 +--
 drivers/media/dvb/frontends/stv090x.c       |    8 ++++----
 7 files changed, 14 insertions(+), 16 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +1 -1
index 8cdc666..18a7e23 100644
@@ -628,7 +628,7 @@ restart:
 				 */
 				if (fepriv->algo_status & DVBFE_ALGO_SEARCH_AGAIN) {
 					if (fe->ops.search) {
-						fepriv->algo_status = fe->ops.search(fe, &fepriv->parameters_in);
+						fepriv->algo_status = fe->ops.search(fe);
 						/* We did do a search as was requested, the flags are
 						 * now unset as well and has the flags wrt to search.
 						 */
drivers/media/dvb/dvb-core/dvb_frontend.h +1 -1
index e10fe77..79f01ce 100644
@@ -306,7 +306,7 @@ struct dvb_frontend_ops {
 	/* These callbacks are for devices that implement their own
 	 * tuning algorithms, rather than a simple swzigzag
 	 */
-	enum dvbfe_search (*search)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
+	enum dvbfe_search (*search)(struct dvb_frontend *fe);
 	int (*track)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
 
 	struct dvb_tuner_ops tuner_ops;
drivers/media/dvb/frontends/cxd2820r_core.c +1 -2
index 5b2d840..96ceed7 100644
@@ -653,8 +653,7 @@ static int cxd2820r_get_tune_settings(struct dvb_frontend *fe,
 	return ret;
 }
 
-static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
 {
 	struct cxd2820r_priv *priv = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
drivers/media/dvb/frontends/mb86a16.c +3 -3
index 292ba7b..45844f4 100644
@@ -1621,13 +1621,13 @@ err:
 	return -EREMOTEIO;
 }
 
-static enum dvbfe_search mb86a16_search(struct dvb_frontend *fe,
-					struct dvb_frontend_parameters *p)
+static enum dvbfe_search mb86a16_search(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct mb86a16_state *state = fe->demodulator_priv;
 
 	state->frequency = p->frequency / 1000;
-	state->srate = p->u.qpsk.symbol_rate / 1000;
+	state->srate = p->symbol_rate / 1000;
 
 	if (!mb86a16_set_fe(state)) {
 		dprintk(verbose, MB86A16_ERROR, 1, "Successfully acquired LOCK");
drivers/media/dvb/frontends/stb0899_drv.c +3 -3
index 0c47a99..93afc79 100644
@@ -1431,7 +1431,7 @@ static void stb0899_set_iterations(struct stb0899_state *state)
 	stb0899_write_s2reg(state, STB0899_S2FEC, STB0899_BASE_MAX_ITER, STB0899_OFF0_MAX_ITER, reg);
 }
 
-static enum dvbfe_search stb0899_search(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
+static enum dvbfe_search stb0899_search(struct dvb_frontend *fe)
 {
 	struct stb0899_state *state = fe->demodulator_priv;
 	struct stb0899_params *i_params = &state->params;
@@ -1441,8 +1441,8 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe, struct dvb_fron
 
 	u32 SearchRange, gain;
 
-	i_params->freq	= p->frequency;
-	i_params->srate = p->u.qpsk.symbol_rate;
+	i_params->freq	= props->frequency;
+	i_params->srate = props->symbol_rate;
 	state->delsys = props->delivery_system;
 	dprintk(state->verbose, FE_DEBUG, 1, "delivery system=%d", state->delsys);
 
drivers/media/dvb/frontends/stv0900_core.c +1 -2
index 3f7e62f..83e9a81 100644
@@ -1558,8 +1558,7 @@ static int stv0900_status(struct stv0900_internal *intp,
 	return locked;
 }
 
-static enum dvbfe_search stv0900_search(struct dvb_frontend *fe,
-					struct dvb_frontend_parameters *params)
+static enum dvbfe_search stv0900_search(struct dvb_frontend *fe)
 {
 	struct stv0900_state *state = fe->demodulator_priv;
 	struct stv0900_internal *intp = state->internal;
drivers/media/dvb/frontends/stv090x.c +4 -4
index 574ef67..dd8ded5 100644
@@ -3427,17 +3427,17 @@ err:
 	return -1;
 }
 
-static enum dvbfe_search stv090x_search(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
+static enum dvbfe_search stv090x_search(struct dvb_frontend *fe)
 {
 	struct stv090x_state *state = fe->demodulator_priv;
 	struct dtv_frontend_properties *props = &fe->dtv_property_cache;
 
-	if (p->frequency == 0)
+	if (props->frequency == 0)
 		return DVBFE_ALGO_SEARCH_INVALID;
 
 	state->delsys = props->delivery_system;
-	state->frequency = p->frequency;
-	state->srate = p->u.qpsk.symbol_rate;
+	state->frequency = props->frequency;
+	state->srate = props->symbol_rate;
 	state->search_mode = STV090x_SEARCH_AUTO;
 	state->algo = STV090x_COLD_SEARCH;
 	state->fec = STV090x_PRERR;
Signature · 1 line
1.7.8.352.g876a6
#87 lore raw

RFC PATCH 87/91 dvb: remove the track() fops

This callback is not used anywhere. Maybe it were used in the past to optimize the custom algo, but, as it is not used anymore, let's just remove it.

If later needed, some patch may re-add it with a proper implementation.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c  |    5 +----
 drivers/media/dvb/dvb-core/dvb_frontend.h  |    1 -
 drivers/media/dvb/frontends/stb0899_drv.c  |   21 ---------------------
 drivers/media/dvb/frontends/stv0900_core.c |    7 -------
 4 files changed, 1 insertions(+), 33 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +1 -4
index 18a7e23..68d284b 100644
@@ -637,10 +637,7 @@ restart:
 					}
 				}
 				/* Track the carrier if the search was successful */
-				if (fepriv->algo_status == DVBFE_ALGO_SEARCH_SUCCESS) {
-					if (fe->ops.track)
-						fe->ops.track(fe, &fepriv->parameters_in);
-				} else {
+				if (fepriv->algo_status != DVBFE_ALGO_SEARCH_SUCCESS) {
 					fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
 					fepriv->delay = HZ / 2;
 				}
drivers/media/dvb/dvb-core/dvb_frontend.h +0 -1
index 79f01ce..52efcbd 100644
@@ -307,7 +307,6 @@ struct dvb_frontend_ops {
 	 * tuning algorithms, rather than a simple swzigzag
 	 */
 	enum dvbfe_search (*search)(struct dvb_frontend *fe);
-	int (*track)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
 
 	struct dvb_tuner_ops tuner_ops;
 	struct analog_demod_ops analog_ops;
drivers/media/dvb/frontends/stb0899_drv.c +0 -21
index 93afc79..9fad627 100644
@@ -1568,26 +1568,6 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe)
 
 	return DVBFE_ALGO_SEARCH_ERROR;
 }
-/*
- * stb0899_track
- * periodically check the signal level against a specified
- * threshold level and perform derotator centering.
- * called once we have a lock from a successful search
- * event.
- *
- * Will be called periodically called to maintain the
- * lock.
- *
- * Will be used to get parameters as well as info from
- * the decoded baseband header
- *
- * Once a new lock has established, the internal state
- * frequency (internal->freq) is updated
- */
-static int stb0899_track(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
-{
-	return 0;
-}
 
 static int stb0899_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
 {
@@ -1647,7 +1627,6 @@ static struct dvb_frontend_ops stb0899_ops = {
 
 	.get_frontend_algo		= stb0899_frontend_algo,
 	.search				= stb0899_search,
-	.track				= stb0899_track,
 	.get_frontend                   = stb0899_get_frontend,
 
 
drivers/media/dvb/frontends/stv0900_core.c +0 -7
index 83e9a81..8af1e624 100644
@@ -1658,12 +1658,6 @@ static int stv0900_read_status(struct dvb_frontend *fe, enum fe_status *status)
 	return 0;
 }
 
-static int stv0900_track(struct dvb_frontend *fe,
-			struct dvb_frontend_parameters *p)
-{
-	return 0;
-}
-
 static int stv0900_stop_ts(struct dvb_frontend *fe, int stop_ts)
 {
 
@@ -1891,7 +1885,6 @@ static struct dvb_frontend_ops stv0900_ops = {
 	.diseqc_recv_slave_reply	= stv0900_recv_slave_reply,
 	.set_tone			= stv0900_set_tone,
 	.search				= stv0900_search,
-	.track				= stv0900_track,
 	.read_status			= stv0900_read_status,
 	.read_ber			= stv0900_read_ber,
 	.read_signal_strength		= stv0900_read_signal_strength,
Signature · 1 line
1.7.8.352.g876a6
#88 lore raw

RFC PATCH 88/91 dvb-core: don't use fe_bandwidth_t on driver

Now that everybody is talking DVBv5 API dialect, using this DVBv3 macro internally is not ok.

---
 drivers/media/dvb/bt8xx/dst_common.h    |    2 +-
 drivers/media/dvb/frontends/dib3000mc.c |    2 +-
 drivers/media/dvb/frontends/dib7000m.c  |    2 +-
 drivers/media/dvb/frontends/tda10048.c  |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/media/dvb/bt8xx/dst_common.h +1 -1
index d88cf2a..d70d98f 100644
@@ -124,7 +124,7 @@ struct dst_state {
 	u16 decode_snr;
 	unsigned long cur_jiff;
 	u8 k22;
-	fe_bandwidth_t bandwidth;
+	u32 bandwidth;
 	u32 dst_hw_cap;
 	u8 dst_fw_version;
 	fe_sec_mini_cmd_t minicmd;
drivers/media/dvb/frontends/dib3000mc.c +1 -1
index 8130028..d98a010 100644
@@ -40,7 +40,7 @@ struct dib3000mc_state {
 
 	u32 timf;
 
-	fe_bandwidth_t current_bandwidth;
+	u32 current_bandwidth;
 
 	u16 dev_id;
 
drivers/media/dvb/frontends/dib7000m.c +1 -1
index eb90c4f..b6a25a2 100644
@@ -38,7 +38,7 @@ struct dib7000m_state {
 	u16 wbd_ref;
 
 	u8 current_band;
-	fe_bandwidth_t current_bandwidth;
+	u32 current_bandwidth;
 	struct dibx000_agc_config *current_agc;
 	u32 timf;
 	u32 timf_default;
drivers/media/dvb/frontends/tda10048.c +1 -1
index 80de9f6..dfd1d5a 100644
@@ -153,7 +153,7 @@ struct tda10048_state {
 	u32 pll_pfactor;
 	u32 sample_freq;
 
-	enum fe_bandwidth bandwidth;
+	u32 bandwidth;
 };
 
 static struct init_tab {
Signature · 1 line
1.7.8.352.g876a6
#89 lore raw

RFC PATCH 89/91 dvb: don't use DVBv3 bandwidth macros

Every frontend now uses DVBv5 way. So, let's not use the DVBv3 macros internally anymore.

---
 drivers/media/common/tuners/mt2266.c         |    4 +---
 drivers/media/common/tuners/mxl5007t.c       |    5 +----
 drivers/media/common/tuners/tda18271-fe.c    |    7 +------
 drivers/media/common/tuners/tda827x.c        |   14 ++------------
 drivers/media/common/tuners/tuner-simple.c   |   12 +-----------
 drivers/media/common/tuners/xc4000.c         |   11 +++--------
 drivers/media/common/tuners/xc5000.c         |   12 +++---------
 drivers/media/dvb/dvb-usb/mxl111sf-tuner.c   |    5 +----
 drivers/media/dvb/frontends/af9013.c         |    2 +-
 drivers/media/dvb/frontends/af9013_priv.h    |    2 +-
 drivers/media/dvb/frontends/dib3000mb_priv.h |    2 +-
 drivers/media/dvb/frontends/dvb-pll.c        |    7 +------
 12 files changed, 17 insertions(+), 66 deletions(-)
drivers/media/common/tuners/mt2266.c +1 -3
index 2fb5a60..bca4d75 100644
@@ -150,20 +150,18 @@ static int mt2266_set_params(struct dvb_frontend *fe)
 	case 6000000:
 		mt2266_writeregs(priv, mt2266_init_6mhz,
 				 sizeof(mt2266_init_6mhz));
-		priv->bandwidth = BANDWIDTH_6_MHZ;
 		break;
 	case 8000000:
 		mt2266_writeregs(priv, mt2266_init_8mhz,
 				 sizeof(mt2266_init_8mhz));
-		priv->bandwidth = BANDWIDTH_8_MHZ;
 		break;
 	case 7000000:
 	default:
 		mt2266_writeregs(priv, mt2266_init_7mhz,
 				 sizeof(mt2266_init_7mhz));
-		priv->bandwidth = BANDWIDTH_7_MHZ;
 		break;
 	}
+	priv->bandwidth = c->bandwidth_hz;
 
 	if (band == MT2266_VHF && priv->band == MT2266_UHF) {
 		dprintk("Switch from UHF to VHF");
drivers/media/common/tuners/mxl5007t.c +1 -4
index 5d71e22..88bbc21 100644
@@ -624,7 +624,6 @@ static int mxl5007t_set_params(struct dvb_frontend *fe)
 	enum mxl5007t_mode mode;
 	int ret;
 	u32 freq = c->frequency;
-	u32 band = BANDWIDTH_6_MHZ;
 
 	switch (delsys) {
 	case SYS_ATSC:
@@ -644,10 +643,8 @@ static int mxl5007t_set_params(struct dvb_frontend *fe)
 			break;
 		case 7000000:
 			bw = MxL_BW_7MHz;
-			band = BANDWIDTH_7_MHZ;
 		case 8000000:
 			bw = MxL_BW_8MHz;
-			band = BANDWIDTH_8_MHZ;
 		default:
 			return -EINVAL;
 		}
@@ -671,7 +668,7 @@ static int mxl5007t_set_params(struct dvb_frontend *fe)
 		goto fail;
 
 	state->frequency = freq;
-	state->bandwidth = band;
+	state->bandwidth = c->bandwidth_hz;
 fail:
 	mutex_unlock(&state->lock);
 
drivers/media/common/tuners/tda18271-fe.c +1 -6
index 53299b0..d3d91ea 100644
@@ -934,7 +934,6 @@ static int tda18271_set_params(struct dvb_frontend *fe)
 	u32 delsys = c->delivery_system;
 	u32 bw = c->bandwidth_hz;
 	u32 freq = c->frequency;
-	u32 band = BANDWIDTH_6_MHZ;
 	struct tda18271_priv *priv = fe->tuner_priv;
 	struct tda18271_std_map *std_map = &priv->std;
 	struct tda18271_std_map_item *map;
@@ -953,10 +952,8 @@ static int tda18271_set_params(struct dvb_frontend *fe)
 			map = &std_map->dvbt_6;
 		} else if (bw <= 7000000) {
 			map = &std_map->dvbt_7;
-			band = BANDWIDTH_7_MHZ;
 		} else {
 			map = &std_map->dvbt_8;
-			band = BANDWIDTH_8_MHZ;
 		}
 		break;
 	case SYS_DVBC_ANNEX_B:
@@ -968,10 +965,8 @@ static int tda18271_set_params(struct dvb_frontend *fe)
 			map = &std_map->qam_6;
 		} else if (bw <= 7000000) {
 			map = &std_map->qam_7;
-			band = BANDWIDTH_7_MHZ;
 		} else {
 			map = &std_map->qam_8;
-			band = BANDWIDTH_8_MHZ;
 		}
 		break;
 	default:
@@ -990,7 +985,7 @@ static int tda18271_set_params(struct dvb_frontend *fe)
 
 	priv->if_freq   = map->if_freq;
 	priv->frequency = freq;
-	priv->bandwidth = band;
+	priv->bandwidth = bw;
 fail:
 	return ret;
 }
drivers/media/common/tuners/tda827x.c +2 -12
index d96d0b9..e180def 100644
@@ -158,7 +158,6 @@ static int tda827xo_set_params(struct dvb_frontend *fe)
 	struct tda827x_priv *priv = fe->tuner_priv;
 	u8 buf[14];
 	int rc;
-	u32 band;
 
 	struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
 			       .buf = buf, .len = sizeof(buf) };
@@ -168,16 +167,12 @@ static int tda827xo_set_params(struct dvb_frontend *fe)
 	dprintk("%s:\n", __func__);
 	if (c->bandwidth_hz == 0) {
 		if_freq = 5000000;
-		band = BANDWIDTH_8_MHZ;
 	} else if (c->bandwidth_hz <= 6000000) {
 		if_freq = 4000000;
-		band = BANDWIDTH_6_MHZ;
 	} else if (c->bandwidth_hz <= 7000000) {
 		if_freq = 4500000;
-		band = BANDWIDTH_7_MHZ;
 	} else {	/* 8 MHz */
 		if_freq = 5000000;
-		band = BANDWIDTH_8_MHZ;
 	}
 	tuner_freq = c->frequency;
 
@@ -224,7 +219,7 @@ static int tda827xo_set_params(struct dvb_frontend *fe)
 		goto err;
 
 	priv->frequency = c->frequency;
-	priv->bandwidth = band;
+	priv->bandwidth = c->bandwidth_hz;
 
 	return 0;
 
@@ -522,7 +517,6 @@ static int tda827xa_set_params(struct dvb_frontend *fe)
 	struct tda827x_priv *priv = fe->tuner_priv;
 	struct tda827xa_data *frequency_map = tda827xa_dvbt;
 	u8 buf[11];
-	u32 band;
 
 	struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
 			       .buf = buf, .len = sizeof(buf) };
@@ -537,16 +531,12 @@ static int tda827xa_set_params(struct dvb_frontend *fe)
 
 	if (c->bandwidth_hz == 0) {
 		if_freq = 5000000;
-		band = BANDWIDTH_8_MHZ;
 	} else if (c->bandwidth_hz <= 6000000) {
 		if_freq = 4000000;
-		band = BANDWIDTH_6_MHZ;
 	} else if (c->bandwidth_hz <= 7000000) {
 		if_freq = 4500000;
-		band = BANDWIDTH_7_MHZ;
 	} else {	/* 8 MHz */
 		if_freq = 5000000;
-		band = BANDWIDTH_8_MHZ;
 	}
 	tuner_freq = c->frequency;
 
@@ -652,7 +642,7 @@ static int tda827xa_set_params(struct dvb_frontend *fe)
 		goto err;
 
 	priv->frequency = c->frequency;
-	priv->bandwidth = band;
+	priv->bandwidth = c->bandwidth_hz;
 
 	return 0;
 
drivers/media/common/tuners/tuner-simple.c +1 -11
index ce91c43..39e7e58 100644
@@ -1028,17 +1028,7 @@ static int simple_get_frequency(struct dvb_frontend *fe, u32 *frequency)
 static int simple_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
 {
 	struct tuner_simple_priv *priv = fe->tuner_priv;
-	switch (priv->bandwidth) {
-	case 6000000:
-		*bandwidth = BANDWIDTH_6_MHZ;
-		break;
-	case 7000000:
-		*bandwidth = BANDWIDTH_7_MHZ;
-		break;
-	case 8000000:
-		*bandwidth = BANDWIDTH_8_MHZ;
-		break;
-	}
+	*bandwidth = priv->bandwidth;
 	return 0;
 }
 
drivers/media/common/tuners/xc4000.c +3 -8
index d17c0f5..7b5a46e 100644
@@ -1139,7 +1139,6 @@ static int xc4000_set_params(struct dvb_frontend *fe)
 		dprintk(1, "%s() VSB modulation\n", __func__);
 		priv->rf_mode = XC_RF_MODE_AIR;
 		priv->freq_hz = c->frequency - 1750000;
-		priv->bandwidth = BANDWIDTH_6_MHZ;
 		priv->video_standard = XC4000_DTV6;
 		type = DTV6;
 		break;
@@ -1147,7 +1146,6 @@ static int xc4000_set_params(struct dvb_frontend *fe)
 		dprintk(1, "%s() QAM modulation\n", __func__);
 		priv->rf_mode = XC_RF_MODE_CABLE;
 		priv->freq_hz = c->frequency - 1750000;
-		priv->bandwidth = BANDWIDTH_6_MHZ;
 		priv->video_standard = XC4000_DTV6;
 		type = DTV6;
 		break;
@@ -1156,26 +1154,21 @@ static int xc4000_set_params(struct dvb_frontend *fe)
 		dprintk(1, "%s() OFDM\n", __func__);
 		if (bw == 0) {
 			if (c->frequency < 400000000) {
-				priv->bandwidth = BANDWIDTH_7_MHZ;
 				priv->freq_hz = c->frequency - 2250000;
 			} else {
-				priv->bandwidth = BANDWIDTH_8_MHZ;
 				priv->freq_hz = c->frequency - 2750000;
 			}
 			priv->video_standard = XC4000_DTV7_8;
 			type = DTV78;
 		} else if (bw <= 6000000) {
-			priv->bandwidth = BANDWIDTH_6_MHZ;
 			priv->video_standard = XC4000_DTV6;
 			priv->freq_hz = c->frequency - 1750000;
 			type = DTV6;
 		} else if (bw <= 7000000) {
-			priv->bandwidth = BANDWIDTH_7_MHZ;
 			priv->video_standard = XC4000_DTV7;
 			priv->freq_hz = c->frequency - 2250000;
 			type = DTV7;
 		} else {
-			priv->bandwidth = BANDWIDTH_8_MHZ;
 			priv->video_standard = XC4000_DTV8;
 			priv->freq_hz = c->frequency - 2750000;
 			type = DTV8;
@@ -1195,6 +1188,8 @@ static int xc4000_set_params(struct dvb_frontend *fe)
 	if (check_firmware(fe, type, 0, priv->if_khz) != 0)
 		goto fail;
 
+	priv->bandwidth = c->bandwidth_hz;
+
 	ret = xc_set_signal_source(priv, priv->rf_mode);
 	if (ret != 0) {
 		printk(KERN_ERR "xc4000: xc_set_signal_source(%d) failed\n",
@@ -1591,7 +1586,7 @@ struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
 		break;
 	case 1:
 		/* new tuner instance */
-		priv->bandwidth = BANDWIDTH_6_MHZ;
+		priv->bandwidth = 6000000;
 		/* set default configuration */
 		priv->if_khz = 4560;
 		priv->default_pm = 0;
drivers/media/common/tuners/xc5000.c +3 -9
index 7796339..296df05 100644
@@ -650,14 +650,12 @@ static int xc5000_set_params(struct dvb_frontend *fe)
 		dprintk(1, "%s() VSB modulation\n", __func__);
 		priv->rf_mode = XC_RF_MODE_AIR;
 		priv->freq_hz = freq - 1750000;
-		priv->bandwidth = BANDWIDTH_6_MHZ;
 		priv->video_standard = DTV6;
 		break;
 	case SYS_DVBC_ANNEX_B:
 		dprintk(1, "%s() QAM modulation\n", __func__);
 		priv->rf_mode = XC_RF_MODE_CABLE;
 		priv->freq_hz = freq - 1750000;
-		priv->bandwidth = BANDWIDTH_6_MHZ;
 		priv->video_standard = DTV6;
 		break;
 	case SYS_DVBT:
@@ -665,17 +663,14 @@ static int xc5000_set_params(struct dvb_frontend *fe)
 		dprintk(1, "%s() OFDM\n", __func__);
 		switch (bw) {
 		case 6000000:
-			priv->bandwidth = BANDWIDTH_6_MHZ;
 			priv->video_standard = DTV6;
 			priv->freq_hz = freq - 1750000;
 			break;
 		case 7000000:
-			priv->bandwidth = BANDWIDTH_7_MHZ;
 			priv->video_standard = DTV7;
 			priv->freq_hz = freq - 2250000;
 			break;
 		case 8000000:
-			priv->bandwidth = BANDWIDTH_8_MHZ;
 			priv->video_standard = DTV8;
 			priv->freq_hz = freq - 2750000;
 			break;
@@ -689,17 +684,14 @@ static int xc5000_set_params(struct dvb_frontend *fe)
 		dprintk(1, "%s() QAM modulation\n", __func__);
 		priv->rf_mode = XC_RF_MODE_CABLE;
 		if (bw <= 6000000) {
-			priv->bandwidth = BANDWIDTH_6_MHZ;
 			priv->video_standard = DTV6;
 			priv->freq_hz = freq - 1750000;
 			b = 6;
 		} else if (bw <= 7000000) {
-			priv->bandwidth = BANDWIDTH_7_MHZ;
 			priv->video_standard = DTV7;
 			priv->freq_hz = freq - 2250000;
 			b = 7;
 		} else {
-			priv->bandwidth = BANDWIDTH_8_MHZ;
 			priv->video_standard = DTV7_8;
 			priv->freq_hz = freq - 2750000;
 			b = 8;
@@ -745,6 +737,8 @@ static int xc5000_set_params(struct dvb_frontend *fe)
 	if (debug)
 		xc_debug_dump(priv);
 
+	priv->bandwidth = bw;
+
 	return 0;
 }
 
@@ -1126,7 +1120,7 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
 		break;
 	case 1:
 		/* new tuner instance */
-		priv->bandwidth = BANDWIDTH_6_MHZ;
+		priv->bandwidth = 6000000;
 		fe->tuner_priv = priv;
 		break;
 	default:
drivers/media/dvb/dvb-usb/mxl111sf-tuner.c +1 -4
index 3a533df..72db6ee 100644
@@ -279,7 +279,6 @@ static int mxl111sf_tuner_set_params(struct dvb_frontend *fe)
 	struct mxl111sf_tuner_state *state = fe->tuner_priv;
 	int ret;
 	u8 bw;
-	u32 band = BANDWIDTH_6_MHZ;
 
 	mxl_dbg("()");
 
@@ -297,11 +296,9 @@ static int mxl111sf_tuner_set_params(struct dvb_frontend *fe)
 			break;
 		case 7000000:
 			bw = 7;
-			band = BANDWIDTH_7_MHZ;
 			break;
 		case 8000000:
 			bw = 8;
-			band = BANDWIDTH_8_MHZ;
 			break;
 		default:
 			err("%s: bandwidth not set!", __func__);
@@ -317,7 +314,7 @@ static int mxl111sf_tuner_set_params(struct dvb_frontend *fe)
 		goto fail;
 
 	state->frequency = c->frequency;
-	state->bandwidth = band;
+	state->bandwidth = c->bandwidth_hz;
 fail:
 	return ret;
 }
drivers/media/dvb/frontends/af9013.c +1 -1
index 08a0364..a8aefe9 100644
@@ -220,7 +220,7 @@ static u32 af913_div(u32 a, u32 b, u32 x)
 	return r;
 }
 
-static int af9013_set_coeff(struct af9013_state *state, fe_bandwidth_t bw)
+static int af9013_set_coeff(struct af9013_state *state, u32 bw)
 {
 	int ret, i, j, found;
 	deb_info("%s: adc_clock:%d bw:%d\n", __func__,
drivers/media/dvb/frontends/af9013_priv.h +1 -1
index 67efd16..80e6be3 100644
@@ -62,7 +62,7 @@ struct snr_table {
 
 struct coeff {
 	u32 adc_clock;
-	fe_bandwidth_t bw;
+	u32 bw;
 	u8 val[24];
 };
 
drivers/media/dvb/frontends/dib3000mb_priv.h +1 -1
index 16c5265..9dc235a 100644
@@ -98,7 +98,7 @@ struct dib3000_state {
 	int timing_offset;
 	int timing_offset_comp_done;
 
-	fe_bandwidth_t last_tuned_bw;
+	u32 last_tuned_bw;
 	u32 last_tuned_freq;
 };
 
drivers/media/dvb/frontends/dvb-pll.c +1 -6
index 0625e61..95cb042 100644
@@ -634,12 +634,7 @@ static int dvb_pll_set_params(struct dvb_frontend *fe)
 	}
 
 	priv->frequency = frequency;
-	if (c->bandwidth_hz <= 6000000)
-		priv->bandwidth = BANDWIDTH_6_MHZ;
-	else if (c->bandwidth_hz <= 7000000)
-		priv->bandwidth = BANDWIDTH_7_MHZ;
-	if (c->bandwidth_hz <= 8000000)
-		priv->bandwidth = BANDWIDTH_8_MHZ;
+	priv->bandwidth = c->bandwidth_hz;
 
 	return 0;
 }
Signature · 1 line
1.7.8.352.g876a6
#90 lore raw

RFC PATCH 90/91 cx23885-dvb: Remove a dirty hack that would require DVBv3

The cx23885-dvb driver has a dirty hack:
1) it hooks the DVBv3 legacy call to FE_SET_FRONTEND;
2) it uses internally the DVBv3 struct to decide some configs.

Replace it by a change during the gate control. This will likely work, but requires testing. Anyway, the current way will break, as soon as we stop copying data for DVBv3 for pure DVBv5 calls.

Compile-tested only.

---
 drivers/media/video/cx23885/cx23885-dvb.c |   41 ++++++++--------------------
 1 files changed, 12 insertions(+), 29 deletions(-)
drivers/media/video/cx23885/cx23885-dvb.c +12 -29
index bcb45be..28d51d8 100644
@@ -111,6 +111,8 @@ static void dvb_buf_release(struct videobuf_queue *q,
 	cx23885_free_buffer(q, (struct cx23885_buffer *)vb);
 }
 
+static int cx23885_dvb_set_frontend(struct dvb_frontend *fe);
+
 static void cx23885_dvb_gate_ctrl(struct cx23885_tsport  *port, int open)
 {
 	struct videobuf_dvb_frontends *f;
@@ -125,6 +127,12 @@ static void cx23885_dvb_gate_ctrl(struct cx23885_tsport  *port, int open)
 
 	if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl)
 		fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, open);
+
+	/*
+	 * FIXME: Improve this path to avoid calling the
+	 * cx23885_dvb_set_frontend() every time it passes here.
+	 */
+	cx23885_dvb_set_frontend(fe->dvb.frontend);
 }
 
 static struct videobuf_queue_ops dvb_qops = {
@@ -479,15 +487,15 @@ static struct xc5000_config mygica_x8506_xc5000_config = {
 	.if_khz = 5380,
 };
 
-static int cx23885_dvb_set_frontend(struct dvb_frontend *fe,
-				    struct dvb_frontend_parameters *param)
+static int cx23885_dvb_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct cx23885_tsport *port = fe->dvb->priv;
 	struct cx23885_dev *dev = port->dev;
 
 	switch (dev->board) {
 	case CX23885_BOARD_HAUPPAUGE_HVR1275:
-		switch (param->u.vsb.modulation) {
+		switch (p->modulation) {
 		case VSB_8:
 			cx23885_gpio_clear(dev, GPIO_5);
 			break;
@@ -507,31 +515,6 @@ static int cx23885_dvb_set_frontend(struct dvb_frontend *fe,
 	return 0;
 }
 
-static int cx23885_dvb_fe_ioctl_override(struct dvb_frontend *fe,
-					 unsigned int cmd, void *parg,
-					 unsigned int stage)
-{
-	int err = 0;
-
-	switch (stage) {
-	case DVB_FE_IOCTL_PRE:
-
-		switch (cmd) {
-		case FE_SET_FRONTEND:
-			err = cx23885_dvb_set_frontend(fe,
-				(struct dvb_frontend_parameters *) parg);
-			break;
-		}
-		break;
-
-	case DVB_FE_IOCTL_POST:
-		/* no post-ioctl handling required */
-		break;
-	}
-	return err;
-};
-
-
 static struct lgs8gxx_config magicpro_prohdtve2_lgs8g75_config = {
 	.prod = LGS8GXX_PROD_LGS8G75,
 	.demod_address = 0x19,
@@ -1151,7 +1134,7 @@ static int dvb_register(struct cx23885_tsport *port)
 	/* register everything */
 	ret = videobuf_dvb_register_bus(&port->frontends, THIS_MODULE, port,
 					&dev->pci->dev, adapter_nr, mfe_shared,
-					cx23885_dvb_fe_ioctl_override);
+					NULL);
 	if (ret)
 		goto frontend_detach;
 
Signature · 1 line
1.7.8.352.g876a6
#91 lore raw

RFC PATCH 91/91 dvb-core: be sure that drivers won't use DVBv3 internally

Now that all frontends are implementing DVBv5, don't export the DVBv3 specific stuff to the drivers. Only the core should be aware of that, as it will keep providing DVBv3 backward compatibility.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c |    3 +++
 drivers/media/dvb/dvb-core/dvb_frontend.h |    2 ++
 include/linux/dvb/frontend.h              |    6 ++++--
 3 files changed, 9 insertions(+), 2 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +3 -0
index 68d284b..9131f1a 100644
@@ -25,6 +25,9 @@
  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
  */
 
+/* Enables DVBv3 compatibility bits at the headers */
+#define __DVB_CORE__
+
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
drivers/media/dvb/dvb-core/dvb_frontend.h +2 -0
index 52efcbd..382d97f 100644
@@ -315,6 +315,7 @@ struct dvb_frontend_ops {
 	int (*get_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
 };
 
+#ifdef __DVB_CORE__
 #define MAX_EVENT 8
 
 struct dvb_fe_events {
@@ -325,6 +326,7 @@ struct dvb_fe_events {
 	wait_queue_head_t	  wait_queue;
 	struct mutex		  mtx;
 };
+#endif
 
 struct dtv_frontend_properties {
 
include/linux/dvb/frontend.h +4 -2
index a3c7623..7e7cb64 100644
@@ -181,6 +181,7 @@ typedef enum fe_transmit_mode {
 	TRANSMISSION_MODE_32K,
 } fe_transmit_mode_t;
 
+#if defined(__DVB_CORE__) || !defined (__KERNEL__)
 typedef enum fe_bandwidth {
 	BANDWIDTH_8_MHZ,
 	BANDWIDTH_7_MHZ,
@@ -190,7 +191,7 @@ typedef enum fe_bandwidth {
 	BANDWIDTH_10_MHZ,
 	BANDWIDTH_1_712_MHZ,
 } fe_bandwidth_t;
-
+#endif
 
 typedef enum fe_guard_interval {
 	GUARD_INTERVAL_1_32,
@@ -213,6 +214,7 @@ typedef enum fe_hierarchy {
 } fe_hierarchy_t;
 
 
+#if defined(__DVB_CORE__) || !defined (__KERNEL__)
 struct dvb_qpsk_parameters {
 	__u32		symbol_rate;  /* symbol rate in Symbols per second */
 	fe_code_rate_t	fec_inner;    /* forward error correction (see above) */
@@ -251,11 +253,11 @@ struct dvb_frontend_parameters {
 	} u;
 };
 
-
 struct dvb_frontend_event {
 	fe_status_t status;
 	struct dvb_frontend_parameters parameters;
 };
+#endif
 
 /* S2API Commands */
 #define DTV_UNDEFINED		0
Signature · 1 line
1.7.8.352.g876a6
#92 lore raw

Re: [PATCH RFC 24/91] [media] em28xx-dvb: don't initialize drx-d non-used fields with zero

In reply to Mauro Carvalho Chehab
Quoted 3 lines · Mauro Carvalho Chehab

There's no need to initialize unused fields with zero, as Kernel does it automatically. Don't do that, in order to save some space at the data segment.

No space is saved for members of a struct, unless the complete struct is initialized to zero.

Anyway, it improves readability.

Quoted 28 lines

This also allows the removal of the unused pll_set callback.

---
 drivers/media/video/em28xx/em28xx-dvb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/media/video/em28xx/em28xx-dvb.c +6 -4
index 3868c1e..28be043 100644
@@ -302,10 +302,12 @@ static struct zl10353_config em28xx_zl10353_xc3028_no_i2c_gate = {
 };
 
 static struct drxd_config em28xx_drxd = {
-	.index = 0, .demod_address = 0x70, .demod_revision = 0xa2,
-	.demoda_address = 0x00, .pll_address = 0x00,
-	.pll_type = DRXD_PLL_NONE, .clock = 12000, .insert_rs_byte = 1,
-	.pll_set = NULL, .osc_deviation = NULL, .IF = 42800000,
+	.demod_address = 0x70,
+	.demod_revision = 0xa2,
+	.pll_type = DRXD_PLL_NONE,
+	.clock = 12000,
+	.insert_rs_byte = 1,
+	.IF = 42800000,
 	.disable_i2c_gate_ctrl = 1,
 };
 
#93 lore raw

Re: [PATCH RFC 04/91] [media] af9013: convert set_fontend to use DVBv5 parameters

In reply to Mauro Carvalho Chehab

Hello
basically I am done all these changes when rewrote whole af9013 driver. Fist PULL request is sent one month ago and I resend it last week. Could you apply that first?

Antti

Quoted 389 lines · Mauro Carvalho Chehab

Instead of using dvb_frontend_parameters struct, that were designed for a subset of the supported standards, use the DVBv5 cache information.

Also, fill the supported delivery systems at dvb_frontend_ops struct.

---
  drivers/media/dvb/frontends/af9013.c      |  110 +++++++++++++++--------------
  drivers/media/dvb/frontends/af9013_priv.h |   24 +++---
  2 files changed, 68 insertions(+), 66 deletions(-)
drivers/media/dvb/frontends/af9013.c +56 -54
index 540ed0f..08a0364 100644
@@ -365,9 +365,10 @@ error:
  	return ret;
  }
 
-static int af9013_set_ofdm_params(struct af9013_state *state,
-	struct dvb_ofdm_parameters *params, u8 *auto_mode)
+static int af9013_set_ofdm_params(struct dvb_frontend *fe, u8 *auto_mode)
  {
+	struct dtv_frontend_properties *c =&fe->dtv_property_cache;
+	struct af9013_state *state = fe->demodulator_priv;
  	int ret;
  	u8 i, buf[3] = {0, 0, 0};
  	*auto_mode = 0; /* set if parameters are requested to auto set */
@@ -376,7 +377,7 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
  	   garbage parameters given by application for compatibility.
  	   MPlayer seems to provide garbage parameters currently. */
 
-	switch (params->transmission_mode) {
+	switch (c->transmission_mode) {
  	case TRANSMISSION_MODE_AUTO:
  		*auto_mode = 1;
  	case TRANSMISSION_MODE_2K:
@@ -389,7 +390,7 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
  		*auto_mode = 1;
  	}
 
-	switch (params->guard_interval) {
+	switch (c->guard_interval) {
  	case GUARD_INTERVAL_AUTO:
  		*auto_mode = 1;
  	case GUARD_INTERVAL_1_32:
@@ -408,7 +409,7 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
  		*auto_mode = 1;
  	}
 
-	switch (params->hierarchy_information) {
+	switch (c->hierarchy) {
  	case HIERARCHY_AUTO:
  		*auto_mode = 1;
  	case HIERARCHY_NONE:
@@ -423,11 +424,11 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
  		buf[0] |= (3<<  4);
  		break;
  	default:
-		deb_info("%s: invalid hierarchy_information\n", __func__);
+		deb_info("%s: invalid hierarchy\n", __func__);
  		*auto_mode = 1;
  	};
 
-	switch (params->constellation) {
+	switch (c->modulation) {
  	case QAM_AUTO:
  		*auto_mode = 1;
  	case QPSK:
@@ -439,14 +440,14 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
  		buf[1] |= (2<<  6);
  		break;
  	default:
-		deb_info("%s: invalid constellation\n", __func__);
+		deb_info("%s: invalid modulation\n", __func__);
  		*auto_mode = 1;
  	}
 
  	/* Use HP. How and which case we can switch to LP? */
  	buf[1] |= (1<<  4);
 
-	switch (params->code_rate_HP) {
+	switch (c->code_rate_HP) {
  	case FEC_AUTO:
  		*auto_mode = 1;
  	case FEC_1_2:
@@ -468,11 +469,11 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
  		*auto_mode = 1;
  	}
 
-	switch (params->code_rate_LP) {
+	switch (c->code_rate_LP) {
  	case FEC_AUTO:
  	/* if HIERARCHY_NONE and FEC_NONE then LP FEC is set to FEC_AUTO
  	   by dvb_frontend.c for compatibility */
-		if (params->hierarchy_information != HIERARCHY_NONE)
+		if (c->hierarchy != HIERARCHY_NONE)
  			*auto_mode = 1;
  	case FEC_1_2:
  		break;
@@ -489,20 +490,20 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
  		buf[2] |= (4<<  3);
  		break;
  	case FEC_NONE:
-		if (params->hierarchy_information == HIERARCHY_AUTO)
+		if (c->hierarchy == HIERARCHY_AUTO)
  			break;
  	default:
  		deb_info("%s: invalid code_rate_LP\n", __func__);
  		*auto_mode = 1;
  	}
 
-	switch (params->bandwidth) {
-	case BANDWIDTH_6_MHZ:
+	switch (c->bandwidth_hz) {
+	case 6000000:
  		break;
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
  		buf[1] |= (1<<  2);
  		break;
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
  		buf[1] |= (2<<  2);
  		break;
  	default:
@@ -594,24 +595,24 @@ static int af9013_lock_led(struct af9013_state *state, u8 onoff)
  	return af9013_write_reg_bits(state, 0xd730, 0, 1, onoff);
  }
 
-static int af9013_set_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *params)
+static int af9013_set_frontend(struct dvb_frontend *fe)
  {
+	struct dtv_frontend_properties *c =&fe->dtv_property_cache;
  	struct af9013_state *state = fe->demodulator_priv;
  	int ret;
  	u8 auto_mode; /* auto set TPS */
 
-	deb_info("%s: freq:%d bw:%d\n", __func__, params->frequency,
-		params->u.ofdm.bandwidth);
+	deb_info("%s: freq:%d Hz bw:%d Hz\n", __func__, c->frequency,
+		c->bandwidth_hz);
 
-	state->frequency = params->frequency;
+	state->frequency = c->frequency;
 
  	/* program tuner */
  	if (fe->ops.tuner_ops.set_params)
  		fe->ops.tuner_ops.set_params(fe);
 
  	/* program CFOE coefficients */
-	ret = af9013_set_coeff(state, params->u.ofdm.bandwidth);
+	ret = af9013_set_coeff(state, c->bandwidth_hz);
  	if (ret)
  		goto error;
 
@@ -641,7 +642,7 @@ static int af9013_set_frontend(struct dvb_frontend *fe,
  		goto error;
 
  	/* program TPS and bandwidth, check if auto mode needed */
-	ret = af9013_set_ofdm_params(state,&params->u.ofdm,&auto_mode);
+	ret = af9013_set_ofdm_params(fe,&auto_mode);
  	if (ret)
  		goto error;
 
@@ -670,7 +671,7 @@ error:
  }
 
  static int af9013_get_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+			       struct dtv_frontend_properties *c)
  {
  	struct af9013_state *state = fe->demodulator_priv;
  	int ret;
@@ -686,104 +687,104 @@ static int af9013_get_frontend(struct dvb_frontend *fe,
 
  	switch ((buf[1]>>  6)&  3) {
  	case 0:
-		p->u.ofdm.constellation = QPSK;
+		c->modulation = QPSK;
  		break;
  	case 1:
-		p->u.ofdm.constellation = QAM_16;
+		c->modulation = QAM_16;
  		break;
  	case 2:
-		p->u.ofdm.constellation = QAM_64;
+		c->modulation = QAM_64;
  		break;
  	}
 
  	switch ((buf[0]>>  0)&  3) {
  	case 0:
-		p->u.ofdm.transmission_mode = TRANSMISSION_MODE_2K;
+		c->modulation = TRANSMISSION_MODE_2K;
  		break;
  	case 1:
-		p->u.ofdm.transmission_mode = TRANSMISSION_MODE_8K;
+		c->modulation = TRANSMISSION_MODE_8K;
  	}
 
  	switch ((buf[0]>>  2)&  3) {
  	case 0:
-		p->u.ofdm.guard_interval = GUARD_INTERVAL_1_32;
+		c->guard_interval = GUARD_INTERVAL_1_32;
  		break;
  	case 1:
-		p->u.ofdm.guard_interval = GUARD_INTERVAL_1_16;
+		c->guard_interval = GUARD_INTERVAL_1_16;
  		break;
  	case 2:
-		p->u.ofdm.guard_interval = GUARD_INTERVAL_1_8;
+		c->guard_interval = GUARD_INTERVAL_1_8;
  		break;
  	case 3:
-		p->u.ofdm.guard_interval = GUARD_INTERVAL_1_4;
+		c->guard_interval = GUARD_INTERVAL_1_4;
  		break;
  	}
 
  	switch ((buf[0]>>  4)&  7) {
  	case 0:
-		p->u.ofdm.hierarchy_information = HIERARCHY_NONE;
+		c->hierarchy = HIERARCHY_NONE;
  		break;
  	case 1:
-		p->u.ofdm.hierarchy_information = HIERARCHY_1;
+		c->hierarchy = HIERARCHY_1;
  		break;
  	case 2:
-		p->u.ofdm.hierarchy_information = HIERARCHY_2;
+		c->hierarchy = HIERARCHY_2;
  		break;
  	case 3:
-		p->u.ofdm.hierarchy_information = HIERARCHY_4;
+		c->hierarchy = HIERARCHY_4;
  		break;
  	}
 
  	switch ((buf[2]>>  0)&  7) {
  	case 0:
-		p->u.ofdm.code_rate_HP = FEC_1_2;
+		c->code_rate_HP = FEC_1_2;
  		break;
  	case 1:
-		p->u.ofdm.code_rate_HP = FEC_2_3;
+		c->code_rate_HP = FEC_2_3;
  		break;
  	case 2:
-		p->u.ofdm.code_rate_HP = FEC_3_4;
+		c->code_rate_HP = FEC_3_4;
  		break;
  	case 3:
-		p->u.ofdm.code_rate_HP = FEC_5_6;
+		c->code_rate_HP = FEC_5_6;
  		break;
  	case 4:
-		p->u.ofdm.code_rate_HP = FEC_7_8;
+		c->code_rate_HP = FEC_7_8;
  		break;
  	}
 
  	switch ((buf[2]>>  3)&  7) {
  	case 0:
-		p->u.ofdm.code_rate_LP = FEC_1_2;
+		c->code_rate_LP = FEC_1_2;
  		break;
  	case 1:
-		p->u.ofdm.code_rate_LP = FEC_2_3;
+		c->code_rate_LP = FEC_2_3;
  		break;
  	case 2:
-		p->u.ofdm.code_rate_LP = FEC_3_4;
+		c->code_rate_LP = FEC_3_4;
  		break;
  	case 3:
-		p->u.ofdm.code_rate_LP = FEC_5_6;
+		c->code_rate_LP = FEC_5_6;
  		break;
  	case 4:
-		p->u.ofdm.code_rate_LP = FEC_7_8;
+		c->code_rate_LP = FEC_7_8;
  		break;
  	}
 
  	switch ((buf[1]>>  2)&  3) {
  	case 0:
-		p->u.ofdm.bandwidth = BANDWIDTH_6_MHZ;
+		c->bandwidth_hz = 6000000;
  		break;
  	case 1:
-		p->u.ofdm.bandwidth = BANDWIDTH_7_MHZ;
+		c->bandwidth_hz = 7000000;
  		break;
  	case 2:
-		p->u.ofdm.bandwidth = BANDWIDTH_8_MHZ;
+		c->bandwidth_hz = 8000000;
  		break;
  	}
 
-	p->inversion = INVERSION_AUTO;
-	p->frequency = state->frequency;
+	c->inversion = INVERSION_AUTO;
+	c->frequency = state->frequency;
 
  error:
  	return ret;
@@ -1505,6 +1506,7 @@ error:
  EXPORT_SYMBOL(af9013_attach);
 
  static struct dvb_frontend_ops af9013_ops = {
+	.delsys = { SYS_DVBT },
  	.info = {
  		.name = "Afatech AF9013 DVB-T",
  		.type = FE_OFDM,
@@ -1529,8 +1531,8 @@ static struct dvb_frontend_ops af9013_ops = {
  	.sleep = af9013_sleep,
  	.i2c_gate_ctrl = af9013_i2c_gate_ctrl,
 
-	.set_frontend_legacy = af9013_set_frontend,
-	.get_frontend_legacy = af9013_get_frontend,
+	.set_frontend = af9013_set_frontend,
+	.get_frontend = af9013_get_frontend,
 
  	.get_tune_settings = af9013_get_tune_settings,
 
drivers/media/dvb/frontends/af9013_priv.h +12 -12
index e00b2a4..67efd16 100644
@@ -69,43 +69,43 @@ struct coeff {
  /* pre-calculated coeff lookup table */
  static struct coeff coeff_table[] = {
  	/* 28.800 MHz */
-	{ 28800, BANDWIDTH_8_MHZ, { 0x02, 0x8a, 0x28, 0xa3, 0x05, 0x14,
+	{ 28800, 8000000, { 0x02, 0x8a, 0x28, 0xa3, 0x05, 0x14,
  		0x51, 0x11, 0x00, 0xa2, 0x8f, 0x3d, 0x00, 0xa2, 0x8a,
  		0x29, 0x00, 0xa2, 0x85, 0x14, 0x01, 0x45, 0x14, 0x14 } },
-	{ 28800, BANDWIDTH_7_MHZ, { 0x02, 0x38, 0xe3, 0x8e, 0x04, 0x71,
+	{ 28800, 7000000, { 0x02, 0x38, 0xe3, 0x8e, 0x04, 0x71,
  		0xc7, 0x07, 0x00, 0x8e, 0x3d, 0x55, 0x00, 0x8e, 0x38,
  		0xe4, 0x00, 0x8e, 0x34, 0x72, 0x01, 0x1c, 0x71, 0x32 } },
-	{ 28800, BANDWIDTH_6_MHZ, { 0x01, 0xe7, 0x9e, 0x7a, 0x03, 0xcf,
+	{ 28800, 6000000, { 0x01, 0xe7, 0x9e, 0x7a, 0x03, 0xcf,
  		0x3c, 0x3d, 0x00, 0x79, 0xeb, 0x6e, 0x00, 0x79, 0xe7,
  		0x9e, 0x00, 0x79, 0xe3, 0xcf, 0x00, 0xf3, 0xcf, 0x0f } },
  	/* 20.480 MHz */
-	{ 20480, BANDWIDTH_8_MHZ, { 0x03, 0x92, 0x49, 0x26, 0x07, 0x24,
+	{ 20480, 8000000, { 0x03, 0x92, 0x49, 0x26, 0x07, 0x24,
  		0x92, 0x13, 0x00, 0xe4, 0x99, 0x6e, 0x00, 0xe4, 0x92,
  		0x49, 0x00, 0xe4, 0x8b, 0x25, 0x01, 0xc9, 0x24, 0x25 } },
-	{ 20480, BANDWIDTH_7_MHZ, { 0x03, 0x20, 0x00, 0x01, 0x06, 0x40,
+	{ 20480, 7000000, { 0x03, 0x20, 0x00, 0x01, 0x06, 0x40,
  		0x00, 0x00, 0x00, 0xc8, 0x06, 0x40, 0x00, 0xc8, 0x00,
  		0x00, 0x00, 0xc7, 0xf9, 0xc0, 0x01, 0x90, 0x00, 0x00 } },
-	{ 20480, BANDWIDTH_6_MHZ, { 0x02, 0xad, 0xb6, 0xdc, 0x05, 0x5b,
+	{ 20480, 6000000, { 0x02, 0xad, 0xb6, 0xdc, 0x05, 0x5b,
  		0x6d, 0x2e, 0x00, 0xab, 0x73, 0x13, 0x00, 0xab, 0x6d,
  		0xb7, 0x00, 0xab, 0x68, 0x5c, 0x01, 0x56, 0xdb, 0x1c } },
  	/* 28.000 MHz */
-	{ 28000, BANDWIDTH_8_MHZ, { 0x02, 0x9c, 0xbc, 0x15, 0x05, 0x39,
+	{ 28000, 8000000, { 0x02, 0x9c, 0xbc, 0x15, 0x05, 0x39,
  		0x78, 0x0a, 0x00, 0xa7, 0x34, 0x3f, 0x00, 0xa7, 0x2f,
  		0x05, 0x00, 0xa7, 0x29, 0xcc, 0x01, 0x4e, 0x5e, 0x03 } },
-	{ 28000, BANDWIDTH_7_MHZ, { 0x02, 0x49, 0x24, 0x92, 0x04, 0x92,
+	{ 28000, 7000000, { 0x02, 0x49, 0x24, 0x92, 0x04, 0x92,
  		0x49, 0x09, 0x00, 0x92, 0x4d, 0xb7, 0x00, 0x92, 0x49,
  		0x25, 0x00, 0x92, 0x44, 0x92, 0x01, 0x24, 0x92, 0x12 } },
-	{ 28000, BANDWIDTH_6_MHZ, { 0x01, 0xf5, 0x8d, 0x10, 0x03, 0xeb,
+	{ 28000, 6000000, { 0x01, 0xf5, 0x8d, 0x10, 0x03, 0xeb,
  		0x1a, 0x08, 0x00, 0x7d, 0x67, 0x2f, 0x00, 0x7d, 0x63,
  		0x44, 0x00, 0x7d, 0x5f, 0x59, 0x00, 0xfa, 0xc6, 0x22 } },
  	/* 25.000 MHz */
-	{ 25000, BANDWIDTH_8_MHZ, { 0x02, 0xec, 0xfb, 0x9d, 0x05, 0xd9,
+	{ 25000, 8000000, { 0x02, 0xec, 0xfb, 0x9d, 0x05, 0xd9,
  		0xf7, 0x0e, 0x00, 0xbb, 0x44, 0xc1, 0x00, 0xbb, 0x3e,
  		0xe7, 0x00, 0xbb, 0x39, 0x0d, 0x01, 0x76, 0x7d, 0x34 } },
-	{ 25000, BANDWIDTH_7_MHZ, { 0x02, 0x8f, 0x5c, 0x29, 0x05, 0x1e,
+	{ 25000, 7000000, { 0x02, 0x8f, 0x5c, 0x29, 0x05, 0x1e,
  		0xb8, 0x14, 0x00, 0xa3, 0xdc, 0x29, 0x00, 0xa3, 0xd7,
  		0x0a, 0x00, 0xa3, 0xd1, 0xec, 0x01, 0x47, 0xae, 0x05 } },
-	{ 25000, BANDWIDTH_6_MHZ, { 0x02, 0x31, 0xbc, 0xb5, 0x04, 0x63,
+	{ 25000, 6000000, { 0x02, 0x31, 0xbc, 0xb5, 0x04, 0x63,
  		0x79, 0x1b, 0x00, 0x8c, 0x73, 0x91, 0x00, 0x8c, 0x6f,
  		0x2d, 0x00, 0x8c, 0x6a, 0xca, 0x01, 0x18, 0xde, 0x17 } },
  };
Signature · 1 line
http://palosaari.fi/
#94 lore raw

Re: [PATCH RFC 04/91] [media] af9013: convert set_fontend to use DVBv5 parameters

Quoted 2 lines · Antti Palosaari

Hello
basically I am done all these changes when rewrote whole af9013 driver. Fist PULL request is sent one month ago and I resend it last week. Could you apply that first?

I'll apply the pending pull requests before those series and rebase what's needed. As it is written there, this is a RFC ;)

I should be handling the pending stuff later this week.

Quoted 395 lines

Antti

Quoted 389 lines · Mauro Carvalho Chehab

Instead of using dvb_frontend_parameters struct, that were designed for a subset of the supported standards, use the DVBv5 cache information.

Also, fill the supported delivery systems at dvb_frontend_ops struct.

---
  drivers/media/dvb/frontends/af9013.c      |  110 +++++++++++++++--------------
  drivers/media/dvb/frontends/af9013_priv.h |   24 +++---
  2 files changed, 68 insertions(+), 66 deletions(-)
drivers/media/dvb/frontends/af9013.c +56 -54
index 540ed0f..08a0364 100644
@@ -365,9 +365,10 @@ error:
      return ret;
  }
 
-static int af9013_set_ofdm_params(struct af9013_state *state,
-    struct dvb_ofdm_parameters *params, u8 *auto_mode)
+static int af9013_set_ofdm_params(struct dvb_frontend *fe, u8 *auto_mode)
  {
+    struct dtv_frontend_properties *c =&fe->dtv_property_cache;
+    struct af9013_state *state = fe->demodulator_priv;
      int ret;
      u8 i, buf[3] = {0, 0, 0};
      *auto_mode = 0; /* set if parameters are requested to auto set */
@@ -376,7 +377,7 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
         garbage parameters given by application for compatibility.
         MPlayer seems to provide garbage parameters currently. */
 
-    switch (params->transmission_mode) {
+    switch (c->transmission_mode) {
      case TRANSMISSION_MODE_AUTO:
          *auto_mode = 1;
      case TRANSMISSION_MODE_2K:
@@ -389,7 +390,7 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
          *auto_mode = 1;
      }
 
-    switch (params->guard_interval) {
+    switch (c->guard_interval) {
      case GUARD_INTERVAL_AUTO:
          *auto_mode = 1;
      case GUARD_INTERVAL_1_32:
@@ -408,7 +409,7 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
          *auto_mode = 1;
      }
 
-    switch (params->hierarchy_information) {
+    switch (c->hierarchy) {
      case HIERARCHY_AUTO:
          *auto_mode = 1;
      case HIERARCHY_NONE:
@@ -423,11 +424,11 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
          buf[0] |= (3<<  4);
          break;
      default:
-        deb_info("%s: invalid hierarchy_information\n", __func__);
+        deb_info("%s: invalid hierarchy\n", __func__);
          *auto_mode = 1;
      };
 
-    switch (params->constellation) {
+    switch (c->modulation) {
      case QAM_AUTO:
          *auto_mode = 1;
      case QPSK:
@@ -439,14 +440,14 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
          buf[1] |= (2<<  6);
          break;
      default:
-        deb_info("%s: invalid constellation\n", __func__);
+        deb_info("%s: invalid modulation\n", __func__);
          *auto_mode = 1;
      }
 
      /* Use HP. How and which case we can switch to LP? */
      buf[1] |= (1<<  4);
 
-    switch (params->code_rate_HP) {
+    switch (c->code_rate_HP) {
      case FEC_AUTO:
          *auto_mode = 1;
      case FEC_1_2:
@@ -468,11 +469,11 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
          *auto_mode = 1;
      }
 
-    switch (params->code_rate_LP) {
+    switch (c->code_rate_LP) {
      case FEC_AUTO:
      /* if HIERARCHY_NONE and FEC_NONE then LP FEC is set to FEC_AUTO
         by dvb_frontend.c for compatibility */
-        if (params->hierarchy_information != HIERARCHY_NONE)
+        if (c->hierarchy != HIERARCHY_NONE)
              *auto_mode = 1;
      case FEC_1_2:
          break;
@@ -489,20 +490,20 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
          buf[2] |= (4<<  3);
          break;
      case FEC_NONE:
-        if (params->hierarchy_information == HIERARCHY_AUTO)
+        if (c->hierarchy == HIERARCHY_AUTO)
              break;
      default:
          deb_info("%s: invalid code_rate_LP\n", __func__);
          *auto_mode = 1;
      }
 
-    switch (params->bandwidth) {
-    case BANDWIDTH_6_MHZ:
+    switch (c->bandwidth_hz) {
+    case 6000000:
          break;
-    case BANDWIDTH_7_MHZ:
+    case 7000000:
          buf[1] |= (1<<  2);
          break;
-    case BANDWIDTH_8_MHZ:
+    case 8000000:
          buf[1] |= (2<<  2);
          break;
      default:
@@ -594,24 +595,24 @@ static int af9013_lock_led(struct af9013_state *state, u8 onoff)
      return af9013_write_reg_bits(state, 0xd730, 0, 1, onoff);
  }
 
-static int af9013_set_frontend(struct dvb_frontend *fe,
-    struct dvb_frontend_parameters *params)
+static int af9013_set_frontend(struct dvb_frontend *fe)
  {
+    struct dtv_frontend_properties *c =&fe->dtv_property_cache;
      struct af9013_state *state = fe->demodulator_priv;
      int ret;
      u8 auto_mode; /* auto set TPS */
 
-    deb_info("%s: freq:%d bw:%d\n", __func__, params->frequency,
-        params->u.ofdm.bandwidth);
+    deb_info("%s: freq:%d Hz bw:%d Hz\n", __func__, c->frequency,
+        c->bandwidth_hz);
 
-    state->frequency = params->frequency;
+    state->frequency = c->frequency;
 
      /* program tuner */
      if (fe->ops.tuner_ops.set_params)
          fe->ops.tuner_ops.set_params(fe);
 
      /* program CFOE coefficients */
-    ret = af9013_set_coeff(state, params->u.ofdm.bandwidth);
+    ret = af9013_set_coeff(state, c->bandwidth_hz);
      if (ret)
          goto error;
 
@@ -641,7 +642,7 @@ static int af9013_set_frontend(struct dvb_frontend *fe,
          goto error;
 
      /* program TPS and bandwidth, check if auto mode needed */
-    ret = af9013_set_ofdm_params(state,&params->u.ofdm,&auto_mode);
+    ret = af9013_set_ofdm_params(fe,&auto_mode);
      if (ret)
          goto error;
 
@@ -670,7 +671,7 @@ error:
  }
 
  static int af9013_get_frontend(struct dvb_frontend *fe,
-    struct dvb_frontend_parameters *p)
+                   struct dtv_frontend_properties *c)
  {
      struct af9013_state *state = fe->demodulator_priv;
      int ret;
@@ -686,104 +687,104 @@ static int af9013_get_frontend(struct dvb_frontend *fe,
 
      switch ((buf[1]>>  6)&  3) {
      case 0:
-        p->u.ofdm.constellation = QPSK;
+        c->modulation = QPSK;
          break;
      case 1:
-        p->u.ofdm.constellation = QAM_16;
+        c->modulation = QAM_16;
          break;
      case 2:
-        p->u.ofdm.constellation = QAM_64;
+        c->modulation = QAM_64;
          break;
      }
 
      switch ((buf[0]>>  0)&  3) {
      case 0:
-        p->u.ofdm.transmission_mode = TRANSMISSION_MODE_2K;
+        c->modulation = TRANSMISSION_MODE_2K;
          break;
      case 1:
-        p->u.ofdm.transmission_mode = TRANSMISSION_MODE_8K;
+        c->modulation = TRANSMISSION_MODE_8K;
      }
 
      switch ((buf[0]>>  2)&  3) {
      case 0:
-        p->u.ofdm.guard_interval = GUARD_INTERVAL_1_32;
+        c->guard_interval = GUARD_INTERVAL_1_32;
          break;
      case 1:
-        p->u.ofdm.guard_interval = GUARD_INTERVAL_1_16;
+        c->guard_interval = GUARD_INTERVAL_1_16;
          break;
      case 2:
-        p->u.ofdm.guard_interval = GUARD_INTERVAL_1_8;
+        c->guard_interval = GUARD_INTERVAL_1_8;
          break;
      case 3:
-        p->u.ofdm.guard_interval = GUARD_INTERVAL_1_4;
+        c->guard_interval = GUARD_INTERVAL_1_4;
          break;
      }
 
      switch ((buf[0]>>  4)&  7) {
      case 0:
-        p->u.ofdm.hierarchy_information = HIERARCHY_NONE;
+        c->hierarchy = HIERARCHY_NONE;
          break;
      case 1:
-        p->u.ofdm.hierarchy_information = HIERARCHY_1;
+        c->hierarchy = HIERARCHY_1;
          break;
      case 2:
-        p->u.ofdm.hierarchy_information = HIERARCHY_2;
+        c->hierarchy = HIERARCHY_2;
          break;
      case 3:
-        p->u.ofdm.hierarchy_information = HIERARCHY_4;
+        c->hierarchy = HIERARCHY_4;
          break;
      }
 
      switch ((buf[2]>>  0)&  7) {
      case 0:
-        p->u.ofdm.code_rate_HP = FEC_1_2;
+        c->code_rate_HP = FEC_1_2;
          break;
      case 1:
-        p->u.ofdm.code_rate_HP = FEC_2_3;
+        c->code_rate_HP = FEC_2_3;
          break;
      case 2:
-        p->u.ofdm.code_rate_HP = FEC_3_4;
+        c->code_rate_HP = FEC_3_4;
          break;
      case 3:
-        p->u.ofdm.code_rate_HP = FEC_5_6;
+        c->code_rate_HP = FEC_5_6;
          break;
      case 4:
-        p->u.ofdm.code_rate_HP = FEC_7_8;
+        c->code_rate_HP = FEC_7_8;
          break;
      }
 
      switch ((buf[2]>>  3)&  7) {
      case 0:
-        p->u.ofdm.code_rate_LP = FEC_1_2;
+        c->code_rate_LP = FEC_1_2;
          break;
      case 1:
-        p->u.ofdm.code_rate_LP = FEC_2_3;
+        c->code_rate_LP = FEC_2_3;
          break;
      case 2:
-        p->u.ofdm.code_rate_LP = FEC_3_4;
+        c->code_rate_LP = FEC_3_4;
          break;
      case 3:
-        p->u.ofdm.code_rate_LP = FEC_5_6;
+        c->code_rate_LP = FEC_5_6;
          break;
      case 4:
-        p->u.ofdm.code_rate_LP = FEC_7_8;
+        c->code_rate_LP = FEC_7_8;
          break;
      }
 
      switch ((buf[1]>>  2)&  3) {
      case 0:
-        p->u.ofdm.bandwidth = BANDWIDTH_6_MHZ;
+        c->bandwidth_hz = 6000000;
          break;
      case 1:
-        p->u.ofdm.bandwidth = BANDWIDTH_7_MHZ;
+        c->bandwidth_hz = 7000000;
          break;
      case 2:
-        p->u.ofdm.bandwidth = BANDWIDTH_8_MHZ;
+        c->bandwidth_hz = 8000000;
          break;
      }
 
-    p->inversion = INVERSION_AUTO;
-    p->frequency = state->frequency;
+    c->inversion = INVERSION_AUTO;
+    c->frequency = state->frequency;
 
  error:
      return ret;
@@ -1505,6 +1506,7 @@ error:
  EXPORT_SYMBOL(af9013_attach);
 
  static struct dvb_frontend_ops af9013_ops = {
+    .delsys = { SYS_DVBT },
      .info = {
          .name = "Afatech AF9013 DVB-T",
          .type = FE_OFDM,
@@ -1529,8 +1531,8 @@ static struct dvb_frontend_ops af9013_ops = {
      .sleep = af9013_sleep,
      .i2c_gate_ctrl = af9013_i2c_gate_ctrl,
 
-    .set_frontend_legacy = af9013_set_frontend,
-    .get_frontend_legacy = af9013_get_frontend,
+    .set_frontend = af9013_set_frontend,
+    .get_frontend = af9013_get_frontend,
 
      .get_tune_settings = af9013_get_tune_settings,
 
drivers/media/dvb/frontends/af9013_priv.h +12 -12
index e00b2a4..67efd16 100644
@@ -69,43 +69,43 @@ struct coeff {
  /* pre-calculated coeff lookup table */
  static struct coeff coeff_table[] = {
      /* 28.800 MHz */
-    { 28800, BANDWIDTH_8_MHZ, { 0x02, 0x8a, 0x28, 0xa3, 0x05, 0x14,
+    { 28800, 8000000, { 0x02, 0x8a, 0x28, 0xa3, 0x05, 0x14,
          0x51, 0x11, 0x00, 0xa2, 0x8f, 0x3d, 0x00, 0xa2, 0x8a,
          0x29, 0x00, 0xa2, 0x85, 0x14, 0x01, 0x45, 0x14, 0x14 } },
-    { 28800, BANDWIDTH_7_MHZ, { 0x02, 0x38, 0xe3, 0x8e, 0x04, 0x71,
+    { 28800, 7000000, { 0x02, 0x38, 0xe3, 0x8e, 0x04, 0x71,
          0xc7, 0x07, 0x00, 0x8e, 0x3d, 0x55, 0x00, 0x8e, 0x38,
          0xe4, 0x00, 0x8e, 0x34, 0x72, 0x01, 0x1c, 0x71, 0x32 } },
-    { 28800, BANDWIDTH_6_MHZ, { 0x01, 0xe7, 0x9e, 0x7a, 0x03, 0xcf,
+    { 28800, 6000000, { 0x01, 0xe7, 0x9e, 0x7a, 0x03, 0xcf,
          0x3c, 0x3d, 0x00, 0x79, 0xeb, 0x6e, 0x00, 0x79, 0xe7,
          0x9e, 0x00, 0x79, 0xe3, 0xcf, 0x00, 0xf3, 0xcf, 0x0f } },
      /* 20.480 MHz */
-    { 20480, BANDWIDTH_8_MHZ, { 0x03, 0x92, 0x49, 0x26, 0x07, 0x24,
+    { 20480, 8000000, { 0x03, 0x92, 0x49, 0x26, 0x07, 0x24,
          0x92, 0x13, 0x00, 0xe4, 0x99, 0x6e, 0x00, 0xe4, 0x92,
          0x49, 0x00, 0xe4, 0x8b, 0x25, 0x01, 0xc9, 0x24, 0x25 } },
-    { 20480, BANDWIDTH_7_MHZ, { 0x03, 0x20, 0x00, 0x01, 0x06, 0x40,
+    { 20480, 7000000, { 0x03, 0x20, 0x00, 0x01, 0x06, 0x40,
          0x00, 0x00, 0x00, 0xc8, 0x06, 0x40, 0x00, 0xc8, 0x00,
          0x00, 0x00, 0xc7, 0xf9, 0xc0, 0x01, 0x90, 0x00, 0x00 } },
-    { 20480, BANDWIDTH_6_MHZ, { 0x02, 0xad, 0xb6, 0xdc, 0x05, 0x5b,
+    { 20480, 6000000, { 0x02, 0xad, 0xb6, 0xdc, 0x05, 0x5b,
          0x6d, 0x2e, 0x00, 0xab, 0x73, 0x13, 0x00, 0xab, 0x6d,
          0xb7, 0x00, 0xab, 0x68, 0x5c, 0x01, 0x56, 0xdb, 0x1c } },
      /* 28.000 MHz */
-    { 28000, BANDWIDTH_8_MHZ, { 0x02, 0x9c, 0xbc, 0x15, 0x05, 0x39,
+    { 28000, 8000000, { 0x02, 0x9c, 0xbc, 0x15, 0x05, 0x39,
          0x78, 0x0a, 0x00, 0xa7, 0x34, 0x3f, 0x00, 0xa7, 0x2f,
          0x05, 0x00, 0xa7, 0x29, 0xcc, 0x01, 0x4e, 0x5e, 0x03 } },
-    { 28000, BANDWIDTH_7_MHZ, { 0x02, 0x49, 0x24, 0x92, 0x04, 0x92,
+    { 28000, 7000000, { 0x02, 0x49, 0x24, 0x92, 0x04, 0x92,
          0x49, 0x09, 0x00, 0x92, 0x4d, 0xb7, 0x00, 0x92, 0x49,
          0x25, 0x00, 0x92, 0x44, 0x92, 0x01, 0x24, 0x92, 0x12 } },
-    { 28000, BANDWIDTH_6_MHZ, { 0x01, 0xf5, 0x8d, 0x10, 0x03, 0xeb,
+    { 28000, 6000000, { 0x01, 0xf5, 0x8d, 0x10, 0x03, 0xeb,
          0x1a, 0x08, 0x00, 0x7d, 0x67, 0x2f, 0x00, 0x7d, 0x63,
          0x44, 0x00, 0x7d, 0x5f, 0x59, 0x00, 0xfa, 0xc6, 0x22 } },
      /* 25.000 MHz */
-    { 25000, BANDWIDTH_8_MHZ, { 0x02, 0xec, 0xfb, 0x9d, 0x05, 0xd9,
+    { 25000, 8000000, { 0x02, 0xec, 0xfb, 0x9d, 0x05, 0xd9,
          0xf7, 0x0e, 0x00, 0xbb, 0x44, 0xc1, 0x00, 0xbb, 0x3e,
          0xe7, 0x00, 0xbb, 0x39, 0x0d, 0x01, 0x76, 0x7d, 0x34 } },
-    { 25000, BANDWIDTH_7_MHZ, { 0x02, 0x8f, 0x5c, 0x29, 0x05, 0x1e,
+    { 25000, 7000000, { 0x02, 0x8f, 0x5c, 0x29, 0x05, 0x1e,
          0xb8, 0x14, 0x00, 0xa3, 0xdc, 0x29, 0x00, 0xa3, 0xd7,
          0x0a, 0x00, 0xa3, 0xd1, 0xec, 0x01, 0x47, 0xae, 0x05 } },
-    { 25000, BANDWIDTH_6_MHZ, { 0x02, 0x31, 0xbc, 0xb5, 0x04, 0x63,
+    { 25000, 6000000, { 0x02, 0x31, 0xbc, 0xb5, 0x04, 0x63,
          0x79, 0x1b, 0x00, 0x8c, 0x73, 0x91, 0x00, 0x8c, 0x6f,
          0x2d, 0x00, 0x8c, 0x6a, 0xca, 0x01, 0x18, 0xde, 0x17 } },
  };
#95 lore raw

Re: [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback

In reply to Mauro Carvalho Chehab
Quoted 264 lines · Mauro Carvalho Chehab

The old method is renamed to get_frontend_legacy(), while not all frontends are converted.

---
 drivers/media/dvb/bt8xx/dst.c               |    8 +-
 drivers/media/dvb/dvb-core/dvb_frontend.c   |  102 ++++++++++++++++++++------
 drivers/media/dvb/dvb-core/dvb_frontend.h   |    5 +-
 drivers/media/dvb/dvb-usb/af9005-fe.c       |    4 +-
 drivers/media/dvb/dvb-usb/cinergyT2-fe.c    |    2 +-
 drivers/media/dvb/dvb-usb/dtt200u-fe.c      |    2 +-
 drivers/media/dvb/dvb-usb/friio-fe.c        |    2 +-
 drivers/media/dvb/dvb-usb/mxl111sf-demod.c  |    2 +-
 drivers/media/dvb/dvb-usb/vp702x-fe.c       |    2 +-
 drivers/media/dvb/dvb-usb/vp7045-fe.c       |    2 +-
 drivers/media/dvb/firewire/firedtv-fe.c     |    2 +-
 drivers/media/dvb/frontends/af9013.c        |    2 +-
 drivers/media/dvb/frontends/atbm8830.c      |    2 +-
 drivers/media/dvb/frontends/au8522_dig.c    |    2 +-
 drivers/media/dvb/frontends/cx22700.c       |    2 +-
 drivers/media/dvb/frontends/cx22702.c       |    2 +-
 drivers/media/dvb/frontends/cx24110.c       |    2 +-
 drivers/media/dvb/frontends/cx24123.c       |    2 +-
 drivers/media/dvb/frontends/cxd2820r_core.c |    4 +-
 drivers/media/dvb/frontends/dib3000mb.c     |    2 +-
 drivers/media/dvb/frontends/dib3000mc.c     |    2 +-
 drivers/media/dvb/frontends/dib7000m.c      |    2 +-
 drivers/media/dvb/frontends/dib7000p.c      |    2 +-
 drivers/media/dvb/frontends/dib8000.c       |    4 +-
 drivers/media/dvb/frontends/dib9000.c       |    4 +-
 drivers/media/dvb/frontends/drxd_hard.c     |    2 +-
 drivers/media/dvb/frontends/drxk_hard.c     |    4 +-
 drivers/media/dvb/frontends/dvb_dummy_fe.c  |    6 +-
 drivers/media/dvb/frontends/it913x-fe.c     |    2 +-
 drivers/media/dvb/frontends/l64781.c        |    2 +-
 drivers/media/dvb/frontends/lgdt3305.c      |    4 +-
 drivers/media/dvb/frontends/lgdt330x.c      |    4 +-
 drivers/media/dvb/frontends/lgs8gl5.c       |    2 +-
 drivers/media/dvb/frontends/lgs8gxx.c       |    2 +-
 drivers/media/dvb/frontends/mb86a20s.c      |    2 +-
 drivers/media/dvb/frontends/mt312.c         |    2 +-
 drivers/media/dvb/frontends/mt352.c         |    2 +-
 drivers/media/dvb/frontends/or51132.c       |    2 +-
 drivers/media/dvb/frontends/s5h1409.c       |    2 +-
 drivers/media/dvb/frontends/s5h1411.c       |    2 +-
 drivers/media/dvb/frontends/s5h1420.c       |    2 +-
 drivers/media/dvb/frontends/s5h1432.c       |    2 +-
 drivers/media/dvb/frontends/s921.c          |    2 +-
 drivers/media/dvb/frontends/stb0899_drv.c   |    2 +-
 drivers/media/dvb/frontends/stb6100.c       |    4 +-
 drivers/media/dvb/frontends/stv0297.c       |    2 +-
 drivers/media/dvb/frontends/stv0299.c       |    2 +-
 drivers/media/dvb/frontends/stv0367.c       |    4 +-
 drivers/media/dvb/frontends/stv0900_core.c  |    2 +-
 drivers/media/dvb/frontends/tda10021.c      |    2 +-
 drivers/media/dvb/frontends/tda10023.c      |    2 +-
 drivers/media/dvb/frontends/tda10048.c      |    2 +-
 drivers/media/dvb/frontends/tda1004x.c      |    4 +-
 drivers/media/dvb/frontends/tda10071.c      |    2 +-
 drivers/media/dvb/frontends/tda10086.c      |    2 +-
 drivers/media/dvb/frontends/tda8083.c       |    2 +-
 drivers/media/dvb/frontends/ves1820.c       |    2 +-
 drivers/media/dvb/frontends/ves1x93.c       |    2 +-
 drivers/media/dvb/frontends/zl10353.c       |    2 +-
 drivers/media/dvb/siano/smsdvb.c            |    2 +-
 drivers/media/video/tlg2300/pd-dvb.c        |    2 +-
 drivers/staging/media/as102/as102_fe.c      |    2 +-
 62 files changed, 157 insertions(+), 100 deletions(-)
drivers/media/dvb/bt8xx/dst.c +4 -4
index 4658bd6..6afc083 100644
@@ -1778,7 +1778,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1804,7 +1804,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1838,7 +1838,7 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1861,7 +1861,7 @@ static struct dvb_frontend_ops dst_atsc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
drivers/media/dvb/dvb-core/dvb_frontend.c +68 -19
index eca6170..1eefb91 100644
@@ -139,6 +139,14 @@ struct dvb_frontend_private {
 };
 
 static void dvb_frontend_wakeup(struct dvb_frontend *fe);
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out);
+
+static bool has_get_frontend(struct dvb_frontend *fe)
+{
+	return fe->ops.get_frontend || fe->ops.get_frontend_legacy;
+}
 
 static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 {
@@ -149,8 +157,8 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 
 	dprintk ("%s\n", __func__);
 
-	if ((status & FE_HAS_LOCK) && fe->ops.get_frontend)
-		fe->ops.get_frontend(fe, &fepriv->parameters_out);
+	if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
+		dtv_get_frontend(fe, NULL, &fepriv->parameters_out);
 
 	mutex_lock(&events->mtx);
 
@@ -1097,11 +1105,10 @@ static void dtv_property_cache_sync(struct dvb_frontend *fe,
 /* Ensure the cached values are set correctly in the frontend
  * legacy tuning structures, for the advanced tuning API.
  */
-static void dtv_property_legacy_params_sync(struct dvb_frontend *fe)
+static void dtv_property_legacy_params_sync(struct dvb_frontend *fe,
+					    struct dvb_frontend_parameters *p)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dvb_frontend_parameters *p = &fepriv->parameters_in;
 
 	p->frequency = c->frequency;
 	p->inversion = c->inversion;
@@ -1223,6 +1230,7 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe)
 static void dtv_property_cache_submit(struct dvb_frontend *fe)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 
 	/* For legacy delivery systems we don't need the delivery_system to
 	 * be specified, but we populate the older structures from the cache
@@ -1231,7 +1239,7 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	if(is_legacy_delivery_system(c->delivery_system)) {
 
 		dprintk("%s() legacy, modulation = %d\n", __func__, c->modulation);
-		dtv_property_legacy_params_sync(fe);
+		dtv_property_legacy_params_sync(fe, &fepriv->parameters_in);
 
 	} else {
 		dprintk("%s() adv, modulation = %d\n", __func__, c->modulation);
@@ -1246,6 +1254,58 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	}
 }
 
+/**
+ * dtv_get_frontend - calls a callback for retrieving DTV parameters
+ * @fe:		struct dvb_frontend pointer
+ * @c:		struct dtv_frontend_properties pointer (DVBv5 cache)
+ * @p_out	struct dvb_frontend_parameters pointer (DVBv3 FE struct)
+ *
+ * This routine calls either the DVBv3 or DVBv5 get_frontend call.
+ * If c is not null, it will update the DVBv5 cache struct pointed by it.
+ * If p_out is not null, it will update the DVBv3 params pointed by it.
+ */
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out)
+{
+	const struct dtv_frontend_properties *cache = &fe->dtv_property_cache;
+	struct dtv_frontend_properties tmp_cache;
+	struct dvb_frontend_parameters tmp_out;
+	bool fill_cache = (c != NULL);
+	bool fill_params = (p_out != NULL);
+	int r;
+
+	if (!p_out)
+		p_out = & tmp_out;
+
+	if (!c)
+		c = &tmp_cache;
+	else
+		memcpy(c, cache, sizeof(*c));
+
+	/* Then try the DVBv5 one */
+	if (fe->ops.get_frontend) {
+		r = fe->ops.get_frontend(fe, c);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_params)
+			dtv_property_legacy_params_sync(fe, p_out);
+		return 0;
+	}
+
+	/* As no DVBv5 call exists, use the DVBv3 one */
+	if (fe->ops.get_frontend_legacy) {
+		r = fe->ops.get_frontend_legacy(fe, p_out);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_cache)
+			dtv_property_cache_sync(fe, c, p_out);
+		return 0;
+	}
+
+	return -EOPNOTSUPP;
+}
+
 static int dvb_frontend_ioctl_legacy(struct file *file,
 			unsigned int cmd, void *parg);
 static int dvb_frontend_ioctl_properties(struct file *file,
@@ -1296,24 +1356,12 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 }
 
 static int dtv_property_process_get(struct dvb_frontend *fe,
+				    const struct dtv_frontend_properties *c,
 				    struct dtv_property *tvp,
 				    struct file *file)
 {
-	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dtv_frontend_properties cdetected;
 	int r;
 
-	/*
-	 * If the driver implements a get_frontend function, then convert
-	 * detected parameters to S2API properties.
-	 */
-	if (fe->ops.get_frontend) {
-		cdetected = *c;
-		dtv_property_cache_sync(fe, &cdetected, &fepriv->parameters_out);
-		c = &cdetected;
-	}
-
 	switch(tvp->cmd) {
 	case DTV_ENUM_DELSYS:
 		dtv_set_default_delivery_caps(fe, tvp);
@@ -1685,6 +1733,7 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 
 	} else
 	if(cmd == FE_GET_PROPERTY) {
+		struct dtv_frontend_properties cache_out;
 
 		tvps = (struct dtv_properties __user *)parg;
 

drivers/media/dvb/dvb-core/dvb_frontend.c static int dvb_frontend_ioctl_properties(struct file *file, · line 1763

Quoted 8 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +5 -0
@@ -1707,8 +1756,13 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 			goto out;
 		}
 
+		/*
+		 * Fills the cache out struct with the cache contents, plus
+		 * the data retrieved from get_frontend/get_frontend_legacy.
+		 */
+		dtv_get_frontend(fe, &cache_out, NULL);

Unlike before, this code actually calls the get_frontend driver callback, causing unwanted I2C traffic for every property. Please drop this behavioural change.

Btw, this doesn't match the patch description.

Quoted 913 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +5 -5
 		for (i = 0; i < tvps->num; i++) {
-			err = dtv_property_process_get(fe, tvp + i, file);
+			err = dtv_property_process_get(fe, &cache_out, tvp + i, file);
 			if (err < 0)
 				goto out;
 			(tvp + i)->result = err;
@@ -2008,10 +2062,10 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 		break;
 
 	case FE_GET_FRONTEND:
-		if (fe->ops.get_frontend) {
-			err = fe->ops.get_frontend(fe, &fepriv->parameters_out);
-			memcpy(parg, &fepriv->parameters_out, sizeof(struct dvb_frontend_parameters));
-		}
+		err = dtv_get_frontend(fe, NULL, &fepriv->parameters_out);
+		if (err >= 0)
+			memcpy(parg, &fepriv->parameters_out,
+			       sizeof(struct dvb_frontend_parameters));
 		break;
 
 	case FE_SET_FRONTEND_TUNE_MODE:
drivers/media/dvb/dvb-core/dvb_frontend.h +4 -1
index dd44964..06ec17a 100644
@@ -256,6 +256,8 @@ struct analog_demod_ops {
 	int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
 };
 
+struct dtv_frontend_properties;
+
 struct dvb_frontend_ops {
 
 	struct dvb_frontend_info info;
@@ -284,7 +286,8 @@ struct dvb_frontend_ops {
 	int (*set_frontend)(struct dvb_frontend* fe);
 	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 (*get_frontend_legacy)(struct dvb_frontend *fe, struct dvb_frontend_parameters *params);
+	int (*get_frontend)(struct dvb_frontend *fe, struct dtv_frontend_properties *props);
 
 	int (*read_status)(struct dvb_frontend* fe, fe_status_t* status);
 	int (*read_ber)(struct dvb_frontend* fe, u32* ber);
drivers/media/dvb/dvb-usb/af9005-fe.c +2 -2
index f216933..e9addd8 100644
@@ -1239,7 +1239,7 @@ static int af9005_fe_get_frontend(struct dvb_frontend *fe,
 				      &temp);
 	if (ret)
 		return ret;
-	deb_info("===== fe_get_frontend ==============\n");
+	deb_info("===== fe_get_frontend_legacy = =============\n");
 	deb_info("CONSTELLATION ");
 	switch (temp) {
 	case 0:
@@ -1476,7 +1476,7 @@ static struct dvb_frontend_ops af9005_fe_ops = {
 	.ts_bus_ctrl = af9005_ts_bus_ctrl,
 
 	.set_frontend_legacy = af9005_fe_set_frontend,
-	.get_frontend = af9005_fe_get_frontend,
+	.get_frontend_legacy = af9005_fe_get_frontend,
 
 	.read_status = af9005_fe_read_status,
 	.read_ber = af9005_fe_read_ber,
drivers/media/dvb/dvb-usb/cinergyT2-fe.c +1 -1
index cad2284..40d50f7 100644
@@ -341,7 +341,7 @@ static struct dvb_frontend_ops cinergyt2_fe_ops = {
 	.sleep			= cinergyt2_fe_sleep,
 
 	.set_frontend_legacy		= cinergyt2_fe_set_frontend,
-	.get_frontend		= cinergyt2_fe_get_frontend,
+	.get_frontend_legacy = cinergyt2_fe_get_frontend,
 	.get_tune_settings	= cinergyt2_fe_get_tune_settings,
 
 	.read_status		= cinergyt2_fe_read_status,
drivers/media/dvb/dvb-usb/dtt200u-fe.c +1 -1
index ef9f7e4..7ce8227 100644
@@ -194,7 +194,7 @@ static struct dvb_frontend_ops dtt200u_fe_ops = {
 	.sleep = dtt200u_fe_sleep,
 
 	.set_frontend_legacy = dtt200u_fe_set_frontend,
-	.get_frontend = dtt200u_fe_get_frontend,
+	.get_frontend_legacy = dtt200u_fe_get_frontend,
 	.get_tune_settings = dtt200u_fe_get_tune_settings,
 
 	.read_status = dtt200u_fe_read_status,
drivers/media/dvb/dvb-usb/friio-fe.c +1 -1
index c98e2cc..7973aaf 100644
@@ -467,7 +467,7 @@ static struct dvb_frontend_ops jdvbt90502_ops = {
 	.set_property = jdvbt90502_set_property,
 
 	.set_frontend_legacy = jdvbt90502_set_frontend,
-	.get_frontend = jdvbt90502_get_frontend,
+	.get_frontend_legacy = jdvbt90502_get_frontend,
 
 	.read_status = jdvbt90502_read_status,
 	.read_signal_strength = jdvbt90502_read_signal_strength,
drivers/media/dvb/dvb-usb/mxl111sf-demod.c +1 -1
index 6639d3a..b798cc8 100644
@@ -571,7 +571,7 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = {
 	.i2c_gate_ctrl        = mxl111sf_i2c_gate_ctrl,
 #endif
 	.set_frontend_legacy         = mxl111sf_demod_set_frontend,
-	.get_frontend         = mxl111sf_demod_get_frontend,
+	.get_frontend_legacy = mxl111sf_demod_get_frontend,
 	.get_tune_settings    = mxl111sf_demod_get_tune_settings,
 	.read_status          = mxl111sf_demod_read_status,
 	.read_signal_strength = mxl111sf_demod_read_signal_strength,
drivers/media/dvb/dvb-usb/vp702x-fe.c +1 -1
index ee2177e..8ff5aab 100644
@@ -371,7 +371,7 @@ static struct dvb_frontend_ops vp702x_fe_ops = {
 	.sleep = vp702x_fe_sleep,
 
 	.set_frontend_legacy = vp702x_fe_set_frontend,
-	.get_frontend = vp702x_fe_get_frontend,
+	.get_frontend_legacy = vp702x_fe_get_frontend,
 	.get_tune_settings = vp702x_fe_get_tune_settings,
 
 	.read_status = vp702x_fe_read_status,
drivers/media/dvb/dvb-usb/vp7045-fe.c +1 -1
index 4f708c7..f8b5d8c 100644
@@ -181,7 +181,7 @@ static struct dvb_frontend_ops vp7045_fe_ops = {
 	.sleep = vp7045_fe_sleep,
 
 	.set_frontend_legacy = vp7045_fe_set_frontend,
-	.get_frontend = vp7045_fe_get_frontend,
+	.get_frontend_legacy = vp7045_fe_get_frontend,
 	.get_tune_settings = vp7045_fe_get_tune_settings,
 
 	.read_status = vp7045_fe_read_status,
drivers/media/dvb/firewire/firedtv-fe.c +1 -1
index a887abc..1eb5ad3 100644
@@ -174,7 +174,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name)
 	ops->sleep			= fdtv_sleep;
 
 	ops->set_frontend_legacy	= fdtv_set_frontend;
-	ops->get_frontend		= fdtv_get_frontend;
+	ops->get_frontend_legacy = fdtv_get_frontend;
 
 	ops->get_property		= fdtv_get_property;
 	ops->set_property		= fdtv_set_property;
drivers/media/dvb/frontends/af9013.c +1 -1
index a041d7f..540ed0f 100644
@@ -1530,7 +1530,7 @@ static struct dvb_frontend_ops af9013_ops = {
 	.i2c_gate_ctrl = af9013_i2c_gate_ctrl,
 
 	.set_frontend_legacy = af9013_set_frontend,
-	.get_frontend = af9013_get_frontend,
+	.get_frontend_legacy = af9013_get_frontend,
 
 	.get_tune_settings = af9013_get_tune_settings,
 
drivers/media/dvb/frontends/atbm8830.c +1 -1
index 5fc30f3..c4e0909 100644
@@ -450,7 +450,7 @@ static struct dvb_frontend_ops atbm8830_ops = {
 	.i2c_gate_ctrl = atbm8830_i2c_gate_ctrl,
 
 	.set_frontend_legacy = atbm8830_set_fe,
-	.get_frontend = atbm8830_get_fe,
+	.get_frontend_legacy = atbm8830_get_fe,
 	.get_tune_settings = atbm8830_get_tune_settings,
 
 	.read_status = atbm8830_read_status,
drivers/media/dvb/frontends/au8522_dig.c +1 -1
index 4b74cc8..327d6fe 100644
@@ -1024,7 +1024,7 @@ static struct dvb_frontend_ops au8522_ops = {
 	.sleep                = au8522_sleep,
 	.i2c_gate_ctrl        = au8522_i2c_gate_ctrl,
 	.set_frontend_legacy         = au8522_set_frontend,
-	.get_frontend         = au8522_get_frontend,
+	.get_frontend_legacy = au8522_get_frontend,
 	.get_tune_settings    = au8522_get_tune_settings,
 	.read_status          = au8522_read_status,
 	.read_ber             = au8522_read_ber,
drivers/media/dvb/frontends/cx22700.c +1 -1
index ce1e74f..7ac95de 100644
@@ -420,7 +420,7 @@ static struct dvb_frontend_ops cx22700_ops = {
 	.i2c_gate_ctrl = cx22700_i2c_gate_ctrl,
 
 	.set_frontend_legacy = cx22700_set_frontend,
-	.get_frontend = cx22700_get_frontend,
+	.get_frontend_legacy = cx22700_get_frontend,
 	.get_tune_settings = cx22700_get_tune_settings,
 
 	.read_status = cx22700_read_status,
drivers/media/dvb/frontends/cx22702.c +1 -1
index 2cea13e..a04cff8 100644
@@ -623,7 +623,7 @@ static const struct dvb_frontend_ops cx22702_ops = {
 	.i2c_gate_ctrl = cx22702_i2c_gate_ctrl,
 
 	.set_frontend_legacy = cx22702_set_tps,
-	.get_frontend = cx22702_get_frontend,
+	.get_frontend_legacy = cx22702_get_frontend,
 	.get_tune_settings = cx22702_get_tune_settings,
 
 	.read_status = cx22702_read_status,
drivers/media/dvb/frontends/cx24110.c +1 -1
index c75f9da..278034d 100644
@@ -644,7 +644,7 @@ static struct dvb_frontend_ops cx24110_ops = {
 	.init = cx24110_initfe,
 	.write = _cx24110_pll_write,
 	.set_frontend_legacy = cx24110_set_frontend,
-	.get_frontend = cx24110_get_frontend,
+	.get_frontend_legacy = cx24110_get_frontend,
 	.read_status = cx24110_read_status,
 	.read_ber = cx24110_read_ber,
 	.read_signal_strength = cx24110_read_signal_strength,
drivers/media/dvb/frontends/cx24123.c +1 -1
index 1342429..96f99a8 100644
@@ -1147,7 +1147,7 @@ static struct dvb_frontend_ops cx24123_ops = {
 
 	.init = cx24123_initfe,
 	.set_frontend_legacy = cx24123_set_frontend,
-	.get_frontend = cx24123_get_frontend,
+	.get_frontend_legacy = cx24123_get_frontend,
 	.read_status = cx24123_read_status,
 	.read_ber = cx24123_read_ber,
 	.read_signal_strength = cx24123_read_signal_strength,
drivers/media/dvb/frontends/cxd2820r_core.c +2 -2
index e8ace56..97bc353 100644
@@ -823,7 +823,7 @@ static const struct dvb_frontend_ops cxd2820r_ops[2] = {
 		.get_tune_settings = cxd2820r_get_tune_settings,
 		.i2c_gate_ctrl = cxd2820r_i2c_gate_ctrl,
 
-		.get_frontend = cxd2820r_get_frontend,
+		.get_frontend_legacy = cxd2820r_get_frontend,
 
 		.get_frontend_algo = cxd2820r_get_frontend_algo,
 		.search = cxd2820r_search,
@@ -853,7 +853,7 @@ static const struct dvb_frontend_ops cxd2820r_ops[2] = {
 		.i2c_gate_ctrl = cxd2820r_i2c_gate_ctrl,
 
 		.set_frontend_legacy = cxd2820r_set_frontend,
-		.get_frontend = cxd2820r_get_frontend,
+		.get_frontend_legacy = cxd2820r_get_frontend,
 
 		.read_status = cxd2820r_read_status,
 		.read_snr = cxd2820r_read_snr,
drivers/media/dvb/frontends/dib3000mb.c +1 -1
index 987eb17..77af240 100644
@@ -817,7 +817,7 @@ static struct dvb_frontend_ops dib3000mb_ops = {
 	.sleep = dib3000mb_sleep,
 
 	.set_frontend_legacy = dib3000mb_set_frontend_and_tuner,
-	.get_frontend = dib3000mb_get_frontend,
+	.get_frontend_legacy = dib3000mb_get_frontend,
 	.get_tune_settings = dib3000mb_fe_get_tune_settings,
 
 	.read_status = dib3000mb_read_status,
drivers/media/dvb/frontends/dib3000mc.c +1 -1
index 19fca6e..7ec0e02 100644
@@ -920,7 +920,7 @@ static struct dvb_frontend_ops dib3000mc_ops = {
 
 	.set_frontend_legacy         = dib3000mc_set_frontend,
 	.get_tune_settings    = dib3000mc_fe_get_tune_settings,
-	.get_frontend         = dib3000mc_get_frontend,
+	.get_frontend_legacy = dib3000mc_get_frontend,
 
 	.read_status          = dib3000mc_read_status,
 	.read_ber             = dib3000mc_read_ber,
drivers/media/dvb/frontends/dib7000m.c +1 -1
index cc6a710..45c1105 100644
@@ -1453,7 +1453,7 @@ static struct dvb_frontend_ops dib7000m_ops = {
 
 	.set_frontend_legacy         = dib7000m_set_frontend,
 	.get_tune_settings    = dib7000m_fe_get_tune_settings,
-	.get_frontend         = dib7000m_get_frontend,
+	.get_frontend_legacy = dib7000m_get_frontend,
 
 	.read_status          = dib7000m_read_status,
 	.read_ber             = dib7000m_read_ber,
drivers/media/dvb/frontends/dib7000p.c +1 -1
index 1e81b5b..feb82b0 100644
@@ -2441,7 +2441,7 @@ static struct dvb_frontend_ops dib7000p_ops = {
 
 	.set_frontend_legacy = dib7000p_set_frontend,
 	.get_tune_settings = dib7000p_fe_get_tune_settings,
-	.get_frontend = dib7000p_get_frontend,
+	.get_frontend_legacy = dib7000p_get_frontend,
 
 	.read_status = dib7000p_read_status,
 	.read_ber = dib7000p_read_ber,
drivers/media/dvb/frontends/dib8000.c +2 -2
index f9c98ba..9860062 100644
@@ -2824,7 +2824,7 @@ static int dib8000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 		if (stat&FE_HAS_SYNC) {
 			dprintk("TMCC lock on the slave%i", index_frontend);
 			/* synchronize the cache with the other frontends */
-			state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], fep);
+			state->fe[index_frontend]->ops.get_frontend_legacy(state->fe[index_frontend], fep);
 			for (sub_index_frontend = 0; (sub_index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[sub_index_frontend] != NULL); sub_index_frontend++) {
 				if (sub_index_frontend != index_frontend) {
 					state->fe[sub_index_frontend]->dtv_property_cache.isdbt_sb_mode = state->fe[index_frontend]->dtv_property_cache.isdbt_sb_mode;
@@ -3481,7 +3481,7 @@ static const struct dvb_frontend_ops dib8000_ops = {
 
 	.set_frontend_legacy = dib8000_set_frontend,
 	.get_tune_settings = dib8000_fe_get_tune_settings,
-	.get_frontend = dib8000_get_frontend,
+	.get_frontend_legacy = dib8000_get_frontend,
 
 	.read_status = dib8000_read_status,
 	.read_ber = dib8000_read_ber,
drivers/media/dvb/frontends/dib9000.c +2 -2
index c7b4910..4d82a4a 100644
@@ -1883,7 +1883,7 @@ static int dib9000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 			dprintk("TPS lock on the slave%i", index_frontend);
 
 			/* synchronize the cache with the other frontends */
-			state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], fep);
+			state->fe[index_frontend]->ops.get_frontend_legacy(state->fe[index_frontend], fep);
 			for (sub_index_frontend = 0; (sub_index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[sub_index_frontend] != NULL);
 			     sub_index_frontend++) {
 				if (sub_index_frontend != index_frontend) {
@@ -2515,7 +2515,7 @@ static struct dvb_frontend_ops dib9000_ops = {
 
 	.set_frontend_legacy = dib9000_set_frontend,
 	.get_tune_settings = dib9000_fe_get_tune_settings,
-	.get_frontend = dib9000_get_frontend,
+	.get_frontend_legacy = dib9000_get_frontend,
 
 	.read_status = dib9000_read_status,
 	.read_ber = dib9000_read_ber,
drivers/media/dvb/frontends/drxd_hard.c +1 -1
index 8118bb3..ca05a24 100644
@@ -2957,7 +2957,7 @@ static struct dvb_frontend_ops drxd_ops = {
 	.i2c_gate_ctrl = drxd_i2c_gate_ctrl,
 
 	.set_frontend_legacy = drxd_set_frontend,
-	.get_frontend = drxd_get_frontend,
+	.get_frontend_legacy = drxd_get_frontend,
 	.get_tune_settings = drxd_get_tune_settings,
 
 	.read_status = drxd_read_status,
drivers/media/dvb/frontends/drxk_hard.c +2 -2
index 1205944..2299e1d3 100644
@@ -6407,7 +6407,7 @@ static struct dvb_frontend_ops drxk_c_ops = {
 	.i2c_gate_ctrl = drxk_gate_ctrl,
 
 	.set_frontend_legacy = drxk_set_parameters,
-	.get_frontend = drxk_c_get_frontend,
+	.get_frontend_legacy = drxk_c_get_frontend,
 	.get_property = drxk_c_get_property,
 	.get_tune_settings = drxk_c_get_tune_settings,
 
@@ -6440,7 +6440,7 @@ static struct dvb_frontend_ops drxk_t_ops = {
 	.i2c_gate_ctrl = drxk_gate_ctrl,
 
 	.set_frontend_legacy = drxk_set_parameters,
-	.get_frontend = drxk_t_get_frontend,
+	.get_frontend_legacy = drxk_t_get_frontend,
 	.get_property = drxk_t_get_property,
 
 	.read_status = drxk_read_status,
drivers/media/dvb/frontends/dvb_dummy_fe.c +3 -3
index 322bcd7..31e1dd6 100644
@@ -193,7 +193,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
 	.sleep = dvb_dummy_fe_sleep,
 
 	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
-	.get_frontend = dvb_dummy_fe_get_frontend,
+	.get_frontend_legacy = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
 	.read_ber = dvb_dummy_fe_read_ber,
@@ -223,7 +223,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
 	.sleep = dvb_dummy_fe_sleep,
 
 	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
-	.get_frontend = dvb_dummy_fe_get_frontend,
+	.get_frontend_legacy = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
 	.read_ber = dvb_dummy_fe_read_ber,
@@ -255,7 +255,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
 	.sleep = dvb_dummy_fe_sleep,
 
 	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
-	.get_frontend = dvb_dummy_fe_get_frontend,
+	.get_frontend_legacy = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
 	.read_ber = dvb_dummy_fe_read_ber,
drivers/media/dvb/frontends/it913x-fe.c +1 -1
index 54d8534..a13f897 100644
@@ -940,7 +940,7 @@ static struct dvb_frontend_ops it913x_fe_ofdm_ops = {
 	.sleep = it913x_fe_sleep,
 
 	.set_frontend_legacy = it913x_fe_set_frontend,
-	.get_frontend = it913x_fe_get_frontend,
+	.get_frontend_legacy = it913x_fe_get_frontend,
 
 	.read_status = it913x_fe_read_status,
 	.read_signal_strength = it913x_fe_read_signal_strength,
drivers/media/dvb/frontends/l64781.c +1 -1
index fd4170a..1f1c598 100644
@@ -585,7 +585,7 @@ static struct dvb_frontend_ops l64781_ops = {
 	.sleep = l64781_sleep,
 
 	.set_frontend_legacy = apply_frontend_param,
-	.get_frontend = get_frontend,
+	.get_frontend_legacy = get_frontend,
 	.get_tune_settings = l64781_get_tune_settings,
 
 	.read_status = l64781_read_status,
drivers/media/dvb/frontends/lgdt3305.c +2 -2
index 8f15178..e1a9c92 100644
@@ -1177,7 +1177,7 @@ static struct dvb_frontend_ops lgdt3304_ops = {
 	.i2c_gate_ctrl        = lgdt3305_i2c_gate_ctrl,
 	.init                 = lgdt3305_init,
 	.set_frontend_legacy         = lgdt3304_set_parameters,
-	.get_frontend         = lgdt3305_get_frontend,
+	.get_frontend_legacy = lgdt3305_get_frontend,
 	.get_tune_settings    = lgdt3305_get_tune_settings,
 	.read_status          = lgdt3305_read_status,
 	.read_ber             = lgdt3305_read_ber,
@@ -1200,7 +1200,7 @@ static struct dvb_frontend_ops lgdt3305_ops = {
 	.init                 = lgdt3305_init,
 	.sleep                = lgdt3305_sleep,
 	.set_frontend_legacy         = lgdt3305_set_parameters,
-	.get_frontend         = lgdt3305_get_frontend,
+	.get_frontend_legacy = lgdt3305_get_frontend,
 	.get_tune_settings    = lgdt3305_get_tune_settings,
 	.read_status          = lgdt3305_read_status,
 	.read_ber             = lgdt3305_read_ber,
drivers/media/dvb/frontends/lgdt330x.c +2 -2
index bdae349..21bffc0 100644
@@ -774,7 +774,7 @@ static struct dvb_frontend_ops lgdt3302_ops = {
 	},
 	.init                 = lgdt330x_init,
 	.set_frontend_legacy         = lgdt330x_set_parameters,
-	.get_frontend         = lgdt330x_get_frontend,
+	.get_frontend_legacy = lgdt330x_get_frontend,
 	.get_tune_settings    = lgdt330x_get_tune_settings,
 	.read_status          = lgdt3302_read_status,
 	.read_ber             = lgdt330x_read_ber,
@@ -797,7 +797,7 @@ static struct dvb_frontend_ops lgdt3303_ops = {
 	},
 	.init                 = lgdt330x_init,
 	.set_frontend_legacy         = lgdt330x_set_parameters,
-	.get_frontend         = lgdt330x_get_frontend,
+	.get_frontend_legacy = lgdt330x_get_frontend,
 	.get_tune_settings    = lgdt330x_get_tune_settings,
 	.read_status          = lgdt3303_read_status,
 	.read_ber             = lgdt330x_read_ber,
drivers/media/dvb/frontends/lgs8gl5.c +1 -1
index 65a5c5d..f4e82a6 100644
@@ -435,7 +435,7 @@ static struct dvb_frontend_ops lgs8gl5_ops = {
 	.init = lgs8gl5_init,
 
 	.set_frontend_legacy = lgs8gl5_set_frontend,
-	.get_frontend = lgs8gl5_get_frontend,
+	.get_frontend_legacy = lgs8gl5_get_frontend,
 	.get_tune_settings = lgs8gl5_get_tune_settings,
 
 	.read_status = lgs8gl5_read_status,
drivers/media/dvb/frontends/lgs8gxx.c +1 -1
index 5684b61..05bfa05 100644
@@ -1014,7 +1014,7 @@ static struct dvb_frontend_ops lgs8gxx_ops = {
 	.i2c_gate_ctrl = lgs8gxx_i2c_gate_ctrl,
 
 	.set_frontend_legacy = lgs8gxx_set_fe,
-	.get_frontend = lgs8gxx_get_fe,
+	.get_frontend_legacy = lgs8gxx_get_fe,
 	.get_tune_settings = lgs8gxx_get_tune_settings,
 
 	.read_status = lgs8gxx_read_status,
drivers/media/dvb/frontends/mb86a20s.c +1 -1
index 3ae6d1f..2dfea6c 100644
@@ -628,7 +628,7 @@ static struct dvb_frontend_ops mb86a20s_ops = {
 
 	.init = mb86a20s_initfe,
 	.set_frontend_legacy = mb86a20s_set_frontend,
-	.get_frontend = mb86a20s_get_frontend,
+	.get_frontend_legacy = mb86a20s_get_frontend,
 	.read_status = mb86a20s_read_status,
 	.read_signal_strength = mb86a20s_read_signal_strength,
 	.tune = mb86a20s_tune,
drivers/media/dvb/frontends/mt312.c +1 -1
index efae45f..8f5d2d2 100644
@@ -762,7 +762,7 @@ static struct dvb_frontend_ops mt312_ops = {
 	.i2c_gate_ctrl = mt312_i2c_gate_ctrl,
 
 	.set_frontend_legacy = mt312_set_frontend,
-	.get_frontend = mt312_get_frontend,
+	.get_frontend_legacy = mt312_get_frontend,
 	.get_tune_settings = mt312_get_tune_settings,
 
 	.read_status = mt312_read_status,
drivers/media/dvb/frontends/mt352.c +1 -1
index 2bd68c5..021108d 100644
@@ -593,7 +593,7 @@ static struct dvb_frontend_ops mt352_ops = {
 	.write = _mt352_write,
 
 	.set_frontend_legacy = mt352_set_parameters,
-	.get_frontend = mt352_get_parameters,
+	.get_frontend_legacy = mt352_get_parameters,
 	.get_tune_settings = mt352_get_tune_settings,
 
 	.read_status = mt352_read_status,
drivers/media/dvb/frontends/or51132.c +1 -1
index 461f9fd..e0c952c 100644
@@ -598,7 +598,7 @@ static struct dvb_frontend_ops or51132_ops = {
 	.sleep = or51132_sleep,
 
 	.set_frontend_legacy = or51132_set_parameters,
-	.get_frontend = or51132_get_parameters,
+	.get_frontend_legacy = or51132_get_parameters,
 	.get_tune_settings = or51132_get_tune_settings,
 
 	.read_status = or51132_read_status,
drivers/media/dvb/frontends/s5h1409.c +1 -1
index 0b6e6c5..f39216c 100644
@@ -1009,7 +1009,7 @@ static struct dvb_frontend_ops s5h1409_ops = {
 	.init                 = s5h1409_init,
 	.i2c_gate_ctrl        = s5h1409_i2c_gate_ctrl,
 	.set_frontend_legacy         = s5h1409_set_frontend,
-	.get_frontend         = s5h1409_get_frontend,
+	.get_frontend_legacy = s5h1409_get_frontend,
 	.get_tune_settings    = s5h1409_get_tune_settings,
 	.read_status          = s5h1409_read_status,
 	.read_ber             = s5h1409_read_ber,
drivers/media/dvb/frontends/s5h1411.c +1 -1
index 67ab85c..cb221aa 100644
@@ -929,7 +929,7 @@ static struct dvb_frontend_ops s5h1411_ops = {
 	.sleep                = s5h1411_sleep,
 	.i2c_gate_ctrl        = s5h1411_i2c_gate_ctrl,
 	.set_frontend_legacy         = s5h1411_set_frontend,
-	.get_frontend         = s5h1411_get_frontend,
+	.get_frontend_legacy = s5h1411_get_frontend,
 	.get_tune_settings    = s5h1411_get_tune_settings,
 	.read_status          = s5h1411_read_status,
 	.read_ber             = s5h1411_read_ber,
drivers/media/dvb/frontends/s5h1420.c +1 -1
index e2cecf4..44ec27d 100644
@@ -961,7 +961,7 @@ static struct dvb_frontend_ops s5h1420_ops = {
 	.i2c_gate_ctrl = s5h1420_i2c_gate_ctrl,
 
 	.set_frontend_legacy = s5h1420_set_frontend,
-	.get_frontend = s5h1420_get_frontend,
+	.get_frontend_legacy = s5h1420_get_frontend,
 	.get_tune_settings = s5h1420_get_tune_settings,
 
 	.read_status = s5h1420_read_status,
drivers/media/dvb/frontends/s5h1432.c +1 -1
index a0dbbdc..f22c71e 100644
@@ -397,7 +397,7 @@ static struct dvb_frontend_ops s5h1432_ops = {
 	.init = s5h1432_init,
 	.sleep = s5h1432_sleep,
 	.set_frontend_legacy = s5h1432_set_frontend,
-	.get_frontend = s5h1432_get_frontend,
+	.get_frontend_legacy = s5h1432_get_frontend,
 	.get_tune_settings = s5h1432_get_tune_settings,
 	.read_status = s5h1432_read_status,
 	.read_ber = s5h1432_read_ber,
drivers/media/dvb/frontends/s921.c +1 -1
index 6615979..5e8f2a8 100644
@@ -535,7 +535,7 @@ static struct dvb_frontend_ops s921_ops = {
 
 	.init = s921_initfe,
 	.set_frontend_legacy = s921_set_frontend,
-	.get_frontend = s921_get_frontend,
+	.get_frontend_legacy = s921_get_frontend,
 	.read_status = s921_read_status,
 	.read_signal_strength = s921_read_signal_strength,
 	.tune = s921_tune,
drivers/media/dvb/frontends/stb0899_drv.c +1 -1
index 9c93d9f..9fa31d5 100644
@@ -1648,7 +1648,7 @@ static struct dvb_frontend_ops stb0899_ops = {
 	.get_frontend_algo		= stb0899_frontend_algo,
 	.search				= stb0899_search,
 	.track				= stb0899_track,
-	.get_frontend			= stb0899_get_frontend,
+	.get_frontend_legacy = stb0899_get_frontend,
 
 
 	.read_status			= stb0899_read_status,
drivers/media/dvb/frontends/stb6100.c +2 -2
index bc1a8af..7f68fd3 100644
@@ -335,9 +335,9 @@ static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency)
 
 	dprintk(verbose, FE_DEBUG, 1, "Version 2010-8-14 13:51");
 
-	if (fe->ops.get_frontend) {
+	if (fe->ops.get_frontend_legacy) {
 		dprintk(verbose, FE_DEBUG, 1, "Get frontend parameters");
-		fe->ops.get_frontend(fe, &p);
+		fe->ops.get_frontend_legacy(fe, &p);
 	}
 	srate = p.u.qpsk.symbol_rate;
 
drivers/media/dvb/frontends/stv0297.c +1 -1
index 63a3e1b..5d7c288 100644
@@ -707,7 +707,7 @@ static struct dvb_frontend_ops stv0297_ops = {
 	.i2c_gate_ctrl = stv0297_i2c_gate_ctrl,
 
 	.set_frontend_legacy = stv0297_set_frontend,
-	.get_frontend = stv0297_get_frontend,
+	.get_frontend_legacy = stv0297_get_frontend,
 
 	.read_status = stv0297_read_status,
 	.read_ber = stv0297_read_ber,
drivers/media/dvb/frontends/stv0299.c +1 -1
index 4f248e1..6aeabaf 100644
@@ -730,7 +730,7 @@ static struct dvb_frontend_ops stv0299_ops = {
 	.i2c_gate_ctrl = stv0299_i2c_gate_ctrl,
 
 	.set_frontend_legacy = stv0299_set_frontend,
-	.get_frontend = stv0299_get_frontend,
+	.get_frontend_legacy = stv0299_get_frontend,
 	.get_tune_settings = stv0299_get_tune_settings,
 
 	.read_status = stv0299_read_status,
drivers/media/dvb/frontends/stv0367.c +2 -2
index 7752d13..e0a2438 100644
@@ -2286,7 +2286,7 @@ static struct dvb_frontend_ops stv0367ter_ops = {
 	.sleep = stv0367ter_sleep,
 	.i2c_gate_ctrl = stv0367ter_gate_ctrl,
 	.set_frontend_legacy = stv0367ter_set_frontend,
-	.get_frontend = stv0367ter_get_frontend,
+	.get_frontend_legacy = stv0367ter_get_frontend,
 	.get_tune_settings = stv0367_get_tune_settings,
 	.read_status = stv0367ter_read_status,
 	.read_ber = stv0367ter_read_ber,/* too slow */
@@ -3404,7 +3404,7 @@ static struct dvb_frontend_ops stv0367cab_ops = {
 	.sleep					= stv0367cab_sleep,
 	.i2c_gate_ctrl				= stv0367cab_gate_ctrl,
 	.set_frontend_legacy				= stv0367cab_set_frontend,
-	.get_frontend				= stv0367cab_get_frontend,
+	.get_frontend_legacy = stv0367cab_get_frontend,
 	.read_status				= stv0367cab_read_status,
 /*	.read_ber				= stv0367cab_read_ber, */
 	.read_signal_strength			= stv0367cab_read_strength,
drivers/media/dvb/frontends/stv0900_core.c +1 -1
index 2b8d78c..df46654 100644
@@ -1908,7 +1908,7 @@ static struct dvb_frontend_ops stv0900_ops = {
 	},
 	.release			= stv0900_release,
 	.init				= stv0900_init,
-	.get_frontend                   = stv0900_get_frontend,
+	.get_frontend_legacy = stv0900_get_frontend,
 	.sleep				= stv0900_sleep,
 	.get_frontend_algo		= stv0900_frontend_algo,
 	.i2c_gate_ctrl			= stv0900_i2c_gate_ctrl,
drivers/media/dvb/frontends/tda10021.c +1 -1
index 0bbf681..3976d22 100644
@@ -525,7 +525,7 @@ static struct dvb_frontend_ops tda10021_ops = {
 	.i2c_gate_ctrl = tda10021_i2c_gate_ctrl,
 
 	.set_frontend_legacy = tda10021_set_parameters,
-	.get_frontend = tda10021_get_frontend,
+	.get_frontend_legacy = tda10021_get_frontend,
 	.get_property = tda10021_get_property,
 
 	.read_status = tda10021_read_status,
drivers/media/dvb/frontends/tda10023.c +1 -1
index f79841b..de535a4 100644
@@ -610,7 +610,7 @@ static struct dvb_frontend_ops tda10023_ops = {
 	.i2c_gate_ctrl = tda10023_i2c_gate_ctrl,
 
 	.set_frontend_legacy = tda10023_set_parameters,
-	.get_frontend = tda10023_get_frontend,
+	.get_frontend_legacy = tda10023_get_frontend,
 	.get_property = tda10023_get_property,
 	.read_status = tda10023_read_status,
 	.read_ber = tda10023_read_ber,
drivers/media/dvb/frontends/tda10048.c +1 -1
index 479ff85..bba249b 100644
@@ -1189,7 +1189,7 @@ static struct dvb_frontend_ops tda10048_ops = {
 	.init = tda10048_init,
 	.i2c_gate_ctrl = tda10048_i2c_gate_ctrl,
 	.set_frontend_legacy = tda10048_set_frontend,
-	.get_frontend = tda10048_get_frontend,
+	.get_frontend_legacy = tda10048_get_frontend,
 	.get_tune_settings = tda10048_get_tune_settings,
 	.read_status = tda10048_read_status,
 	.read_ber = tda10048_read_ber,
drivers/media/dvb/frontends/tda1004x.c +2 -2
index dd41057..2dbb070 100644
@@ -1252,7 +1252,7 @@ static struct dvb_frontend_ops tda10045_ops = {
 	.i2c_gate_ctrl = tda1004x_i2c_gate_ctrl,
 
 	.set_frontend_legacy = tda1004x_set_fe,
-	.get_frontend = tda1004x_get_fe,
+	.get_frontend_legacy = tda1004x_get_fe,
 	.get_tune_settings = tda1004x_get_tune_settings,
 
 	.read_status = tda1004x_read_status,
@@ -1322,7 +1322,7 @@ static struct dvb_frontend_ops tda10046_ops = {
 	.i2c_gate_ctrl = tda1004x_i2c_gate_ctrl,
 
 	.set_frontend_legacy = tda1004x_set_fe,
-	.get_frontend = tda1004x_get_fe,
+	.get_frontend_legacy = tda1004x_get_fe,
 	.get_tune_settings = tda1004x_get_tune_settings,
 
 	.read_status = tda1004x_read_status,
drivers/media/dvb/frontends/tda10071.c +1 -1
index 7bffa65..e9e00ea 100644
@@ -1248,7 +1248,7 @@ static struct dvb_frontend_ops tda10071_ops = {
 	.sleep = tda10071_sleep,
 
 	.set_frontend_legacy = tda10071_set_frontend,
-	.get_frontend = tda10071_get_frontend,
+	.get_frontend_legacy = tda10071_get_frontend,
 
 	.read_status = tda10071_read_status,
 	.read_snr = tda10071_read_snr,
drivers/media/dvb/frontends/tda10086.c +1 -1
index be4649f..8501100 100644
@@ -723,7 +723,7 @@ static struct dvb_frontend_ops tda10086_ops = {
 	.i2c_gate_ctrl = tda10086_i2c_gate_ctrl,
 
 	.set_frontend_legacy = tda10086_set_frontend,
-	.get_frontend = tda10086_get_frontend,
+	.get_frontend_legacy = tda10086_get_frontend,
 	.get_tune_settings = tda10086_get_tune_settings,
 
 	.read_status = tda10086_read_status,
drivers/media/dvb/frontends/tda8083.c +1 -1
index 9d1466f..7ff2946 100644
@@ -462,7 +462,7 @@ static struct dvb_frontend_ops tda8083_ops = {
 	.sleep = tda8083_sleep,
 
 	.set_frontend_legacy = tda8083_set_frontend,
-	.get_frontend = tda8083_get_frontend,
+	.get_frontend_legacy = tda8083_get_frontend,
 
 	.read_status = tda8083_read_status,
 	.read_signal_strength = tda8083_read_signal_strength,
drivers/media/dvb/frontends/ves1820.c +1 -1
index 6fb8eb5..7961231 100644
@@ -426,7 +426,7 @@ static struct dvb_frontend_ops ves1820_ops = {
 	.sleep = ves1820_sleep,
 
 	.set_frontend_legacy = ves1820_set_parameters,
-	.get_frontend = ves1820_get_frontend,
+	.get_frontend_legacy = ves1820_get_frontend,
 	.get_tune_settings = ves1820_get_tune_settings,
 
 	.read_status = ves1820_read_status,
drivers/media/dvb/frontends/ves1x93.c +1 -1
index f80f152..a95619e 100644
@@ -530,7 +530,7 @@ static struct dvb_frontend_ops ves1x93_ops = {
 	.i2c_gate_ctrl = ves1x93_i2c_gate_ctrl,
 
 	.set_frontend_legacy = ves1x93_set_frontend,
-	.get_frontend = ves1x93_get_frontend,
+	.get_frontend_legacy = ves1x93_get_frontend,
 
 	.read_status = ves1x93_read_status,
 	.read_ber = ves1x93_read_ber,
drivers/media/dvb/frontends/zl10353.c +1 -1
index 8b6c2a4..35334da 100644
@@ -676,7 +676,7 @@ static struct dvb_frontend_ops zl10353_ops = {
 	.write = zl10353_write,
 
 	.set_frontend_legacy = zl10353_set_parameters,
-	.get_frontend = zl10353_get_parameters,
+	.get_frontend_legacy = zl10353_get_parameters,
 	.get_tune_settings = zl10353_get_tune_settings,
 
 	.read_status = zl10353_read_status,
drivers/media/dvb/siano/smsdvb.c +1 -1
index fa17f02..df08d6a 100644
@@ -806,7 +806,7 @@ static struct dvb_frontend_ops smsdvb_fe_ops = {
 	.release = smsdvb_release,
 
 	.set_frontend_legacy = smsdvb_set_frontend,
-	.get_frontend = smsdvb_get_frontend,
+	.get_frontend_legacy = smsdvb_get_frontend,
 	.get_tune_settings = smsdvb_get_tune_settings,
 
 	.read_status = smsdvb_read_status,
drivers/media/video/tlg2300/pd-dvb.c +1 -1
index 51a7d55..f864c17 100644
@@ -354,7 +354,7 @@ static struct dvb_frontend_ops poseidon_frontend_ops = {
 	.sleep = poseidon_fe_sleep,
 
 	.set_frontend_legacy = poseidon_set_fe,
-	.get_frontend = poseidon_get_fe,
+	.get_frontend_legacy = poseidon_get_fe,
 	.get_tune_settings = poseidon_fe_get_tune_settings,
 
 	.read_status	= poseidon_read_status,
drivers/staging/media/as102/as102_fe.c +1 -1
index 161bcbe..b0c5128 100644
@@ -297,7 +297,7 @@ static struct dvb_frontend_ops as102_fe_ops = {
 	},
 
 	.set_frontend_legacy	= as102_fe_set_frontend,
-	.get_frontend		= as102_fe_get_frontend,
+	.get_frontend_legacy	= as102_fe_get_frontend,
 	.get_tune_settings	= as102_fe_get_tune_settings,
 
 	.read_status		= as102_fe_read_status,
#96 lore raw

Re: [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback

Quoted 268 lines · Andreas Oberritter
Quoted 267 lines · Mauro Carvalho Chehab

The old method is renamed to get_frontend_legacy(), while not all frontends are converted.

---
 drivers/media/dvb/bt8xx/dst.c               |    8 +-
 drivers/media/dvb/dvb-core/dvb_frontend.c   |  102 ++++++++++++++++++++------
 drivers/media/dvb/dvb-core/dvb_frontend.h   |    5 +-
 drivers/media/dvb/dvb-usb/af9005-fe.c       |    4 +-
 drivers/media/dvb/dvb-usb/cinergyT2-fe.c    |    2 +-
 drivers/media/dvb/dvb-usb/dtt200u-fe.c      |    2 +-
 drivers/media/dvb/dvb-usb/friio-fe.c        |    2 +-
 drivers/media/dvb/dvb-usb/mxl111sf-demod.c  |    2 +-
 drivers/media/dvb/dvb-usb/vp702x-fe.c       |    2 +-
 drivers/media/dvb/dvb-usb/vp7045-fe.c       |    2 +-
 drivers/media/dvb/firewire/firedtv-fe.c     |    2 +-
 drivers/media/dvb/frontends/af9013.c        |    2 +-
 drivers/media/dvb/frontends/atbm8830.c      |    2 +-
 drivers/media/dvb/frontends/au8522_dig.c    |    2 +-
 drivers/media/dvb/frontends/cx22700.c       |    2 +-
 drivers/media/dvb/frontends/cx22702.c       |    2 +-
 drivers/media/dvb/frontends/cx24110.c       |    2 +-
 drivers/media/dvb/frontends/cx24123.c       |    2 +-
 drivers/media/dvb/frontends/cxd2820r_core.c |    4 +-
 drivers/media/dvb/frontends/dib3000mb.c     |    2 +-
 drivers/media/dvb/frontends/dib3000mc.c     |    2 +-
 drivers/media/dvb/frontends/dib7000m.c      |    2 +-
 drivers/media/dvb/frontends/dib7000p.c      |    2 +-
 drivers/media/dvb/frontends/dib8000.c       |    4 +-
 drivers/media/dvb/frontends/dib9000.c       |    4 +-
 drivers/media/dvb/frontends/drxd_hard.c     |    2 +-
 drivers/media/dvb/frontends/drxk_hard.c     |    4 +-
 drivers/media/dvb/frontends/dvb_dummy_fe.c  |    6 +-
 drivers/media/dvb/frontends/it913x-fe.c     |    2 +-
 drivers/media/dvb/frontends/l64781.c        |    2 +-
 drivers/media/dvb/frontends/lgdt3305.c      |    4 +-
 drivers/media/dvb/frontends/lgdt330x.c      |    4 +-
 drivers/media/dvb/frontends/lgs8gl5.c       |    2 +-
 drivers/media/dvb/frontends/lgs8gxx.c       |    2 +-
 drivers/media/dvb/frontends/mb86a20s.c      |    2 +-
 drivers/media/dvb/frontends/mt312.c         |    2 +-
 drivers/media/dvb/frontends/mt352.c         |    2 +-
 drivers/media/dvb/frontends/or51132.c       |    2 +-
 drivers/media/dvb/frontends/s5h1409.c       |    2 +-
 drivers/media/dvb/frontends/s5h1411.c       |    2 +-
 drivers/media/dvb/frontends/s5h1420.c       |    2 +-
 drivers/media/dvb/frontends/s5h1432.c       |    2 +-
 drivers/media/dvb/frontends/s921.c          |    2 +-
 drivers/media/dvb/frontends/stb0899_drv.c   |    2 +-
 drivers/media/dvb/frontends/stb6100.c       |    4 +-
 drivers/media/dvb/frontends/stv0297.c       |    2 +-
 drivers/media/dvb/frontends/stv0299.c       |    2 +-
 drivers/media/dvb/frontends/stv0367.c       |    4 +-
 drivers/media/dvb/frontends/stv0900_core.c  |    2 +-
 drivers/media/dvb/frontends/tda10021.c      |    2 +-
 drivers/media/dvb/frontends/tda10023.c      |    2 +-
 drivers/media/dvb/frontends/tda10048.c      |    2 +-
 drivers/media/dvb/frontends/tda1004x.c      |    4 +-
 drivers/media/dvb/frontends/tda10071.c      |    2 +-
 drivers/media/dvb/frontends/tda10086.c      |    2 +-
 drivers/media/dvb/frontends/tda8083.c       |    2 +-
 drivers/media/dvb/frontends/ves1820.c       |    2 +-
 drivers/media/dvb/frontends/ves1x93.c       |    2 +-
 drivers/media/dvb/frontends/zl10353.c       |    2 +-
 drivers/media/dvb/siano/smsdvb.c            |    2 +-
 drivers/media/video/tlg2300/pd-dvb.c        |    2 +-
 drivers/staging/media/as102/as102_fe.c      |    2 +-
 62 files changed, 157 insertions(+), 100 deletions(-)
drivers/media/dvb/bt8xx/dst.c +4 -4
index 4658bd6..6afc083 100644
@@ -1778,7 +1778,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1804,7 +1804,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1838,7 +1838,7 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1861,7 +1861,7 @@ static struct dvb_frontend_ops dst_atsc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
drivers/media/dvb/dvb-core/dvb_frontend.c +68 -19
index eca6170..1eefb91 100644
@@ -139,6 +139,14 @@ struct dvb_frontend_private {
 };
 
 static void dvb_frontend_wakeup(struct dvb_frontend *fe);
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out);
+
+static bool has_get_frontend(struct dvb_frontend *fe)
+{
+	return fe->ops.get_frontend || fe->ops.get_frontend_legacy;
+}
 
 static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 {
@@ -149,8 +157,8 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 
 	dprintk ("%s\n", __func__);
 
-	if ((status & FE_HAS_LOCK) && fe->ops.get_frontend)
-		fe->ops.get_frontend(fe, &fepriv->parameters_out);
+	if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
+		dtv_get_frontend(fe, NULL, &fepriv->parameters_out);
 
 	mutex_lock(&events->mtx);
 
@@ -1097,11 +1105,10 @@ static void dtv_property_cache_sync(struct dvb_frontend *fe,
 /* Ensure the cached values are set correctly in the frontend
  * legacy tuning structures, for the advanced tuning API.
  */
-static void dtv_property_legacy_params_sync(struct dvb_frontend *fe)
+static void dtv_property_legacy_params_sync(struct dvb_frontend *fe,
+					    struct dvb_frontend_parameters *p)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dvb_frontend_parameters *p = &fepriv->parameters_in;
 
 	p->frequency = c->frequency;
 	p->inversion = c->inversion;
@@ -1223,6 +1230,7 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe)
 static void dtv_property_cache_submit(struct dvb_frontend *fe)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 
 	/* For legacy delivery systems we don't need the delivery_system to
 	 * be specified, but we populate the older structures from the cache
@@ -1231,7 +1239,7 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	if(is_legacy_delivery_system(c->delivery_system)) {
 
 		dprintk("%s() legacy, modulation = %d\n", __func__, c->modulation);
-		dtv_property_legacy_params_sync(fe);
+		dtv_property_legacy_params_sync(fe, &fepriv->parameters_in);
 
 	} else {
 		dprintk("%s() adv, modulation = %d\n", __func__, c->modulation);
@@ -1246,6 +1254,58 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	}
 }
 
+/**
+ * dtv_get_frontend - calls a callback for retrieving DTV parameters
+ * @fe:		struct dvb_frontend pointer
+ * @c:		struct dtv_frontend_properties pointer (DVBv5 cache)
+ * @p_out	struct dvb_frontend_parameters pointer (DVBv3 FE struct)
+ *
+ * This routine calls either the DVBv3 or DVBv5 get_frontend call.
+ * If c is not null, it will update the DVBv5 cache struct pointed by it.
+ * If p_out is not null, it will update the DVBv3 params pointed by it.
+ */
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out)
+{
+	const struct dtv_frontend_properties *cache = &fe->dtv_property_cache;
+	struct dtv_frontend_properties tmp_cache;
+	struct dvb_frontend_parameters tmp_out;
+	bool fill_cache = (c != NULL);
+	bool fill_params = (p_out != NULL);
+	int r;
+
+	if (!p_out)
+		p_out = & tmp_out;
+
+	if (!c)
+		c = &tmp_cache;
+	else
+		memcpy(c, cache, sizeof(*c));
+
+	/* Then try the DVBv5 one */
+	if (fe->ops.get_frontend) {
+		r = fe->ops.get_frontend(fe, c);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_params)
+			dtv_property_legacy_params_sync(fe, p_out);
+		return 0;
+	}
+
+	/* As no DVBv5 call exists, use the DVBv3 one */
+	if (fe->ops.get_frontend_legacy) {
+		r = fe->ops.get_frontend_legacy(fe, p_out);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_cache)
+			dtv_property_cache_sync(fe, c, p_out);
+		return 0;
+	}
+
+	return -EOPNOTSUPP;
+}
+
 static int dvb_frontend_ioctl_legacy(struct file *file,
 			unsigned int cmd, void *parg);
 static int dvb_frontend_ioctl_properties(struct file *file,
@@ -1296,24 +1356,12 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 }
 
 static int dtv_property_process_get(struct dvb_frontend *fe,
+				    const struct dtv_frontend_properties *c,
 				    struct dtv_property *tvp,
 				    struct file *file)
 {
-	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dtv_frontend_properties cdetected;
 	int r;
 
-	/*
-	 * If the driver implements a get_frontend function, then convert
-	 * detected parameters to S2API properties.
-	 */
-	if (fe->ops.get_frontend) {
-		cdetected = *c;
-		dtv_property_cache_sync(fe, &cdetected, &fepriv->parameters_out);
-		c = &cdetected;
-	}
-
 	switch(tvp->cmd) {
 	case DTV_ENUM_DELSYS:
 		dtv_set_default_delivery_caps(fe, tvp);
@@ -1685,6 +1733,7 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 
 	} else
 	if(cmd == FE_GET_PROPERTY) {
+		struct dtv_frontend_properties cache_out;
 
 		tvps = (struct dtv_properties __user *)parg;
 
@@ -1707,8 +1756,13 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 			goto out;
 		}
 
Quoted 9 lines

drivers/media/dvb/dvb-core/dvb_frontend.c static int dvb_frontend_ioctl_properties(struct file *file, · line 1763

Quoted 5 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +5 -0
+		/*
+		 * Fills the cache out struct with the cache contents, plus
+		 * the data retrieved from get_frontend/get_frontend_legacy.
+		 */
+		dtv_get_frontend(fe, &cache_out, NULL);

Unlike before, this code actually calls the get_frontend driver callback, causing unwanted I2C traffic for every property. Please drop this behavioural change.

Look again: get_frontend() is called only once, when the user requests FE_GET_PROPERTY.

This will only generate i2c traffic if the frontend implements get_frontend, and if it needs to retrieve something from the hardware.

Btw, there's an optimization on it done by patch 83/91 [1]: if the driver doesn't implement get_frontend, it should return the cached values.

[1] http://patchwork.linuxtv.org/patch/9057/

Quoted 5 lines

Btw, this doesn't match the patch description.

drivers/media/dvb/dvb-core/dvb_frontend.c static int dvb_frontend_ioctl_properties(struct file *file, · line 1765

Quoted 3 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +1 -1
 		for (i = 0; i < tvps->num; i++) {
-			err = dtv_property_process_get(fe, tvp + i, file);
+			err = dtv_property_process_get(fe, &cache_out, tvp + i, file);

This loop will sync the data from the cache into the users data, but it won't call get_frontend().

Btw, if you take a look inside dtv_property_process_get(), you'll see that get_property() is called every time, for each property.

So, the basic difference is that get_property() will serialize for every property, while get_frontend() is called only once.

Quoted 915 lines
Quoted 902 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +4 -4
 			if (err < 0)
 				goto out;
 			(tvp + i)->result = err;
@@ -2008,10 +2062,10 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 		break;
 
 	case FE_GET_FRONTEND:
-		if (fe->ops.get_frontend) {
-			err = fe->ops.get_frontend(fe, &fepriv->parameters_out);
-			memcpy(parg, &fepriv->parameters_out, sizeof(struct dvb_frontend_parameters));
-		}
+		err = dtv_get_frontend(fe, NULL, &fepriv->parameters_out);
+		if (err >= 0)
+			memcpy(parg, &fepriv->parameters_out,
+			       sizeof(struct dvb_frontend_parameters));
 		break;
 
 	case FE_SET_FRONTEND_TUNE_MODE:
drivers/media/dvb/dvb-core/dvb_frontend.h +4 -1
index dd44964..06ec17a 100644
@@ -256,6 +256,8 @@ struct analog_demod_ops {
 	int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
 };
 
+struct dtv_frontend_properties;
+
 struct dvb_frontend_ops {
 
 	struct dvb_frontend_info info;
@@ -284,7 +286,8 @@ struct dvb_frontend_ops {
 	int (*set_frontend)(struct dvb_frontend* fe);
 	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 (*get_frontend_legacy)(struct dvb_frontend *fe, struct dvb_frontend_parameters *params);
+	int (*get_frontend)(struct dvb_frontend *fe, struct dtv_frontend_properties *props);
 
 	int (*read_status)(struct dvb_frontend* fe, fe_status_t* status);
 	int (*read_ber)(struct dvb_frontend* fe, u32* ber);
drivers/media/dvb/dvb-usb/af9005-fe.c +2 -2
index f216933..e9addd8 100644
@@ -1239,7 +1239,7 @@ static int af9005_fe_get_frontend(struct dvb_frontend *fe,
 				      &temp);
 	if (ret)
 		return ret;
-	deb_info("===== fe_get_frontend ==============\n");
+	deb_info("===== fe_get_frontend_legacy = =============\n");
 	deb_info("CONSTELLATION ");
 	switch (temp) {
 	case 0:
@@ -1476,7 +1476,7 @@ static struct dvb_frontend_ops af9005_fe_ops = {
 	.ts_bus_ctrl = af9005_ts_bus_ctrl,
 
 	.set_frontend_legacy = af9005_fe_set_frontend,
-	.get_frontend = af9005_fe_get_frontend,
+	.get_frontend_legacy = af9005_fe_get_frontend,
 
 	.read_status = af9005_fe_read_status,
 	.read_ber = af9005_fe_read_ber,
drivers/media/dvb/dvb-usb/cinergyT2-fe.c +1 -1
index cad2284..40d50f7 100644
@@ -341,7 +341,7 @@ static struct dvb_frontend_ops cinergyt2_fe_ops = {
 	.sleep			= cinergyt2_fe_sleep,
 
 	.set_frontend_legacy		= cinergyt2_fe_set_frontend,
-	.get_frontend		= cinergyt2_fe_get_frontend,
+	.get_frontend_legacy = cinergyt2_fe_get_frontend,
 	.get_tune_settings	= cinergyt2_fe_get_tune_settings,
 
 	.read_status		= cinergyt2_fe_read_status,
drivers/media/dvb/dvb-usb/dtt200u-fe.c +1 -1
index ef9f7e4..7ce8227 100644
@@ -194,7 +194,7 @@ static struct dvb_frontend_ops dtt200u_fe_ops = {
 	.sleep = dtt200u_fe_sleep,
 
 	.set_frontend_legacy = dtt200u_fe_set_frontend,
-	.get_frontend = dtt200u_fe_get_frontend,
+	.get_frontend_legacy = dtt200u_fe_get_frontend,
 	.get_tune_settings = dtt200u_fe_get_tune_settings,
 
 	.read_status = dtt200u_fe_read_status,
drivers/media/dvb/dvb-usb/friio-fe.c +1 -1
index c98e2cc..7973aaf 100644
@@ -467,7 +467,7 @@ static struct dvb_frontend_ops jdvbt90502_ops = {
 	.set_property = jdvbt90502_set_property,
 
 	.set_frontend_legacy = jdvbt90502_set_frontend,
-	.get_frontend = jdvbt90502_get_frontend,
+	.get_frontend_legacy = jdvbt90502_get_frontend,
 
 	.read_status = jdvbt90502_read_status,
 	.read_signal_strength = jdvbt90502_read_signal_strength,
drivers/media/dvb/dvb-usb/mxl111sf-demod.c +1 -1
index 6639d3a..b798cc8 100644
@@ -571,7 +571,7 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = {
 	.i2c_gate_ctrl        = mxl111sf_i2c_gate_ctrl,
 #endif
 	.set_frontend_legacy         = mxl111sf_demod_set_frontend,
-	.get_frontend         = mxl111sf_demod_get_frontend,
+	.get_frontend_legacy = mxl111sf_demod_get_frontend,
 	.get_tune_settings    = mxl111sf_demod_get_tune_settings,
 	.read_status          = mxl111sf_demod_read_status,
 	.read_signal_strength = mxl111sf_demod_read_signal_strength,
drivers/media/dvb/dvb-usb/vp702x-fe.c +1 -1
index ee2177e..8ff5aab 100644
@@ -371,7 +371,7 @@ static struct dvb_frontend_ops vp702x_fe_ops = {
 	.sleep = vp702x_fe_sleep,
 
 	.set_frontend_legacy = vp702x_fe_set_frontend,
-	.get_frontend = vp702x_fe_get_frontend,
+	.get_frontend_legacy = vp702x_fe_get_frontend,
 	.get_tune_settings = vp702x_fe_get_tune_settings,
 
 	.read_status = vp702x_fe_read_status,
drivers/media/dvb/dvb-usb/vp7045-fe.c +1 -1
index 4f708c7..f8b5d8c 100644
@@ -181,7 +181,7 @@ static struct dvb_frontend_ops vp7045_fe_ops = {
 	.sleep = vp7045_fe_sleep,
 
 	.set_frontend_legacy = vp7045_fe_set_frontend,
-	.get_frontend = vp7045_fe_get_frontend,
+	.get_frontend_legacy = vp7045_fe_get_frontend,
 	.get_tune_settings = vp7045_fe_get_tune_settings,
 
 	.read_status = vp7045_fe_read_status,
drivers/media/dvb/firewire/firedtv-fe.c +1 -1
index a887abc..1eb5ad3 100644
@@ -174,7 +174,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name)
 	ops->sleep			= fdtv_sleep;
 
 	ops->set_frontend_legacy	= fdtv_set_frontend;
-	ops->get_frontend		= fdtv_get_frontend;
+	ops->get_frontend_legacy = fdtv_get_frontend;
 
 	ops->get_property		= fdtv_get_property;
 	ops->set_property		= fdtv_set_property;
drivers/media/dvb/frontends/af9013.c +1 -1
index a041d7f..540ed0f 100644
@@ -1530,7 +1530,7 @@ static struct dvb_frontend_ops af9013_ops = {
 	.i2c_gate_ctrl = af9013_i2c_gate_ctrl,
 
 	.set_frontend_legacy = af9013_set_frontend,
-	.get_frontend = af9013_get_frontend,
+	.get_frontend_legacy = af9013_get_frontend,
 
 	.get_tune_settings = af9013_get_tune_settings,
 
drivers/media/dvb/frontends/atbm8830.c +1 -1
index 5fc30f3..c4e0909 100644
@@ -450,7 +450,7 @@ static struct dvb_frontend_ops atbm8830_ops = {
 	.i2c_gate_ctrl = atbm8830_i2c_gate_ctrl,
 
 	.set_frontend_legacy = atbm8830_set_fe,
-	.get_frontend = atbm8830_get_fe,
+	.get_frontend_legacy = atbm8830_get_fe,
 	.get_tune_settings = atbm8830_get_tune_settings,
 
 	.read_status = atbm8830_read_status,
drivers/media/dvb/frontends/au8522_dig.c +1 -1
index 4b74cc8..327d6fe 100644
@@ -1024,7 +1024,7 @@ static struct dvb_frontend_ops au8522_ops = {
 	.sleep                = au8522_sleep,
 	.i2c_gate_ctrl        = au8522_i2c_gate_ctrl,
 	.set_frontend_legacy         = au8522_set_frontend,
-	.get_frontend         = au8522_get_frontend,
+	.get_frontend_legacy = au8522_get_frontend,
 	.get_tune_settings    = au8522_get_tune_settings,
 	.read_status          = au8522_read_status,
 	.read_ber             = au8522_read_ber,
drivers/media/dvb/frontends/cx22700.c +1 -1
index ce1e74f..7ac95de 100644
@@ -420,7 +420,7 @@ static struct dvb_frontend_ops cx22700_ops = {
 	.i2c_gate_ctrl = cx22700_i2c_gate_ctrl,
 
 	.set_frontend_legacy = cx22700_set_frontend,
-	.get_frontend = cx22700_get_frontend,
+	.get_frontend_legacy = cx22700_get_frontend,
 	.get_tune_settings = cx22700_get_tune_settings,
 
 	.read_status = cx22700_read_status,
drivers/media/dvb/frontends/cx22702.c +1 -1
index 2cea13e..a04cff8 100644
@@ -623,7 +623,7 @@ static const struct dvb_frontend_ops cx22702_ops = {
 	.i2c_gate_ctrl = cx22702_i2c_gate_ctrl,
 
 	.set_frontend_legacy = cx22702_set_tps,
-	.get_frontend = cx22702_get_frontend,
+	.get_frontend_legacy = cx22702_get_frontend,
 	.get_tune_settings = cx22702_get_tune_settings,
 
 	.read_status = cx22702_read_status,
drivers/media/dvb/frontends/cx24110.c +1 -1
index c75f9da..278034d 100644
@@ -644,7 +644,7 @@ static struct dvb_frontend_ops cx24110_ops = {
 	.init = cx24110_initfe,
 	.write = _cx24110_pll_write,
 	.set_frontend_legacy = cx24110_set_frontend,
-	.get_frontend = cx24110_get_frontend,
+	.get_frontend_legacy = cx24110_get_frontend,
 	.read_status = cx24110_read_status,
 	.read_ber = cx24110_read_ber,
 	.read_signal_strength = cx24110_read_signal_strength,
drivers/media/dvb/frontends/cx24123.c +1 -1
index 1342429..96f99a8 100644
@@ -1147,7 +1147,7 @@ static struct dvb_frontend_ops cx24123_ops = {
 
 	.init = cx24123_initfe,
 	.set_frontend_legacy = cx24123_set_frontend,
-	.get_frontend = cx24123_get_frontend,
+	.get_frontend_legacy = cx24123_get_frontend,
 	.read_status = cx24123_read_status,
 	.read_ber = cx24123_read_ber,
 	.read_signal_strength = cx24123_read_signal_strength,
drivers/media/dvb/frontends/cxd2820r_core.c +2 -2
index e8ace56..97bc353 100644
@@ -823,7 +823,7 @@ static const struct dvb_frontend_ops cxd2820r_ops[2] = {
 		.get_tune_settings = cxd2820r_get_tune_settings,
 		.i2c_gate_ctrl = cxd2820r_i2c_gate_ctrl,
 
-		.get_frontend = cxd2820r_get_frontend,
+		.get_frontend_legacy = cxd2820r_get_frontend,
 
 		.get_frontend_algo = cxd2820r_get_frontend_algo,
 		.search = cxd2820r_search,
@@ -853,7 +853,7 @@ static const struct dvb_frontend_ops cxd2820r_ops[2] = {
 		.i2c_gate_ctrl = cxd2820r_i2c_gate_ctrl,
 
 		.set_frontend_legacy = cxd2820r_set_frontend,
-		.get_frontend = cxd2820r_get_frontend,
+		.get_frontend_legacy = cxd2820r_get_frontend,
 
 		.read_status = cxd2820r_read_status,
 		.read_snr = cxd2820r_read_snr,
drivers/media/dvb/frontends/dib3000mb.c +1 -1
index 987eb17..77af240 100644
@@ -817,7 +817,7 @@ static struct dvb_frontend_ops dib3000mb_ops = {
 	.sleep = dib3000mb_sleep,
 
 	.set_frontend_legacy = dib3000mb_set_frontend_and_tuner,
-	.get_frontend = dib3000mb_get_frontend,
+	.get_frontend_legacy = dib3000mb_get_frontend,
 	.get_tune_settings = dib3000mb_fe_get_tune_settings,
 
 	.read_status = dib3000mb_read_status,
drivers/media/dvb/frontends/dib3000mc.c +1 -1
index 19fca6e..7ec0e02 100644
@@ -920,7 +920,7 @@ static struct dvb_frontend_ops dib3000mc_ops = {
 
 	.set_frontend_legacy         = dib3000mc_set_frontend,
 	.get_tune_settings    = dib3000mc_fe_get_tune_settings,
-	.get_frontend         = dib3000mc_get_frontend,
+	.get_frontend_legacy = dib3000mc_get_frontend,
 
 	.read_status          = dib3000mc_read_status,
 	.read_ber             = dib3000mc_read_ber,
drivers/media/dvb/frontends/dib7000m.c +1 -1
index cc6a710..45c1105 100644
@@ -1453,7 +1453,7 @@ static struct dvb_frontend_ops dib7000m_ops = {
 
 	.set_frontend_legacy         = dib7000m_set_frontend,
 	.get_tune_settings    = dib7000m_fe_get_tune_settings,
-	.get_frontend         = dib7000m_get_frontend,
+	.get_frontend_legacy = dib7000m_get_frontend,
 
 	.read_status          = dib7000m_read_status,
 	.read_ber             = dib7000m_read_ber,
drivers/media/dvb/frontends/dib7000p.c +1 -1
index 1e81b5b..feb82b0 100644
@@ -2441,7 +2441,7 @@ static struct dvb_frontend_ops dib7000p_ops = {
 
 	.set_frontend_legacy = dib7000p_set_frontend,
 	.get_tune_settings = dib7000p_fe_get_tune_settings,
-	.get_frontend = dib7000p_get_frontend,
+	.get_frontend_legacy = dib7000p_get_frontend,
 
 	.read_status = dib7000p_read_status,
 	.read_ber = dib7000p_read_ber,
drivers/media/dvb/frontends/dib8000.c +2 -2
index f9c98ba..9860062 100644
@@ -2824,7 +2824,7 @@ static int dib8000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 		if (stat&FE_HAS_SYNC) {
 			dprintk("TMCC lock on the slave%i", index_frontend);
 			/* synchronize the cache with the other frontends */
-			state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], fep);
+			state->fe[index_frontend]->ops.get_frontend_legacy(state->fe[index_frontend], fep);
 			for (sub_index_frontend = 0; (sub_index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[sub_index_frontend] != NULL); sub_index_frontend++) {
 				if (sub_index_frontend != index_frontend) {
 					state->fe[sub_index_frontend]->dtv_property_cache.isdbt_sb_mode = state->fe[index_frontend]->dtv_property_cache.isdbt_sb_mode;
@@ -3481,7 +3481,7 @@ static const struct dvb_frontend_ops dib8000_ops = {
 
 	.set_frontend_legacy = dib8000_set_frontend,
 	.get_tune_settings = dib8000_fe_get_tune_settings,
-	.get_frontend = dib8000_get_frontend,
+	.get_frontend_legacy = dib8000_get_frontend,
 
 	.read_status = dib8000_read_status,
 	.read_ber = dib8000_read_ber,
drivers/media/dvb/frontends/dib9000.c +2 -2
index c7b4910..4d82a4a 100644
@@ -1883,7 +1883,7 @@ static int dib9000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 			dprintk("TPS lock on the slave%i", index_frontend);
 
 			/* synchronize the cache with the other frontends */
-			state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], fep);
+			state->fe[index_frontend]->ops.get_frontend_legacy(state->fe[index_frontend], fep);
 			for (sub_index_frontend = 0; (sub_index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[sub_index_frontend] != NULL);
 			     sub_index_frontend++) {
 				if (sub_index_frontend != index_frontend) {
@@ -2515,7 +2515,7 @@ static struct dvb_frontend_ops dib9000_ops = {
 
 	.set_frontend_legacy = dib9000_set_frontend,
 	.get_tune_settings = dib9000_fe_get_tune_settings,
-	.get_frontend = dib9000_get_frontend,
+	.get_frontend_legacy = dib9000_get_frontend,
 
 	.read_status = dib9000_read_status,
 	.read_ber = dib9000_read_ber,
drivers/media/dvb/frontends/drxd_hard.c +1 -1
index 8118bb3..ca05a24 100644
@@ -2957,7 +2957,7 @@ static struct dvb_frontend_ops drxd_ops = {
 	.i2c_gate_ctrl = drxd_i2c_gate_ctrl,
 
 	.set_frontend_legacy = drxd_set_frontend,
-	.get_frontend = drxd_get_frontend,
+	.get_frontend_legacy = drxd_get_frontend,
 	.get_tune_settings = drxd_get_tune_settings,
 
 	.read_status = drxd_read_status,
drivers/media/dvb/frontends/drxk_hard.c +2 -2
index 1205944..2299e1d3 100644
@@ -6407,7 +6407,7 @@ static struct dvb_frontend_ops drxk_c_ops = {
 	.i2c_gate_ctrl = drxk_gate_ctrl,
 
 	.set_frontend_legacy = drxk_set_parameters,
-	.get_frontend = drxk_c_get_frontend,
+	.get_frontend_legacy = drxk_c_get_frontend,
 	.get_property = drxk_c_get_property,
 	.get_tune_settings = drxk_c_get_tune_settings,
 
@@ -6440,7 +6440,7 @@ static struct dvb_frontend_ops drxk_t_ops = {
 	.i2c_gate_ctrl = drxk_gate_ctrl,
 
 	.set_frontend_legacy = drxk_set_parameters,
-	.get_frontend = drxk_t_get_frontend,
+	.get_frontend_legacy = drxk_t_get_frontend,
 	.get_property = drxk_t_get_property,
 
 	.read_status = drxk_read_status,
drivers/media/dvb/frontends/dvb_dummy_fe.c +3 -3
index 322bcd7..31e1dd6 100644
@@ -193,7 +193,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
 	.sleep = dvb_dummy_fe_sleep,
 
 	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
-	.get_frontend = dvb_dummy_fe_get_frontend,
+	.get_frontend_legacy = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
 	.read_ber = dvb_dummy_fe_read_ber,
@@ -223,7 +223,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
 	.sleep = dvb_dummy_fe_sleep,
 
 	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
-	.get_frontend = dvb_dummy_fe_get_frontend,
+	.get_frontend_legacy = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
 	.read_ber = dvb_dummy_fe_read_ber,
@@ -255,7 +255,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
 	.sleep = dvb_dummy_fe_sleep,
 
 	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
-	.get_frontend = dvb_dummy_fe_get_frontend,
+	.get_frontend_legacy = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
 	.read_ber = dvb_dummy_fe_read_ber,
drivers/media/dvb/frontends/it913x-fe.c +1 -1
index 54d8534..a13f897 100644
@@ -940,7 +940,7 @@ static struct dvb_frontend_ops it913x_fe_ofdm_ops = {
 	.sleep = it913x_fe_sleep,
 
 	.set_frontend_legacy = it913x_fe_set_frontend,
-	.get_frontend = it913x_fe_get_frontend,
+	.get_frontend_legacy = it913x_fe_get_frontend,
 
 	.read_status = it913x_fe_read_status,
 	.read_signal_strength = it913x_fe_read_signal_strength,
drivers/media/dvb/frontends/l64781.c +1 -1
index fd4170a..1f1c598 100644
@@ -585,7 +585,7 @@ static struct dvb_frontend_ops l64781_ops = {
 	.sleep = l64781_sleep,
 
 	.set_frontend_legacy = apply_frontend_param,
-	.get_frontend = get_frontend,
+	.get_frontend_legacy = get_frontend,
 	.get_tune_settings = l64781_get_tune_settings,
 
 	.read_status = l64781_read_status,
drivers/media/dvb/frontends/lgdt3305.c +2 -2
index 8f15178..e1a9c92 100644
@@ -1177,7 +1177,7 @@ static struct dvb_frontend_ops lgdt3304_ops = {
 	.i2c_gate_ctrl        = lgdt3305_i2c_gate_ctrl,
 	.init                 = lgdt3305_init,
 	.set_frontend_legacy         = lgdt3304_set_parameters,
-	.get_frontend         = lgdt3305_get_frontend,
+	.get_frontend_legacy = lgdt3305_get_frontend,
 	.get_tune_settings    = lgdt3305_get_tune_settings,
 	.read_status          = lgdt3305_read_status,
 	.read_ber             = lgdt3305_read_ber,
@@ -1200,7 +1200,7 @@ static struct dvb_frontend_ops lgdt3305_ops = {
 	.init                 = lgdt3305_init,
 	.sleep                = lgdt3305_sleep,
 	.set_frontend_legacy         = lgdt3305_set_parameters,
-	.get_frontend         = lgdt3305_get_frontend,
+	.get_frontend_legacy = lgdt3305_get_frontend,
 	.get_tune_settings    = lgdt3305_get_tune_settings,
 	.read_status          = lgdt3305_read_status,
 	.read_ber             = lgdt3305_read_ber,
drivers/media/dvb/frontends/lgdt330x.c +2 -2
index bdae349..21bffc0 100644
@@ -774,7 +774,7 @@ static struct dvb_frontend_ops lgdt3302_ops = {
 	},
 	.init                 = lgdt330x_init,
 	.set_frontend_legacy         = lgdt330x_set_parameters,
-	.get_frontend         = lgdt330x_get_frontend,
+	.get_frontend_legacy = lgdt330x_get_frontend,
 	.get_tune_settings    = lgdt330x_get_tune_settings,
 	.read_status          = lgdt3302_read_status,
 	.read_ber             = lgdt330x_read_ber,
@@ -797,7 +797,7 @@ static struct dvb_frontend_ops lgdt3303_ops = {
 	},
 	.init                 = lgdt330x_init,
 	.set_frontend_legacy         = lgdt330x_set_parameters,
-	.get_frontend         = lgdt330x_get_frontend,
+	.get_frontend_legacy = lgdt330x_get_frontend,
 	.get_tune_settings    = lgdt330x_get_tune_settings,
 	.read_status          = lgdt3303_read_status,
 	.read_ber             = lgdt330x_read_ber,
drivers/media/dvb/frontends/lgs8gl5.c +1 -1
index 65a5c5d..f4e82a6 100644
@@ -435,7 +435,7 @@ static struct dvb_frontend_ops lgs8gl5_ops = {
 	.init = lgs8gl5_init,
 
 	.set_frontend_legacy = lgs8gl5_set_frontend,
-	.get_frontend = lgs8gl5_get_frontend,
+	.get_frontend_legacy = lgs8gl5_get_frontend,
 	.get_tune_settings = lgs8gl5_get_tune_settings,
 
 	.read_status = lgs8gl5_read_status,
drivers/media/dvb/frontends/lgs8gxx.c +1 -1
index 5684b61..05bfa05 100644
@@ -1014,7 +1014,7 @@ static struct dvb_frontend_ops lgs8gxx_ops = {
 	.i2c_gate_ctrl = lgs8gxx_i2c_gate_ctrl,
 
 	.set_frontend_legacy = lgs8gxx_set_fe,
-	.get_frontend = lgs8gxx_get_fe,
+	.get_frontend_legacy = lgs8gxx_get_fe,
 	.get_tune_settings = lgs8gxx_get_tune_settings,
 
 	.read_status = lgs8gxx_read_status,
drivers/media/dvb/frontends/mb86a20s.c +1 -1
index 3ae6d1f..2dfea6c 100644
@@ -628,7 +628,7 @@ static struct dvb_frontend_ops mb86a20s_ops = {
 
 	.init = mb86a20s_initfe,
 	.set_frontend_legacy = mb86a20s_set_frontend,
-	.get_frontend = mb86a20s_get_frontend,
+	.get_frontend_legacy = mb86a20s_get_frontend,
 	.read_status = mb86a20s_read_status,
 	.read_signal_strength = mb86a20s_read_signal_strength,
 	.tune = mb86a20s_tune,
drivers/media/dvb/frontends/mt312.c +1 -1
index efae45f..8f5d2d2 100644
@@ -762,7 +762,7 @@ static struct dvb_frontend_ops mt312_ops = {
 	.i2c_gate_ctrl = mt312_i2c_gate_ctrl,
 
 	.set_frontend_legacy = mt312_set_frontend,
-	.get_frontend = mt312_get_frontend,
+	.get_frontend_legacy = mt312_get_frontend,
 	.get_tune_settings = mt312_get_tune_settings,
 
 	.read_status = mt312_read_status,
drivers/media/dvb/frontends/mt352.c +1 -1
index 2bd68c5..021108d 100644
@@ -593,7 +593,7 @@ static struct dvb_frontend_ops mt352_ops = {
 	.write = _mt352_write,
 
 	.set_frontend_legacy = mt352_set_parameters,
-	.get_frontend = mt352_get_parameters,
+	.get_frontend_legacy = mt352_get_parameters,
 	.get_tune_settings = mt352_get_tune_settings,
 
 	.read_status = mt352_read_status,
drivers/media/dvb/frontends/or51132.c +1 -1
index 461f9fd..e0c952c 100644
@@ -598,7 +598,7 @@ static struct dvb_frontend_ops or51132_ops = {
 	.sleep = or51132_sleep,
 
 	.set_frontend_legacy = or51132_set_parameters,
-	.get_frontend = or51132_get_parameters,
+	.get_frontend_legacy = or51132_get_parameters,
 	.get_tune_settings = or51132_get_tune_settings,
 
 	.read_status = or51132_read_status,
drivers/media/dvb/frontends/s5h1409.c +1 -1
index 0b6e6c5..f39216c 100644
@@ -1009,7 +1009,7 @@ static struct dvb_frontend_ops s5h1409_ops = {
 	.init                 = s5h1409_init,
 	.i2c_gate_ctrl        = s5h1409_i2c_gate_ctrl,
 	.set_frontend_legacy         = s5h1409_set_frontend,
-	.get_frontend         = s5h1409_get_frontend,
+	.get_frontend_legacy = s5h1409_get_frontend,
 	.get_tune_settings    = s5h1409_get_tune_settings,
 	.read_status          = s5h1409_read_status,
 	.read_ber             = s5h1409_read_ber,
drivers/media/dvb/frontends/s5h1411.c +1 -1
index 67ab85c..cb221aa 100644
@@ -929,7 +929,7 @@ static struct dvb_frontend_ops s5h1411_ops = {
 	.sleep                = s5h1411_sleep,
 	.i2c_gate_ctrl        = s5h1411_i2c_gate_ctrl,
 	.set_frontend_legacy         = s5h1411_set_frontend,
-	.get_frontend         = s5h1411_get_frontend,
+	.get_frontend_legacy = s5h1411_get_frontend,
 	.get_tune_settings    = s5h1411_get_tune_settings,
 	.read_status          = s5h1411_read_status,
 	.read_ber             = s5h1411_read_ber,
drivers/media/dvb/frontends/s5h1420.c +1 -1
index e2cecf4..44ec27d 100644
@@ -961,7 +961,7 @@ static struct dvb_frontend_ops s5h1420_ops = {
 	.i2c_gate_ctrl = s5h1420_i2c_gate_ctrl,
 
 	.set_frontend_legacy = s5h1420_set_frontend,
-	.get_frontend = s5h1420_get_frontend,
+	.get_frontend_legacy = s5h1420_get_frontend,
 	.get_tune_settings = s5h1420_get_tune_settings,
 
 	.read_status = s5h1420_read_status,
drivers/media/dvb/frontends/s5h1432.c +1 -1
index a0dbbdc..f22c71e 100644
@@ -397,7 +397,7 @@ static struct dvb_frontend_ops s5h1432_ops = {
 	.init = s5h1432_init,
 	.sleep = s5h1432_sleep,
 	.set_frontend_legacy = s5h1432_set_frontend,
-	.get_frontend = s5h1432_get_frontend,
+	.get_frontend_legacy = s5h1432_get_frontend,
 	.get_tune_settings = s5h1432_get_tune_settings,
 	.read_status = s5h1432_read_status,
 	.read_ber = s5h1432_read_ber,
drivers/media/dvb/frontends/s921.c +1 -1
index 6615979..5e8f2a8 100644
@@ -535,7 +535,7 @@ static struct dvb_frontend_ops s921_ops = {
 
 	.init = s921_initfe,
 	.set_frontend_legacy = s921_set_frontend,
-	.get_frontend = s921_get_frontend,
+	.get_frontend_legacy = s921_get_frontend,
 	.read_status = s921_read_status,
 	.read_signal_strength = s921_read_signal_strength,
 	.tune = s921_tune,
drivers/media/dvb/frontends/stb0899_drv.c +1 -1
index 9c93d9f..9fa31d5 100644
@@ -1648,7 +1648,7 @@ static struct dvb_frontend_ops stb0899_ops = {
 	.get_frontend_algo		= stb0899_frontend_algo,
 	.search				= stb0899_search,
 	.track				= stb0899_track,
-	.get_frontend			= stb0899_get_frontend,
+	.get_frontend_legacy = stb0899_get_frontend,
 
 
 	.read_status			= stb0899_read_status,
drivers/media/dvb/frontends/stb6100.c +2 -2
index bc1a8af..7f68fd3 100644
@@ -335,9 +335,9 @@ static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency)
 
 	dprintk(verbose, FE_DEBUG, 1, "Version 2010-8-14 13:51");
 
-	if (fe->ops.get_frontend) {
+	if (fe->ops.get_frontend_legacy) {
 		dprintk(verbose, FE_DEBUG, 1, "Get frontend parameters");
-		fe->ops.get_frontend(fe, &p);
+		fe->ops.get_frontend_legacy(fe, &p);
 	}
 	srate = p.u.qpsk.symbol_rate;
 
drivers/media/dvb/frontends/stv0297.c +1 -1
index 63a3e1b..5d7c288 100644
@@ -707,7 +707,7 @@ static struct dvb_frontend_ops stv0297_ops = {
 	.i2c_gate_ctrl = stv0297_i2c_gate_ctrl,
 
 	.set_frontend_legacy = stv0297_set_frontend,
-	.get_frontend = stv0297_get_frontend,
+	.get_frontend_legacy = stv0297_get_frontend,
 
 	.read_status = stv0297_read_status,
 	.read_ber = stv0297_read_ber,
drivers/media/dvb/frontends/stv0299.c +1 -1
index 4f248e1..6aeabaf 100644
@@ -730,7 +730,7 @@ static struct dvb_frontend_ops stv0299_ops = {
 	.i2c_gate_ctrl = stv0299_i2c_gate_ctrl,
 
 	.set_frontend_legacy = stv0299_set_frontend,
-	.get_frontend = stv0299_get_frontend,
+	.get_frontend_legacy = stv0299_get_frontend,
 	.get_tune_settings = stv0299_get_tune_settings,
 
 	.read_status = stv0299_read_status,
drivers/media/dvb/frontends/stv0367.c +2 -2
index 7752d13..e0a2438 100644
@@ -2286,7 +2286,7 @@ static struct dvb_frontend_ops stv0367ter_ops = {
 	.sleep = stv0367ter_sleep,
 	.i2c_gate_ctrl = stv0367ter_gate_ctrl,
 	.set_frontend_legacy = stv0367ter_set_frontend,
-	.get_frontend = stv0367ter_get_frontend,
+	.get_frontend_legacy = stv0367ter_get_frontend,
 	.get_tune_settings = stv0367_get_tune_settings,
 	.read_status = stv0367ter_read_status,
 	.read_ber = stv0367ter_read_ber,/* too slow */
@@ -3404,7 +3404,7 @@ static struct dvb_frontend_ops stv0367cab_ops = {
 	.sleep					= stv0367cab_sleep,
 	.i2c_gate_ctrl				= stv0367cab_gate_ctrl,
 	.set_frontend_legacy				= stv0367cab_set_frontend,
-	.get_frontend				= stv0367cab_get_frontend,
+	.get_frontend_legacy = stv0367cab_get_frontend,
 	.read_status				= stv0367cab_read_status,
 /*	.read_ber				= stv0367cab_read_ber, */
 	.read_signal_strength			= stv0367cab_read_strength,
drivers/media/dvb/frontends/stv0900_core.c +1 -1
index 2b8d78c..df46654 100644
@@ -1908,7 +1908,7 @@ static struct dvb_frontend_ops stv0900_ops = {
 	},
 	.release			= stv0900_release,
 	.init				= stv0900_init,
-	.get_frontend                   = stv0900_get_frontend,
+	.get_frontend_legacy = stv0900_get_frontend,
 	.sleep				= stv0900_sleep,
 	.get_frontend_algo		= stv0900_frontend_algo,
 	.i2c_gate_ctrl			= stv0900_i2c_gate_ctrl,
drivers/media/dvb/frontends/tda10021.c +1 -1
index 0bbf681..3976d22 100644
@@ -525,7 +525,7 @@ static struct dvb_frontend_ops tda10021_ops = {
 	.i2c_gate_ctrl = tda10021_i2c_gate_ctrl,
 
 	.set_frontend_legacy = tda10021_set_parameters,
-	.get_frontend = tda10021_get_frontend,
+	.get_frontend_legacy = tda10021_get_frontend,
 	.get_property = tda10021_get_property,
 
 	.read_status = tda10021_read_status,
drivers/media/dvb/frontends/tda10023.c +1 -1
index f79841b..de535a4 100644
@@ -610,7 +610,7 @@ static struct dvb_frontend_ops tda10023_ops = {
 	.i2c_gate_ctrl = tda10023_i2c_gate_ctrl,
 
 	.set_frontend_legacy = tda10023_set_parameters,
-	.get_frontend = tda10023_get_frontend,
+	.get_frontend_legacy = tda10023_get_frontend,
 	.get_property = tda10023_get_property,
 	.read_status = tda10023_read_status,
 	.read_ber = tda10023_read_ber,
drivers/media/dvb/frontends/tda10048.c +1 -1
index 479ff85..bba249b 100644
@@ -1189,7 +1189,7 @@ static struct dvb_frontend_ops tda10048_ops = {
 	.init = tda10048_init,
 	.i2c_gate_ctrl = tda10048_i2c_gate_ctrl,
 	.set_frontend_legacy = tda10048_set_frontend,
-	.get_frontend = tda10048_get_frontend,
+	.get_frontend_legacy = tda10048_get_frontend,
 	.get_tune_settings = tda10048_get_tune_settings,
 	.read_status = tda10048_read_status,
 	.read_ber = tda10048_read_ber,
drivers/media/dvb/frontends/tda1004x.c +2 -2
index dd41057..2dbb070 100644
@@ -1252,7 +1252,7 @@ static struct dvb_frontend_ops tda10045_ops = {
 	.i2c_gate_ctrl = tda1004x_i2c_gate_ctrl,
 
 	.set_frontend_legacy = tda1004x_set_fe,
-	.get_frontend = tda1004x_get_fe,
+	.get_frontend_legacy = tda1004x_get_fe,
 	.get_tune_settings = tda1004x_get_tune_settings,
 
 	.read_status = tda1004x_read_status,
@@ -1322,7 +1322,7 @@ static struct dvb_frontend_ops tda10046_ops = {
 	.i2c_gate_ctrl = tda1004x_i2c_gate_ctrl,
 
 	.set_frontend_legacy = tda1004x_set_fe,
-	.get_frontend = tda1004x_get_fe,
+	.get_frontend_legacy = tda1004x_get_fe,
 	.get_tune_settings = tda1004x_get_tune_settings,
 
 	.read_status = tda1004x_read_status,
drivers/media/dvb/frontends/tda10071.c +1 -1
index 7bffa65..e9e00ea 100644
@@ -1248,7 +1248,7 @@ static struct dvb_frontend_ops tda10071_ops = {
 	.sleep = tda10071_sleep,
 
 	.set_frontend_legacy = tda10071_set_frontend,
-	.get_frontend = tda10071_get_frontend,
+	.get_frontend_legacy = tda10071_get_frontend,
 
 	.read_status = tda10071_read_status,
 	.read_snr = tda10071_read_snr,
drivers/media/dvb/frontends/tda10086.c +1 -1
index be4649f..8501100 100644
@@ -723,7 +723,7 @@ static struct dvb_frontend_ops tda10086_ops = {
 	.i2c_gate_ctrl = tda10086_i2c_gate_ctrl,
 
 	.set_frontend_legacy = tda10086_set_frontend,
-	.get_frontend = tda10086_get_frontend,
+	.get_frontend_legacy = tda10086_get_frontend,
 	.get_tune_settings = tda10086_get_tune_settings,
 
 	.read_status = tda10086_read_status,
drivers/media/dvb/frontends/tda8083.c +1 -1
index 9d1466f..7ff2946 100644
@@ -462,7 +462,7 @@ static struct dvb_frontend_ops tda8083_ops = {
 	.sleep = tda8083_sleep,
 
 	.set_frontend_legacy = tda8083_set_frontend,
-	.get_frontend = tda8083_get_frontend,
+	.get_frontend_legacy = tda8083_get_frontend,
 
 	.read_status = tda8083_read_status,
 	.read_signal_strength = tda8083_read_signal_strength,
drivers/media/dvb/frontends/ves1820.c +1 -1
index 6fb8eb5..7961231 100644
@@ -426,7 +426,7 @@ static struct dvb_frontend_ops ves1820_ops = {
 	.sleep = ves1820_sleep,
 
 	.set_frontend_legacy = ves1820_set_parameters,
-	.get_frontend = ves1820_get_frontend,
+	.get_frontend_legacy = ves1820_get_frontend,
 	.get_tune_settings = ves1820_get_tune_settings,
 
 	.read_status = ves1820_read_status,
drivers/media/dvb/frontends/ves1x93.c +1 -1
index f80f152..a95619e 100644
@@ -530,7 +530,7 @@ static struct dvb_frontend_ops ves1x93_ops = {
 	.i2c_gate_ctrl = ves1x93_i2c_gate_ctrl,
 
 	.set_frontend_legacy = ves1x93_set_frontend,
-	.get_frontend = ves1x93_get_frontend,
+	.get_frontend_legacy = ves1x93_get_frontend,
 
 	.read_status = ves1x93_read_status,
 	.read_ber = ves1x93_read_ber,
drivers/media/dvb/frontends/zl10353.c +1 -1
index 8b6c2a4..35334da 100644
@@ -676,7 +676,7 @@ static struct dvb_frontend_ops zl10353_ops = {
 	.write = zl10353_write,
 
 	.set_frontend_legacy = zl10353_set_parameters,
-	.get_frontend = zl10353_get_parameters,
+	.get_frontend_legacy = zl10353_get_parameters,
 	.get_tune_settings = zl10353_get_tune_settings,
 
 	.read_status = zl10353_read_status,
drivers/media/dvb/siano/smsdvb.c +1 -1
index fa17f02..df08d6a 100644
@@ -806,7 +806,7 @@ static struct dvb_frontend_ops smsdvb_fe_ops = {
 	.release = smsdvb_release,
 
 	.set_frontend_legacy = smsdvb_set_frontend,
-	.get_frontend = smsdvb_get_frontend,
+	.get_frontend_legacy = smsdvb_get_frontend,
 	.get_tune_settings = smsdvb_get_tune_settings,
 
 	.read_status = smsdvb_read_status,
drivers/media/video/tlg2300/pd-dvb.c +1 -1
index 51a7d55..f864c17 100644
@@ -354,7 +354,7 @@ static struct dvb_frontend_ops poseidon_frontend_ops = {
 	.sleep = poseidon_fe_sleep,
 
 	.set_frontend_legacy = poseidon_set_fe,
-	.get_frontend = poseidon_get_fe,
+	.get_frontend_legacy = poseidon_get_fe,
 	.get_tune_settings = poseidon_fe_get_tune_settings,
 
 	.read_status	= poseidon_read_status,
drivers/staging/media/as102/as102_fe.c +0 -0
index 161bcbe..b0c5128 100644

drivers/staging/media/as102/as102_fe.c static struct dvb_frontend_ops as102_fe_ops = { · line 303

Quoted 8 lines
drivers/staging/media/as102/as102_fe.c +1 -1
@@ -297,7 +297,7 @@ static struct dvb_frontend_ops as102_fe_ops = {
 	},
 
 	.set_frontend_legacy	= as102_fe_set_frontend,
-	.get_frontend		= as102_fe_get_frontend,
+	.get_frontend_legacy	= as102_fe_get_frontend,
 	.get_tune_settings	= as102_fe_get_tune_settings,
 
 	.read_status		= as102_fe_read_status,

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#97 lore raw

Re: [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback

Quoted 279 lines · Mauro Carvalho Chehab
Quoted 268 lines · Andreas Oberritter
Quoted 267 lines · Mauro Carvalho Chehab

The old method is renamed to get_frontend_legacy(), while not all frontends are converted.

---
 drivers/media/dvb/bt8xx/dst.c               |    8 +-
 drivers/media/dvb/dvb-core/dvb_frontend.c   |  102 ++++++++++++++++++++------
 drivers/media/dvb/dvb-core/dvb_frontend.h   |    5 +-
 drivers/media/dvb/dvb-usb/af9005-fe.c       |    4 +-
 drivers/media/dvb/dvb-usb/cinergyT2-fe.c    |    2 +-
 drivers/media/dvb/dvb-usb/dtt200u-fe.c      |    2 +-
 drivers/media/dvb/dvb-usb/friio-fe.c        |    2 +-
 drivers/media/dvb/dvb-usb/mxl111sf-demod.c  |    2 +-
 drivers/media/dvb/dvb-usb/vp702x-fe.c       |    2 +-
 drivers/media/dvb/dvb-usb/vp7045-fe.c       |    2 +-
 drivers/media/dvb/firewire/firedtv-fe.c     |    2 +-
 drivers/media/dvb/frontends/af9013.c        |    2 +-
 drivers/media/dvb/frontends/atbm8830.c      |    2 +-
 drivers/media/dvb/frontends/au8522_dig.c    |    2 +-
 drivers/media/dvb/frontends/cx22700.c       |    2 +-
 drivers/media/dvb/frontends/cx22702.c       |    2 +-
 drivers/media/dvb/frontends/cx24110.c       |    2 +-
 drivers/media/dvb/frontends/cx24123.c       |    2 +-
 drivers/media/dvb/frontends/cxd2820r_core.c |    4 +-
 drivers/media/dvb/frontends/dib3000mb.c     |    2 +-
 drivers/media/dvb/frontends/dib3000mc.c     |    2 +-
 drivers/media/dvb/frontends/dib7000m.c      |    2 +-
 drivers/media/dvb/frontends/dib7000p.c      |    2 +-
 drivers/media/dvb/frontends/dib8000.c       |    4 +-
 drivers/media/dvb/frontends/dib9000.c       |    4 +-
 drivers/media/dvb/frontends/drxd_hard.c     |    2 +-
 drivers/media/dvb/frontends/drxk_hard.c     |    4 +-
 drivers/media/dvb/frontends/dvb_dummy_fe.c  |    6 +-
 drivers/media/dvb/frontends/it913x-fe.c     |    2 +-
 drivers/media/dvb/frontends/l64781.c        |    2 +-
 drivers/media/dvb/frontends/lgdt3305.c      |    4 +-
 drivers/media/dvb/frontends/lgdt330x.c      |    4 +-
 drivers/media/dvb/frontends/lgs8gl5.c       |    2 +-
 drivers/media/dvb/frontends/lgs8gxx.c       |    2 +-
 drivers/media/dvb/frontends/mb86a20s.c      |    2 +-
 drivers/media/dvb/frontends/mt312.c         |    2 +-
 drivers/media/dvb/frontends/mt352.c         |    2 +-
 drivers/media/dvb/frontends/or51132.c       |    2 +-
 drivers/media/dvb/frontends/s5h1409.c       |    2 +-
 drivers/media/dvb/frontends/s5h1411.c       |    2 +-
 drivers/media/dvb/frontends/s5h1420.c       |    2 +-
 drivers/media/dvb/frontends/s5h1432.c       |    2 +-
 drivers/media/dvb/frontends/s921.c          |    2 +-
 drivers/media/dvb/frontends/stb0899_drv.c   |    2 +-
 drivers/media/dvb/frontends/stb6100.c       |    4 +-
 drivers/media/dvb/frontends/stv0297.c       |    2 +-
 drivers/media/dvb/frontends/stv0299.c       |    2 +-
 drivers/media/dvb/frontends/stv0367.c       |    4 +-
 drivers/media/dvb/frontends/stv0900_core.c  |    2 +-
 drivers/media/dvb/frontends/tda10021.c      |    2 +-
 drivers/media/dvb/frontends/tda10023.c      |    2 +-
 drivers/media/dvb/frontends/tda10048.c      |    2 +-
 drivers/media/dvb/frontends/tda1004x.c      |    4 +-
 drivers/media/dvb/frontends/tda10071.c      |    2 +-
 drivers/media/dvb/frontends/tda10086.c      |    2 +-
 drivers/media/dvb/frontends/tda8083.c       |    2 +-
 drivers/media/dvb/frontends/ves1820.c       |    2 +-
 drivers/media/dvb/frontends/ves1x93.c       |    2 +-
 drivers/media/dvb/frontends/zl10353.c       |    2 +-
 drivers/media/dvb/siano/smsdvb.c            |    2 +-
 drivers/media/video/tlg2300/pd-dvb.c        |    2 +-
 drivers/staging/media/as102/as102_fe.c      |    2 +-
 62 files changed, 157 insertions(+), 100 deletions(-)
drivers/media/dvb/bt8xx/dst.c +4 -4
index 4658bd6..6afc083 100644
@@ -1778,7 +1778,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1804,7 +1804,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1838,7 +1838,7 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1861,7 +1861,7 @@ static struct dvb_frontend_ops dst_atsc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
drivers/media/dvb/dvb-core/dvb_frontend.c +68 -19
index eca6170..1eefb91 100644
@@ -139,6 +139,14 @@ struct dvb_frontend_private {
 };
 
 static void dvb_frontend_wakeup(struct dvb_frontend *fe);
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out);
+
+static bool has_get_frontend(struct dvb_frontend *fe)
+{
+	return fe->ops.get_frontend || fe->ops.get_frontend_legacy;
+}
 
 static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 {
@@ -149,8 +157,8 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 
 	dprintk ("%s\n", __func__);
 
-	if ((status & FE_HAS_LOCK) && fe->ops.get_frontend)
-		fe->ops.get_frontend(fe, &fepriv->parameters_out);
+	if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
+		dtv_get_frontend(fe, NULL, &fepriv->parameters_out);
 
 	mutex_lock(&events->mtx);
 
@@ -1097,11 +1105,10 @@ static void dtv_property_cache_sync(struct dvb_frontend *fe,
 /* Ensure the cached values are set correctly in the frontend
  * legacy tuning structures, for the advanced tuning API.
  */
-static void dtv_property_legacy_params_sync(struct dvb_frontend *fe)
+static void dtv_property_legacy_params_sync(struct dvb_frontend *fe,
+					    struct dvb_frontend_parameters *p)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dvb_frontend_parameters *p = &fepriv->parameters_in;
 
 	p->frequency = c->frequency;
 	p->inversion = c->inversion;
@@ -1223,6 +1230,7 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe)
 static void dtv_property_cache_submit(struct dvb_frontend *fe)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 
 	/* For legacy delivery systems we don't need the delivery_system to
 	 * be specified, but we populate the older structures from the cache
@@ -1231,7 +1239,7 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	if(is_legacy_delivery_system(c->delivery_system)) {
 
 		dprintk("%s() legacy, modulation = %d\n", __func__, c->modulation);
-		dtv_property_legacy_params_sync(fe);
+		dtv_property_legacy_params_sync(fe, &fepriv->parameters_in);
 
 	} else {
 		dprintk("%s() adv, modulation = %d\n", __func__, c->modulation);
@@ -1246,6 +1254,58 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	}
 }
 
+/**
+ * dtv_get_frontend - calls a callback for retrieving DTV parameters
+ * @fe:		struct dvb_frontend pointer
+ * @c:		struct dtv_frontend_properties pointer (DVBv5 cache)
+ * @p_out	struct dvb_frontend_parameters pointer (DVBv3 FE struct)
+ *
+ * This routine calls either the DVBv3 or DVBv5 get_frontend call.
+ * If c is not null, it will update the DVBv5 cache struct pointed by it.
+ * If p_out is not null, it will update the DVBv3 params pointed by it.
+ */
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out)
+{
+	const struct dtv_frontend_properties *cache = &fe->dtv_property_cache;
+	struct dtv_frontend_properties tmp_cache;
+	struct dvb_frontend_parameters tmp_out;
+	bool fill_cache = (c != NULL);
+	bool fill_params = (p_out != NULL);
+	int r;
+
+	if (!p_out)
+		p_out = & tmp_out;
+
+	if (!c)
+		c = &tmp_cache;
+	else
+		memcpy(c, cache, sizeof(*c));
+
+	/* Then try the DVBv5 one */
+	if (fe->ops.get_frontend) {
+		r = fe->ops.get_frontend(fe, c);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_params)
+			dtv_property_legacy_params_sync(fe, p_out);
+		return 0;
+	}
+
+	/* As no DVBv5 call exists, use the DVBv3 one */
+	if (fe->ops.get_frontend_legacy) {
+		r = fe->ops.get_frontend_legacy(fe, p_out);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_cache)
+			dtv_property_cache_sync(fe, c, p_out);
+		return 0;
+	}
+
+	return -EOPNOTSUPP;
+}
+
 static int dvb_frontend_ioctl_legacy(struct file *file,
 			unsigned int cmd, void *parg);
 static int dvb_frontend_ioctl_properties(struct file *file,
@@ -1296,24 +1356,12 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 }
 
 static int dtv_property_process_get(struct dvb_frontend *fe,
+				    const struct dtv_frontend_properties *c,
 				    struct dtv_property *tvp,
 				    struct file *file)
 {
-	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dtv_frontend_properties cdetected;
 	int r;
 
-	/*
-	 * If the driver implements a get_frontend function, then convert
-	 * detected parameters to S2API properties.
-	 */
-	if (fe->ops.get_frontend) {
-		cdetected = *c;
-		dtv_property_cache_sync(fe, &cdetected, &fepriv->parameters_out);
-		c = &cdetected;
-	}
-
 	switch(tvp->cmd) {
 	case DTV_ENUM_DELSYS:
 		dtv_set_default_delivery_caps(fe, tvp);
@@ -1685,6 +1733,7 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 
 	} else
 	if(cmd == FE_GET_PROPERTY) {
+		struct dtv_frontend_properties cache_out;
 
 		tvps = (struct dtv_properties __user *)parg;
 
@@ -1707,8 +1756,13 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 			goto out;
 		}
 
Quoted 9 lines

drivers/media/dvb/dvb-core/dvb_frontend.c static int dvb_frontend_ioctl_properties(struct file *file, · line 1763

Quoted 5 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +5 -0
+		/*
+		 * Fills the cache out struct with the cache contents, plus
+		 * the data retrieved from get_frontend/get_frontend_legacy.
+		 */
+		dtv_get_frontend(fe, &cache_out, NULL);

Unlike before, this code actually calls the get_frontend driver callback, causing unwanted I2C traffic for every property. Please drop this behavioural change.

Quoted 2 lines

Look again: get_frontend() is called only once, when the user requests FE_GET_PROPERTY.

So let me rephrase: Unlike before, this code actually calls the get_frontend driver callback, causing unwanted I2C traffic for every FE_GET_PROPERTY ioctl.

Quoted 2 lines

This will only generate i2c traffic if the frontend implements get_frontend, and if it needs to retrieve something from the hardware.

What do you mean by "if it needs to retrieve something"? There's no logic in dtv_get_frontend() to handle that. Usually there's no logic in the get_frontend callback either, because it's job is to retrieve something from the hardware _unconditionally_.

Btw, I just noticed that get_frontend gets a parameter 'props' while set_frontend doesn't. IMO this should be changed, e.g. by adding const struct dtv_frontend_properties* to set_frontend, if you insist on introducing this callback.

A far better solution would be to just use the get_property callback for all properties instead of replacing the legacy get_frontend callback with a new "catch-all" function.

Quoted 1 line
Quoted 1 line

Btw, this doesn't match the patch description.

#98 lore raw

Re: [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback

Quoted 280 lines · Andreas Oberritter
Quoted 279 lines · Mauro Carvalho Chehab
Quoted 277 lines · Andreas Oberritter
Quoted 264 lines · Mauro Carvalho Chehab

The old method is renamed to get_frontend_legacy(), while not all frontends are converted.

---
 drivers/media/dvb/bt8xx/dst.c               |    8 +-
 drivers/media/dvb/dvb-core/dvb_frontend.c   |  102 ++++++++++++++++++++------
 drivers/media/dvb/dvb-core/dvb_frontend.h   |    5 +-
 drivers/media/dvb/dvb-usb/af9005-fe.c       |    4 +-
 drivers/media/dvb/dvb-usb/cinergyT2-fe.c    |    2 +-
 drivers/media/dvb/dvb-usb/dtt200u-fe.c      |    2 +-
 drivers/media/dvb/dvb-usb/friio-fe.c        |    2 +-
 drivers/media/dvb/dvb-usb/mxl111sf-demod.c  |    2 +-
 drivers/media/dvb/dvb-usb/vp702x-fe.c       |    2 +-
 drivers/media/dvb/dvb-usb/vp7045-fe.c       |    2 +-
 drivers/media/dvb/firewire/firedtv-fe.c     |    2 +-
 drivers/media/dvb/frontends/af9013.c        |    2 +-
 drivers/media/dvb/frontends/atbm8830.c      |    2 +-
 drivers/media/dvb/frontends/au8522_dig.c    |    2 +-
 drivers/media/dvb/frontends/cx22700.c       |    2 +-
 drivers/media/dvb/frontends/cx22702.c       |    2 +-
 drivers/media/dvb/frontends/cx24110.c       |    2 +-
 drivers/media/dvb/frontends/cx24123.c       |    2 +-
 drivers/media/dvb/frontends/cxd2820r_core.c |    4 +-
 drivers/media/dvb/frontends/dib3000mb.c     |    2 +-
 drivers/media/dvb/frontends/dib3000mc.c     |    2 +-
 drivers/media/dvb/frontends/dib7000m.c      |    2 +-
 drivers/media/dvb/frontends/dib7000p.c      |    2 +-
 drivers/media/dvb/frontends/dib8000.c       |    4 +-
 drivers/media/dvb/frontends/dib9000.c       |    4 +-
 drivers/media/dvb/frontends/drxd_hard.c     |    2 +-
 drivers/media/dvb/frontends/drxk_hard.c     |    4 +-
 drivers/media/dvb/frontends/dvb_dummy_fe.c  |    6 +-
 drivers/media/dvb/frontends/it913x-fe.c     |    2 +-
 drivers/media/dvb/frontends/l64781.c        |    2 +-
 drivers/media/dvb/frontends/lgdt3305.c      |    4 +-
 drivers/media/dvb/frontends/lgdt330x.c      |    4 +-
 drivers/media/dvb/frontends/lgs8gl5.c       |    2 +-
 drivers/media/dvb/frontends/lgs8gxx.c       |    2 +-
 drivers/media/dvb/frontends/mb86a20s.c      |    2 +-
 drivers/media/dvb/frontends/mt312.c         |    2 +-
 drivers/media/dvb/frontends/mt352.c         |    2 +-
 drivers/media/dvb/frontends/or51132.c       |    2 +-
 drivers/media/dvb/frontends/s5h1409.c       |    2 +-
 drivers/media/dvb/frontends/s5h1411.c       |    2 +-
 drivers/media/dvb/frontends/s5h1420.c       |    2 +-
 drivers/media/dvb/frontends/s5h1432.c       |    2 +-
 drivers/media/dvb/frontends/s921.c          |    2 +-
 drivers/media/dvb/frontends/stb0899_drv.c   |    2 +-
 drivers/media/dvb/frontends/stb6100.c       |    4 +-
 drivers/media/dvb/frontends/stv0297.c       |    2 +-
 drivers/media/dvb/frontends/stv0299.c       |    2 +-
 drivers/media/dvb/frontends/stv0367.c       |    4 +-
 drivers/media/dvb/frontends/stv0900_core.c  |    2 +-
 drivers/media/dvb/frontends/tda10021.c      |    2 +-
 drivers/media/dvb/frontends/tda10023.c      |    2 +-
 drivers/media/dvb/frontends/tda10048.c      |    2 +-
 drivers/media/dvb/frontends/tda1004x.c      |    4 +-
 drivers/media/dvb/frontends/tda10071.c      |    2 +-
 drivers/media/dvb/frontends/tda10086.c      |    2 +-
 drivers/media/dvb/frontends/tda8083.c       |    2 +-
 drivers/media/dvb/frontends/ves1820.c       |    2 +-
 drivers/media/dvb/frontends/ves1x93.c       |    2 +-
 drivers/media/dvb/frontends/zl10353.c       |    2 +-
 drivers/media/dvb/siano/smsdvb.c            |    2 +-
 drivers/media/video/tlg2300/pd-dvb.c        |    2 +-
 drivers/staging/media/as102/as102_fe.c      |    2 +-
 62 files changed, 157 insertions(+), 100 deletions(-)
drivers/media/dvb/bt8xx/dst.c +4 -4
index 4658bd6..6afc083 100644
@@ -1778,7 +1778,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1804,7 +1804,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1838,7 +1838,7 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1861,7 +1861,7 @@ static struct dvb_frontend_ops dst_atsc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
drivers/media/dvb/dvb-core/dvb_frontend.c +68 -19
index eca6170..1eefb91 100644
@@ -139,6 +139,14 @@ struct dvb_frontend_private {
 };
 
 static void dvb_frontend_wakeup(struct dvb_frontend *fe);
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out);
+
+static bool has_get_frontend(struct dvb_frontend *fe)
+{
+	return fe->ops.get_frontend || fe->ops.get_frontend_legacy;
+}
 
 static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 {
@@ -149,8 +157,8 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 
 	dprintk ("%s\n", __func__);
 
-	if ((status & FE_HAS_LOCK) && fe->ops.get_frontend)
-		fe->ops.get_frontend(fe, &fepriv->parameters_out);
+	if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
+		dtv_get_frontend(fe, NULL, &fepriv->parameters_out);
 
 	mutex_lock(&events->mtx);
 
@@ -1097,11 +1105,10 @@ static void dtv_property_cache_sync(struct dvb_frontend *fe,
 /* Ensure the cached values are set correctly in the frontend
  * legacy tuning structures, for the advanced tuning API.
  */
-static void dtv_property_legacy_params_sync(struct dvb_frontend *fe)
+static void dtv_property_legacy_params_sync(struct dvb_frontend *fe,
+					    struct dvb_frontend_parameters *p)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dvb_frontend_parameters *p = &fepriv->parameters_in;
 
 	p->frequency = c->frequency;
 	p->inversion = c->inversion;
@@ -1223,6 +1230,7 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe)
 static void dtv_property_cache_submit(struct dvb_frontend *fe)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 
 	/* For legacy delivery systems we don't need the delivery_system to
 	 * be specified, but we populate the older structures from the cache
@@ -1231,7 +1239,7 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	if(is_legacy_delivery_system(c->delivery_system)) {
 
 		dprintk("%s() legacy, modulation = %d\n", __func__, c->modulation);
-		dtv_property_legacy_params_sync(fe);
+		dtv_property_legacy_params_sync(fe, &fepriv->parameters_in);
 
 	} else {
 		dprintk("%s() adv, modulation = %d\n", __func__, c->modulation);
@@ -1246,6 +1254,58 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	}
 }
 
+/**
+ * dtv_get_frontend - calls a callback for retrieving DTV parameters
+ * @fe:		struct dvb_frontend pointer
+ * @c:		struct dtv_frontend_properties pointer (DVBv5 cache)
+ * @p_out	struct dvb_frontend_parameters pointer (DVBv3 FE struct)
+ *
+ * This routine calls either the DVBv3 or DVBv5 get_frontend call.
+ * If c is not null, it will update the DVBv5 cache struct pointed by it.
+ * If p_out is not null, it will update the DVBv3 params pointed by it.
+ */
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out)
+{
+	const struct dtv_frontend_properties *cache = &fe->dtv_property_cache;
+	struct dtv_frontend_properties tmp_cache;
+	struct dvb_frontend_parameters tmp_out;
+	bool fill_cache = (c != NULL);
+	bool fill_params = (p_out != NULL);
+	int r;
+
+	if (!p_out)
+		p_out = & tmp_out;
+
+	if (!c)
+		c = &tmp_cache;
+	else
+		memcpy(c, cache, sizeof(*c));
+
+	/* Then try the DVBv5 one */
+	if (fe->ops.get_frontend) {
+		r = fe->ops.get_frontend(fe, c);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_params)
+			dtv_property_legacy_params_sync(fe, p_out);
+		return 0;
+	}
+
+	/* As no DVBv5 call exists, use the DVBv3 one */
+	if (fe->ops.get_frontend_legacy) {
+		r = fe->ops.get_frontend_legacy(fe, p_out);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_cache)
+			dtv_property_cache_sync(fe, c, p_out);
+		return 0;
+	}
+
+	return -EOPNOTSUPP;
+}
+
 static int dvb_frontend_ioctl_legacy(struct file *file,
 			unsigned int cmd, void *parg);
 static int dvb_frontend_ioctl_properties(struct file *file,
@@ -1296,24 +1356,12 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 }
 
 static int dtv_property_process_get(struct dvb_frontend *fe,
+				    const struct dtv_frontend_properties *c,
 				    struct dtv_property *tvp,
 				    struct file *file)
 {
-	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dtv_frontend_properties cdetected;
 	int r;
 
-	/*
-	 * If the driver implements a get_frontend function, then convert
-	 * detected parameters to S2API properties.
-	 */
-	if (fe->ops.get_frontend) {
-		cdetected = *c;
-		dtv_property_cache_sync(fe, &cdetected, &fepriv->parameters_out);
-		c = &cdetected;
-	}
-
 	switch(tvp->cmd) {
 	case DTV_ENUM_DELSYS:
 		dtv_set_default_delivery_caps(fe, tvp);
@@ -1685,6 +1733,7 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 
 	} else
 	if(cmd == FE_GET_PROPERTY) {
+		struct dtv_frontend_properties cache_out;
 
 		tvps = (struct dtv_properties __user *)parg;
 

drivers/media/dvb/dvb-core/dvb_frontend.c static int dvb_frontend_ioctl_properties(struct file *file, · line 1763

Quoted 8 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +5 -0
@@ -1707,8 +1756,13 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 			goto out;
 		}
 
+		/*
+		 * Fills the cache out struct with the cache contents, plus
+		 * the data retrieved from get_frontend/get_frontend_legacy.
+		 */
+		dtv_get_frontend(fe, &cache_out, NULL);

Unlike before, this code actually calls the get_frontend driver callback, causing unwanted I2C traffic for every property. Please drop this behavioural change.

Quoted 5 lines
Quoted 2 lines

Look again: get_frontend() is called only once, when the user requests FE_GET_PROPERTY.

So let me rephrase: Unlike before, this code actually calls the get_frontend driver callback,

True.

Quoted 1 line

causing unwanted I2C traffic for every FE_GET_PROPERTY ioctl.

Why unwanted? If the userspace is calling it, it likely wants some fresh information about the frontend.

One usage of such call would be to retrieve the autodetected properties, after having a frontend lock.

Quoted 7 lines
Quoted 2 lines

This will only generate i2c traffic if the frontend implements get_frontend, and if it needs to retrieve something from the hardware.

What do you mean by "if it needs to retrieve something"? There's no logic in dtv_get_frontend() to handle that. Usually there's no logic in the get_frontend callback either, because it's job is to retrieve something from the hardware _unconditionally_.

For example, at FE_SET, it asked for modulation detection. a GET_PROP may return what was the detected modulation.

Quoted 2 lines

Btw, I just noticed that get_frontend gets a parameter 'props' while set_frontend doesn't.

My first coding were to not add a props parameter there. Then I realized that it could make some sense to not touch at the frontend cache parameters on a get_frontend, in order to prevent it to replace *_AUTO parameters by a detected parameter, as subsequent FE_SET_PROPERTY calls might try to just change the frequency, instead of filling all the properties again.

So, I decided to explicitly pass a parameter there.

Quoted 7 lines

IMO this should be changed, e.g. by adding const
struct dtv_frontend_properties* to set_frontend, if you insist on introducing this callback.

A far better solution would be to just use the get_property callback for all properties instead of replacing the legacy get_frontend callback with a new "catch-all" function.

Sorry, but I didn't understand what you're meaning. This is exactly what get_frontend callback is doing: it retrieves all properties.

After applying the entire patch series, the differences against the old behavior is that:
- get_frontend() will update the dtv_frontend_properties struct, instead of dvb_frontend_parameters;
- if get_frontend() is not implemented, it will return the last properties retrieved by a FE_SET_PROPERTY, or the ones initialized by dtv_property_cache_init();
- DVBv3 parameters sync will only be called for a FE_GET_FRONTEND call;
- as a side effect of updating the DVBv5 struct, drivers for ISDB-T, DSS, etc will return the parameters returned by the driver, not a damaged copy of it (the cache sync stuff mangles the returned parameters, due to the compat bits - this makes sense for a DVBv3 call, but it is a disaster for a DVBv5 call).

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines

Btw, this doesn't match the patch description.

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#99 lore raw

Re: [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback

Quoted 287 lines · Mauro Carvalho Chehab
Quoted 280 lines · Andreas Oberritter
Quoted 279 lines · Mauro Carvalho Chehab
Quoted 277 lines · Andreas Oberritter
Quoted 264 lines · Mauro Carvalho Chehab

The old method is renamed to get_frontend_legacy(), while not all frontends are converted.

---
 drivers/media/dvb/bt8xx/dst.c               |    8 +-
 drivers/media/dvb/dvb-core/dvb_frontend.c   |  102 ++++++++++++++++++++------
 drivers/media/dvb/dvb-core/dvb_frontend.h   |    5 +-
 drivers/media/dvb/dvb-usb/af9005-fe.c       |    4 +-
 drivers/media/dvb/dvb-usb/cinergyT2-fe.c    |    2 +-
 drivers/media/dvb/dvb-usb/dtt200u-fe.c      |    2 +-
 drivers/media/dvb/dvb-usb/friio-fe.c        |    2 +-
 drivers/media/dvb/dvb-usb/mxl111sf-demod.c  |    2 +-
 drivers/media/dvb/dvb-usb/vp702x-fe.c       |    2 +-
 drivers/media/dvb/dvb-usb/vp7045-fe.c       |    2 +-
 drivers/media/dvb/firewire/firedtv-fe.c     |    2 +-
 drivers/media/dvb/frontends/af9013.c        |    2 +-
 drivers/media/dvb/frontends/atbm8830.c      |    2 +-
 drivers/media/dvb/frontends/au8522_dig.c    |    2 +-
 drivers/media/dvb/frontends/cx22700.c       |    2 +-
 drivers/media/dvb/frontends/cx22702.c       |    2 +-
 drivers/media/dvb/frontends/cx24110.c       |    2 +-
 drivers/media/dvb/frontends/cx24123.c       |    2 +-
 drivers/media/dvb/frontends/cxd2820r_core.c |    4 +-
 drivers/media/dvb/frontends/dib3000mb.c     |    2 +-
 drivers/media/dvb/frontends/dib3000mc.c     |    2 +-
 drivers/media/dvb/frontends/dib7000m.c      |    2 +-
 drivers/media/dvb/frontends/dib7000p.c      |    2 +-
 drivers/media/dvb/frontends/dib8000.c       |    4 +-
 drivers/media/dvb/frontends/dib9000.c       |    4 +-
 drivers/media/dvb/frontends/drxd_hard.c     |    2 +-
 drivers/media/dvb/frontends/drxk_hard.c     |    4 +-
 drivers/media/dvb/frontends/dvb_dummy_fe.c  |    6 +-
 drivers/media/dvb/frontends/it913x-fe.c     |    2 +-
 drivers/media/dvb/frontends/l64781.c        |    2 +-
 drivers/media/dvb/frontends/lgdt3305.c      |    4 +-
 drivers/media/dvb/frontends/lgdt330x.c      |    4 +-
 drivers/media/dvb/frontends/lgs8gl5.c       |    2 +-
 drivers/media/dvb/frontends/lgs8gxx.c       |    2 +-
 drivers/media/dvb/frontends/mb86a20s.c      |    2 +-
 drivers/media/dvb/frontends/mt312.c         |    2 +-
 drivers/media/dvb/frontends/mt352.c         |    2 +-
 drivers/media/dvb/frontends/or51132.c       |    2 +-
 drivers/media/dvb/frontends/s5h1409.c       |    2 +-
 drivers/media/dvb/frontends/s5h1411.c       |    2 +-
 drivers/media/dvb/frontends/s5h1420.c       |    2 +-
 drivers/media/dvb/frontends/s5h1432.c       |    2 +-
 drivers/media/dvb/frontends/s921.c          |    2 +-
 drivers/media/dvb/frontends/stb0899_drv.c   |    2 +-
 drivers/media/dvb/frontends/stb6100.c       |    4 +-
 drivers/media/dvb/frontends/stv0297.c       |    2 +-
 drivers/media/dvb/frontends/stv0299.c       |    2 +-
 drivers/media/dvb/frontends/stv0367.c       |    4 +-
 drivers/media/dvb/frontends/stv0900_core.c  |    2 +-
 drivers/media/dvb/frontends/tda10021.c      |    2 +-
 drivers/media/dvb/frontends/tda10023.c      |    2 +-
 drivers/media/dvb/frontends/tda10048.c      |    2 +-
 drivers/media/dvb/frontends/tda1004x.c      |    4 +-
 drivers/media/dvb/frontends/tda10071.c      |    2 +-
 drivers/media/dvb/frontends/tda10086.c      |    2 +-
 drivers/media/dvb/frontends/tda8083.c       |    2 +-
 drivers/media/dvb/frontends/ves1820.c       |    2 +-
 drivers/media/dvb/frontends/ves1x93.c       |    2 +-
 drivers/media/dvb/frontends/zl10353.c       |    2 +-
 drivers/media/dvb/siano/smsdvb.c            |    2 +-
 drivers/media/video/tlg2300/pd-dvb.c        |    2 +-
 drivers/staging/media/as102/as102_fe.c      |    2 +-
 62 files changed, 157 insertions(+), 100 deletions(-)
drivers/media/dvb/bt8xx/dst.c +4 -4
index 4658bd6..6afc083 100644
@@ -1778,7 +1778,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1804,7 +1804,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1838,7 +1838,7 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1861,7 +1861,7 @@ static struct dvb_frontend_ops dst_atsc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
drivers/media/dvb/dvb-core/dvb_frontend.c +68 -19
index eca6170..1eefb91 100644
@@ -139,6 +139,14 @@ struct dvb_frontend_private {
 };
 
 static void dvb_frontend_wakeup(struct dvb_frontend *fe);
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out);
+
+static bool has_get_frontend(struct dvb_frontend *fe)
+{
+	return fe->ops.get_frontend || fe->ops.get_frontend_legacy;
+}
 
 static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 {
@@ -149,8 +157,8 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 
 	dprintk ("%s\n", __func__);
 
-	if ((status & FE_HAS_LOCK) && fe->ops.get_frontend)
-		fe->ops.get_frontend(fe, &fepriv->parameters_out);
+	if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
+		dtv_get_frontend(fe, NULL, &fepriv->parameters_out);
 
 	mutex_lock(&events->mtx);
 
@@ -1097,11 +1105,10 @@ static void dtv_property_cache_sync(struct dvb_frontend *fe,
 /* Ensure the cached values are set correctly in the frontend
  * legacy tuning structures, for the advanced tuning API.
  */
-static void dtv_property_legacy_params_sync(struct dvb_frontend *fe)
+static void dtv_property_legacy_params_sync(struct dvb_frontend *fe,
+					    struct dvb_frontend_parameters *p)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dvb_frontend_parameters *p = &fepriv->parameters_in;
 
 	p->frequency = c->frequency;
 	p->inversion = c->inversion;
@@ -1223,6 +1230,7 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe)
 static void dtv_property_cache_submit(struct dvb_frontend *fe)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 
 	/* For legacy delivery systems we don't need the delivery_system to
 	 * be specified, but we populate the older structures from the cache
@@ -1231,7 +1239,7 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	if(is_legacy_delivery_system(c->delivery_system)) {
 
 		dprintk("%s() legacy, modulation = %d\n", __func__, c->modulation);
-		dtv_property_legacy_params_sync(fe);
+		dtv_property_legacy_params_sync(fe, &fepriv->parameters_in);
 
 	} else {
 		dprintk("%s() adv, modulation = %d\n", __func__, c->modulation);
@@ -1246,6 +1254,58 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	}
 }
 
+/**
+ * dtv_get_frontend - calls a callback for retrieving DTV parameters
+ * @fe:		struct dvb_frontend pointer
+ * @c:		struct dtv_frontend_properties pointer (DVBv5 cache)
+ * @p_out	struct dvb_frontend_parameters pointer (DVBv3 FE struct)
+ *
+ * This routine calls either the DVBv3 or DVBv5 get_frontend call.
+ * If c is not null, it will update the DVBv5 cache struct pointed by it.
+ * If p_out is not null, it will update the DVBv3 params pointed by it.
+ */
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out)
+{
+	const struct dtv_frontend_properties *cache = &fe->dtv_property_cache;
+	struct dtv_frontend_properties tmp_cache;
+	struct dvb_frontend_parameters tmp_out;
+	bool fill_cache = (c != NULL);
+	bool fill_params = (p_out != NULL);
+	int r;
+
+	if (!p_out)
+		p_out = & tmp_out;
+
+	if (!c)
+		c = &tmp_cache;
+	else
+		memcpy(c, cache, sizeof(*c));
+
+	/* Then try the DVBv5 one */
+	if (fe->ops.get_frontend) {
+		r = fe->ops.get_frontend(fe, c);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_params)
+			dtv_property_legacy_params_sync(fe, p_out);
+		return 0;
+	}
+
+	/* As no DVBv5 call exists, use the DVBv3 one */
+	if (fe->ops.get_frontend_legacy) {
+		r = fe->ops.get_frontend_legacy(fe, p_out);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_cache)
+			dtv_property_cache_sync(fe, c, p_out);
+		return 0;
+	}
+
+	return -EOPNOTSUPP;
+}
+
 static int dvb_frontend_ioctl_legacy(struct file *file,
 			unsigned int cmd, void *parg);
 static int dvb_frontend_ioctl_properties(struct file *file,
@@ -1296,24 +1356,12 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 }
 
 static int dtv_property_process_get(struct dvb_frontend *fe,
+				    const struct dtv_frontend_properties *c,
 				    struct dtv_property *tvp,
 				    struct file *file)
 {
-	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dtv_frontend_properties cdetected;
 	int r;
 
-	/*
-	 * If the driver implements a get_frontend function, then convert
-	 * detected parameters to S2API properties.
-	 */
-	if (fe->ops.get_frontend) {
-		cdetected = *c;
-		dtv_property_cache_sync(fe, &cdetected, &fepriv->parameters_out);
-		c = &cdetected;
-	}
-
 	switch(tvp->cmd) {
 	case DTV_ENUM_DELSYS:
 		dtv_set_default_delivery_caps(fe, tvp);
@@ -1685,6 +1733,7 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 
 	} else
 	if(cmd == FE_GET_PROPERTY) {
+		struct dtv_frontend_properties cache_out;
 
 		tvps = (struct dtv_properties __user *)parg;
 

drivers/media/dvb/dvb-core/dvb_frontend.c static int dvb_frontend_ioctl_properties(struct file *file, · line 1763

Quoted 8 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +5 -0
@@ -1707,8 +1756,13 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 			goto out;
 		}
 
+		/*
+		 * Fills the cache out struct with the cache contents, plus
+		 * the data retrieved from get_frontend/get_frontend_legacy.
+		 */
+		dtv_get_frontend(fe, &cache_out, NULL);

Unlike before, this code actually calls the get_frontend driver callback, causing unwanted I2C traffic for every property. Please drop this behavioural change.

Quoted 5 lines
Quoted 2 lines

Look again: get_frontend() is called only once, when the user requests FE_GET_PROPERTY.

So let me rephrase: Unlike before, this code actually calls the get_frontend driver callback,

Quoted 6 lines

True.

Quoted 1 line

causing unwanted I2C traffic for every FE_GET_PROPERTY ioctl.

Why unwanted? If the userspace is calling it, it likely wants some fresh information about the frontend.

If I want to query the current frequency property, then the driver shouldn't have to read the symbol rate, FEC etc. Doing that made sense when FE_GET_FRONTEND had to fill a struct, but now that we're using distinct properties it doesn't make sense anymore.

Quoted 6 lines

One usage of such call would be to retrieve the autodetected properties, after having a frontend lock.

Quoted 3 lines
Quoted 2 lines

This will only generate i2c traffic if the frontend implements get_frontend, and if it needs to retrieve something from the hardware.

Quoted 7 lines
Quoted 4 lines

What do you mean by "if it needs to retrieve something"? There's no logic in dtv_get_frontend() to handle that. Usually there's no logic in the get_frontend callback either, because it's job is to retrieve something from the hardware _unconditionally_.

For example, at FE_SET, it asked for modulation detection. a GET_PROP may return what was the detected modulation.

Yes. The detected value should be set by the driver in its get_property callback.

Quoted 15 lines
Quoted 2 lines

Btw, I just noticed that get_frontend gets a parameter 'props' while set_frontend doesn't.

My first coding were to not add a props parameter there. Then I realized that it could make some sense to not touch at the frontend cache parameters on a get_frontend, in order to prevent it to replace *_AUTO parameters by a detected parameter, as subsequent FE_SET_PROPERTY calls might try to just change the frequency, instead of filling all the properties again.

So, I decided to explicitly pass a parameter there.

Quoted 4 lines

IMO this should be changed, e.g. by adding const
struct dtv_frontend_properties* to set_frontend, if you insist on introducing this callback.

Quoted 6 lines
Quoted 3 lines

A far better solution would be to just use the get_property callback for all properties instead of replacing the legacy get_frontend callback with a new "catch-all" function.

Sorry, but I didn't understand what you're meaning. This is exactly what get_frontend callback is doing: it retrieves all properties.

See above.

#100 lore raw

Re: [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback

Quoted 292 lines · Andreas Oberritter
Quoted 291 lines · Mauro Carvalho Chehab
Quoted 280 lines · Andreas Oberritter
Quoted 279 lines · Mauro Carvalho Chehab
Quoted 277 lines · Andreas Oberritter
Quoted 264 lines · Mauro Carvalho Chehab

The old method is renamed to get_frontend_legacy(), while not all frontends are converted.

---
 drivers/media/dvb/bt8xx/dst.c               |    8 +-
 drivers/media/dvb/dvb-core/dvb_frontend.c   |  102 ++++++++++++++++++++------
 drivers/media/dvb/dvb-core/dvb_frontend.h   |    5 +-
 drivers/media/dvb/dvb-usb/af9005-fe.c       |    4 +-
 drivers/media/dvb/dvb-usb/cinergyT2-fe.c    |    2 +-
 drivers/media/dvb/dvb-usb/dtt200u-fe.c      |    2 +-
 drivers/media/dvb/dvb-usb/friio-fe.c        |    2 +-
 drivers/media/dvb/dvb-usb/mxl111sf-demod.c  |    2 +-
 drivers/media/dvb/dvb-usb/vp702x-fe.c       |    2 +-
 drivers/media/dvb/dvb-usb/vp7045-fe.c       |    2 +-
 drivers/media/dvb/firewire/firedtv-fe.c     |    2 +-
 drivers/media/dvb/frontends/af9013.c        |    2 +-
 drivers/media/dvb/frontends/atbm8830.c      |    2 +-
 drivers/media/dvb/frontends/au8522_dig.c    |    2 +-
 drivers/media/dvb/frontends/cx22700.c       |    2 +-
 drivers/media/dvb/frontends/cx22702.c       |    2 +-
 drivers/media/dvb/frontends/cx24110.c       |    2 +-
 drivers/media/dvb/frontends/cx24123.c       |    2 +-
 drivers/media/dvb/frontends/cxd2820r_core.c |    4 +-
 drivers/media/dvb/frontends/dib3000mb.c     |    2 +-
 drivers/media/dvb/frontends/dib3000mc.c     |    2 +-
 drivers/media/dvb/frontends/dib7000m.c      |    2 +-
 drivers/media/dvb/frontends/dib7000p.c      |    2 +-
 drivers/media/dvb/frontends/dib8000.c       |    4 +-
 drivers/media/dvb/frontends/dib9000.c       |    4 +-
 drivers/media/dvb/frontends/drxd_hard.c     |    2 +-
 drivers/media/dvb/frontends/drxk_hard.c     |    4 +-
 drivers/media/dvb/frontends/dvb_dummy_fe.c  |    6 +-
 drivers/media/dvb/frontends/it913x-fe.c     |    2 +-
 drivers/media/dvb/frontends/l64781.c        |    2 +-
 drivers/media/dvb/frontends/lgdt3305.c      |    4 +-
 drivers/media/dvb/frontends/lgdt330x.c      |    4 +-
 drivers/media/dvb/frontends/lgs8gl5.c       |    2 +-
 drivers/media/dvb/frontends/lgs8gxx.c       |    2 +-
 drivers/media/dvb/frontends/mb86a20s.c      |    2 +-
 drivers/media/dvb/frontends/mt312.c         |    2 +-
 drivers/media/dvb/frontends/mt352.c         |    2 +-
 drivers/media/dvb/frontends/or51132.c       |    2 +-
 drivers/media/dvb/frontends/s5h1409.c       |    2 +-
 drivers/media/dvb/frontends/s5h1411.c       |    2 +-
 drivers/media/dvb/frontends/s5h1420.c       |    2 +-
 drivers/media/dvb/frontends/s5h1432.c       |    2 +-
 drivers/media/dvb/frontends/s921.c          |    2 +-
 drivers/media/dvb/frontends/stb0899_drv.c   |    2 +-
 drivers/media/dvb/frontends/stb6100.c       |    4 +-
 drivers/media/dvb/frontends/stv0297.c       |    2 +-
 drivers/media/dvb/frontends/stv0299.c       |    2 +-
 drivers/media/dvb/frontends/stv0367.c       |    4 +-
 drivers/media/dvb/frontends/stv0900_core.c  |    2 +-
 drivers/media/dvb/frontends/tda10021.c      |    2 +-
 drivers/media/dvb/frontends/tda10023.c      |    2 +-
 drivers/media/dvb/frontends/tda10048.c      |    2 +-
 drivers/media/dvb/frontends/tda1004x.c      |    4 +-
 drivers/media/dvb/frontends/tda10071.c      |    2 +-
 drivers/media/dvb/frontends/tda10086.c      |    2 +-
 drivers/media/dvb/frontends/tda8083.c       |    2 +-
 drivers/media/dvb/frontends/ves1820.c       |    2 +-
 drivers/media/dvb/frontends/ves1x93.c       |    2 +-
 drivers/media/dvb/frontends/zl10353.c       |    2 +-
 drivers/media/dvb/siano/smsdvb.c            |    2 +-
 drivers/media/video/tlg2300/pd-dvb.c        |    2 +-
 drivers/staging/media/as102/as102_fe.c      |    2 +-
 62 files changed, 157 insertions(+), 100 deletions(-)
drivers/media/dvb/bt8xx/dst.c +4 -4
index 4658bd6..6afc083 100644
@@ -1778,7 +1778,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1804,7 +1804,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1838,7 +1838,7 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1861,7 +1861,7 @@ static struct dvb_frontend_ops dst_atsc_ops = {
 	.init = dst_init,
 	.tune = dst_tune_frontend,
 	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend = dst_get_frontend,
+	.get_frontend_legacy = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
drivers/media/dvb/dvb-core/dvb_frontend.c +68 -19
index eca6170..1eefb91 100644
@@ -139,6 +139,14 @@ struct dvb_frontend_private {
 };
 
 static void dvb_frontend_wakeup(struct dvb_frontend *fe);
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out);
+
+static bool has_get_frontend(struct dvb_frontend *fe)
+{
+	return fe->ops.get_frontend || fe->ops.get_frontend_legacy;
+}
 
 static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 {
@@ -149,8 +157,8 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 
 	dprintk ("%s\n", __func__);
 
-	if ((status & FE_HAS_LOCK) && fe->ops.get_frontend)
-		fe->ops.get_frontend(fe, &fepriv->parameters_out);
+	if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
+		dtv_get_frontend(fe, NULL, &fepriv->parameters_out);
 
 	mutex_lock(&events->mtx);
 
@@ -1097,11 +1105,10 @@ static void dtv_property_cache_sync(struct dvb_frontend *fe,
 /* Ensure the cached values are set correctly in the frontend
  * legacy tuning structures, for the advanced tuning API.
  */
-static void dtv_property_legacy_params_sync(struct dvb_frontend *fe)
+static void dtv_property_legacy_params_sync(struct dvb_frontend *fe,
+					    struct dvb_frontend_parameters *p)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dvb_frontend_parameters *p = &fepriv->parameters_in;
 
 	p->frequency = c->frequency;
 	p->inversion = c->inversion;
@@ -1223,6 +1230,7 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe)
 static void dtv_property_cache_submit(struct dvb_frontend *fe)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 
 	/* For legacy delivery systems we don't need the delivery_system to
 	 * be specified, but we populate the older structures from the cache
@@ -1231,7 +1239,7 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	if(is_legacy_delivery_system(c->delivery_system)) {
 
 		dprintk("%s() legacy, modulation = %d\n", __func__, c->modulation);
-		dtv_property_legacy_params_sync(fe);
+		dtv_property_legacy_params_sync(fe, &fepriv->parameters_in);
 
 	} else {
 		dprintk("%s() adv, modulation = %d\n", __func__, c->modulation);
@@ -1246,6 +1254,58 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
 	}
 }
 
+/**
+ * dtv_get_frontend - calls a callback for retrieving DTV parameters
+ * @fe:		struct dvb_frontend pointer
+ * @c:		struct dtv_frontend_properties pointer (DVBv5 cache)
+ * @p_out	struct dvb_frontend_parameters pointer (DVBv3 FE struct)
+ *
+ * This routine calls either the DVBv3 or DVBv5 get_frontend call.
+ * If c is not null, it will update the DVBv5 cache struct pointed by it.
+ * If p_out is not null, it will update the DVBv3 params pointed by it.
+ */
+static int dtv_get_frontend(struct dvb_frontend *fe,
+			    struct dtv_frontend_properties *c,
+			    struct dvb_frontend_parameters *p_out)
+{
+	const struct dtv_frontend_properties *cache = &fe->dtv_property_cache;
+	struct dtv_frontend_properties tmp_cache;
+	struct dvb_frontend_parameters tmp_out;
+	bool fill_cache = (c != NULL);
+	bool fill_params = (p_out != NULL);
+	int r;
+
+	if (!p_out)
+		p_out = & tmp_out;
+
+	if (!c)
+		c = &tmp_cache;
+	else
+		memcpy(c, cache, sizeof(*c));
+
+	/* Then try the DVBv5 one */
+	if (fe->ops.get_frontend) {
+		r = fe->ops.get_frontend(fe, c);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_params)
+			dtv_property_legacy_params_sync(fe, p_out);
+		return 0;
+	}
+
+	/* As no DVBv5 call exists, use the DVBv3 one */
+	if (fe->ops.get_frontend_legacy) {
+		r = fe->ops.get_frontend_legacy(fe, p_out);
+		if (unlikely(r < 0))
+			return r;
+		if (fill_cache)
+			dtv_property_cache_sync(fe, c, p_out);
+		return 0;
+	}
+
+	return -EOPNOTSUPP;
+}
+
 static int dvb_frontend_ioctl_legacy(struct file *file,
 			unsigned int cmd, void *parg);
 static int dvb_frontend_ioctl_properties(struct file *file,
@@ -1296,24 +1356,12 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 }
 
 static int dtv_property_process_get(struct dvb_frontend *fe,
+				    const struct dtv_frontend_properties *c,
 				    struct dtv_property *tvp,
 				    struct file *file)
 {
-	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dtv_frontend_properties cdetected;
 	int r;
 
-	/*
-	 * If the driver implements a get_frontend function, then convert
-	 * detected parameters to S2API properties.
-	 */
-	if (fe->ops.get_frontend) {
-		cdetected = *c;
-		dtv_property_cache_sync(fe, &cdetected, &fepriv->parameters_out);
-		c = &cdetected;
-	}
-
 	switch(tvp->cmd) {
 	case DTV_ENUM_DELSYS:
 		dtv_set_default_delivery_caps(fe, tvp);
@@ -1685,6 +1733,7 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 
 	} else
 	if(cmd == FE_GET_PROPERTY) {
+		struct dtv_frontend_properties cache_out;
 
 		tvps = (struct dtv_properties __user *)parg;
 

drivers/media/dvb/dvb-core/dvb_frontend.c static int dvb_frontend_ioctl_properties(struct file *file, · line 1763

Quoted 8 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +5 -0
@@ -1707,8 +1756,13 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 			goto out;
 		}
 
+		/*
+		 * Fills the cache out struct with the cache contents, plus
+		 * the data retrieved from get_frontend/get_frontend_legacy.
+		 */
+		dtv_get_frontend(fe, &cache_out, NULL);

Unlike before, this code actually calls the get_frontend driver callback, causing unwanted I2C traffic for every property. Please drop this behavioural change.

Quoted 5 lines
Quoted 2 lines

Look again: get_frontend() is called only once, when the user requests FE_GET_PROPERTY.

So let me rephrase: Unlike before, this code actually calls the get_frontend driver callback,

True.

Quoted 1 line

causing unwanted I2C traffic for every FE_GET_PROPERTY ioctl.

Quoted 7 lines
Quoted 2 lines

Why unwanted? If the userspace is calling it, it likely wants some fresh information about the frontend.

If I want to query the current frequency property, then the driver shouldn't have to read the symbol rate, FEC etc. Doing that made sense when FE_GET_FRONTEND had to fill a struct, but now that we're using distinct properties it doesn't make sense anymore.

Ok, you're talking about an optimization over what's currently done.

I agree that it would be great to have such optimization, but this is out of the target intended by this patchset.

The target of this patchset (and the previous one) is to be sure that all DVBv3 handling will be confined into the DVB core, making possible to remove uneeded DVBv3 parameter copies for pure DVBv5 calls and to do other optimizations inside the core.

I can see a few ways of doing such optimization:

1) instead of implementing a get_frontend() callback, drivers would use get_property().

As get_property() will serialize the calls, this will work fine if each DVB property would require a separate hardware call. However, if the same hardware call would retrieve an entire set of parameters (this is true on some firmware-based cards like siano), using it will actually slow down the driver, if several parameters are required at the same time.

So, such firmware-based drivers will work better with get_frontend() than with get_property().

After looking on all drivers that implement get_frontend(), very few drivers will actually generate too much traffic for get_frontend(). Yet, after applying this series, it will be easier to work on such drivers to optimize them.

2) add a bitmap field at DVBv5 cache parameter, to indicate what parameters were requested by userspace.

This way, drivers could check the bitmask and do the minimal amount of transfers to retrieve the needed data, not spending I2C bus cycles to retrieve data that would be discarded by the core.

I'm not convinced if we should go this way, as implementing get_property() seems simpler.

Quoted 44 lines
Quoted 6 lines

One usage of such call would be to retrieve the autodetected properties, after having a frontend lock.

Quoted 3 lines
Quoted 2 lines

This will only generate i2c traffic if the frontend implements get_frontend, and if it needs to retrieve something from the hardware.

Quoted 7 lines
Quoted 4 lines

What do you mean by "if it needs to retrieve something"? There's no logic in dtv_get_frontend() to handle that. Usually there's no logic in the get_frontend callback either, because it's job is to retrieve something from the hardware _unconditionally_.

For example, at FE_SET, it asked for modulation detection. a GET_PROP may return what was the detected modulation.

Yes. The detected value should be set by the driver in its get_property callback.

Quoted 15 lines
Quoted 2 lines

Btw, I just noticed that get_frontend gets a parameter 'props' while set_frontend doesn't.

My first coding were to not add a props parameter there. Then I realized that it could make some sense to not touch at the frontend cache parameters on a get_frontend, in order to prevent it to replace *_AUTO parameters by a detected parameter, as subsequent FE_SET_PROPERTY calls might try to just change the frequency, instead of filling all the properties again.

So, I decided to explicitly pass a parameter there.

Quoted 4 lines

IMO this should be changed, e.g. by adding const
struct dtv_frontend_properties* to set_frontend, if you insist on introducing this callback.

Quoted 6 lines
Quoted 3 lines

A far better solution would be to just use the get_property callback for all properties instead of replacing the legacy get_frontend callback with a new "catch-all" function.

Sorry, but I didn't understand what you're meaning. This is exactly what get_frontend callback is doing: it retrieves all properties.

See above.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#101 lore raw

Re: [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback

In reply to Mauro Carvalho Chehab
Quoted 2 lines · Mauro Carvalho Chehab

One usage of such call would be to retrieve the autodetected properties, after having a frontend lock.

Btw., dvb_frontend already refreshes the cache whenever the lock status changes, i.e. when generating frontend events.

#102 lore raw

Re: [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback

Quoted 6 lines · Andreas Oberritter
Quoted 2 lines · Mauro Carvalho Chehab

One usage of such call would be to retrieve the autodetected properties, after having a frontend lock.

Btw., dvb_frontend already refreshes the cache whenever the lock status changes, i.e. when generating frontend events.

True. Well, if all agree, we can add a patch after this series removing the extra parameter from get_frontend(), making it symmetric to the set calls.

(I prefer to code it as a separate patch, as changing the entire chain of about 80 patches is very painful. Also, a simple perl script is probably enough to do the trick of changing all at once).

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#103 lore raw

Re: [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback

Hi Andreas,

Quoted 11 lines · Mauro Carvalho Chehab
Quoted 6 lines · Andreas Oberritter
Quoted 2 lines · Mauro Carvalho Chehab

One usage of such call would be to retrieve the autodetected properties, after having a frontend lock.

Btw., dvb_frontend already refreshes the cache whenever the lock status changes, i.e. when generating frontend events.

True. Well, if all agree, we can add a patch after this series removing the extra parameter from get_frontend(), making it symmetric to the set calls.

The enclosed patch should do the trick. It also optimizes a little bit the dtv_get_frontend() static function.

-
[PATCH] [media] dvb: don't require a parameter for get_frontend

Just like set_frontend, use the dvb cache properties for get_frontend. This is more consistent, as both functions are now symetric. Also, at the places get_frontend is called, it makes sense to update the cache.

Most of this patch were generated by this small perl script:

	while (<>) { $file .= $_; }
	if ($file =~ m/\.get_frontend\s*=\s*([\d\w_]+)/) {
		my $get = $1;
		$file =~ s/($get)(\s*\([^\,\)]+)\,\s*struct\s+dtv_frontend_properties\s*\*\s*([_\d\w]+)\)\s*\{/\1\2)\n{\n\tstruct dtv_frontend_properties *\3 = &fe->dtv_property_cache;/g;
	}
	print $file;

Of course, the changes at dvb_frontend.[ch] were made by hand, as well as the changes on a few other places, where get_frontend() is called internally inside the driver.

On some places, get_frontend() were just a void function. Those occurrences were removed, as the DVB core handles such cases.

drivers/media/dvb/bt8xx/dst.c +2 -1
index 80b1f2a..9c5cbf1 100644
@@ -1685,8 +1685,9 @@ static int dst_get_tuning_algo(struct dvb_frontend *fe)
 	return dst_algo ? DVBFE_ALGO_HW : DVBFE_ALGO_SW;
 }
 
-static int dst_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
+static int dst_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct dst_state *state = fe->demodulator_priv;
 
 	p->frequency = state->decode_freq;
drivers/media/dvb/dvb-core/dvb_frontend.c +7 -23
index 9d092a6..9a7ee92 100644
@@ -143,7 +143,6 @@ struct dvb_frontend_private {
 
 static void dvb_frontend_wakeup(struct dvb_frontend *fe);
 static int dtv_get_frontend(struct dvb_frontend *fe,
-			    struct dtv_frontend_properties *c,
 			    struct dvb_frontend_parameters *p_out);
 
 static bool has_get_frontend(struct dvb_frontend *fe)
@@ -161,7 +160,7 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 	dprintk ("%s\n", __func__);
 
 	if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
-		dtv_get_frontend(fe, NULL, &fepriv->parameters_out);
+		dtv_get_frontend(fe, &fepriv->parameters_out);
 
 	mutex_lock(&events->mtx);
 
@@ -1261,33 +1260,20 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
  * If p_out is not null, it will update the DVBv3 params pointed by it.
  */
 static int dtv_get_frontend(struct dvb_frontend *fe,
-			    struct dtv_frontend_properties *c,
 			    struct dvb_frontend_parameters *p_out)
 {
-	const struct dtv_frontend_properties *cache = &fe->dtv_property_cache;
-	struct dtv_frontend_properties tmp_cache;
-	struct dvb_frontend_parameters tmp_out;
-	bool fill_params = (p_out != NULL);
 	int r;
 
-	if (!p_out)
-		p_out = & tmp_out;
-
-	if (!c)
-		c = &tmp_cache;
-	else
-		memcpy(c, cache, sizeof(*c));
-
 	if (fe->ops.get_frontend) {
-		r = fe->ops.get_frontend(fe, c);
+		r = fe->ops.get_frontend(fe);
 		if (unlikely(r < 0))
 			return r;
-		if (fill_params)
+		if (p_out)
 			dtv_property_legacy_params_sync(fe, p_out);
 		return 0;
 	}
 
-	/* As everything is in cache, this is always supported */
+	/* As everything is in cache, get_frontend fops are always supported */
 	return 0;
 }
 
@@ -1717,8 +1703,6 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 
 	} else
 	if(cmd == FE_GET_PROPERTY) {
-		struct dtv_frontend_properties cache_out;
-
 		tvps = (struct dtv_properties __user *)parg;
 
 		dprintk("%s() properties.num = %d\n", __func__, tvps->num);
@@ -1744,9 +1728,9 @@ static int dvb_frontend_ioctl_properties(struct file *file,
 		 * Fills the cache out struct with the cache contents, plus
 		 * the data retrieved from get_frontend.
 		 */
-		dtv_get_frontend(fe, &cache_out, NULL);
+		dtv_get_frontend(fe, NULL);
 		for (i = 0; i < tvps->num; i++) {
-			err = dtv_property_process_get(fe, &cache_out, tvp + i, file);
+			err = dtv_property_process_get(fe, c, tvp + i, file);
 			if (err < 0)
 				goto out;
 			(tvp + i)->result = err;
@@ -2043,7 +2027,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 		break;
 
 	case FE_GET_FRONTEND:
-		err = dtv_get_frontend(fe, NULL, &fepriv->parameters_out);
+		err = dtv_get_frontend(fe, &fepriv->parameters_out);
 		if (err >= 0)
 			memcpy(parg, &fepriv->parameters_out,
 			       sizeof(struct dvb_frontend_parameters));
drivers/media/dvb/dvb-core/dvb_frontend.h +1 -1
index 382d97f..1ee2e7f 100644
@@ -284,7 +284,7 @@ struct dvb_frontend_ops {
 	int (*set_frontend)(struct dvb_frontend* fe);
 	int (*get_tune_settings)(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* settings);
 
-	int (*get_frontend)(struct dvb_frontend *fe, struct dtv_frontend_properties *props);
+	int (*get_frontend)(struct dvb_frontend *fe);
 
 	int (*read_status)(struct dvb_frontend* fe, fe_status_t* status);
 	int (*read_ber)(struct dvb_frontend* fe, u32* ber);
drivers/media/dvb/dvb-usb/af9005-fe.c +2 -2
index 6c1ef61..27ad0a3 100644
@@ -1225,9 +1225,9 @@ static int af9005_fe_set_frontend(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int af9005_fe_get_frontend(struct dvb_frontend *fe,
-				  struct dtv_frontend_properties *fep)
+static int af9005_fe_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct af9005_fe_state *state = fe->demodulator_priv;
 	int ret;
 	u8 temp;
drivers/media/dvb/dvb-usb/cinergyT2-fe.c +0 -7
index 0b49d44..0b85564 100644
@@ -296,12 +296,6 @@ static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe)
 	return (err < 0) ? err : 0;
 }
 
-static int cinergyt2_fe_get_frontend(struct dvb_frontend *fe,
-				  struct dtv_frontend_properties *fep)
-{
-	return 0;
-}
-
 static void cinergyt2_fe_release(struct dvb_frontend *fe)
 {
 	struct cinergyt2_fe_state *state = fe->demodulator_priv;
@@ -352,7 +346,6 @@ static struct dvb_frontend_ops cinergyt2_fe_ops = {
 	.sleep			= cinergyt2_fe_sleep,
 
 	.set_frontend		= cinergyt2_fe_set_frontend,
-	.get_frontend		= cinergyt2_fe_get_frontend,
 	.get_tune_settings	= cinergyt2_fe_get_tune_settings,
 
 	.read_status		= cinergyt2_fe_read_status,
drivers/media/dvb/dvb-usb/dtt200u-fe.c +2 -2
index 643242e..270747d 100644
@@ -133,9 +133,9 @@ static int dtt200u_fe_set_frontend(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int dtt200u_fe_get_frontend(struct dvb_frontend* fe,
-				  struct dtv_frontend_properties *fep)
+static int dtt200u_fe_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct dtt200u_fe_state *state = fe->demodulator_priv;
 	memcpy(fep,&state->fep,sizeof(struct dtv_frontend_properties));
 	return 0;
drivers/media/dvb/dvb-usb/friio-fe.c +2 -2
index 375815d..0660a87 100644
@@ -282,9 +282,9 @@ static int jdvbt90502_set_property(struct dvb_frontend *fe,
 	return r;
 }
 
-static int jdvbt90502_get_frontend(struct dvb_frontend *fe,
-				   struct dtv_frontend_properties *p)
+static int jdvbt90502_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	p->inversion = INVERSION_AUTO;
 	p->bandwidth_hz = 6000000;
 	p->code_rate_HP = FEC_AUTO;
drivers/media/dvb/dvb-usb/mxl111sf-demod.c +2 -2
index c61f246..694e207 100644
@@ -507,9 +507,9 @@ static int mxl111sf_demod_read_signal_strength(struct dvb_frontend *fe,
 	return 0;
 }
 
-static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe,
-				       struct dtv_frontend_properties *p)
+static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct mxl111sf_demod_state *state = fe->demodulator_priv;
 
 	mxl_dbg("()");
drivers/media/dvb/dvb-usb/vp702x-fe.c +0 -8
index fa0b811..178e938 100644
@@ -211,13 +211,6 @@ static int vp702x_fe_sleep(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int vp702x_fe_get_frontend(struct dvb_frontend* fe,
-				  struct dtv_frontend_properties *fep)
-{
-	deb_fe("%s\n",__func__);
-	return 0;
-}
-
 static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe,
 				    struct dvb_diseqc_master_cmd *m)
 {
@@ -372,7 +365,6 @@ static struct dvb_frontend_ops vp702x_fe_ops = {
 	.sleep = vp702x_fe_sleep,
 
 	.set_frontend = vp702x_fe_set_frontend,
-	.get_frontend = vp702x_fe_get_frontend,
 	.get_tune_settings = vp702x_fe_get_tune_settings,
 
 	.read_status = vp702x_fe_read_status,
drivers/media/dvb/firewire/firedtv-fe.c +0 -20
index e1705a9..39f5caa 100644
@@ -149,22 +149,6 @@ static int fdtv_set_frontend(struct dvb_frontend *fe)
 	return avc_tuner_dsd(fdtv, p);
 }
 
-static int fdtv_get_frontend(struct dvb_frontend *fe,
-			     struct dtv_frontend_properties *params)
-{
-	return -EOPNOTSUPP;
-}
-
-static int fdtv_get_property(struct dvb_frontend *fe, struct dtv_property *tvp)
-{
-	return 0;
-}
-
-static int fdtv_set_property(struct dvb_frontend *fe, struct dtv_property *tvp)
-{
-	return 0;
-}
-
 void fdtv_frontend_init(struct firedtv *fdtv, const char *name)
 {
 	struct dvb_frontend_ops *ops = &fdtv->fe.ops;
@@ -174,10 +158,6 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name)
 	ops->sleep			= fdtv_sleep;
 
 	ops->set_frontend		= fdtv_set_frontend;
-	ops->get_frontend		= fdtv_get_frontend;
-
-	ops->get_property		= fdtv_get_property;
-	ops->set_property		= fdtv_set_property;
 
 	ops->read_status		= fdtv_read_status;
 	ops->read_ber			= fdtv_read_ber;
drivers/media/dvb/frontends/af9013.c +2 -2
index a8aefe9..e630d46 100644
@@ -670,9 +670,9 @@ error:
 	return ret;
 }
 
-static int af9013_get_frontend(struct dvb_frontend *fe,
-			       struct dtv_frontend_properties *c)
+static int af9013_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct af9013_state *state = fe->demodulator_priv;
 	int ret;
 	u8 i, buf[3];
drivers/media/dvb/frontends/atbm8830.c +2 -2
index c4edbbe..ff86074 100644
@@ -297,9 +297,9 @@ static int atbm8830_set_fe(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int atbm8830_get_fe(struct dvb_frontend *fe,
-			   struct dtv_frontend_properties *c)
+static int atbm8830_get_fe(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	dprintk("%s\n", __func__);
 
 	/* TODO: get real readings from device */
drivers/media/dvb/frontends/au8522_dig.c +2 -2
index 027d45d..762cd5e 100644
@@ -911,9 +911,9 @@ static int au8522_read_ber(struct dvb_frontend *fe, u32 *ber)
 	return au8522_read_ucblocks(fe, ber);
 }
 
-static int au8522_get_frontend(struct dvb_frontend *fe,
-			       struct dtv_frontend_properties *c)
+static int au8522_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct au8522_state *state = fe->demodulator_priv;
 
 	c->frequency = state->current_frequency;
drivers/media/dvb/frontends/cx22700.c +2 -2
index 3c571b9..d5d61a5 100644
@@ -341,9 +341,9 @@ static int cx22700_set_frontend(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int cx22700_get_frontend(struct dvb_frontend* fe,
-				struct dtv_frontend_properties *c)
+static int cx22700_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct cx22700_state* state = fe->demodulator_priv;
 	u8 reg09 = cx22700_readreg (state, 0x09);
 
drivers/media/dvb/frontends/cx22702.c +2 -2
index 225ce84..587c3ec 100644
@@ -546,9 +546,9 @@ static int cx22702_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
 	return 0;
 }
 
-static int cx22702_get_frontend(struct dvb_frontend *fe,
-				struct dtv_frontend_properties *c)
+static int cx22702_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct cx22702_state *state = fe->demodulator_priv;
 
 	u8 reg0C = cx22702_readreg(state, 0x0C);
drivers/media/dvb/frontends/cx24110.c +2 -2
index 6f85bb1..98014fc 100644
@@ -549,9 +549,9 @@ static int cx24110_set_frontend(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int cx24110_get_frontend(struct dvb_frontend* fe,
-				struct dtv_frontend_properties *p)
+static int cx24110_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct cx24110_state *state = fe->demodulator_priv;
 	s32 afc; unsigned sclk;
 
drivers/media/dvb/frontends/cx24123.c +2 -2
index faafb1f..ad5d1a4 100644
@@ -959,9 +959,9 @@ static int cx24123_set_frontend(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int cx24123_get_frontend(struct dvb_frontend *fe,
-				struct dtv_frontend_properties *p)
+static int cx24123_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct cx24123_state *state = fe->demodulator_priv;
 
 	dprintk("\n");
drivers/media/dvb/frontends/cxd2820r_core.c +2 -2
index 96ceed7..b14e509 100644
@@ -381,9 +381,9 @@ static int cxd2820r_read_status(struct dvb_frontend *fe, fe_status_t *status)
 	return ret;
 }
 
-static int cxd2820r_get_frontend(struct dvb_frontend *fe,
-				 struct dtv_frontend_properties *c)
+static int cxd2820r_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct cxd2820r_priv *priv = fe->demodulator_priv;
 	int ret;
 	dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system);
drivers/media/dvb/frontends/dib3000mb.c +4 -5
index 432d1b0..01a1e30 100644
@@ -112,8 +112,7 @@ static u16 dib3000_seq[2][2][2] =     /* fft,gua,   inv   */
 		}
 	};
 
-static int dib3000mb_get_frontend(struct dvb_frontend* fe,
-				  struct dtv_frontend_properties *c);
+static int dib3000mb_get_frontend(struct dvb_frontend* fe);
 
 static int dib3000mb_set_frontend(struct dvb_frontend* fe, int tuner)
 {
@@ -360,7 +359,7 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe, int tuner)
 		deb_setf("search_state after autosearch %d after %d checks\n",search_state,as_count);
 
 		if (search_state == 1) {
-			if (dib3000mb_get_frontend(fe, c) == 0) {
+			if (dib3000mb_get_frontend(fe) == 0) {
 				deb_setf("reading tuning data from frontend succeeded.\n");
 				return dib3000mb_set_frontend(fe, 0);
 			}
@@ -451,9 +450,9 @@ static int dib3000mb_fe_init(struct dvb_frontend* fe, int mobile_mode)
 	return 0;
 }
 
-static int dib3000mb_get_frontend(struct dvb_frontend* fe,
-				  struct dtv_frontend_properties *c)
+static int dib3000mb_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct dib3000_state* state = fe->demodulator_priv;
 	fe_code_rate_t *cr;
 	u16 tps_val;
drivers/media/dvb/frontends/dib3000mc.c +4 -6
index d98a010..f2ad9ae 100644
@@ -632,9 +632,9 @@ struct i2c_adapter * dib3000mc_get_tuner_i2c_master(struct dvb_frontend *demod,
 
 EXPORT_SYMBOL(dib3000mc_get_tuner_i2c_master);
 
-static int dib3000mc_get_frontend(struct dvb_frontend* fe,
-				  struct dtv_frontend_properties *fep)
+static int dib3000mc_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct dib3000mc_state *state = fe->demodulator_priv;
 	u16 tps = dib3000mc_read_word(state,458);
 
@@ -689,7 +689,7 @@ static int dib3000mc_get_frontend(struct dvb_frontend* fe,
 
 static int dib3000mc_set_frontend(struct dvb_frontend* fe)
 {
-	struct dtv_frontend_properties *fep = &fe->dtv_property_cache, tmp;
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct dib3000mc_state *state = fe->demodulator_priv;
 	int ret;
 
@@ -712,8 +712,6 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe)
 	    fep->code_rate_HP   == FEC_AUTO) {
 		int i = 1000, found;
 
-		tmp = *fep;
-
 		dib3000mc_autosearch_start(fe);
 		do {
 			msleep(1);
@@ -724,7 +722,7 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe)
 		if (found == 0 || found == 1)
 			return 0; // no channel found
 
-		dib3000mc_get_frontend(fe, &tmp);
+		dib3000mc_get_frontend(fe);
 	}
 
 	ret = dib3000mc_tune(fe);
drivers/media/dvb/frontends/dib7000m.c +4 -6
index b6a25a2..aa6a798 100644
@@ -1154,9 +1154,9 @@ static int dib7000m_identify(struct dib7000m_state *state)
 }
 
 
-static int dib7000m_get_frontend(struct dvb_frontend* fe,
-				 struct dtv_frontend_properties *fep)
+static int dib7000m_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct dib7000m_state *state = fe->demodulator_priv;
 	u16 tps = dib7000m_read_word(state,480);
 
@@ -1214,7 +1214,7 @@ static int dib7000m_get_frontend(struct dvb_frontend* fe,
 
 static int dib7000m_set_frontend(struct dvb_frontend* fe)
 {
-	struct dtv_frontend_properties *fep = &fe->dtv_property_cache, tmp;
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct dib7000m_state *state = fe->demodulator_priv;
 	int time, ret;
 
@@ -1239,8 +1239,6 @@ static int dib7000m_set_frontend(struct dvb_frontend* fe)
 		fep->code_rate_HP      == FEC_AUTO) {
 		int i = 800, found;
 
-		tmp = *fep;
-
 		dib7000m_autosearch_start(fe);
 		do {
 			msleep(1);
@@ -1251,7 +1249,7 @@ static int dib7000m_set_frontend(struct dvb_frontend* fe)
 		if (found == 0 || found == 1)
 			return 0; // no channel found
 
-		dib7000m_get_frontend(fe, &tmp);
+		dib7000m_get_frontend(fe);
 	}
 
 	ret = dib7000m_tune(fe);
drivers/media/dvb/frontends/dib7000p.c +4 -5
index c92c1a0..361bdb1 100644
@@ -1384,9 +1384,9 @@ static int dib7000p_identify(struct dib7000p_state *st)
 	return 0;
 }
 
-static int dib7000p_get_frontend(struct dvb_frontend *fe,
-				 struct dtv_frontend_properties *fep)
+static int dib7000p_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct dib7000p_state *state = fe->demodulator_priv;
 	u16 tps = dib7000p_read_word(state, 463);
 
@@ -1482,7 +1482,7 @@ static int dib7000p_get_frontend(struct dvb_frontend *fe,
 
 static int dib7000p_set_frontend(struct dvb_frontend *fe)
 {
-	struct dtv_frontend_properties *fep = &fe->dtv_property_cache, tmp;
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct dib7000p_state *state = fe->demodulator_priv;
 	int time, ret;
 
@@ -1509,7 +1509,6 @@ static int dib7000p_set_frontend(struct dvb_frontend *fe)
 		fep->guard_interval == GUARD_INTERVAL_AUTO || fep->modulation == QAM_AUTO || fep->code_rate_HP == FEC_AUTO) {
 		int i = 800, found;
 
-		tmp = *fep;
 		dib7000p_autosearch_start(fe);
 		do {
 			msleep(1);
@@ -1520,7 +1519,7 @@ static int dib7000p_set_frontend(struct dvb_frontend *fe)
 		if (found == 0 || found == 1)
 			return 0;
 
-		dib7000p_get_frontend(fe, &tmp);
+		dib7000p_get_frontend(fe);
 	}
 
 	ret = dib7000p_tune(fe);
drivers/media/dvb/frontends/dib8000.c +3 -3
index 115c099..fe07d74 100644
@@ -2810,7 +2810,7 @@ int dib8000_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tun
 }
 EXPORT_SYMBOL(dib8000_set_tune_state);
 
-static int dib8000_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *c)
+static int dib8000_get_frontend(struct dvb_frontend *fe)
 {
 	struct dib8000_state *state = fe->demodulator_priv;
 	u16 i, val = 0;
@@ -2824,7 +2824,7 @@ static int dib8000_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_pro
 		if (stat&FE_HAS_SYNC) {
 			dprintk("TMCC lock on the slave%i", index_frontend);
 			/* synchronize the cache with the other frontends */
-			state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], c);
+			state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend]);
 			for (sub_index_frontend = 0; (sub_index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[sub_index_frontend] != NULL); sub_index_frontend++) {
 				if (sub_index_frontend != index_frontend) {
 					state->fe[sub_index_frontend]->dtv_property_cache.isdbt_sb_mode = state->fe[index_frontend]->dtv_property_cache.isdbt_sb_mode;
@@ -3088,7 +3088,7 @@ static int dib8000_set_frontend(struct dvb_frontend *fe)
 
 		dprintk("tune success on frontend%i", index_frontend_success);
 
-		dib8000_get_frontend(fe, &state->fe[0]->dtv_property_cache);
+		dib8000_get_frontend(fe);
 	}
 
 	for (index_frontend = 0, ret = 0; (ret >= 0) && (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++)
drivers/media/dvb/frontends/dib9000.c +3 -3
index 974c2b7..2312b4d 100644
@@ -1867,7 +1867,7 @@ static int dib9000_fe_get_tune_settings(struct dvb_frontend *fe, struct dvb_fron
 	return 0;
 }
 
-static int dib9000_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *c)
+static int dib9000_get_frontend(struct dvb_frontend *fe)
 {
 	struct dib9000_state *state = fe->demodulator_priv;
 	u8 index_frontend, sub_index_frontend;
@@ -1883,7 +1883,7 @@ static int dib9000_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_pro
 			dprintk("TPS lock on the slave%i", index_frontend);
 
 			/* synchronize the cache with the other frontends */
-			state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], c);
+			state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend]);
 			for (sub_index_frontend = 0; (sub_index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[sub_index_frontend] != NULL);
 			     sub_index_frontend++) {
 				if (sub_index_frontend != index_frontend) {
@@ -2054,7 +2054,7 @@ static int dib9000_set_frontend(struct dvb_frontend *fe)
 
 	/* synchronize all the channel cache */
 	state->get_frontend_internal = 1;
-	dib9000_get_frontend(state->fe[0], &state->fe[0]->dtv_property_cache);
+	dib9000_get_frontend(state->fe[0]);
 	state->get_frontend_internal = 0;
 
 	/* retune the other frontends with the found channel */
drivers/media/dvb/frontends/dvb_dummy_fe.c +4 -2
index b5e2a70..0f0796b 100644
@@ -68,8 +68,10 @@ static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int dvb_dummy_fe_get_frontend(struct dvb_frontend *fe,
-				     struct dtv_frontend_properties *c)
+/*
+ * Only needed if it actually reads something from the hardware
+ */
+static int dvb_dummy_fe_get_frontend(struct dvb_frontend *fe)
 {
 	return 0;
 }
drivers/media/dvb/frontends/it913x-fe.c +2 -2
index 5a353cb..187d9ea 100644
@@ -572,9 +572,9 @@ static int it913x_fe_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
 	return 0;
 }
 
-static int it913x_fe_get_frontend(struct dvb_frontend *fe,
-			struct dtv_frontend_properties *p)
+static int it913x_fe_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct it913x_fe_state *state = fe->demodulator_priv;
 	int ret;
 	u8 reg[8];
drivers/media/dvb/frontends/l64781.c +2 -2
index 1784e34..4fc6dda 100644
@@ -243,9 +243,9 @@ static int apply_frontend_param (struct dvb_frontend* fe)
 	return 0;
 }
 
-static int get_frontend(struct dvb_frontend* fe,
-			struct dtv_frontend_properties *p)
+static int get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct l64781_state* state = fe->demodulator_priv;
 	int tmp;
 
drivers/media/dvb/frontends/lgdt3305.c +2 -2
index 58eb7bc..0b289b2 100644
@@ -813,9 +813,9 @@ fail:
 	return ret;
 }
 
-static int lgdt3305_get_frontend(struct dvb_frontend *fe,
-				 struct dtv_frontend_properties *p)
+static int lgdt3305_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct lgdt3305_state *state = fe->demodulator_priv;
 
 	lg_dbg("\n");
drivers/media/dvb/frontends/lgdt330x.c +2 -2
index f117eeb..cf69df3 100644
@@ -428,9 +428,9 @@ static int lgdt330x_set_parameters(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int lgdt330x_get_frontend(struct dvb_frontend *fe,
-				 struct dtv_frontend_properties *p)
+static int lgdt330x_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct lgdt330x_state *state = fe->demodulator_priv;
 	p->frequency = state->current_frequency;
 	return 0;
drivers/media/dvb/frontends/lgs8gl5.c +2 -2
index 0f4bc16..8f2f43b 100644
@@ -336,9 +336,9 @@ lgs8gl5_set_frontend(struct dvb_frontend *fe)
 
 
 static int
-lgs8gl5_get_frontend(struct dvb_frontend *fe,
-		struct dtv_frontend_properties *p)
+lgs8gl5_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct lgs8gl5_state *state = fe->demodulator_priv;
 	u8 inv = lgs8gl5_read_reg(state, REG_INVERSION);
 
drivers/media/dvb/frontends/lgs8gxx.c +2 -2
index da7d8f6..a47add2 100644
@@ -691,9 +691,9 @@ static int lgs8gxx_set_fe(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int lgs8gxx_get_fe(struct dvb_frontend *fe,
-			  struct dtv_frontend_properties *fe_params)
+static int lgs8gxx_get_fe(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache;
 	dprintk("%s\n", __func__);
 
 	/* TODO: get real readings from device */
drivers/media/dvb/frontends/mb86a20s.c +2 -2
index d71d6ee..4267e51 100644
@@ -525,9 +525,9 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe)
 	return rc;
 }
 
-static int mb86a20s_get_frontend(struct dvb_frontend *fe,
-				 struct dtv_frontend_properties *p)
+static int mb86a20s_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 
 	/* FIXME: For now, it does nothing */
 
drivers/media/dvb/frontends/mt312.c +2 -2
index 3e4512a..90aac0d 100644
@@ -636,9 +636,9 @@ static int mt312_set_frontend(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int mt312_get_frontend(struct dvb_frontend *fe,
-			      struct dtv_frontend_properties *p)
+static int mt312_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct mt312_state *state = fe->demodulator_priv;
 	int ret;
 
drivers/media/dvb/frontends/mt352.c +2 -2
index 0155fa8..84129ae 100644
@@ -311,9 +311,9 @@ static int mt352_set_parameters(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int mt352_get_parameters(struct dvb_frontend* fe,
-				struct dtv_frontend_properties *op)
+static int mt352_get_parameters(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *op = &fe->dtv_property_cache;
 	struct mt352_state* state = fe->demodulator_priv;
 	u16 tps;
 	u16 div;
drivers/media/dvb/frontends/or51132.c +2 -2
index 2d9e81b..5bb6f3e 100644
@@ -375,9 +375,9 @@ static int or51132_set_parameters(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int or51132_get_parameters(struct dvb_frontend* fe,
-				  struct dtv_frontend_properties *p)
+static int or51132_get_parameters(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct or51132_state* state = fe->demodulator_priv;
 	int status;
 	int retry = 1;
drivers/media/dvb/frontends/s5h1409.c +2 -2
index 2641fd5..21baea8 100644
@@ -925,9 +925,9 @@ static int s5h1409_read_ber(struct dvb_frontend *fe, u32 *ber)
 	return s5h1409_read_ucblocks(fe, ber);
 }
 
-static int s5h1409_get_frontend(struct dvb_frontend *fe,
-				struct dtv_frontend_properties *p)
+static int s5h1409_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct s5h1409_state *state = fe->demodulator_priv;
 
 	p->frequency = state->current_frequency;
drivers/media/dvb/frontends/s5h1411.c +2 -2
index 08f568c..b8c7feb 100644
@@ -840,9 +840,9 @@ static int s5h1411_read_ber(struct dvb_frontend *fe, u32 *ber)
 	return s5h1411_read_ucblocks(fe, ber);
 }
 
-static int s5h1411_get_frontend(struct dvb_frontend *fe,
-				struct dtv_frontend_properties *p)
+static int s5h1411_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct s5h1411_state *state = fe->demodulator_priv;
 
 	p->frequency = state->current_frequency;
drivers/media/dvb/frontends/s5h1420.c +2 -2
index 0726494..3d0334a 100644
@@ -765,9 +765,9 @@ static int s5h1420_set_frontend(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int s5h1420_get_frontend(struct dvb_frontend* fe,
-				struct dtv_frontend_properties *p)
+static int s5h1420_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct s5h1420_state* state = fe->demodulator_priv;
 
 	p->frequency = state->tunedfreq + s5h1420_getfreqoffset(state);
drivers/media/dvb/frontends/s921.c +2 -2
index 7652d3f..6012e10 100644
@@ -433,9 +433,9 @@ static int s921_set_frontend(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int s921_get_frontend(struct dvb_frontend *fe,
-	struct dtv_frontend_properties *p)
+static int s921_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct s921_state *state = fe->demodulator_priv;
 
 	/* FIXME: Probably it is possible to get it from regs f1 and f2 */
drivers/media/dvb/frontends/stb0899_drv.c +2 -1
index 9fad627..c9e1785 100644
@@ -1569,8 +1569,9 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe)
 	return DVBFE_ALGO_SEARCH_ERROR;
 }
 
-static int stb0899_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
+static int stb0899_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct stb0899_state *state		= fe->demodulator_priv;
 	struct stb0899_internal *internal	= &state->internal;
 
drivers/media/dvb/frontends/stb6100.c +1 -1
index a566763..2d7c901 100644
@@ -337,7 +337,7 @@ static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency)
 
 	if (fe->ops.get_frontend) {
 		dprintk(verbose, FE_DEBUG, 1, "Get frontend parameters");
-		fe->ops.get_frontend(fe, &p);
+		fe->ops.get_frontend(fe);
 	}
 	srate = p.symbol_rate;
 
drivers/media/dvb/frontends/stv0297.c +2 -1
index 88e8e52..dd0a190 100644
@@ -614,8 +614,9 @@ timeout:
 	return 0;
 }
 
-static int stv0297_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
+static int stv0297_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct stv0297_state *state = fe->demodulator_priv;
 	int reg_00, reg_83;
 
drivers/media/dvb/frontends/stv0299.c +2 -1
index ad6f3a6..114d112 100644
@@ -596,8 +596,9 @@ static int stv0299_set_frontend(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int stv0299_get_frontend(struct dvb_frontend* fe, struct dtv_frontend_properties * p)
+static int stv0299_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct stv0299_state* state = fe->demodulator_priv;
 	s32 derot_freq;
 	int invval;
drivers/media/dvb/frontends/stv0367.c +4 -4
index 7c8964f6..6786b9e 100644
@@ -1926,9 +1926,9 @@ static int stv0367ter_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
 	return 0;
 }
 
-static int stv0367ter_get_frontend(struct dvb_frontend *fe,
-				   struct dtv_frontend_properties *p)
+static int stv0367ter_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct stv0367_state *state = fe->demodulator_priv;
 	struct stv0367ter_state *ter_state = state->ter_state;
 
@@ -3136,9 +3136,9 @@ static int stv0367cab_set_frontend(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int stv0367cab_get_frontend(struct dvb_frontend *fe,
-				   struct dtv_frontend_properties *p)
+static int stv0367cab_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct stv0367_state *state = fe->demodulator_priv;
 	struct stv0367cab_state *cab_state = state->cab_state;
 
drivers/media/dvb/frontends/stv0900_core.c +2 -2
index 8af1e624..33325ae 100644
@@ -1843,9 +1843,9 @@ static int stv0900_sleep(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int stv0900_get_frontend(struct dvb_frontend *fe,
-				struct dtv_frontend_properties *p)
+static int stv0900_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct stv0900_state *state = fe->demodulator_priv;
 	struct stv0900_internal *intp = state->internal;
 	enum fe_stv0900_demod_num demod = state->demod;
drivers/media/dvb/frontends/tda10021.c +2 -1
index c8ab01b..035e0e2 100644
@@ -386,8 +386,9 @@ static int tda10021_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int tda10021_get_frontend(struct dvb_frontend* fe, struct dtv_frontend_properties *p)
+static int tda10021_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct tda10021_state* state = fe->demodulator_priv;
 	int sync;
 	s8 afc = 0;
drivers/media/dvb/frontends/tda10023.c +2 -1
index 8f451dc..55d7563 100644
@@ -456,8 +456,9 @@ static int tda10023_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int tda10023_get_frontend(struct dvb_frontend* fe, struct dtv_frontend_properties *p)
+static int tda10023_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct tda10023_state* state = fe->demodulator_priv;
 	int sync,inv;
 	s8 afc = 0;
drivers/media/dvb/frontends/tda10048.c +2 -2
index dfd1d5a..99bf0c0 100644
@@ -1028,9 +1028,9 @@ static int tda10048_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
 	return 0;
 }
 
-static int tda10048_get_frontend(struct dvb_frontend *fe,
-	struct dtv_frontend_properties *p)
+static int tda10048_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct tda10048_state *state = fe->demodulator_priv;
 
 	dprintk(1, "%s()\n", __func__);
drivers/media/dvb/frontends/tda1004x.c +2 -1
index d5e68af..e180103 100644
@@ -895,8 +895,9 @@ static int tda1004x_set_fe(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int tda1004x_get_fe(struct dvb_frontend* fe, struct dtv_frontend_properties *fe_params)
+static int tda1004x_get_fe(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache;
 	struct tda1004x_state* state = fe->demodulator_priv;
 
 	dprintk("%s\n", __func__);
drivers/media/dvb/frontends/tda10071.c +2 -2
index 68dcce6..d9e0bd9 100644
@@ -776,9 +776,9 @@ error:
 	return ret;
 }
 
-static int tda10071_get_frontend(struct dvb_frontend *fe,
-	struct dtv_frontend_properties *p)
+static int tda10071_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct tda10071_priv *priv = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	int ret, i;
drivers/media/dvb/frontends/tda10086.c +2 -1
index cfc6e0e..83256d5 100644
@@ -457,8 +457,9 @@ static int tda10086_set_frontend(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int tda10086_get_frontend(struct dvb_frontend* fe, struct dtv_frontend_properties *fe_params)
+static int tda10086_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache;
 	struct tda10086_state* state = fe->demodulator_priv;
 	u8 val;
 	int tmp;
drivers/media/dvb/frontends/tda8083.c +2 -1
index 88a22d3..7a16e8d 100644
@@ -335,8 +335,9 @@ static int tda8083_set_frontend(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int tda8083_get_frontend(struct dvb_frontend* fe, struct dtv_frontend_properties *p)
+static int tda8083_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct tda8083_state* state = fe->demodulator_priv;
 
 	/*  FIXME: get symbolrate & frequency offset...*/
drivers/media/dvb/frontends/ves1820.c +2 -1
index ef1b5fe..37ff9f0 100644
@@ -310,8 +310,9 @@ static int ves1820_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int ves1820_get_frontend(struct dvb_frontend* fe, struct dtv_frontend_properties *p)
+static int ves1820_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ves1820_state* state = fe->demodulator_priv;
 	int sync;
 	s8 afc = 0;
drivers/media/dvb/frontends/ves1x93.c +2 -2
index 15929c2..13f3a21 100644
@@ -403,9 +403,9 @@ static int ves1x93_set_frontend(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int ves1x93_get_frontend(struct dvb_frontend* fe,
-				struct dtv_frontend_properties *p)
+static int ves1x93_get_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ves1x93_state* state = fe->demodulator_priv;
 	int afc;
 
drivers/media/dvb/frontends/zl10353.c +2 -2
index 39c1bdb..816fa86 100644
@@ -371,9 +371,9 @@ static int zl10353_set_parameters(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int zl10353_get_parameters(struct dvb_frontend *fe,
-				  struct dtv_frontend_properties *c)
+static int zl10353_get_parameters(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct zl10353_state *state = fe->demodulator_priv;
 	int s6, s9;
 	u16 tps;
drivers/media/dvb/siano/smsdvb.c +2 -2
index 71ee9fa..198cc0e 100644
@@ -739,9 +739,9 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe)
 	}
 }
 
-static int smsdvb_get_frontend(struct dvb_frontend *fe,
-			      struct dtv_frontend_properties *fep)
+static int smsdvb_get_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct smsdvb_client_t *client =
 		container_of(fe, struct smsdvb_client_t, frontend);
 
drivers/media/video/tlg2300/pd-dvb.c +2 -2
index 7998811..d7aac42 100644
@@ -231,9 +231,9 @@ static s32 poseidon_fe_init(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int poseidon_get_fe(struct dvb_frontend *fe,
-			struct dtv_frontend_properties *fep)
+static int poseidon_get_fe(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct poseidon *pd = fe->demodulator_priv;
 	struct pd_dvb_adapter *pd_dvb = &pd->dvb_data;
 
#104 lore raw

Re: [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback

In reply to Andreas Oberritter
Quoted 6 lines · Andreas Oberritter
Quoted 2 lines · Mauro Carvalho Chehab

One usage of such call would be to retrieve the autodetected properties, after having a frontend lock.

Btw., dvb_frontend already refreshes the cache whenever the lock status changes, i.e. when generating frontend events.

Btw, the event ioctl is DVBv3 only. It probably makes sense to add one DTV command to implement it.

In a matter of fact, IMO, the better is to implement a set of DTV read status commands, plus one command for event.

This way, a status call could return the events that are specific for each delivery system, instead of returning something that will require the userspace to do a FE_GET_PROPERTY call, in order to get the real parameters for the newer delivery systems.

The current status API has some limits for some new delivery systems. For example, on ISDB-T, devices can produce both consolidated and per-layer status.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#105 lore raw

Re: [PATCH RFC 01/91] [media] dvb-core: allow demods to specify the supported delivery systems supported standards.

In reply to Mauro Carvalho Chehab
Quoted 1 line · Mauro Carvalho Chehab

DVB-S and DVB-T, as those were the standards supported by DVBv3.

The description seems to be incomplete.

Quoted 35 lines

New standards like DSS, ISDB and CTTB don't fit on any of the above types.

while there's a way for the drivers to explicitly change whatever default DELSYS were filled inside the core, still a fake value is needed there, and a "compat" code to allow DVBv3 applications to work with those delivery systems is needed. This is good for a short term solution, while applications aren't using DVBv5 directly.

However, at long term, this is bad, as the compat code runs even if the application is using DVBv5. Also, the compat code is not perfect, and only works when the frontend is capable of auto-detecting the parameters that aren't visible by the faked delivery systems.

So, let the frontend fill the supported delivery systems at the device properties directly, and, in the future, let the core to use the delsys to fill the reported info::type based on the delsys.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   13 +++++++++++++
 drivers/media/dvb/dvb-core/dvb_frontend.h |    8 ++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +3 -0
index 8dedff4..f17c411 100644
@@ -1252,6 +1252,19 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 	const struct dvb_frontend_info *info = &fe->ops.info;
 	u32 ncaps = 0;
 
+	/*
+	 * If the frontend explicitly sets a list, use it, instead of
+	 * filling based on the info->type

drivers/media/dvb/dvb-core/dvb_frontend.c static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct · line 1267

Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +10 -0
+	 */
+	if (fe->ops.delsys[ncaps]) {
+		while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
+			p->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
+			ncaps++;
+		}
+		p->u.buffer.len = ncaps;
+		return;
+	}
+

I don't understand what this is trying to solve. This is already handled by the get_property driver callback.

dtv_set_default_delivery_caps() only sets some defaults for drivers not implementing get_property yet.

#106 lore raw

Re: [PATCH RFC 01/91] [media] dvb-core: allow demods to specify the supported delivery systems supported standards.

Quoted 54 lines · Andreas Oberritter
Quoted 1 line · Mauro Carvalho Chehab

DVB-S and DVB-T, as those were the standards supported by DVBv3.

The description seems to be incomplete.

Quoted 35 lines

New standards like DSS, ISDB and CTTB don't fit on any of the above types.

while there's a way for the drivers to explicitly change whatever default DELSYS were filled inside the core, still a fake value is needed there, and a "compat" code to allow DVBv3 applications to work with those delivery systems is needed. This is good for a short term solution, while applications aren't using DVBv5 directly.

However, at long term, this is bad, as the compat code runs even if the application is using DVBv5. Also, the compat code is not perfect, and only works when the frontend is capable of auto-detecting the parameters that aren't visible by the faked delivery systems.

So, let the frontend fill the supported delivery systems at the device properties directly, and, in the future, let the core to use the delsys to fill the reported info::type based on the delsys.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   13 +++++++++++++
 drivers/media/dvb/dvb-core/dvb_frontend.h |    8 ++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +3 -0
index 8dedff4..f17c411 100644
@@ -1252,6 +1252,19 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 	const struct dvb_frontend_info *info = &fe->ops.info;
 	u32 ncaps = 0;
 
+	/*
+	 * If the frontend explicitly sets a list, use it, instead of
+	 * filling based on the info->type

drivers/media/dvb/dvb-core/dvb_frontend.c static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct · line 1267

Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +10 -0
+	 */
+	if (fe->ops.delsys[ncaps]) {
+		while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
+			p->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
+			ncaps++;
+		}
+		p->u.buffer.len = ncaps;
+		return;
+	}
+

I don't understand what this is trying to solve. This is already handled by the get_property driver callback.

Quoted 2 lines

dtv_set_default_delivery_caps() only sets some defaults for drivers not implementing get_property yet.

dtv_set_default_delivery_caps() does the wrong thing for delivery systems like ISDB-T, ISDB-S, DSS, DMB-TH, as it fills data with a fake value that is there at fe->ops.info.type.

The fake values there should be used only for DVBv3 legacy calls emulation on those delivery systems that are not fully compatible with a DVBv3 call.

At the end, I think we should deprecate the fe->ops.info.type, as its contents is not reliable (as it can represent something else).

Btw, there are several places at dvb_frontend.c that uses the info.type to assume the delivery system. This leads DVB core to do the wrong assumptions for non-DVBv3 supported systems. The right way is to use a new field that really represents the supported delivery systems by a given frontend, instead of relying on fe->ops.info.type.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#107 lore raw

Re: [PATCH RFC 01/91] [media] dvb-core: allow demods to specify the supported delivery systems supported standards.

Quoted 58 lines · Mauro Carvalho Chehab
Quoted 54 lines · Andreas Oberritter
Quoted 1 line · Mauro Carvalho Chehab

DVB-S and DVB-T, as those were the standards supported by DVBv3.

The description seems to be incomplete.

Quoted 35 lines

New standards like DSS, ISDB and CTTB don't fit on any of the above types.

while there's a way for the drivers to explicitly change whatever default DELSYS were filled inside the core, still a fake value is needed there, and a "compat" code to allow DVBv3 applications to work with those delivery systems is needed. This is good for a short term solution, while applications aren't using DVBv5 directly.

However, at long term, this is bad, as the compat code runs even if the application is using DVBv5. Also, the compat code is not perfect, and only works when the frontend is capable of auto-detecting the parameters that aren't visible by the faked delivery systems.

So, let the frontend fill the supported delivery systems at the device properties directly, and, in the future, let the core to use the delsys to fill the reported info::type based on the delsys.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   13 +++++++++++++
 drivers/media/dvb/dvb-core/dvb_frontend.h |    8 ++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +3 -0
index 8dedff4..f17c411 100644
@@ -1252,6 +1252,19 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 	const struct dvb_frontend_info *info = &fe->ops.info;
 	u32 ncaps = 0;
 
+	/*
+	 * If the frontend explicitly sets a list, use it, instead of
+	 * filling based on the info->type

drivers/media/dvb/dvb-core/dvb_frontend.c static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct · line 1267

Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +10 -0
+	 */
+	if (fe->ops.delsys[ncaps]) {
+		while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
+			p->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
+			ncaps++;
+		}
+		p->u.buffer.len = ncaps;
+		return;
+	}
+

I don't understand what this is trying to solve. This is already handled by the get_property driver callback.

Quoted 2 lines

dtv_set_default_delivery_caps() only sets some defaults for drivers not implementing get_property yet.

Quoted 6 lines

dtv_set_default_delivery_caps() does the wrong thing for delivery systems like ISDB-T, ISDB-S, DSS, DMB-TH, as it fills data with a fake value that is there at fe->ops.info.type.

The fake values there should be used only for DVBv3 legacy calls emulation on those delivery systems that are not fully compatible with a DVBv3 call.

That's right. Still, there's no need to introduce fe->ops.delsys, because the drivers in question could just implement get_property instead. At least that's what we discussed and AFAIR agreed upon when Manu recently submitted his patches regarding enumeration of delivery systems.

Quoted 15 lines

At the end, I think we should deprecate the fe->ops.info.type, as its contents is not reliable (as it can represent something else).

Btw, there are several places at dvb_frontend.c that uses the info.type to assume the delivery system. This leads DVB core to do the wrong assumptions for non-DVBv3 supported systems. The right way is to use a new field that really represents the supported delivery systems by a given frontend, instead of relying on fe->ops.info.type.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#108 lore raw

Re: [PATCH RFC 01/91] [media] dvb-core: allow demods to specify the supported delivery systems supported standards.

Quoted 63 lines · Andreas Oberritter
Quoted 62 lines · Mauro Carvalho Chehab
Quoted 54 lines · Andreas Oberritter
Quoted 1 line · Mauro Carvalho Chehab

DVB-S and DVB-T, as those were the standards supported by DVBv3.

The description seems to be incomplete.

Quoted 35 lines

New standards like DSS, ISDB and CTTB don't fit on any of the above types.

while there's a way for the drivers to explicitly change whatever default DELSYS were filled inside the core, still a fake value is needed there, and a "compat" code to allow DVBv3 applications to work with those delivery systems is needed. This is good for a short term solution, while applications aren't using DVBv5 directly.

However, at long term, this is bad, as the compat code runs even if the application is using DVBv5. Also, the compat code is not perfect, and only works when the frontend is capable of auto-detecting the parameters that aren't visible by the faked delivery systems.

So, let the frontend fill the supported delivery systems at the device properties directly, and, in the future, let the core to use the delsys to fill the reported info::type based on the delsys.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   13 +++++++++++++
 drivers/media/dvb/dvb-core/dvb_frontend.h |    8 ++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +3 -0
index 8dedff4..f17c411 100644
@@ -1252,6 +1252,19 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 	const struct dvb_frontend_info *info = &fe->ops.info;
 	u32 ncaps = 0;
 
+	/*
+	 * If the frontend explicitly sets a list, use it, instead of
+	 * filling based on the info->type

drivers/media/dvb/dvb-core/dvb_frontend.c static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct · line 1267

Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +10 -0
+	 */
+	if (fe->ops.delsys[ncaps]) {
+		while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
+			p->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
+			ncaps++;
+		}
+		p->u.buffer.len = ncaps;
+		return;
+	}
+

I don't understand what this is trying to solve. This is already handled by the get_property driver callback.

Quoted 2 lines

dtv_set_default_delivery_caps() only sets some defaults for drivers not implementing get_property yet.

dtv_set_default_delivery_caps() does the wrong thing for delivery systems like ISDB-T, ISDB-S, DSS, DMB-TH, as it fills data with a fake value that is there at fe->ops.info.type.

Quoted 8 lines
Quoted 2 lines

The fake values there should be used only for DVBv3 legacy calls emulation on those delivery systems that are not fully compatible with a DVBv3 call.

That's right. Still, there's no need to introduce fe->ops.delsys, because the drivers in question could just implement get_property instead. At least that's what we discussed and AFAIR agreed upon when Manu recently submitted his patches regarding enumeration of delivery systems.

Manu's patches were applied (well, except for two patches related to af9013 driver that are/were under discussion between Manu and Antti).

Manu's approach is good, as it provided a way to enumerate the standards without much changes, offering a way for userspace to query the delivery system, at the expense of serializing a driver call for each property.

Yet, it doesn't allow the DVB core to detect the supported delivery systems on a sane way [1].

The addition of fe->ops.delsys is going one step further, as it will allow, at the long term, the removal of info.type.

There are two reasons why we need to get rid of info.type:

1) dvb_frontend core can be changed to use fe->ops.delsys internally, instead of info.type, in order to fix some bugs inside it, where it does the wrong assumption, because the frontend is lying about the delivery system;

2) There is no sane way to fill fe->ops.info.type for Multi delivery system frontends, like DRX-K, that supports both DVB-T and DVB-C. The type can be filled with either FE_QAM or FE_OFDM, not with both. So, choosing either type will be plain wrong, and may cause bad side effects inside dvb_frontend.

[1] Ok, it would be possible to do a hack internally, for it to call get_property() but it is a way more sane to just read fe->ops.delsys.

Quoted 21 lines
Quoted 16 lines

At the end, I think we should deprecate the fe->ops.info.type, as its contents is not reliable (as it can represent something else).

Btw, there are several places at dvb_frontend.c that uses the info.type to assume the delivery system. This leads DVB core to do the wrong assumptions for non-DVBv3 supported systems. The right way is to use a new field that really represents the supported delivery systems by a given frontend, instead of relying on fe->ops.info.type.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#109 lore raw

Re: [PATCH RFC 01/91] [media] dvb-core: allow demods to specify the supported delivery systems supported standards.

Quoted 67 lines · Mauro Carvalho Chehab
Quoted 66 lines · Andreas Oberritter
Quoted 64 lines · Mauro Carvalho Chehab
Quoted 54 lines · Andreas Oberritter
Quoted 1 line · Mauro Carvalho Chehab

DVB-S and DVB-T, as those were the standards supported by DVBv3.

The description seems to be incomplete.

Quoted 35 lines

New standards like DSS, ISDB and CTTB don't fit on any of the above types.

while there's a way for the drivers to explicitly change whatever default DELSYS were filled inside the core, still a fake value is needed there, and a "compat" code to allow DVBv3 applications to work with those delivery systems is needed. This is good for a short term solution, while applications aren't using DVBv5 directly.

However, at long term, this is bad, as the compat code runs even if the application is using DVBv5. Also, the compat code is not perfect, and only works when the frontend is capable of auto-detecting the parameters that aren't visible by the faked delivery systems.

So, let the frontend fill the supported delivery systems at the device properties directly, and, in the future, let the core to use the delsys to fill the reported info::type based on the delsys.

---
  drivers/media/dvb/dvb-core/dvb_frontend.c |   13 +++++++++++++
  drivers/media/dvb/dvb-core/dvb_frontend.h |    8 ++++++++
  2 files changed, 21 insertions(+), 0 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +3 -0
index 8dedff4..f17c411 100644
@@ -1252,6 +1252,19 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
  	const struct dvb_frontend_info *info =&fe->ops.info;
  	u32 ncaps = 0;
 
+	/*
+	 * If the frontend explicitly sets a list, use it, instead of
+	 * filling based on the info->type

drivers/media/dvb/dvb-core/dvb_frontend.c static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct · line 1267

Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +10 -0
+	 */
+	if (fe->ops.delsys[ncaps]) {
+		while (fe->ops.delsys[ncaps]&&  ncaps<  MAX_DELSYS) {
+			p->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
+			ncaps++;
+		}
+		p->u.buffer.len = ncaps;
+		return;
+	}
+

I don't understand what this is trying to solve. This is already handled by the get_property driver callback.

Quoted 2 lines

dtv_set_default_delivery_caps() only sets some defaults for drivers not implementing get_property yet.

dtv_set_default_delivery_caps() does the wrong thing for delivery systems like ISDB-T, ISDB-S, DSS, DMB-TH, as it fills data with a fake value that is there at fe->ops.info.type.

The fake values there should be used only for DVBv3 legacy calls emulation on those delivery systems that are not fully compatible with a DVBv3 call.

Quoted 8 lines
Quoted 5 lines

That's right. Still, there's no need to introduce fe->ops.delsys, because the drivers in question could just implement get_property instead. At least that's what we discussed and AFAIR agreed upon when Manu recently submitted his patches regarding enumeration of delivery systems.

Manu's patches were applied (well, except for two patches related to af9013 driver that are/were under discussion between Manu and Antti).

For me Manu's CXD2820R driver change is OK. I only opened question what is meaning of .init() callback as there is now code I like to see be in .init() is now moved to .set_frontend(). And as you explained, .init() is useless and I will remove it slowly from all my drivers (maybe others too).

Quoted 18 lines

Manu's approach is good, as it provided a way to enumerate the standards without much changes, offering a way for userspace to query the delivery system, at the expense of serializing a driver call for each property.

Yet, it doesn't allow the DVB core to detect the supported delivery systems on a sane way [1].

The addition of fe->ops.delsys is going one step further, as it will allow, at the long term, the removal of info.type.

There are two reasons why we need to get rid of info.type:

1) dvb_frontend core can be changed to use fe->ops.delsys internally, instead of info.type, in order to fix some bugs inside it, where it does the wrong assumption, because the frontend is lying about the delivery system;

Quoted 18 lines

2) There is no sane way to fill fe->ops.info.type for Multi delivery system frontends, like DRX-K, that supports both DVB-T and DVB-C. The type can be filled with either FE_QAM or FE_OFDM, not with both. So, choosing either type will be plain wrong, and may cause bad side effects inside dvb_frontend.

[1] Ok, it would be possible to do a hack internally, for it to call get_property() but it is a way more sane to just read fe->ops.delsys.

Quoted 9 lines
Quoted 9 lines

At the end, I think we should deprecate the fe->ops.info.type, as its contents is not reliable (as it can represent something else).

Btw, there are several places at dvb_frontend.c that uses the info.type to assume the delivery system. This leads DVB core to do the wrong assumptions for non-DVBv3 supported systems. The right way is to use a new field that really represents the supported delivery systems by a given frontend, instead of relying on fe->ops.info.type.

regards
Antti

Signature · 1 line
http://palosaari.fi/
#110 lore raw

Re: [PATCH RFC 01/91] [media] dvb-core: allow demods to specify the supported delivery systems supported standards.

Quoted 74 lines · Antti Palosaari
Quoted 73 lines · Mauro Carvalho Chehab
Quoted 71 lines · Andreas Oberritter
Quoted 58 lines · Mauro Carvalho Chehab
Quoted 54 lines · Andreas Oberritter
Quoted 1 line · Mauro Carvalho Chehab

DVB-S and DVB-T, as those were the standards supported by DVBv3.

The description seems to be incomplete.

Quoted 35 lines

New standards like DSS, ISDB and CTTB don't fit on any of the above types.

while there's a way for the drivers to explicitly change whatever default DELSYS were filled inside the core, still a fake value is needed there, and a "compat" code to allow DVBv3 applications to work with those delivery systems is needed. This is good for a short term solution, while applications aren't using DVBv5 directly.

However, at long term, this is bad, as the compat code runs even if the application is using DVBv5. Also, the compat code is not perfect, and only works when the frontend is capable of auto-detecting the parameters that aren't visible by the faked delivery systems.

So, let the frontend fill the supported delivery systems at the device properties directly, and, in the future, let the core to use the delsys to fill the reported info::type based on the delsys.

---
  drivers/media/dvb/dvb-core/dvb_frontend.c |   13 +++++++++++++
  drivers/media/dvb/dvb-core/dvb_frontend.h |    8 ++++++++
  2 files changed, 21 insertions(+), 0 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +3 -0
index 8dedff4..f17c411 100644
@@ -1252,6 +1252,19 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
      const struct dvb_frontend_info *info =&fe->ops.info;
      u32 ncaps = 0;
 
+    /*
+     * If the frontend explicitly sets a list, use it, instead of
+     * filling based on the info->type

drivers/media/dvb/dvb-core/dvb_frontend.c static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct · line 1267

Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +10 -0
+     */
+    if (fe->ops.delsys[ncaps]) {
+        while (fe->ops.delsys[ncaps]&&  ncaps<  MAX_DELSYS) {
+            p->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
+            ncaps++;
+        }
+        p->u.buffer.len = ncaps;
+        return;
+    }
+

I don't understand what this is trying to solve. This is already handled by the get_property driver callback.

Quoted 2 lines

dtv_set_default_delivery_caps() only sets some defaults for drivers not implementing get_property yet.

Quoted 6 lines

dtv_set_default_delivery_caps() does the wrong thing for delivery systems like ISDB-T, ISDB-S, DSS, DMB-TH, as it fills data with a fake value that is there at fe->ops.info.type.

The fake values there should be used only for DVBv3 legacy calls emulation on those delivery systems that are not fully compatible with a DVBv3 call.

That's right. Still, there's no need to introduce fe->ops.delsys, because the drivers in question could just implement get_property instead. At least that's what we discussed and AFAIR agreed upon when Manu recently submitted his patches regarding enumeration of delivery systems.

Quoted 7 lines
Quoted 2 lines

Manu's patches were applied (well, except for two patches related to af9013 driver that are/were under discussion between Manu and Antti).

For me Manu's CXD2820R driver change is OK. I only opened question what is meaning of .init() callback as there is now code I like to see be in .init() is now moved to .set_frontend(). And as you explained, .init() is useless and I will remove it slowly from all my drivers (maybe others too).

OK, I'll merge Manu's cxd2820r changes then, with your acked-by, during this week.

Quoted 41 lines
Quoted 19 lines

Manu's approach is good, as it provided a way to enumerate the standards without much changes, offering a way for userspace to query the delivery system, at the expense of serializing a driver call for each property.

Yet, it doesn't allow the DVB core to detect the supported delivery systems on a sane way [1].

The addition of fe->ops.delsys is going one step further, as it will allow, at the long term, the removal of info.type.

There are two reasons why we need to get rid of info.type:

1) dvb_frontend core can be changed to use fe->ops.delsys internally, instead of info.type, in order to fix some bugs inside it, where it does the wrong assumption, because the frontend is lying about the delivery system;

Quoted 18 lines

2) There is no sane way to fill fe->ops.info.type for Multi delivery system frontends, like DRX-K, that supports both DVB-T and DVB-C. The type can be filled with either FE_QAM or FE_OFDM, not with both. So, choosing either type will be plain wrong, and may cause bad side effects inside dvb_frontend.

[1] Ok, it would be possible to do a hack internally, for it to call get_property() but it is a way more sane to just read fe->ops.delsys.

Quoted 9 lines
Quoted 9 lines

At the end, I think we should deprecate the fe->ops.info.type, as its contents is not reliable (as it can represent something else).

Btw, there are several places at dvb_frontend.c that uses the info.type to assume the delivery system. This leads DVB core to do the wrong assumptions for non-DVBv3 supported systems. The right way is to use a new field that really represents the supported delivery systems by a given frontend, instead of relying on fe->ops.info.type.

regards
Antti

#111 lore raw

Re: [PATCH RFC 01/91] [media] dvb-core: allow demods to specify the supported delivery systems supported standards.

In reply to Mauro Carvalho Chehab
Quoted 81 lines · Mauro Carvalho Chehab
Quoted 63 lines · Andreas Oberritter
Quoted 62 lines · Mauro Carvalho Chehab
Quoted 54 lines · Andreas Oberritter
Quoted 1 line · Mauro Carvalho Chehab

DVB-S and DVB-T, as those were the standards supported by DVBv3.

The description seems to be incomplete.

Quoted 35 lines

New standards like DSS, ISDB and CTTB don't fit on any of the above types.

while there's a way for the drivers to explicitly change whatever default DELSYS were filled inside the core, still a fake value is needed there, and a "compat" code to allow DVBv3 applications to work with those delivery systems is needed. This is good for a short term solution, while applications aren't using DVBv5 directly.

However, at long term, this is bad, as the compat code runs even if the application is using DVBv5. Also, the compat code is not perfect, and only works when the frontend is capable of auto-detecting the parameters that aren't visible by the faked delivery systems.

So, let the frontend fill the supported delivery systems at the device properties directly, and, in the future, let the core to use the delsys to fill the reported info::type based on the delsys.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   13 +++++++++++++
 drivers/media/dvb/dvb-core/dvb_frontend.h |    8 ++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +3 -0
index 8dedff4..f17c411 100644
@@ -1252,6 +1252,19 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 	const struct dvb_frontend_info *info = &fe->ops.info;
 	u32 ncaps = 0;
 
+	/*
+	 * If the frontend explicitly sets a list, use it, instead of
+	 * filling based on the info->type

drivers/media/dvb/dvb-core/dvb_frontend.c static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct · line 1267

Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +10 -0
+	 */
+	if (fe->ops.delsys[ncaps]) {
+		while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
+			p->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
+			ncaps++;
+		}
+		p->u.buffer.len = ncaps;
+		return;
+	}
+

I don't understand what this is trying to solve. This is already handled by the get_property driver callback.

Quoted 2 lines

dtv_set_default_delivery_caps() only sets some defaults for drivers not implementing get_property yet.

dtv_set_default_delivery_caps() does the wrong thing for delivery systems like ISDB-T, ISDB-S, DSS, DMB-TH, as it fills data with a fake value that is there at fe->ops.info.type.

Quoted 8 lines
Quoted 2 lines

The fake values there should be used only for DVBv3 legacy calls emulation on those delivery systems that are not fully compatible with a DVBv3 call.

That's right. Still, there's no need to introduce fe->ops.delsys, because the drivers in question could just implement get_property instead. At least that's what we discussed and AFAIR agreed upon when Manu recently submitted his patches regarding enumeration of delivery systems.

Manu's patches were applied (well, except for two patches related to af9013 driver that are/were under discussion between Manu and Antti).

Manu's approach is good, as it provided a way to enumerate the standards without much changes, offering a way for userspace to query the delivery system, at the expense of serializing a driver call for each property.

Quoted 5 lines

Yet, it doesn't allow the DVB core to detect the supported delivery systems on a sane way [1].

The addition of fe->ops.delsys is going one step further, as it will allow, at the long term, the removal of info.type.

You can't remove info.type, as it would break userspace. What you can do is deprecate its use inside drivers.

Quoted 7 lines

There are two reasons why we need to get rid of info.type:

1) dvb_frontend core can be changed to use fe->ops.delsys internally, instead of info.type, in order to fix some bugs inside it, where it does the wrong assumption, because the frontend is lying about the delivery system;

Quoted 8 lines

2) There is no sane way to fill fe->ops.info.type for Multi delivery system frontends, like DRX-K, that supports both DVB-T and DVB-C. The type can be filled with either FE_QAM or FE_OFDM, not with both. So, choosing either type will be plain wrong, and may cause bad side effects inside dvb_frontend.

[1] Ok, it would be possible to do a hack internally, for it to call get_property() but it is a way more sane to just read fe->ops.delsys.

I don't see why using the already defined interface to query the possible delivery systems would be a hack.

I also don't see what the enumeration has to do with the deprecation of fe->ops.info.type. If you want to replace fe->ops.info.type, then what you need to know is the currently selected delivery system, not the supported delivery systems. The currently selected system is available from the property cache.

#112 lore raw

Re: [PATCH RFC 01/91] [media] dvb-core: allow demods to specify the supported delivery systems supported standards.

Quoted 82 lines · Andreas Oberritter
Quoted 81 lines · Mauro Carvalho Chehab
Quoted 63 lines · Andreas Oberritter
Quoted 62 lines · Mauro Carvalho Chehab
Quoted 54 lines · Andreas Oberritter
Quoted 1 line · Mauro Carvalho Chehab

DVB-S and DVB-T, as those were the standards supported by DVBv3.

The description seems to be incomplete.

Quoted 35 lines

New standards like DSS, ISDB and CTTB don't fit on any of the above types.

while there's a way for the drivers to explicitly change whatever default DELSYS were filled inside the core, still a fake value is needed there, and a "compat" code to allow DVBv3 applications to work with those delivery systems is needed. This is good for a short term solution, while applications aren't using DVBv5 directly.

However, at long term, this is bad, as the compat code runs even if the application is using DVBv5. Also, the compat code is not perfect, and only works when the frontend is capable of auto-detecting the parameters that aren't visible by the faked delivery systems.

So, let the frontend fill the supported delivery systems at the device properties directly, and, in the future, let the core to use the delsys to fill the reported info::type based on the delsys.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   13 +++++++++++++
 drivers/media/dvb/dvb-core/dvb_frontend.h |    8 ++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +3 -0
index 8dedff4..f17c411 100644
@@ -1252,6 +1252,19 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
 	const struct dvb_frontend_info *info = &fe->ops.info;
 	u32 ncaps = 0;
 
+	/*
+	 * If the frontend explicitly sets a list, use it, instead of
+	 * filling based on the info->type

drivers/media/dvb/dvb-core/dvb_frontend.c static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct · line 1267

Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +10 -0
+	 */
+	if (fe->ops.delsys[ncaps]) {
+		while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
+			p->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
+			ncaps++;
+		}
+		p->u.buffer.len = ncaps;
+		return;
+	}
+

I don't understand what this is trying to solve. This is already handled by the get_property driver callback.

Quoted 2 lines

dtv_set_default_delivery_caps() only sets some defaults for drivers not implementing get_property yet.

dtv_set_default_delivery_caps() does the wrong thing for delivery systems like ISDB-T, ISDB-S, DSS, DMB-TH, as it fills data with a fake value that is there at fe->ops.info.type.

Quoted 8 lines
Quoted 2 lines

The fake values there should be used only for DVBv3 legacy calls emulation on those delivery systems that are not fully compatible with a DVBv3 call.

That's right. Still, there's no need to introduce fe->ops.delsys, because the drivers in question could just implement get_property instead. At least that's what we discussed and AFAIR agreed upon when Manu recently submitted his patches regarding enumeration of delivery systems.

Manu's patches were applied (well, except for two patches related to af9013 driver that are/were under discussion between Manu and Antti).

Manu's approach is good, as it provided a way to enumerate the standards without much changes, offering a way for userspace to query the delivery system, at the expense of serializing a driver call for each property.

Quoted 8 lines
Quoted 5 lines

Yet, it doesn't allow the DVB core to detect the supported delivery systems on a sane way [1].

The addition of fe->ops.delsys is going one step further, as it will allow, at the long term, the removal of info.type.

You can't remove info.type, as it would break userspace. What you can do is deprecate its use inside drivers.

Yes, that's what I'm meaning: remove it from the drivers, and let dvb_frontend fill it for DVBv3 calls, according with the delivery system.

Quoted 13 lines
Quoted 13 lines

There are two reasons why we need to get rid of info.type:

1) dvb_frontend core can be changed to use fe->ops.delsys internally, instead of info.type, in order to fix some bugs inside it, where it does the wrong assumption, because the frontend is lying about the delivery system;

2) There is no sane way to fill fe->ops.info.type for Multi delivery system frontends, like DRX-K, that supports both DVB-T and DVB-C. The type can be filled with either FE_QAM or FE_OFDM, not with both. So, choosing either type will be plain wrong, and may cause bad side effects inside dvb_frontend.

Quoted 5 lines
Quoted 2 lines

[1] Ok, it would be possible to do a hack internally, for it to call get_property() but it is a way more sane to just read fe->ops.delsys.

I don't see why using the already defined interface to query the possible delivery systems would be a hack.

It is a hack, as instead of just doing a single table lookup, the current approach is to have a code filling information based on fe->ops.info.type, with can be wrong, and then jump to the driver's code to get the right information, and, for each DTV properties, on every call, call get_property() to do nothing for all calls.

Quoted 5 lines

I also don't see what the enumeration has to do with the deprecation of fe->ops.info.type. If you want to replace fe->ops.info.type, then what you need to know is the currently selected delivery system, not the supported delivery systems. The currently selected system is available from the property cache.

Yes, most of the code should be using the current delivery system.

Yet, there are some places at dvb_frontend.c that uses fe->ops.info.type, like for instance, at dtv_property_cache_init():
*/
static void dtv_property_cache_init(struct dvb_frontend *fe,
struct dtv_frontend_properties *c)

{
        switch (fe->ops.info.type) {

...

The initial selected system is based on fe->ops.info.type. The best thing to do, instead, would be to use fe->ops.delsys[0]. Without properly setting the initial current delivery system, a DVBv3 call won't work.

So, in order to remove fe->ops.info.type filling from the drivers, the DVB core should have an initialization code like:

	c->delivery_system = fe->ops.delsys[0];
	switch (fe->ops.delsys[0]) {
	case SYS_DVBT:
	case SYS_ISDBT:
	case SYS_DMBTH:
		fe->ops.info.type = FE_OFDM;
		break;
...
	}

Regards,
Mauro

#113 lore raw

Re: [PATCH RFC 01/91] [media] dvb-core: allow demods to specify the supported delivery systems supported standards.

In reply to Mauro Carvalho Chehab
Quoted 87 lines · Mauro Carvalho Chehab
Quoted 63 lines · Andreas Oberritter
Quoted 62 lines · Mauro Carvalho Chehab
Quoted 54 lines · Andreas Oberritter
Quoted 1 line · Mauro Carvalho Chehab

DVB-S and DVB-T, as those were the standards supported by DVBv3.

The description seems to be incomplete.

Quoted 35 lines

New standards like DSS, ISDB and CTTB don't fit on any of the above types.

while there's a way for the drivers to explicitly change whatever default DELSYS were filled inside the core, still a fake value is needed there, and a "compat" code to allow DVBv3 applications to work with those delivery systems is needed. This is good for a short term solution, while applications aren't using DVBv5 directly.

However, at long term, this is bad, as the compat code runs even if the application is using DVBv5. Also, the compat code is not perfect, and only works when the frontend is capable of auto-detecting the parameters that aren't visible by the faked delivery systems.

So, let the frontend fill the supported delivery systems at the device properties directly, and, in the future, let the core to use the delsys to fill the reported info::type based on the delsys.

---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   13 +++++++++++++ drivers/media/dvb/dvb-core/dvb_frontend.h |    8 ++++++++

 2 files changed, 21 insertions(+), 0 deletions(-)
drivers/media/dvb/dvb-core/dvb_frontend.c +3 -0
index 8dedff4..f17c411 100644
@@ -1252,6 +1252,19 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
    const struct dvb_frontend_info *info = &fe->ops.info;
    u32 ncaps = 0;
 
+  /*
+   * If the frontend explicitly sets a list, use it, instead of
+   * filling based on the info->type

drivers/media/dvb/dvb-core/dvb_frontend.c static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct · line 1267

Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +10 -0
+   */
+  if (fe->ops.delsys[ncaps]) {
+          while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
+                  p->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
+                  ncaps++;
+          }
+          p->u.buffer.len = ncaps;
+          return;
+  }
+

I don't understand what this is trying to solve. This is already handled by the get_property driver callback.

Quoted 2 lines

dtv_set_default_delivery_caps() only sets some defaults for drivers not implementing get_property yet.

dtv_set_default_delivery_caps() does the wrong thing for delivery systems like ISDB-T, ISDB-S, DSS, DMB-TH, as it fills data with a fake value that is there at fe->ops.info.type.

Quoted 8 lines
Quoted 2 lines

The fake values there should be used only for DVBv3 legacy calls emulation on those delivery systems that are not fully compatible with a DVBv3 call.

That's right. Still, there's no need to introduce fe->ops.delsys, because the drivers in question could just implement get_property instead. At least that's what we discussed and AFAIR agreed upon when Manu recently submitted his patches regarding enumeration of delivery systems.

Manu's patches were applied (well, except for two patches related to af9013 driver that are/were under discussion between Manu and Antti).

Manu's approach is good, as it provided a way to enumerate the standards without much changes, offering a way for userspace to query the delivery system, at the expense of serializing a driver call for each property.

Yet, it doesn't allow the DVB core to detect the supported delivery systems on a sane way [1].

The addition of fe->ops.delsys is going one step further, as it will allow, at the long term, the removal of info.type.

Quoted 6 lines

There are two reasons why we need to get rid of info.type:

1) dvb_frontend core can be changed to use fe->ops.delsys internally, instead of info.type, in order to fix some bugs inside it, where it does the wrong assumption, because the frontend is lying about the delivery system;

The frontend doesn't lie about the delivery system, but just announces the delivery system to which the device is initialized by default.

Quoted 6 lines

2) There is no sane way to fill fe->ops.info.type for Multi delivery system frontends, like DRX-K, that supports both DVB-T and DVB-C. The type can be filled with either FE_QAM or FE_OFDM, not with both. So, choosing either type will be plain wrong, and may cause bad side effects inside dvb_frontend.

for any multi-standard demodulator, you cannot announce 2 or more delivery systems as the default initialized one. Logically, also it doesn't make sense to announce 2 delivery systems as default. You have now introduced an ambiguity as to what mode it is now initialized.

for any multi-standard device, the device is initialized to only 1 single delivery system and only that should be announced and available through info.type for the same reason fe->ops.info.type shouldn't be filled by anybody else other than the driver alone.

#114 lore raw
In reply to Mauro Carvalho Chehab
Quoted 1 line · Mauro Carvalho Chehab

Mauro Carvalho Chehab (91):

It would be nice if you could send each message as a reply to the cover letter next time, instead of sending message x as a reply to message x-1.

Otherwise, one needs a very wide screen to display all messages in a threaded view. I stopped reading around message 50.

#115 lore raw
Quoted 8 lines · Andreas Oberritter
Quoted 1 line · Mauro Carvalho Chehab

Mauro Carvalho Chehab (91):

It would be nice if you could send each message as a reply to the cover letter next time, instead of sending message x as a reply to message x-1.

Otherwise, one needs a very wide screen to display all messages in a threaded view. I stopped reading around message 50.

This is the way git mail-send does, at least by default. Maybe there's an option for it to change the way threads are shown. I'll seek if is there any way to change it.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#116 lore raw
Quoted 7 lines · Mauro Carvalho Chehab
Quoted 6 lines · Andreas Oberritter
Quoted 1 line · Mauro Carvalho Chehab

Mauro Carvalho Chehab (91):

It would be nice if you could send each message as a reply to the cover letter next time, instead of sending message x as a reply to message x-1.

Quoted 6 lines
Quoted 2 lines

Otherwise, one needs a very wide screen to display all messages in a threaded view. I stopped reading around message 50.

This is the way git mail-send does, at least by default. Maybe there's an option for it to change the way threads are shown. I'll seek if is there any way to change it.

Ok, this should fix my git mail-send config:

[sendemail]
chainreplyto = false

Next time, it should send everything as reply to the first message.

Thanks for pointing it!
Mauro

#117 lore raw
In reply to Mauro Carvalho Chehab

Hi Mauro,

your changset breaks the auto-inversion capability of dvb_frontend.c for frontends which doesn't implement auto-inversion. Currently tda10021.c, tda10023.c and drxk_hard.c are not working. They fail at the following check:

231 static int tda10021_set_parameters (struct dvb_frontend *fe)
....
232 {
279 if (c->inversion != INVERSION_ON && c->inversion != INVERSION_OFF)
280 return -EINVAL;

The given inversion is INVERSION_AUTO.

Regards,
Hartmut

Am 27.12.2011 02:07, schrieb Mauro Carvalho Chehab:

Quoted 236 lines

This patch series comes after the previous series of 47 patches. Basically, changes all DVB frontend drivers to work directly with the DVBv5 structure. This warrants that all drivers will be getting/setting frontend parameters on a consistent way, and opens space for improving the DVB core, in order to avoid copying data from/to the DVBv3 structs without need.

Most of the patches on this series are trivial changes. Yet, it would be great to test them, in order to be sure that nothing broke.

The last patch in this series hide the DVBv3 parameters struct from the frontend drivers, keeping them visible only to the dvb_core. This helps to warrant that everything were ported, and that newer patches won't re-introduce DVBv3 structs by mistake.

There aren't many cleanups inside the dvb_frontend.c yet.

Before cleaning up the core, I intend to do some tests with a some devices, in order to be sure that nothing broke with all those changes.

Test reports are welcome.

All patches are at my experimental tree:
http://git.linuxtv.org/mchehab/experimental.git/shortlog/refs/heads/DVB_v5_v4

Regards,
Mauro

Mauro Carvalho Chehab (91):
[media] dvb-core: allow demods to specify the supported delivery
systems supported standards.
[media] Rename set_frontend fops to set_frontend_legacy [media] dvb-core: add support for a DVBv5 get_frontend() callback [media] af9013: convert set_fontend to use DVBv5 parameters [media] atbm8830: convert set_fontend to new way and fix delivery
system
[media] au8522_dig: convert set_fontend to use DVBv5 parameters [media] bcm3510: convert set_fontend to use DVBv5 parameters [media] cx22700: convert set_fontend to use DVBv5 parameters [media] cx22702: convert set_fontend to use DVBv5 parameters [media] cx24110: convert set_fontend to use DVBv5 parameters [media] cx24116: report delivery system and cleanups [media] cx23123: remove an unused argument from

    cx24123_pll_writereg()

[media] av7110: convert set_fontend to use DVBv5 parameters [media] cx23123: convert set_fontend to use DVBv5 parameters [media] cxd2820r: report delivery system and cleanups [media] dibx000: convert set_fontend to use DVBv5 parameters [media] dib9000: remove unused parameters
[media] cx24113: cleanup: remove unused init
[media] dib9000: Get rid of the remaining DVBv3 legacy stuff [media] dib3000mb: convert set_fontend to use DVBv5 parameters [media] dib8000: Remove the old DVBv3 struct from it and add delsys [media] dib9000: get rid of unused dvb_frontend_parameters [media] zl10353: convert set_fontend to use DVBv5 parameters [media] em28xx-dvb: don't initialize drx-d non-used fields with zero [media] drxd: convert set_fontend to use DVBv5 parameters [media] drxk: convert set_fontend to use DVBv5 parameters [media] ds3000: convert set_fontend to use DVBv5 parameters [media] dvb_dummy_fe: convert set_fontend to use DVBv5 parameters [media] ec100: convert set_fontend to use DVBv5 parameters [media] it913x-fe: convert set_fontend to use DVBv5 parameters [media] l64781: convert set_fontend to use DVBv5 parameters [media] lgs8gl5: convert set_fontend to use DVBv5 parameters [media] lgdt330x: convert set_fontend to use DVBv5 parameters [media] lgdt3305: convert set_fontend to use DVBv5 parameters [media] lgs8gxx: convert set_fontend to use DVBv5 parameters [media] vez1x93: convert set_fontend to use DVBv5 parameters [media] mb86a16: Add delivery system type at fe struct [media] mb86a20s: convert set_fontend to use DVBv5 parameters [media] mt352: convert set_fontend to use DVBv5 parameters [media] nxt6000: convert set_fontend to use DVBv5 parameters [media] s5h1432: convert set_fontend to use DVBv5 parameters [media] sp8870: convert set_fontend to use DVBv5 parameters [media] sp887x: convert set_fontend to use DVBv5 parameters [media] stv0367: convert set_fontend to use DVBv5 parameters [media] tda10048: convert set_fontend to use DVBv5 parameters [media] tda1004x: convert set_fontend to use DVBv5 parameters [media] s921: convert set_fontend to use DVBv5 parameters [media] mt312: convert set_fontend to use DVBv5 parameters [media] s5h1420: convert set_fontend to use DVBv5 parameters [media] si21xx: convert set_fontend to use DVBv5 parameters [media] stb0899: convert get_frontend to the new struct [media] stb6100: use get_frontend, instead of get_frontend_legacy() [media] stv0288: convert set_fontend to use DVBv5 parameters [media] stv0297: convert set_fontend to use DVBv5 parameters [media] stv0299: convert set_fontend to use DVBv5 parameters [media] stv900: convert set_fontend to use DVBv5 parameters [media] stv090x: use .delsys property, instead of get_property() [media] tda10021: convert set_fontend to use DVBv5 parameters [media] tda10023: convert set_fontend to use DVBv5 parameters [media] tda10071: convert set_fontend to use DVBv5 parameters [media] tda10086: convert set_fontend to use DVBv5 parameters [media] nxt200x: convert set_fontend to use DVBv5 parameters [media] or51132: convert set_fontend to use DVBv5 parameters [media] or51211: convert set_fontend to use DVBv5 parameters [media] s5h1409: convert set_fontend to use DVBv5 parameters [media] s55h1411: convert set_fontend to use DVBv5 parameters [media] tda8083: convert set_fontend to use DVBv5 parameters [media] vez1820: convert set_fontend to use DVBv5 parameters [media] staging/as102: convert set_fontend to use DVBv5 parameters [media] dst: convert set_fontend to use DVBv5 parameters [media] af9005-fe: convert set_fontend to use DVBv5 parameters [media] cinergyT2-fe: convert set_fontend to use DVBv5 parameters [media] dtt200u-fe: convert set_fontend to use DVBv5 parameters [media] friio-fe: convert set_fontend to use DVBv5 parameters [media] gp8psk-fe: convert set_fontend to use DVBv5 parameters [media] mxl111sf-demod: convert set_fontend to use DVBv5 parameters [media] vp702x-fe: convert set_fontend to use DVBv5 parameters [media] vp7045-fe: convert set_fontend to use DVBv5 parameters [media] firedtv: convert set_fontend to use DVBv5 parameters [media] siano: convert set_fontend to use DVBv5 parameters [media] ttusb-dec: convert set_fontend to use DVBv5 parameters [media] tlg2300: convert set_fontend to use DVBv5 parameters [media] dvb-core: remove get|set_frontend_legacy
[media] dvb: simplify get_tune_settings() struct
[media] dvb-core: Don't pass DVBv3 parameters on tune() fops [media] dvb: don't pass a DVBv3 parameter for search() fops [media] dvb: remove the track() fops
[media] dvb-core: don't use fe_bandwidth_t on driver [media] dvb: don't use DVBv3 bandwidth macros
cx23885-dvb: Remove a dirty hack that would require DVBv3 [media] dvb-core: be sure that drivers won't use DVBv3 internally

 drivers/media/common/tuners/mt2266.c         |    4 +-
 drivers/media/common/tuners/mxl5007t.c       |    5 +-
 drivers/media/common/tuners/tda18271-fe.c    |    7 +-
 drivers/media/common/tuners/tda827x.c        |   14 +--
 drivers/media/common/tuners/tuner-simple.c   |   12 +--
 drivers/media/common/tuners/xc4000.c         |   11 +--
 drivers/media/common/tuners/xc5000.c         |   12 +--
 drivers/media/dvb/bt8xx/dst.c                |   66 ++++++------
 drivers/media/dvb/bt8xx/dst_common.h         |    2 +-
 drivers/media/dvb/dvb-core/dvb_frontend.c    |  131 ++++++++++++++++-------
 drivers/media/dvb/dvb-core/dvb_frontend.h    |   22 +++-
 drivers/media/dvb/dvb-usb/af9005-fe.c        |   99 +++++++++---------
 drivers/media/dvb/dvb-usb/cinergyT2-fe.c     |   27 ++++--
 drivers/media/dvb/dvb-usb/dtt200u-fe.c       |   20 ++--
 drivers/media/dvb/dvb-usb/friio-fe.c         |   26 +++---
 drivers/media/dvb/dvb-usb/gp8psk-fe.c        |   23 +----
 drivers/media/dvb/dvb-usb/mxl111sf-demod.c   |   37 +++----
 drivers/media/dvb/dvb-usb/mxl111sf-tuner.c   |    5 +-
 drivers/media/dvb/dvb-usb/vp702x-fe.c        |   13 ++-
 drivers/media/dvb/dvb-usb/vp7045-fe.c        |   21 ++---
 drivers/media/dvb/firewire/firedtv-avc.c     |   95 ++++++++---------
 drivers/media/dvb/firewire/firedtv-fe.c      |   13 ++-
 drivers/media/dvb/firewire/firedtv.h         |    4 +-
 drivers/media/dvb/frontends/af9013.c         |  108 ++++++++++---------
 drivers/media/dvb/frontends/af9013_priv.h    |   26 +++---
 drivers/media/dvb/frontends/atbm8830.c       |   22 ++--
 drivers/media/dvb/frontends/au8522_dig.c     |   22 ++--
 drivers/media/dvb/frontends/bcm3510.c        |   17 ++--
 drivers/media/dvb/frontends/cx22700.c        |   48 +++++----
 drivers/media/dvb/frontends/cx22702.c        |   66 ++++++------
 drivers/media/dvb/frontends/cx24110.c        |   17 ++--
 drivers/media/dvb/frontends/cx24113.c        |    2 -
 drivers/media/dvb/frontends/cx24116.c        |   35 +++----
 drivers/media/dvb/frontends/cx24123.c        |   51 +++++-----
 drivers/media/dvb/frontends/cxd2820r_c.c     |    6 +-
 drivers/media/dvb/frontends/cxd2820r_core.c  |   34 +++---
 drivers/media/dvb/frontends/cxd2820r_priv.h  |   15 +--
 drivers/media/dvb/frontends/cxd2820r_t.c     |    6 +-
 drivers/media/dvb/frontends/cxd2820r_t2.c    |    6 +-
 drivers/media/dvb/frontends/dib3000mb.c      |  107 +++++++++----------
 drivers/media/dvb/frontends/dib3000mb_priv.h |    2 +-
 drivers/media/dvb/frontends/dib3000mc.c      |  129 ++++++++++++-----------
 drivers/media/dvb/frontends/dib7000m.c       |  133 +++++++++++++-----------
 drivers/media/dvb/frontends/dib7000p.c       |  122 ++++++++++++----------
 drivers/media/dvb/frontends/dib8000.c        |    9 +-
 drivers/media/dvb/frontends/dib9000.c        |   35 ++++---
 drivers/media/dvb/frontends/dibx000_common.h |   10 +--
 drivers/media/dvb/frontends/drxd.h           |    2 -
 drivers/media/dvb/frontends/drxd_hard.c      |   56 ++++------
 drivers/media/dvb/frontends/drxk_hard.c      |  123 +++++++--------------
 drivers/media/dvb/frontends/drxk_hard.h      |    2 +-
 drivers/media/dvb/frontends/ds3000.c         |   35 ++-----
 drivers/media/dvb/frontends/dvb-pll.c        |    7 +-
 drivers/media/dvb/frontends/dvb_dummy_fe.c   |   11 +-
 drivers/media/dvb/frontends/ec100.c          |   17 ++--
 drivers/media/dvb/frontends/it913x-fe-priv.h |   64 ++++++------
 drivers/media/dvb/frontends/it913x-fe.c      |   75 ++++++++------
 drivers/media/dvb/frontends/l64781.c         |  112 +++++++++++---------
 drivers/media/dvb/frontends/lgdt3305.c       |   89 ++++++++--------
 drivers/media/dvb/frontends/lgdt330x.c       |   22 ++--
 drivers/media/dvb/frontends/lgs8gl5.c        |   24 ++--
 drivers/media/dvb/frontends/lgs8gxx.c        |   21 ++--
 drivers/media/dvb/frontends/mb86a16.c        |    7 +-
 drivers/media/dvb/frontends/mb86a20s.c       |   26 +++--
 drivers/media/dvb/frontends/mt312.c          |   32 +++---
 drivers/media/dvb/frontends/mt352.c          |   58 +++++------
 drivers/media/dvb/frontends/nxt200x.c        |   14 ++--
 drivers/media/dvb/frontends/nxt6000.c        |   22 ++--
 drivers/media/dvb/frontends/or51132.c        |   30 +++---
 drivers/media/dvb/frontends/or51211.c        |   10 +-
 drivers/media/dvb/frontends/s5h1409.c        |   12 +-
 drivers/media/dvb/frontends/s5h1411.c        |   12 +-
 drivers/media/dvb/frontends/s5h1420.c        |   64 ++++++------
 drivers/media/dvb/frontends/s5h1432.c        |   27 ++---
 drivers/media/dvb/frontends/s921.c           |   19 ++--
 drivers/media/dvb/frontends/si21xx.c         |   19 +---
 drivers/media/dvb/frontends/sp8870.c         |   25 +++--
 drivers/media/dvb/frontends/sp887x.c         |   47 ++++++---
 drivers/media/dvb/frontends/stb0899_drv.c    |   33 +-----
 drivers/media/dvb/frontends/stb6100.c        |    4 +-
 drivers/media/dvb/frontends/stv0288.c        |    7 +-
 drivers/media/dvb/frontends/stv0297.c        |   31 +++---
 drivers/media/dvb/frontends/stv0299.c        |   28 +++---
 drivers/media/dvb/frontends/stv0367.c        |  146 +++++++++++++-------------
 drivers/media/dvb/frontends/stv0900_core.c   |   43 +-------
 drivers/media/dvb/frontends/stv090x.c        |   27 +----
 drivers/media/dvb/frontends/tda10021.c       |   33 ++-----
 drivers/media/dvb/frontends/tda10023.c       |   31 ++----
 drivers/media/dvb/frontends/tda10048.c       |   76 ++++++--------
 drivers/media/dvb/frontends/tda1004x.c       |  108 ++++++++++---------
 drivers/media/dvb/frontends/tda10071.c       |    6 +-
 drivers/media/dvb/frontends/tda10086.c       |   58 ++++++-----
 drivers/media/dvb/frontends/tda8083.c        |   15 ++--
 drivers/media/dvb/frontends/ves1820.c        |   19 ++--
 drivers/media/dvb/frontends/ves1x93.c        |   20 ++--
 drivers/media/dvb/frontends/zl10353.c        |  109 +++++++++-----------
 drivers/media/dvb/pt1/va1j5jf8007s.c         |    4 +-
 drivers/media/dvb/pt1/va1j5jf8007t.c         |    4 +-
 drivers/media/dvb/siano/smsdvb.c             |   30 ++++--
 drivers/media/dvb/ttpci/av7110.c             |   11 +-
 drivers/media/dvb/ttpci/av7110.h             |    3 +-
 drivers/media/dvb/ttusb-dec/ttusbdecfe.c     |   12 ++-
 drivers/media/video/cx23885/cx23885-dvb.c    |   41 ++-----
 drivers/media/video/em28xx/em28xx-dvb.c      |   10 +-
 drivers/media/video/tlg2300/pd-common.h      |    2 +-
 drivers/media/video/tlg2300/pd-dvb.c         |   19 ++--
 drivers/staging/media/as102/as102_fe.c       |   74 +++++++-------
 drivers/staging/media/as102/as10x_cmd.c      |    4 +-
 drivers/staging/media/as102/as10x_types.h    |    4 +-
 include/linux/dvb/frontend.h                 |    6 +-
 110 files changed, 1814 insertions(+), 1985 deletions(-)
#118 lore raw
Quoted 13 lines · On 28-12-2011 13:50, e9hack wrote:

Hi Mauro,

your changset breaks the auto-inversion capability of dvb_frontend.c for frontends which doesn't implement auto-inversion. Currently tda10021.c, tda10023.c and drxk_hard.c are not working. They fail at the following check:

231 static int tda10021_set_parameters (struct dvb_frontend *fe)
....
232 {
279 if (c->inversion != INVERSION_ON && c->inversion != INVERSION_OFF)
280 return -EINVAL;

Quoted 5 lines

The given inversion is INVERSION_AUTO.

Regards,
Hartmut

Hi Hartmut,

Thanks for testing!

The issue here is that the dvb_frontend sometimes update only the DVBv3 parameters.

This is probably affecting DVBv5 drivers that may be lacking some features, like zigzag support and DVB core emulation for INVERSION_AUTO.

The enclosed patch should fix it.

I'll latter dig into dvb_frontend, in order to replace the tests for info.type there to c->delivery_system, as it might still have some bugs there due to that.

From: Mauro Carvalho Chehab <[email protected]>
Date: Fri, 30 Dec 2011 10:30:25 -0200
Subject: [PATCH] dvb_frontend: Fix inversion breakage due to DVBv5 conversion

On several places inside dvb_frontend, only the DVBv3 parameters were updated. Change it to be sure that, on all places, the DVBv5 parameters will be changed instead.

drivers/media/dvb/dvb-core/dvb_frontend.c +21 -17
index 9dd30be..9d092a6 100644
@@ -288,12 +288,13 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 	int ready = 0;
 	int fe_set_err = 0;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	int original_inversion = fepriv->parameters_in.inversion;
-	u32 original_frequency = fepriv->parameters_in.frequency;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
+	int original_inversion = c->inversion;
+	u32 original_frequency = c->frequency;
 
 	/* are we using autoinversion? */
 	autoinversion = ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) &&
-			 (fepriv->parameters_in.inversion == INVERSION_AUTO));
+			 (c->inversion == INVERSION_AUTO));
 
 	/* setup parameters correctly */
 	while(!ready) {
@@ -359,19 +360,20 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 		fepriv->auto_step, fepriv->auto_sub_step, fepriv->started_auto_step);
 
 	/* set the frontend itself */
-	fepriv->parameters_in.frequency += fepriv->lnb_drift;
+	c->frequency += fepriv->lnb_drift;
 	if (autoinversion)
-		fepriv->parameters_in.inversion = fepriv->inversion;
+		c->inversion = fepriv->inversion;
+	tmp = *c;
 	if (fe->ops.set_frontend)
 		fe_set_err = fe->ops.set_frontend(fe);
-	fepriv->parameters_out = fepriv->parameters_in;
+	*c = tmp;
 	if (fe_set_err < 0) {
 		fepriv->state = FESTATE_ERROR;
 		return fe_set_err;
 	}
 
-	fepriv->parameters_in.frequency = original_frequency;
-	fepriv->parameters_in.inversion = original_inversion;
+	c->frequency = original_frequency;
+	c->inversion = original_inversion;
 
 	fepriv->auto_sub_step++;
 	return 0;
@@ -382,6 +384,7 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 	fe_status_t s = 0;
 	int retval = 0;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
 
 	/* if we've got no parameters, just keep idling */
 	if (fepriv->state & FESTATE_IDLE) {
@@ -393,9 +396,10 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 	/* in SCAN mode, we just set the frontend when asked and leave it alone */
 	if (fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT) {
 		if (fepriv->state & FESTATE_RETUNE) {
+			tmp = *c;
 			if (fe->ops.set_frontend)
 				retval = fe->ops.set_frontend(fe);
-			fepriv->parameters_out = fepriv->parameters_in;
+			*c = tmp;
 			if (retval < 0)
 				fepriv->state = FESTATE_ERROR;
 			else
@@ -425,8 +429,8 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 
 		/* if we're tuned, then we have determined the correct inversion */
 		if ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) &&
-		    (fepriv->parameters_in.inversion == INVERSION_AUTO)) {
-			fepriv->parameters_in.inversion = fepriv->inversion;
+		    (c->inversion == INVERSION_AUTO)) {
+			c->inversion = fepriv->inversion;
 		}
 		return;
 	}
@@ -1976,14 +1980,14 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 
 		/* force auto frequency inversion if requested */
 		if (dvb_force_auto_inversion) {
-			fepriv->parameters_in.inversion = INVERSION_AUTO;
+			c->inversion = INVERSION_AUTO;
 		}
 		if (fe->ops.info.type == FE_OFDM) {
 			/* without hierarchical coding code_rate_LP is irrelevant,
 			 * so we tolerate the otherwise invalid FEC_NONE setting */
-			if (fepriv->parameters_in.u.ofdm.hierarchy_information == HIERARCHY_NONE &&
-			    fepriv->parameters_in.u.ofdm.code_rate_LP == FEC_NONE)
-				fepriv->parameters_in.u.ofdm.code_rate_LP = FEC_AUTO;
+			if (c->hierarchy == HIERARCHY_NONE &&
+			    c->code_rate_LP == FEC_NONE)
+				c->code_rate_LP = FEC_AUTO;
 		}
 
 		/* get frontend-specific tuning settings */
@@ -1996,8 +2000,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 			switch(fe->ops.info.type) {
 			case FE_QPSK:
 				fepriv->min_delay = HZ/20;
-				fepriv->step_size = fepriv->parameters_in.u.qpsk.symbol_rate / 16000;
-				fepriv->max_drift = fepriv->parameters_in.u.qpsk.symbol_rate / 2000;
+				fepriv->step_size = c->symbol_rate / 16000;
+				fepriv->max_drift = c->symbol_rate / 2000;
 				break;
 
 			case FE_QAM:
#119 lore raw

Hi Mauro,

your patch fixes the problem for the tda10021.c and tda10023.c. The drxk_hard.c is a second problem. It is introduced by tda18271c2dd.c:

static int set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)

{
	struct tda_state *state = fe->tuner_priv;
	int status = 0;
	int Standard;
	u32 bw = fe->dtv_property_cache.bandwidth_hz;
	u32 delsys  = fe->dtv_property_cache.delivery_system;

	state->m_Frequency = fe->dtv_property_cache.frequency;

	switch (delsys) {
	case  SYS_DVBT:
	case  SYS_DVBT2:
		switch (bw) {
		case 6000000:
			Standard = HF_DVBT_6MHZ;
			break;
		case 7000000:
			Standard = HF_DVBT_7MHZ;
			break;
		case 8000000:
			Standard = HF_DVBT_8MHZ;
			break;
		default:
			return -EINVAL;
		}
	case SYS_DVBC_ANNEX_A:
	case SYS_DVBC_ANNEX_C:
		if (bw <= 6000000)
			Standard = HF_DVBC_6MHZ;
		else if (bw <= 7000000)
			Standard = HF_DVBC_7MHZ;
		else
			Standard = HF_DVBC_8MHZ;
	default:
		return -EINVAL;
	}

A break is missing before the default statement. Delivery systems for DVB-C result always in an error. It is difficult for me to find the file itself with this content in the git repositories. I got the file from
http://linuxtv.org/downloads/drivers/linux-media-2011-12-25.tar.bz2.

Regards,
Hartmut

Am 30.12.2011 14:19, schrieb Mauro Carvalho Chehab:

Quoted 154 lines · On 28-12-2011 13:50, e9hack wrote:
Quoted 13 lines

Hi Mauro,

your changset breaks the auto-inversion capability of dvb_frontend.c for frontends which doesn't implement auto-inversion. Currently tda10021.c, tda10023.c and drxk_hard.c are not working. They fail at the following check:

231 static int tda10021_set_parameters (struct dvb_frontend *fe)
....
232 {
279 if (c->inversion != INVERSION_ON && c->inversion != INVERSION_OFF)
280 return -EINVAL;

Quoted 5 lines

The given inversion is INVERSION_AUTO.

Regards,
Hartmut

Hi Hartmut,

Thanks for testing!

The issue here is that the dvb_frontend sometimes update only the DVBv3 parameters.

This is probably affecting DVBv5 drivers that may be lacking some features, like zigzag support and DVB core emulation for INVERSION_AUTO.

The enclosed patch should fix it.

I'll latter dig into dvb_frontend, in order to replace the tests for info.type there to c->delivery_system, as it might still have some bugs there due to that.

From: Mauro Carvalho Chehab <[email protected]>
Date: Fri, 30 Dec 2011 10:30:25 -0200
Subject: [PATCH] dvb_frontend: Fix inversion breakage due to DVBv5 conversion

On several places inside dvb_frontend, only the DVBv3 parameters were updated. Change it to be sure that, on all places, the DVBv5 parameters will be changed instead.

drivers/media/dvb/dvb-core/dvb_frontend.c +21 -17
index 9dd30be..9d092a6 100644
@@ -288,12 +288,13 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 	int ready = 0;
 	int fe_set_err = 0;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	int original_inversion = fepriv->parameters_in.inversion;
-	u32 original_frequency = fepriv->parameters_in.frequency;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
+	int original_inversion = c->inversion;
+	u32 original_frequency = c->frequency;
 
 	/* are we using autoinversion? */
 	autoinversion = ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) &&
-			 (fepriv->parameters_in.inversion == INVERSION_AUTO));
+			 (c->inversion == INVERSION_AUTO));
 
 	/* setup parameters correctly */
 	while(!ready) {
@@ -359,19 +360,20 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 		fepriv->auto_step, fepriv->auto_sub_step, fepriv->started_auto_step);
 
 	/* set the frontend itself */
-	fepriv->parameters_in.frequency += fepriv->lnb_drift;
+	c->frequency += fepriv->lnb_drift;
 	if (autoinversion)
-		fepriv->parameters_in.inversion = fepriv->inversion;
+		c->inversion = fepriv->inversion;
+	tmp = *c;
 	if (fe->ops.set_frontend)
 		fe_set_err = fe->ops.set_frontend(fe);
-	fepriv->parameters_out = fepriv->parameters_in;
+	*c = tmp;
 	if (fe_set_err < 0) {
 		fepriv->state = FESTATE_ERROR;
 		return fe_set_err;
 	}
 
-	fepriv->parameters_in.frequency = original_frequency;
-	fepriv->parameters_in.inversion = original_inversion;
+	c->frequency = original_frequency;
+	c->inversion = original_inversion;
 
 	fepriv->auto_sub_step++;
 	return 0;
@@ -382,6 +384,7 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 	fe_status_t s = 0;
 	int retval = 0;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
 
 	/* if we've got no parameters, just keep idling */
 	if (fepriv->state & FESTATE_IDLE) {
@@ -393,9 +396,10 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 	/* in SCAN mode, we just set the frontend when asked and leave it alone */
 	if (fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT) {
 		if (fepriv->state & FESTATE_RETUNE) {
+			tmp = *c;
 			if (fe->ops.set_frontend)
 				retval = fe->ops.set_frontend(fe);
-			fepriv->parameters_out = fepriv->parameters_in;
+			*c = tmp;
 			if (retval < 0)
 				fepriv->state = FESTATE_ERROR;
 			else
@@ -425,8 +429,8 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 
 		/* if we're tuned, then we have determined the correct inversion */
 		if ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) &&
-		    (fepriv->parameters_in.inversion == INVERSION_AUTO)) {
-			fepriv->parameters_in.inversion = fepriv->inversion;
+		    (c->inversion == INVERSION_AUTO)) {
+			c->inversion = fepriv->inversion;
 		}
 		return;
 	}
@@ -1976,14 +1980,14 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 
 		/* force auto frequency inversion if requested */
 		if (dvb_force_auto_inversion) {
-			fepriv->parameters_in.inversion = INVERSION_AUTO;
+			c->inversion = INVERSION_AUTO;
 		}
 		if (fe->ops.info.type == FE_OFDM) {
 			/* without hierarchical coding code_rate_LP is irrelevant,
 			 * so we tolerate the otherwise invalid FEC_NONE setting */
-			if (fepriv->parameters_in.u.ofdm.hierarchy_information == HIERARCHY_NONE &&
-			    fepriv->parameters_in.u.ofdm.code_rate_LP == FEC_NONE)
-				fepriv->parameters_in.u.ofdm.code_rate_LP = FEC_AUTO;
+			if (c->hierarchy == HIERARCHY_NONE &&
+			    c->code_rate_LP == FEC_NONE)
+				c->code_rate_LP = FEC_AUTO;
 		}
 
 		/* get frontend-specific tuning settings */
@@ -1996,8 +2000,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 			switch(fe->ops.info.type) {
 			case FE_QPSK:
 				fepriv->min_delay = HZ/20;
-				fepriv->step_size = fepriv->parameters_in.u.qpsk.symbol_rate / 16000;
-				fepriv->max_drift = fepriv->parameters_in.u.qpsk.symbol_rate / 2000;
+				fepriv->step_size = c->symbol_rate / 16000;
+				fepriv->max_drift = c->symbol_rate / 2000;
 				break;
 
 			case FE_QAM:
#120 lore raw
Quoted 44 lines · On 30-12-2011 15:16, e9hack wrote:

Hi Mauro,

your patch fixes the problem for the tda10021.c and tda10023.c. The drxk_hard.c is a second problem. It is introduced by tda18271c2dd.c:

static int set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)

{
	struct tda_state *state = fe->tuner_priv;
	int status = 0;
	int Standard;
	u32 bw = fe->dtv_property_cache.bandwidth_hz;
	u32 delsys  = fe->dtv_property_cache.delivery_system;

	state->m_Frequency = fe->dtv_property_cache.frequency;

	switch (delsys) {
	case  SYS_DVBT:
	case  SYS_DVBT2:
		switch (bw) {
		case 6000000:
			Standard = HF_DVBT_6MHZ;
			break;
		case 7000000:
			Standard = HF_DVBT_7MHZ;
			break;
		case 8000000:
			Standard = HF_DVBT_8MHZ;
			break;
		default:
			return -EINVAL;
		}
	case SYS_DVBC_ANNEX_A:
	case SYS_DVBC_ANNEX_C:
		if (bw <= 6000000)
			Standard = HF_DVBC_6MHZ;
		else if (bw <= 7000000)
			Standard = HF_DVBC_7MHZ;
		else
			Standard = HF_DVBC_8MHZ;
	default:
		return -EINVAL;
	}
Quoted 4 lines

A break is missing before the default statement. Delivery systems for DVB-C result always in an error. It is difficult for me to find the file itself with this content in the git repositories. I got the file from
http://linuxtv.org/downloads/drivers/linux-media-2011-12-25.tar.bz2.

Oh! I hate "break" statements ;) it is easy to forget one, and the compiler doesn't warn about that.

Thanks for pointing it. I'll add a patch fixing this bug.

Quoted 161 lines

Regards,
Hartmut

Am 30.12.2011 14:19, schrieb Mauro Carvalho Chehab:

Quoted 154 lines · On 28-12-2011 13:50, e9hack wrote:
Quoted 13 lines

Hi Mauro,

your changset breaks the auto-inversion capability of dvb_frontend.c for frontends which doesn't implement auto-inversion. Currently tda10021.c, tda10023.c and drxk_hard.c are not working. They fail at the following check:

231 static int tda10021_set_parameters (struct dvb_frontend *fe)
....
232 {
279 if (c->inversion != INVERSION_ON && c->inversion != INVERSION_OFF)
280 return -EINVAL;

Quoted 5 lines

The given inversion is INVERSION_AUTO.

Regards,
Hartmut

Hi Hartmut,

Thanks for testing!

The issue here is that the dvb_frontend sometimes update only the DVBv3 parameters.

This is probably affecting DVBv5 drivers that may be lacking some features, like zigzag support and DVB core emulation for INVERSION_AUTO.

The enclosed patch should fix it.

I'll latter dig into dvb_frontend, in order to replace the tests for info.type there to c->delivery_system, as it might still have some bugs there due to that.

From: Mauro Carvalho Chehab <[email protected]>
Date: Fri, 30 Dec 2011 10:30:25 -0200
Subject: [PATCH] dvb_frontend: Fix inversion breakage due to DVBv5 conversion

On several places inside dvb_frontend, only the DVBv3 parameters were updated. Change it to be sure that, on all places, the DVBv5 parameters will be changed instead.

drivers/media/dvb/dvb-core/dvb_frontend.c +21 -17
index 9dd30be..9d092a6 100644
@@ -288,12 +288,13 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 	int ready = 0;
 	int fe_set_err = 0;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	int original_inversion = fepriv->parameters_in.inversion;
-	u32 original_frequency = fepriv->parameters_in.frequency;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
+	int original_inversion = c->inversion;
+	u32 original_frequency = c->frequency;
 
 	/* are we using autoinversion? */
 	autoinversion = ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) &&
-			 (fepriv->parameters_in.inversion == INVERSION_AUTO));
+			 (c->inversion == INVERSION_AUTO));
 
 	/* setup parameters correctly */
 	while(!ready) {
@@ -359,19 +360,20 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 		fepriv->auto_step, fepriv->auto_sub_step, fepriv->started_auto_step);
 
 	/* set the frontend itself */
-	fepriv->parameters_in.frequency += fepriv->lnb_drift;
+	c->frequency += fepriv->lnb_drift;
 	if (autoinversion)
-		fepriv->parameters_in.inversion = fepriv->inversion;
+		c->inversion = fepriv->inversion;
+	tmp = *c;
 	if (fe->ops.set_frontend)
 		fe_set_err = fe->ops.set_frontend(fe);
-	fepriv->parameters_out = fepriv->parameters_in;
+	*c = tmp;
 	if (fe_set_err < 0) {
 		fepriv->state = FESTATE_ERROR;
 		return fe_set_err;
 	}
 
-	fepriv->parameters_in.frequency = original_frequency;
-	fepriv->parameters_in.inversion = original_inversion;
+	c->frequency = original_frequency;
+	c->inversion = original_inversion;
 
 	fepriv->auto_sub_step++;
 	return 0;
@@ -382,6 +384,7 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 	fe_status_t s = 0;
 	int retval = 0;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
 
 	/* if we've got no parameters, just keep idling */
 	if (fepriv->state & FESTATE_IDLE) {
@@ -393,9 +396,10 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 	/* in SCAN mode, we just set the frontend when asked and leave it alone */
 	if (fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT) {
 		if (fepriv->state & FESTATE_RETUNE) {
+			tmp = *c;
 			if (fe->ops.set_frontend)
 				retval = fe->ops.set_frontend(fe);
-			fepriv->parameters_out = fepriv->parameters_in;
+			*c = tmp;
 			if (retval < 0)
 				fepriv->state = FESTATE_ERROR;
 			else
@@ -425,8 +429,8 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 
 		/* if we're tuned, then we have determined the correct inversion */
 		if ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) &&
-		    (fepriv->parameters_in.inversion == INVERSION_AUTO)) {
-			fepriv->parameters_in.inversion = fepriv->inversion;
+		    (c->inversion == INVERSION_AUTO)) {
+			c->inversion = fepriv->inversion;
 		}
 		return;
 	}
@@ -1976,14 +1980,14 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 
 		/* force auto frequency inversion if requested */
 		if (dvb_force_auto_inversion) {
-			fepriv->parameters_in.inversion = INVERSION_AUTO;
+			c->inversion = INVERSION_AUTO;
 		}
 		if (fe->ops.info.type == FE_OFDM) {
 			/* without hierarchical coding code_rate_LP is irrelevant,
 			 * so we tolerate the otherwise invalid FEC_NONE setting */
-			if (fepriv->parameters_in.u.ofdm.hierarchy_information == HIERARCHY_NONE &&
-			    fepriv->parameters_in.u.ofdm.code_rate_LP == FEC_NONE)
-				fepriv->parameters_in.u.ofdm.code_rate_LP = FEC_AUTO;
+			if (c->hierarchy == HIERARCHY_NONE &&
+			    c->code_rate_LP == FEC_NONE)
+				c->code_rate_LP = FEC_AUTO;
 		}
 
 		/* get frontend-specific tuning settings */
@@ -1996,8 +2000,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 			switch(fe->ops.info.type) {
 			case FE_QPSK:
 				fepriv->min_delay = HZ/20;
-				fepriv->step_size = fepriv->parameters_in.u.qpsk.symbol_rate / 16000;
-				fepriv->max_drift = fepriv->parameters_in.u.qpsk.symbol_rate / 2000;
+				fepriv->step_size = c->symbol_rate / 16000;
+				fepriv->max_drift = c->symbol_rate / 2000;
 				break;
 
 			case FE_QAM:
#121 lore raw

PATCH 1/1 tda18271c2dd: fix support for DVB-C

In reply to e9hack

As reported by Hartmut <[email protected]>:

Quoted 2 lines

A break is missing before the default statement. Delivery systems for DVB-C result always in an error.

---
 drivers/media/dvb/frontends/tda18271c2dd.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/media/dvb/frontends/tda18271c2dd.c +1 -0
index 0f8e962..f8933cf 100644
@@ -1159,6 +1159,7 @@ static int set_params(struct dvb_frontend *fe,
 			Standard = HF_DVBC_7MHZ;
 		else
 			Standard = HF_DVBC_8MHZ;
+		break;
 	default:
 		return -EINVAL;
 	}
Signature · 1 line
1.7.8.352.g876a6