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 1 of 2

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#23 lore raw

RFC PATCH 23/91 zl10353: 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/dvb/frontends/zl10353.c |  113 +++++++++++++++------------------
 1 files changed, 50 insertions(+), 63 deletions(-)
drivers/media/dvb/frontends/zl10353.c +50 -63
index 35334da..39c1bdb 100644
@@ -37,9 +37,9 @@ struct zl10353_state {
 
 	struct zl10353_config config;
 
-	enum fe_bandwidth bandwidth;
-       u32 ucblocks;
-       u32 frequency;
+	u32 bandwidth;
+	u32 ucblocks;
+	u32 frequency;
 };
 
 static int debug;
@@ -122,30 +122,17 @@ static void zl10353_dump_regs(struct dvb_frontend *fe)
 }
 
 static void zl10353_calc_nominal_rate(struct dvb_frontend *fe,
-				      enum fe_bandwidth bandwidth,
+				      u32 bandwidth,
 				      u16 *nominal_rate)
 {
 	struct zl10353_state *state = fe->demodulator_priv;
 	u32 adc_clock = 450560; /* 45.056 MHz */
 	u64 value;
-	u8 bw;
+	u8 bw = bandwidth / 1000000;
 
 	if (state->config.adc_clock)
 		adc_clock = state->config.adc_clock;
 
-	switch (bandwidth) {
-	case BANDWIDTH_6_MHZ:
-		bw = 6;
-		break;
-	case BANDWIDTH_7_MHZ:
-		bw = 7;
-		break;
-	case BANDWIDTH_8_MHZ:
-	default:
-		bw = 8;
-		break;
-	}
-
 	value = (u64)10 * (1 << 23) / 7 * 125;
 	value = (bw * value) + adc_clock / 2;
 	do_div(value, adc_clock);
@@ -192,16 +179,15 @@ static int zl10353_sleep(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int zl10353_set_parameters(struct dvb_frontend *fe,
-				  struct dvb_frontend_parameters *param)
+static int zl10353_set_parameters(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct zl10353_state *state = fe->demodulator_priv;
 	u16 nominal_rate, input_freq;
 	u8 pllbuf[6] = { 0x67 }, acq_ctl = 0;
 	u16 tps = 0;
-	struct dvb_ofdm_parameters *op = &param->u.ofdm;
 
-       state->frequency = param->frequency;
+	state->frequency = c->frequency;
 
 	zl10353_single_write(fe, RESET, 0x80);
 	udelay(200);
@@ -211,42 +197,44 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
 
 	zl10353_single_write(fe, AGC_TARGET, 0x28);
 
-	if (op->transmission_mode != TRANSMISSION_MODE_AUTO)
+	if (c->transmission_mode != TRANSMISSION_MODE_AUTO)
 		acq_ctl |= (1 << 0);
-	if (op->guard_interval != GUARD_INTERVAL_AUTO)
+	if (c->guard_interval != GUARD_INTERVAL_AUTO)
 		acq_ctl |= (1 << 1);
 	zl10353_single_write(fe, ACQ_CTL, acq_ctl);
 
-	switch (op->bandwidth) {
-	case BANDWIDTH_6_MHZ:
+	switch (c->bandwidth_hz) {
+	case 6000000:
 		/* These are extrapolated from the 7 and 8MHz values */
 		zl10353_single_write(fe, MCLK_RATIO, 0x97);
 		zl10353_single_write(fe, 0x64, 0x34);
 		zl10353_single_write(fe, 0xcc, 0xdd);
 		break;
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		zl10353_single_write(fe, MCLK_RATIO, 0x86);
 		zl10353_single_write(fe, 0x64, 0x35);
 		zl10353_single_write(fe, 0xcc, 0x73);
 		break;
-	case BANDWIDTH_8_MHZ:
 	default:
+		c->bandwidth_hz = 8000000;
+		/* fall though */
+	case 8000000:
 		zl10353_single_write(fe, MCLK_RATIO, 0x75);
 		zl10353_single_write(fe, 0x64, 0x36);
 		zl10353_single_write(fe, 0xcc, 0x73);
 	}
 
-	zl10353_calc_nominal_rate(fe, op->bandwidth, &nominal_rate);
+	zl10353_calc_nominal_rate(fe, c->bandwidth_hz, &nominal_rate);
 	zl10353_single_write(fe, TRL_NOMINAL_RATE_1, msb(nominal_rate));
 	zl10353_single_write(fe, TRL_NOMINAL_RATE_0, lsb(nominal_rate));
-	state->bandwidth = op->bandwidth;
+	state->bandwidth = c->bandwidth_hz;
 
 	zl10353_calc_input_freq(fe, &input_freq);
 	zl10353_single_write(fe, INPUT_FREQ_1, msb(input_freq));
 	zl10353_single_write(fe, INPUT_FREQ_0, lsb(input_freq));
 
 	/* Hint at TPS settings */
-	switch (op->code_rate_HP) {
+	switch (c->code_rate_HP) {
 	case FEC_2_3:
 		tps |= (1 << 7);
 		break;
@@ -266,7 +254,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
 		return -EINVAL;
 	}
 
-	switch (op->code_rate_LP) {
+	switch (c->code_rate_LP) {
 	case FEC_2_3:
 		tps |= (1 << 4);
 		break;
@@ -283,14 +271,14 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
 	case FEC_AUTO:
 		break;
 	case FEC_NONE:
-		if (op->hierarchy_information == HIERARCHY_AUTO ||
-		    op->hierarchy_information == HIERARCHY_NONE)
+		if (c->hierarchy == HIERARCHY_AUTO ||
+		    c->hierarchy == HIERARCHY_NONE)
 			break;
 	default:
 		return -EINVAL;
 	}
 
-	switch (op->constellation) {
+	switch (c->modulation) {
 	case QPSK:
 		break;
 	case QAM_AUTO:
@@ -304,7 +292,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
 		return -EINVAL;
 	}
 
-	switch (op->transmission_mode) {
+	switch (c->transmission_mode) {
 	case TRANSMISSION_MODE_2K:
 	case TRANSMISSION_MODE_AUTO:
 		break;
@@ -315,7 +303,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
 		return -EINVAL;
 	}
 
-	switch (op->guard_interval) {
+	switch (c->guard_interval) {
 	case GUARD_INTERVAL_1_32:
 	case GUARD_INTERVAL_AUTO:
 		break;
@@ -332,7 +320,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
 		return -EINVAL;
 	}
 
-	switch (op->hierarchy_information) {
+	switch (c->hierarchy) {
 	case HIERARCHY_AUTO:
 	case HIERARCHY_NONE:
 		break;
@@ -384,10 +372,9 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
 }
 
 static int zl10353_get_parameters(struct dvb_frontend *fe,
-				  struct dvb_frontend_parameters *param)
+				  struct dtv_frontend_properties *c)
 {
 	struct zl10353_state *state = fe->demodulator_priv;
-	struct dvb_ofdm_parameters *op = &param->u.ofdm;
 	int s6, s9;
 	u16 tps;
 	static const u8 tps_fec_to_api[8] = {
@@ -411,66 +398,66 @@ static int zl10353_get_parameters(struct dvb_frontend *fe,
 	tps = zl10353_read_register(state, TPS_RECEIVED_1) << 8 |
 	      zl10353_read_register(state, TPS_RECEIVED_0);
 
-	op->code_rate_HP = tps_fec_to_api[(tps >> 7) & 7];
-	op->code_rate_LP = tps_fec_to_api[(tps >> 4) & 7];
+	c->code_rate_HP = tps_fec_to_api[(tps >> 7) & 7];
+	c->code_rate_LP = tps_fec_to_api[(tps >> 4) & 7];
 
 	switch ((tps >> 13) & 3) {
 	case 0:
-		op->constellation = QPSK;
+		c->modulation = QPSK;
 		break;
 	case 1:
-		op->constellation = QAM_16;
+		c->modulation = QAM_16;
 		break;
 	case 2:
-		op->constellation = QAM_64;
+		c->modulation = QAM_64;
 		break;
 	default:
-		op->constellation = QAM_AUTO;
+		c->modulation = QAM_AUTO;
 		break;
 	}
 
-	op->transmission_mode = (tps & 0x01) ? TRANSMISSION_MODE_8K :
+	c->transmission_mode = (tps & 0x01) ? TRANSMISSION_MODE_8K :
 					       TRANSMISSION_MODE_2K;
 
 	switch ((tps >> 2) & 3) {
 	case 0:
-		op->guard_interval = GUARD_INTERVAL_1_32;
+		c->guard_interval = GUARD_INTERVAL_1_32;
 		break;
 	case 1:
-		op->guard_interval = GUARD_INTERVAL_1_16;
+		c->guard_interval = GUARD_INTERVAL_1_16;
 		break;
 	case 2:
-		op->guard_interval = GUARD_INTERVAL_1_8;
+		c->guard_interval = GUARD_INTERVAL_1_8;
 		break;
 	case 3:
-		op->guard_interval = GUARD_INTERVAL_1_4;
+		c->guard_interval = GUARD_INTERVAL_1_4;
 		break;
 	default:
-		op->guard_interval = GUARD_INTERVAL_AUTO;
+		c->guard_interval = GUARD_INTERVAL_AUTO;
 		break;
 	}
 
 	switch ((tps >> 10) & 7) {
 	case 0:
-		op->hierarchy_information = HIERARCHY_NONE;
+		c->hierarchy = HIERARCHY_NONE;
 		break;
 	case 1:
-		op->hierarchy_information = HIERARCHY_1;
+		c->hierarchy = HIERARCHY_1;
 		break;
 	case 2:
-		op->hierarchy_information = HIERARCHY_2;
+		c->hierarchy = HIERARCHY_2;
 		break;
 	case 3:
-		op->hierarchy_information = HIERARCHY_4;
+		c->hierarchy = HIERARCHY_4;
 		break;
 	default:
-		op->hierarchy_information = HIERARCHY_AUTO;
+		c->hierarchy = HIERARCHY_AUTO;
 		break;
 	}
 
-       param->frequency = state->frequency;
-	op->bandwidth = state->bandwidth;
-	param->inversion = INVERSION_AUTO;
+	c->frequency = state->frequency;
+	c->bandwidth_hz = state->bandwidth;
+	c->inversion = INVERSION_AUTO;
 
 	return 0;
 }
@@ -651,7 +638,7 @@ error:
 }
 
 static struct dvb_frontend_ops zl10353_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Zarlink ZL10353 DVB-T",
 		.type			= FE_OFDM,
@@ -675,8 +662,8 @@ static struct dvb_frontend_ops zl10353_ops = {
 	.i2c_gate_ctrl = zl10353_i2c_gate_ctrl,
 	.write = zl10353_write,
 
-	.set_frontend_legacy = zl10353_set_parameters,
-	.get_frontend_legacy = zl10353_get_parameters,
+	.set_frontend = zl10353_set_parameters,
+	.get_frontend = zl10353_get_parameters,
 	.get_tune_settings = zl10353_get_tune_settings,
 
 	.read_status = zl10353_read_status,
Signature · 1 line
1.7.8.352.g876a6
#24 lore raw

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

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.

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,
 };
 
Signature · 1 line
1.7.8.352.g876a6
#3 lore raw

RFC PATCH 3/91 dvb-core: add support for a DVBv5 get_frontend() callback

In reply to 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 +78 -24

170 lines not on this page · raw message

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,
Signature · 1 line
1.7.8.352.g876a6
#10 lore raw

RFC PATCH 10/91 cx24110: 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/dvb/frontends/cx24110.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)
drivers/media/dvb/frontends/cx24110.c +11 -10
index 278034d..6f85bb1 100644
@@ -531,25 +531,26 @@ static int cx24110_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int cx24110_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int cx24110_set_frontend(struct dvb_frontend* fe)
 {
 	struct cx24110_state *state = fe->demodulator_priv;
-
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 
 	if (fe->ops.tuner_ops.set_params) {
 		fe->ops.tuner_ops.set_params(fe);
 		if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
 	}
 
-	cx24110_set_inversion (state, p->inversion);
-	cx24110_set_fec (state, p->u.qpsk.fec_inner);
-	cx24110_set_symbolrate (state, p->u.qpsk.symbol_rate);
+	cx24110_set_inversion(state, p->inversion);
+	cx24110_set_fec(state, p->fec_inner);
+	cx24110_set_symbolrate(state, p->symbol_rate);
 	cx24110_writereg(state,0x04,0x05); /* start acquisition */
 
 	return 0;
 }
 
-static int cx24110_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int cx24110_get_frontend(struct dvb_frontend* fe,
+				struct dtv_frontend_properties *p)
 {
 	struct cx24110_state *state = fe->demodulator_priv;
 	s32 afc; unsigned sclk;
@@ -571,7 +572,7 @@ static int cx24110_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 	p->frequency += afc;
 	p->inversion = (cx24110_readreg (state, 0x22) & 0x10) ?
 				INVERSION_ON : INVERSION_OFF;
-	p->u.qpsk.fec_inner = cx24110_get_fec (state);
+	p->fec_inner = cx24110_get_fec (state);
 
 	return 0;
 }
@@ -623,7 +624,7 @@ error:
 }
 
 static struct dvb_frontend_ops cx24110_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name = "Conexant CX24110 DVB-S",
 		.type = FE_QPSK,
@@ -643,8 +644,8 @@ static struct dvb_frontend_ops cx24110_ops = {
 
 	.init = cx24110_initfe,
 	.write = _cx24110_pll_write,
-	.set_frontend_legacy = cx24110_set_frontend,
-	.get_frontend_legacy = cx24110_get_frontend,
+	.set_frontend = cx24110_set_frontend,
+	.get_frontend = cx24110_get_frontend,
 	.read_status = cx24110_read_status,
 	.read_ber = cx24110_read_ber,
 	.read_signal_strength = cx24110_read_signal_strength,
Signature · 1 line
1.7.8.352.g876a6
#17 lore raw

RFC PATCH 17/91 dib9000: remove unused parameters

In reply to Mauro Carvalho Chehab
---
 drivers/media/dvb/frontends/dib9000.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/media/dvb/frontends/dib9000.c +4 -4
index 4d82a4a..0488068 100644
@@ -1136,7 +1136,7 @@ static int dib9000_fw_init(struct dib9000_state *state)
 	return 0;
 }
 
-static void dib9000_fw_set_channel_head(struct dib9000_state *state, struct dvb_frontend_parameters *ch)
+static void dib9000_fw_set_channel_head(struct dib9000_state *state)
 {
 	u8 b[9];
 	u32 freq = state->fe[0]->dtv_property_cache.frequency / 1000;
@@ -1157,7 +1157,7 @@ static void dib9000_fw_set_channel_head(struct dib9000_state *state, struct dvb_
 	dib9000_risc_mem_write(state, FE_MM_W_CHANNEL_HEAD, b);
 }
 
-static int dib9000_fw_get_channel(struct dvb_frontend *fe, struct dvb_frontend_parameters *channel)
+static int dib9000_fw_get_channel(struct dvb_frontend *fe)
 {
 	struct dib9000_state *state = fe->demodulator_priv;
 	struct dibDVBTChannel {
@@ -1462,7 +1462,7 @@ static int dib9000_fw_tune(struct dvb_frontend *fe, struct dvb_frontend_paramete
 
 	switch (state->tune_state) {
 	case CT_DEMOD_START:
-		dib9000_fw_set_channel_head(state, ch);
+		dib9000_fw_set_channel_head(state);
 
 		/* write the channel context - a channel is initialized to 0, so it is OK */
 		dib9000_risc_mem_write(state, FE_MM_W_CHANNEL_CONTEXT, (u8 *) fe_info);
@@ -1911,7 +1911,7 @@ static int dib9000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 	}
 
 	/* get the channel from master chip */
-	ret = dib9000_fw_get_channel(fe, fep);
+	ret = dib9000_fw_get_channel(fe);
 	if (ret != 0)
 		goto return_value;
 
Signature · 1 line
1.7.8.352.g876a6
#78 lore raw

RFC PATCH 78/91 vp7045-fe: 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/dvb/dvb-usb/vp7045-fe.c |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)
drivers/media/dvb/dvb-usb/vp7045-fe.c +8 -15
index f8b5d8c..53d658a0 100644
@@ -103,9 +103,9 @@ static int vp7045_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_front
 	return 0;
 }
 
-static int vp7045_fe_set_frontend(struct dvb_frontend* fe,
-				  struct dvb_frontend_parameters *fep)
+static int vp7045_fe_set_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct vp7045_fe_state *state = fe->demodulator_priv;
 	u8 buf[5];
 	u32 freq = fep->frequency / 1000;
@@ -115,11 +115,10 @@ static int vp7045_fe_set_frontend(struct dvb_frontend* fe,
 	buf[2] =  freq        & 0xff;
 	buf[3] = 0;
 
-	switch (fep->u.ofdm.bandwidth) {
-		case BANDWIDTH_8_MHZ: buf[4] = 8; break;
-		case BANDWIDTH_7_MHZ: buf[4] = 7; break;
-		case BANDWIDTH_6_MHZ: buf[4] = 6; break;
-		case BANDWIDTH_AUTO: return -EOPNOTSUPP;
+	switch (fep->bandwidth_hz) {
+		case 8000000: buf[4] = 8; break;
+		case 7000000: buf[4] = 7; break;
+		case 6000000: buf[4] = 6; break;
 		default:
 			return -EINVAL;
 	}
@@ -128,12 +127,6 @@ static int vp7045_fe_set_frontend(struct dvb_frontend* fe,
 	return 0;
 }
 
-static int vp7045_fe_get_frontend(struct dvb_frontend* fe,
-				  struct dvb_frontend_parameters *fep)
-{
-	return 0;
-}
-
 static void vp7045_fe_release(struct dvb_frontend* fe)
 {
 	struct vp7045_fe_state *state = fe->demodulator_priv;
@@ -159,6 +152,7 @@ error:
 
 
 static struct dvb_frontend_ops vp7045_fe_ops = {
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Twinhan VP7045/46 USB DVB-T",
 		.type			= FE_OFDM,
@@ -180,8 +174,7 @@ static struct dvb_frontend_ops vp7045_fe_ops = {
 	.init = vp7045_fe_init,
 	.sleep = vp7045_fe_sleep,
 
-	.set_frontend_legacy = vp7045_fe_set_frontend,
-	.get_frontend_legacy = vp7045_fe_get_frontend,
+	.set_frontend = vp7045_fe_set_frontend,
 	.get_tune_settings = vp7045_fe_get_tune_settings,
 
 	.read_status = vp7045_fe_read_status,
Signature · 1 line
1.7.8.352.g876a6
#19 lore raw

RFC PATCH 19/91 dib9000: Get rid of the remaining DVBv3 legacy stuff

In reply to Mauro Carvalho Chehab

dib9000 is almost ok, with regards to the usage of DVBv5 parameters. It has just a few stuff using the old way, at set_frontend.

Replace them by the DVBv5 way, and add the delivery system.

---
 drivers/media/dvb/frontends/dib9000.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
drivers/media/dvb/frontends/dib9000.c +11 -8
index 0488068..a3a9fb1 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 dvb_frontend_parameters *fep)
+static int dib9000_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *c)
 {
 	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 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_legacy(state->fe[index_frontend], fep);
+			state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], c);
 			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) {
@@ -1958,7 +1958,7 @@ static int dib9000_set_channel_status(struct dvb_frontend *fe, struct dvb_fronte
 	return 0;
 }
 
-static int dib9000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
+static int dib9000_set_frontend(struct dvb_frontend *fe)
 {
 	struct dib9000_state *state = fe->demodulator_priv;
 	int sleep_time, sleep_time_slave;
@@ -1983,8 +1983,10 @@ static int dib9000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 	fe->dtv_property_cache.delivery_system = SYS_DVBT;
 
 	/* set the master status */
-	if (fep->u.ofdm.transmission_mode == TRANSMISSION_MODE_AUTO ||
-	    fep->u.ofdm.guard_interval == GUARD_INTERVAL_AUTO || fep->u.ofdm.constellation == QAM_AUTO || fep->u.ofdm.code_rate_HP == FEC_AUTO) {
+	if (state->fe[0]->dtv_property_cache.transmission_mode == TRANSMISSION_MODE_AUTO ||
+	    state->fe[0]->dtv_property_cache.guard_interval == GUARD_INTERVAL_AUTO ||
+	    state->fe[0]->dtv_property_cache.modulation == QAM_AUTO ||
+	    state->fe[0]->dtv_property_cache.code_rate_HP == FEC_AUTO) {
 		/* no channel specified, autosearch the channel */
 		state->channel_status.status = CHANNEL_STATUS_PARAMETERS_UNKNOWN;
 	} else
@@ -2052,7 +2054,7 @@ static int dib9000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 
 	/* synchronize all the channel cache */
 	state->get_frontend_internal = 1;
-	dib9000_get_frontend(state->fe[0], fep);
+	dib9000_get_frontend(state->fe[0], &state->fe[0]->dtv_property_cache);
 	state->get_frontend_internal = 0;
 
 	/* retune the other frontends with the found channel */
@@ -2495,6 +2497,7 @@ error:
 EXPORT_SYMBOL(dib9000_attach);
 
 static struct dvb_frontend_ops dib9000_ops = {
+	.delsys = { SYS_DVBT },
 	.info = {
 		 .name = "DiBcom 9000",
 		 .type = FE_OFDM,
@@ -2513,9 +2516,9 @@ static struct dvb_frontend_ops dib9000_ops = {
 	.init = dib9000_wakeup,
 	.sleep = dib9000_sleep,
 
-	.set_frontend_legacy = dib9000_set_frontend,
+	.set_frontend = dib9000_set_frontend,
 	.get_tune_settings = dib9000_fe_get_tune_settings,
-	.get_frontend_legacy = dib9000_get_frontend,
+	.get_frontend = dib9000_get_frontend,
 
 	.read_status = dib9000_read_status,
 	.read_ber = dib9000_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#20 lore raw

RFC PATCH 20/91 dib3000mb: convert set_fontend to use DVBv5 parameters

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/dib3000mb.c |  111 +++++++++++++++----------------
 1 files changed, 54 insertions(+), 57 deletions(-)
drivers/media/dvb/frontends/dib3000mb.c +54 -57
index 77af240..432d1b0 100644
@@ -113,13 +113,12 @@ static u16 dib3000_seq[2][2][2] =     /* fft,gua,   inv   */
 	};
 
 static int dib3000mb_get_frontend(struct dvb_frontend* fe,
-				  struct dvb_frontend_parameters *fep);
+				  struct dtv_frontend_properties *c);
 
-static int dib3000mb_set_frontend(struct dvb_frontend* fe,
-				  struct dvb_frontend_parameters *fep, int tuner)
+static int dib3000mb_set_frontend(struct dvb_frontend* fe, int tuner)
 {
 	struct dib3000_state* state = fe->demodulator_priv;
-	struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	fe_code_rate_t fe_cr = FEC_NONE;
 	int search_state, seq;
 
@@ -128,23 +127,23 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 		if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
 
 		deb_setf("bandwidth: ");
-		switch (ofdm->bandwidth) {
-			case BANDWIDTH_8_MHZ:
+		switch (c->bandwidth_hz) {
+			case 8000000:
 				deb_setf("8 MHz\n");
 				wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[2]);
 				wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_8mhz);
 				break;
-			case BANDWIDTH_7_MHZ:
+			case 7000000:
 				deb_setf("7 MHz\n");
 				wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[1]);
 				wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_7mhz);
 				break;
-			case BANDWIDTH_6_MHZ:
+			case 6000000:
 				deb_setf("6 MHz\n");
 				wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[0]);
 				wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_6mhz);
 				break;
-			case BANDWIDTH_AUTO:
+			case 0:
 				return -EOPNOTSUPP;
 			default:
 				err("unknown bandwidth value.");
@@ -154,7 +153,7 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 	wr(DIB3000MB_REG_LOCK1_MASK, DIB3000MB_LOCK1_SEARCH_4);
 
 	deb_setf("transmission mode: ");
-	switch (ofdm->transmission_mode) {
+	switch (c->transmission_mode) {
 		case TRANSMISSION_MODE_2K:
 			deb_setf("2k\n");
 			wr(DIB3000MB_REG_FFT, DIB3000_TRANSMISSION_MODE_2K);
@@ -171,7 +170,7 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 	}
 
 	deb_setf("guard: ");
-	switch (ofdm->guard_interval) {
+	switch (c->guard_interval) {
 		case GUARD_INTERVAL_1_32:
 			deb_setf("1_32\n");
 			wr(DIB3000MB_REG_GUARD_TIME, DIB3000_GUARD_TIME_1_32);
@@ -196,7 +195,7 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 	}
 
 	deb_setf("inversion: ");
-	switch (fep->inversion) {
+	switch (c->inversion) {
 		case INVERSION_OFF:
 			deb_setf("off\n");
 			wr(DIB3000MB_REG_DDS_INV, DIB3000_DDS_INVERSION_OFF);
@@ -212,8 +211,8 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 			return -EINVAL;
 	}
 
-	deb_setf("constellation: ");
-	switch (ofdm->constellation) {
+	deb_setf("modulation: ");
+	switch (c->modulation) {
 		case QPSK:
 			deb_setf("qpsk\n");
 			wr(DIB3000MB_REG_QAM, DIB3000_CONSTELLATION_QPSK);
@@ -232,7 +231,7 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 			return -EINVAL;
 	}
 	deb_setf("hierarchy: ");
-	switch (ofdm->hierarchy_information) {
+	switch (c->hierarchy) {
 		case HIERARCHY_NONE:
 			deb_setf("none ");
 			/* fall through */
@@ -256,16 +255,16 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 	}
 
 	deb_setf("hierarchy: ");
-	if (ofdm->hierarchy_information == HIERARCHY_NONE) {
+	if (c->hierarchy == HIERARCHY_NONE) {
 		deb_setf("none\n");
 		wr(DIB3000MB_REG_VIT_HRCH, DIB3000_HRCH_OFF);
 		wr(DIB3000MB_REG_VIT_HP, DIB3000_SELECT_HP);
-		fe_cr = ofdm->code_rate_HP;
-	} else if (ofdm->hierarchy_information != HIERARCHY_AUTO) {
+		fe_cr = c->code_rate_HP;
+	} else if (c->hierarchy != HIERARCHY_AUTO) {
 		deb_setf("on\n");
 		wr(DIB3000MB_REG_VIT_HRCH, DIB3000_HRCH_ON);
 		wr(DIB3000MB_REG_VIT_HP, DIB3000_SELECT_LP);
-		fe_cr = ofdm->code_rate_LP;
+		fe_cr = c->code_rate_LP;
 	}
 	deb_setf("fec: ");
 	switch (fe_cr) {
@@ -300,9 +299,9 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 	}
 
 	seq = dib3000_seq
-		[ofdm->transmission_mode == TRANSMISSION_MODE_AUTO]
-		[ofdm->guard_interval == GUARD_INTERVAL_AUTO]
-		[fep->inversion == INVERSION_AUTO];
+		[c->transmission_mode == TRANSMISSION_MODE_AUTO]
+		[c->guard_interval == GUARD_INTERVAL_AUTO]
+		[c->inversion == INVERSION_AUTO];
 
 	deb_setf("seq? %d\n", seq);
 
@@ -310,8 +309,8 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 
 	wr(DIB3000MB_REG_ISI, seq ? DIB3000MB_ISI_INHIBIT : DIB3000MB_ISI_ACTIVATE);
 
-	if (ofdm->transmission_mode == TRANSMISSION_MODE_2K) {
-		if (ofdm->guard_interval == GUARD_INTERVAL_1_8) {
+	if (c->transmission_mode == TRANSMISSION_MODE_2K) {
+		if (c->guard_interval == GUARD_INTERVAL_1_8) {
 			wr(DIB3000MB_REG_SYNC_IMPROVEMENT, DIB3000MB_SYNC_IMPROVE_2K_1_8);
 		} else {
 			wr(DIB3000MB_REG_SYNC_IMPROVEMENT, DIB3000MB_SYNC_IMPROVE_DEFAULT);
@@ -339,10 +338,10 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 	wr_foreach(dib3000mb_reg_agc_bandwidth, dib3000mb_agc_bandwidth_low);
 
 	/* something has to be auto searched */
-	if (ofdm->constellation == QAM_AUTO ||
-		ofdm->hierarchy_information == HIERARCHY_AUTO ||
+	if (c->modulation == QAM_AUTO ||
+		c->hierarchy == HIERARCHY_AUTO ||
 		fe_cr == FEC_AUTO ||
-		fep->inversion == INVERSION_AUTO) {
+		c->inversion == INVERSION_AUTO) {
 		int as_count=0;
 
 		deb_setf("autosearch enabled.\n");
@@ -361,10 +360,9 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 		deb_setf("search_state after autosearch %d after %d checks\n",search_state,as_count);
 
 		if (search_state == 1) {
-			struct dvb_frontend_parameters feps;
-			if (dib3000mb_get_frontend(fe, &feps) == 0) {
+			if (dib3000mb_get_frontend(fe, c) == 0) {
 				deb_setf("reading tuning data from frontend succeeded.\n");
-				return dib3000mb_set_frontend(fe, &feps, 0);
+				return dib3000mb_set_frontend(fe, 0);
 			}
 		}
 
@@ -454,10 +452,9 @@ static int dib3000mb_fe_init(struct dvb_frontend* fe, int mobile_mode)
 }
 
 static int dib3000mb_get_frontend(struct dvb_frontend* fe,
-				  struct dvb_frontend_parameters *fep)
+				  struct dtv_frontend_properties *c)
 {
 	struct dib3000_state* state = fe->demodulator_priv;
-	struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm;
 	fe_code_rate_t *cr;
 	u16 tps_val;
 	int inv_test1,inv_test2;
@@ -484,25 +481,25 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
 	else
 		inv_test2 = 2;
 
-	fep->inversion =
+	c->inversion =
 		((inv_test2 == 2) && (inv_test1==1 || inv_test1==0)) ||
 		((inv_test2 == 0) && (inv_test1==1 || inv_test1==2)) ?
 		INVERSION_ON : INVERSION_OFF;
 
-	deb_getf("inversion %d %d, %d\n", inv_test2, inv_test1, fep->inversion);
+	deb_getf("inversion %d %d, %d\n", inv_test2, inv_test1, c->inversion);
 
 	switch ((tps_val = rd(DIB3000MB_REG_TPS_QAM))) {
 		case DIB3000_CONSTELLATION_QPSK:
 			deb_getf("QPSK ");
-			ofdm->constellation = QPSK;
+			c->modulation = QPSK;
 			break;
 		case DIB3000_CONSTELLATION_16QAM:
 			deb_getf("QAM16 ");
-			ofdm->constellation = QAM_16;
+			c->modulation = QAM_16;
 			break;
 		case DIB3000_CONSTELLATION_64QAM:
 			deb_getf("QAM64 ");
-			ofdm->constellation = QAM_64;
+			c->modulation = QAM_64;
 			break;
 		default:
 			err("Unexpected constellation returned by TPS (%d)", tps_val);
@@ -512,24 +509,24 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
 
 	if (rd(DIB3000MB_REG_TPS_HRCH)) {
 		deb_getf("HRCH ON\n");
-		cr = &ofdm->code_rate_LP;
-		ofdm->code_rate_HP = FEC_NONE;
+		cr = &c->code_rate_LP;
+		c->code_rate_HP = FEC_NONE;
 		switch ((tps_val = rd(DIB3000MB_REG_TPS_VIT_ALPHA))) {
 			case DIB3000_ALPHA_0:
 				deb_getf("HIERARCHY_NONE ");
-				ofdm->hierarchy_information = HIERARCHY_NONE;
+				c->hierarchy = HIERARCHY_NONE;
 				break;
 			case DIB3000_ALPHA_1:
 				deb_getf("HIERARCHY_1 ");
-				ofdm->hierarchy_information = HIERARCHY_1;
+				c->hierarchy = HIERARCHY_1;
 				break;
 			case DIB3000_ALPHA_2:
 				deb_getf("HIERARCHY_2 ");
-				ofdm->hierarchy_information = HIERARCHY_2;
+				c->hierarchy = HIERARCHY_2;
 				break;
 			case DIB3000_ALPHA_4:
 				deb_getf("HIERARCHY_4 ");
-				ofdm->hierarchy_information = HIERARCHY_4;
+				c->hierarchy = HIERARCHY_4;
 				break;
 			default:
 				err("Unexpected ALPHA value returned by TPS (%d)", tps_val);
@@ -540,9 +537,9 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
 		tps_val = rd(DIB3000MB_REG_TPS_CODE_RATE_LP);
 	} else {
 		deb_getf("HRCH OFF\n");
-		cr = &ofdm->code_rate_HP;
-		ofdm->code_rate_LP = FEC_NONE;
-		ofdm->hierarchy_information = HIERARCHY_NONE;
+		cr = &c->code_rate_HP;
+		c->code_rate_LP = FEC_NONE;
+		c->hierarchy = HIERARCHY_NONE;
 
 		tps_val = rd(DIB3000MB_REG_TPS_CODE_RATE_HP);
 	}
@@ -577,19 +574,19 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
 	switch ((tps_val = rd(DIB3000MB_REG_TPS_GUARD_TIME))) {
 		case DIB3000_GUARD_TIME_1_32:
 			deb_getf("GUARD_INTERVAL_1_32 ");
-			ofdm->guard_interval = GUARD_INTERVAL_1_32;
+			c->guard_interval = GUARD_INTERVAL_1_32;
 			break;
 		case DIB3000_GUARD_TIME_1_16:
 			deb_getf("GUARD_INTERVAL_1_16 ");
-			ofdm->guard_interval = GUARD_INTERVAL_1_16;
+			c->guard_interval = GUARD_INTERVAL_1_16;
 			break;
 		case DIB3000_GUARD_TIME_1_8:
 			deb_getf("GUARD_INTERVAL_1_8 ");
-			ofdm->guard_interval = GUARD_INTERVAL_1_8;
+			c->guard_interval = GUARD_INTERVAL_1_8;
 			break;
 		case DIB3000_GUARD_TIME_1_4:
 			deb_getf("GUARD_INTERVAL_1_4 ");
-			ofdm->guard_interval = GUARD_INTERVAL_1_4;
+			c->guard_interval = GUARD_INTERVAL_1_4;
 			break;
 		default:
 			err("Unexpected Guard Time returned by TPS (%d)", tps_val);
@@ -600,11 +597,11 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
 	switch ((tps_val = rd(DIB3000MB_REG_TPS_FFT))) {
 		case DIB3000_TRANSMISSION_MODE_2K:
 			deb_getf("TRANSMISSION_MODE_2K ");
-			ofdm->transmission_mode = TRANSMISSION_MODE_2K;
+			c->transmission_mode = TRANSMISSION_MODE_2K;
 			break;
 		case DIB3000_TRANSMISSION_MODE_8K:
 			deb_getf("TRANSMISSION_MODE_8K ");
-			ofdm->transmission_mode = TRANSMISSION_MODE_8K;
+			c->transmission_mode = TRANSMISSION_MODE_8K;
 			break;
 		default:
 			err("unexpected transmission mode return by TPS (%d)", tps_val);
@@ -701,9 +698,9 @@ static int dib3000mb_fe_init_nonmobile(struct dvb_frontend* fe)
 	return dib3000mb_fe_init(fe, 0);
 }
 
-static int dib3000mb_set_frontend_and_tuner(struct dvb_frontend* fe, struct dvb_frontend_parameters *fep)
+static int dib3000mb_set_frontend_and_tuner(struct dvb_frontend* fe)
 {
-	return dib3000mb_set_frontend(fe, fep, 1);
+	return dib3000mb_set_frontend(fe, 1);
 }
 
 static void dib3000mb_release(struct dvb_frontend* fe)
@@ -794,7 +791,7 @@ error:
 }
 
 static struct dvb_frontend_ops dib3000mb_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "DiBcom 3000M-B DVB-T",
 		.type			= FE_OFDM,
@@ -816,8 +813,8 @@ static struct dvb_frontend_ops dib3000mb_ops = {
 	.init = dib3000mb_fe_init_nonmobile,
 	.sleep = dib3000mb_sleep,
 
-	.set_frontend_legacy = dib3000mb_set_frontend_and_tuner,
-	.get_frontend_legacy = dib3000mb_get_frontend,
+	.set_frontend = dib3000mb_set_frontend_and_tuner,
+	.get_frontend = dib3000mb_get_frontend,
 	.get_tune_settings = dib3000mb_fe_get_tune_settings,
 
 	.read_status = dib3000mb_read_status,
Signature · 1 line
1.7.8.352.g876a6
#2 lore raw

RFC PATCH 2/91 Rename set_frontend fops to set_frontend_legacy

In reply to Mauro Carvalho Chehab

Passing DVBv3 parameters to set_frontend is not fun, as the core doesn't have any way to know if the driver is using the v3 or v5 parameters. So, rename the callback and add a new one to allow distinguish between a mixed v3/v5 paramenter call from a pure v5 call.

After having all frontends to use the new way, the legacy call can be removed.

---
 drivers/media/dvb/bt8xx/dst.c               |    8 ++++----
 drivers/media/dvb/dvb-core/dvb_frontend.c   |    8 ++++++--
 drivers/media/dvb/dvb-core/dvb_frontend.h   |    3 ++-
 drivers/media/dvb/dvb-usb/af9005-fe.c       |    2 +-
 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/gp8psk-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/bcm3510.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/cx24116.c       |    2 +-
 drivers/media/dvb/frontends/cx24123.c       |    2 +-
 drivers/media/dvb/frontends/cxd2820r_core.c |    2 +-
 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       |    2 +-
 drivers/media/dvb/frontends/dib9000.c       |    2 +-
 drivers/media/dvb/frontends/drxd_hard.c     |    2 +-
 drivers/media/dvb/frontends/drxk_hard.c     |    4 ++--
 drivers/media/dvb/frontends/ds3000.c        |    2 +-
 drivers/media/dvb/frontends/dvb_dummy_fe.c  |    6 +++---
 drivers/media/dvb/frontends/ec100.c         |    2 +-
 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/nxt200x.c       |    2 +-
 drivers/media/dvb/frontends/nxt6000.c       |    2 +-
 drivers/media/dvb/frontends/or51132.c       |    2 +-
 drivers/media/dvb/frontends/or51211.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/si21xx.c        |    2 +-
 drivers/media/dvb/frontends/sp8870.c        |    2 +-
 drivers/media/dvb/frontends/sp887x.c        |    2 +-
 drivers/media/dvb/frontends/stv0288.c       |    2 +-
 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/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/dvb/ttpci/av7110.c            |    2 +-
 drivers/media/dvb/ttusb-dec/ttusbdecfe.c    |    4 ++--
 drivers/media/video/tlg2300/pd-dvb.c        |    2 +-
 drivers/staging/media/as102/as102_fe.c      |    2 +-
 73 files changed, 90 insertions(+), 85 deletions(-)
drivers/media/dvb/bt8xx/dst.c +4 -4
index caa4e18..4658bd6 100644
@@ -1777,7 +1777,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
 	.release = dst_release,
 	.init = dst_init,
 	.tune = dst_tune_frontend,
-	.set_frontend = dst_set_frontend,
+	.set_frontend_legacy = dst_set_frontend,
 	.get_frontend = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
@@ -1803,7 +1803,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
 	.release = dst_release,
 	.init = dst_init,
 	.tune = dst_tune_frontend,
-	.set_frontend = dst_set_frontend,
+	.set_frontend_legacy = dst_set_frontend,
 	.get_frontend = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
@@ -1837,7 +1837,7 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
 	.release = dst_release,
 	.init = dst_init,
 	.tune = dst_tune_frontend,
-	.set_frontend = dst_set_frontend,
+	.set_frontend_legacy = dst_set_frontend,
 	.get_frontend = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
@@ -1860,7 +1860,7 @@ static struct dvb_frontend_ops dst_atsc_ops = {
 	.release = dst_release,
 	.init = dst_init,
 	.tune = dst_tune_frontend,
-	.set_frontend = dst_set_frontend,
+	.set_frontend_legacy = dst_set_frontend,
 	.get_frontend = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
drivers/media/dvb/dvb-core/dvb_frontend.c +6 -2
index f17c411..eca6170 100644
@@ -352,7 +352,9 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 	if (autoinversion)
 		fepriv->parameters_in.inversion = fepriv->inversion;
 	if (fe->ops.set_frontend)
-		fe_set_err = fe->ops.set_frontend(fe, &fepriv->parameters_in);
+		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;
@@ -383,7 +385,9 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 	if (fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT) {
 		if (fepriv->state & FESTATE_RETUNE) {
 			if (fe->ops.set_frontend)
-				retval = fe->ops.set_frontend(fe,
+				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)
drivers/media/dvb/dvb-core/dvb_frontend.h +2 -1
index 95f2134..dd44964 100644
@@ -280,7 +280,8 @@ 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)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
+	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)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
drivers/media/dvb/dvb-usb/af9005-fe.c +1 -1
index aa44f65..f216933 100644
@@ -1475,7 +1475,7 @@ static struct dvb_frontend_ops af9005_fe_ops = {
 	.sleep = af9005_fe_sleep,
 	.ts_bus_ctrl = af9005_ts_bus_ctrl,
 
-	.set_frontend = af9005_fe_set_frontend,
+	.set_frontend_legacy = af9005_fe_set_frontend,
 	.get_frontend = af9005_fe_get_frontend,
 
 	.read_status = af9005_fe_read_status,
drivers/media/dvb/dvb-usb/cinergyT2-fe.c +1 -1
index 9cd51ac..cad2284 100644
@@ -340,7 +340,7 @@ static struct dvb_frontend_ops cinergyt2_fe_ops = {
 	.init			= cinergyt2_fe_init,
 	.sleep			= cinergyt2_fe_sleep,
 
-	.set_frontend		= cinergyt2_fe_set_frontend,
+	.set_frontend_legacy		= cinergyt2_fe_set_frontend,
 	.get_frontend		= cinergyt2_fe_get_frontend,
 	.get_tune_settings	= cinergyt2_fe_get_tune_settings,
 
drivers/media/dvb/dvb-usb/dtt200u-fe.c +1 -1
index 17413ad..ef9f7e4 100644
@@ -193,7 +193,7 @@ static struct dvb_frontend_ops dtt200u_fe_ops = {
 	.init = dtt200u_fe_init,
 	.sleep = dtt200u_fe_sleep,
 
-	.set_frontend = dtt200u_fe_set_frontend,
+	.set_frontend_legacy = dtt200u_fe_set_frontend,
 	.get_frontend = dtt200u_fe_get_frontend,
 	.get_tune_settings = dtt200u_fe_get_tune_settings,
 
drivers/media/dvb/dvb-usb/friio-fe.c +1 -1
index 015b4e8..c98e2cc 100644
@@ -466,7 +466,7 @@ static struct dvb_frontend_ops jdvbt90502_ops = {
 
 	.set_property = jdvbt90502_set_property,
 
-	.set_frontend = jdvbt90502_set_frontend,
+	.set_frontend_legacy = jdvbt90502_set_frontend,
 	.get_frontend = jdvbt90502_get_frontend,
 
 	.read_status = jdvbt90502_read_status,
drivers/media/dvb/dvb-usb/gp8psk-fe.c +1 -1
index 5426267..6189446 100644
@@ -368,7 +368,7 @@ static struct dvb_frontend_ops gp8psk_fe_ops = {
 
 	.set_property = gp8psk_fe_set_property,
 	.get_property = gp8psk_fe_get_property,
-	.set_frontend = gp8psk_fe_set_frontend,
+	.set_frontend_legacy = gp8psk_fe_set_frontend,
 
 	.get_tune_settings = gp8psk_fe_get_tune_settings,
 
drivers/media/dvb/dvb-usb/mxl111sf-demod.c +1 -1
index 3ae7729..6639d3a 100644
@@ -570,7 +570,7 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = {
 	.init                 = mxl111sf_init,
 	.i2c_gate_ctrl        = mxl111sf_i2c_gate_ctrl,
 #endif
-	.set_frontend         = mxl111sf_demod_set_frontend,
+	.set_frontend_legacy         = mxl111sf_demod_set_frontend,
 	.get_frontend         = mxl111sf_demod_get_frontend,
 	.get_tune_settings    = mxl111sf_demod_get_tune_settings,
 	.read_status          = mxl111sf_demod_read_status,
drivers/media/dvb/dvb-usb/vp702x-fe.c +1 -1
index 2bb8d4c..ee2177e 100644
@@ -370,7 +370,7 @@ static struct dvb_frontend_ops vp702x_fe_ops = {
 	.init  = vp702x_fe_init,
 	.sleep = vp702x_fe_sleep,
 
-	.set_frontend = vp702x_fe_set_frontend,
+	.set_frontend_legacy = vp702x_fe_set_frontend,
 	.get_frontend = vp702x_fe_get_frontend,
 	.get_tune_settings = vp702x_fe_get_tune_settings,
 
drivers/media/dvb/dvb-usb/vp7045-fe.c +1 -1
index 8452eef..4f708c7 100644
@@ -180,7 +180,7 @@ static struct dvb_frontend_ops vp7045_fe_ops = {
 	.init = vp7045_fe_init,
 	.sleep = vp7045_fe_sleep,
 
-	.set_frontend = vp7045_fe_set_frontend,
+	.set_frontend_legacy = vp7045_fe_set_frontend,
 	.get_frontend = vp7045_fe_get_frontend,
 	.get_tune_settings = vp7045_fe_get_tune_settings,
 
drivers/media/dvb/firewire/firedtv-fe.c +1 -1
index 8748a61..a887abc 100644
@@ -173,7 +173,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name)
 	ops->init			= fdtv_dvb_init;
 	ops->sleep			= fdtv_sleep;
 
-	ops->set_frontend		= fdtv_set_frontend;
+	ops->set_frontend_legacy	= fdtv_set_frontend;
 	ops->get_frontend		= fdtv_get_frontend;
 
 	ops->get_property		= fdtv_get_property;
drivers/media/dvb/frontends/af9013.c +1 -1
index 889827d..a041d7f 100644
@@ -1529,7 +1529,7 @@ static struct dvb_frontend_ops af9013_ops = {
 	.sleep = af9013_sleep,
 	.i2c_gate_ctrl = af9013_i2c_gate_ctrl,
 
-	.set_frontend = af9013_set_frontend,
+	.set_frontend_legacy = af9013_set_frontend,
 	.get_frontend = af9013_get_frontend,
 
 	.get_tune_settings = af9013_get_tune_settings,
drivers/media/dvb/frontends/atbm8830.c +1 -1
index 90480d3..5fc30f3 100644
@@ -449,7 +449,7 @@ static struct dvb_frontend_ops atbm8830_ops = {
 	.write = NULL,
 	.i2c_gate_ctrl = atbm8830_i2c_gate_ctrl,
 
-	.set_frontend = atbm8830_set_fe,
+	.set_frontend_legacy = atbm8830_set_fe,
 	.get_frontend = atbm8830_get_fe,
 	.get_tune_settings = atbm8830_get_tune_settings,
 
drivers/media/dvb/frontends/au8522_dig.c +1 -1
index 1df9d9c..4b74cc8 100644
@@ -1023,7 +1023,7 @@ static struct dvb_frontend_ops au8522_ops = {
 	.init                 = au8522_init,
 	.sleep                = au8522_sleep,
 	.i2c_gate_ctrl        = au8522_i2c_gate_ctrl,
-	.set_frontend         = au8522_set_frontend,
+	.set_frontend_legacy         = au8522_set_frontend,
 	.get_frontend         = au8522_get_frontend,
 	.get_tune_settings    = au8522_get_tune_settings,
 	.read_status          = au8522_read_status,
drivers/media/dvb/frontends/bcm3510.c +1 -1
index 8aff586..43b17fa 100644
@@ -839,7 +839,7 @@ static struct dvb_frontend_ops bcm3510_ops = {
 	.init = bcm3510_init,
 	.sleep = bcm3510_sleep,
 
-	.set_frontend = bcm3510_set_frontend,
+	.set_frontend_legacy = bcm3510_set_frontend,
 	.get_tune_settings = bcm3510_get_tune_settings,
 
 	.read_status = bcm3510_read_status,
drivers/media/dvb/frontends/cx22700.c +1 -1
index 6ef82a1..ce1e74f 100644
@@ -419,7 +419,7 @@ static struct dvb_frontend_ops cx22700_ops = {
 	.init = cx22700_init,
 	.i2c_gate_ctrl = cx22700_i2c_gate_ctrl,
 
-	.set_frontend = cx22700_set_frontend,
+	.set_frontend_legacy = cx22700_set_frontend,
 	.get_frontend = cx22700_get_frontend,
 	.get_tune_settings = cx22700_get_tune_settings,
 
drivers/media/dvb/frontends/cx22702.c +1 -1
index 73dd87a..2cea13e 100644
@@ -622,7 +622,7 @@ static const struct dvb_frontend_ops cx22702_ops = {
 	.init = cx22702_init,
 	.i2c_gate_ctrl = cx22702_i2c_gate_ctrl,
 
-	.set_frontend = cx22702_set_tps,
+	.set_frontend_legacy = cx22702_set_tps,
 	.get_frontend = cx22702_get_frontend,
 	.get_tune_settings = cx22702_get_tune_settings,
 
drivers/media/dvb/frontends/cx24110.c +1 -1
index 1eb9253..c75f9da 100644
@@ -643,7 +643,7 @@ static struct dvb_frontend_ops cx24110_ops = {
 
 	.init = cx24110_initfe,
 	.write = _cx24110_pll_write,
-	.set_frontend = cx24110_set_frontend,
+	.set_frontend_legacy = cx24110_set_frontend,
 	.get_frontend = cx24110_get_frontend,
 	.read_status = cx24110_read_status,
 	.read_ber = cx24110_read_ber,
drivers/media/dvb/frontends/cx24116.c +1 -1
index ccd0525..445ae88 100644
@@ -1509,7 +1509,7 @@ static struct dvb_frontend_ops cx24116_ops = {
 
 	.set_property = cx24116_set_property,
 	.get_property = cx24116_get_property,
-	.set_frontend = cx24116_set_frontend,
+	.set_frontend_legacy = cx24116_set_frontend,
 };
 
 MODULE_DESCRIPTION("DVB Frontend module for Conexant cx24116/cx24118 hardware");
drivers/media/dvb/frontends/cx24123.c +1 -1
index 4d387d3..1342429 100644
@@ -1146,7 +1146,7 @@ static struct dvb_frontend_ops cx24123_ops = {
 	.release = cx24123_release,
 
 	.init = cx24123_initfe,
-	.set_frontend = cx24123_set_frontend,
+	.set_frontend_legacy = cx24123_set_frontend,
 	.get_frontend = cx24123_get_frontend,
 	.read_status = cx24123_read_status,
 	.read_ber = cx24123_read_ber,
drivers/media/dvb/frontends/cxd2820r_core.c +1 -1
index 036480f..e8ace56 100644
@@ -852,7 +852,7 @@ static const struct dvb_frontend_ops cxd2820r_ops[2] = {
 		.get_tune_settings = cxd2820r_get_tune_settings,
 		.i2c_gate_ctrl = cxd2820r_i2c_gate_ctrl,
 
-		.set_frontend = cxd2820r_set_frontend,
+		.set_frontend_legacy = cxd2820r_set_frontend,
 		.get_frontend = cxd2820r_get_frontend,
 
 		.read_status = cxd2820r_read_status,
drivers/media/dvb/frontends/dib3000mb.c +1 -1
index 7403198..987eb17 100644
@@ -816,7 +816,7 @@ static struct dvb_frontend_ops dib3000mb_ops = {
 	.init = dib3000mb_fe_init_nonmobile,
 	.sleep = dib3000mb_sleep,
 
-	.set_frontend = dib3000mb_set_frontend_and_tuner,
+	.set_frontend_legacy = dib3000mb_set_frontend_and_tuner,
 	.get_frontend = dib3000mb_get_frontend,
 	.get_tune_settings = dib3000mb_fe_get_tune_settings,
 
drivers/media/dvb/frontends/dib3000mc.c +1 -1
index 32cd006..19fca6e 100644
@@ -918,7 +918,7 @@ static struct dvb_frontend_ops dib3000mc_ops = {
 	.init                 = dib3000mc_init,
 	.sleep                = dib3000mc_sleep,
 
-	.set_frontend         = dib3000mc_set_frontend,
+	.set_frontend_legacy         = dib3000mc_set_frontend,
 	.get_tune_settings    = dib3000mc_fe_get_tune_settings,
 	.get_frontend         = dib3000mc_get_frontend,
 
drivers/media/dvb/frontends/dib7000m.c +1 -1
index a30a482..cc6a710 100644
@@ -1451,7 +1451,7 @@ static struct dvb_frontend_ops dib7000m_ops = {
 	.init                 = dib7000m_wakeup,
 	.sleep                = dib7000m_sleep,
 
-	.set_frontend         = dib7000m_set_frontend,
+	.set_frontend_legacy         = dib7000m_set_frontend,
 	.get_tune_settings    = dib7000m_fe_get_tune_settings,
 	.get_frontend         = dib7000m_get_frontend,
 
drivers/media/dvb/frontends/dib7000p.c +1 -1
index 9983207..1e81b5b 100644
@@ -2439,7 +2439,7 @@ static struct dvb_frontend_ops dib7000p_ops = {
 	.init = dib7000p_wakeup,
 	.sleep = dib7000p_sleep,
 
-	.set_frontend = dib7000p_set_frontend,
+	.set_frontend_legacy = dib7000p_set_frontend,
 	.get_tune_settings = dib7000p_fe_get_tune_settings,
 	.get_frontend = dib7000p_get_frontend,
 
drivers/media/dvb/frontends/dib8000.c +1 -1
index 2da2bb3..f9c98ba 100644
@@ -3479,7 +3479,7 @@ static const struct dvb_frontend_ops dib8000_ops = {
 	.init = dib8000_wakeup,
 	.sleep = dib8000_sleep,
 
-	.set_frontend = dib8000_set_frontend,
+	.set_frontend_legacy = dib8000_set_frontend,
 	.get_tune_settings = dib8000_fe_get_tune_settings,
 	.get_frontend = dib8000_get_frontend,
 
drivers/media/dvb/frontends/dib9000.c +1 -1
index 660f806..c7b4910 100644
@@ -2513,7 +2513,7 @@ static struct dvb_frontend_ops dib9000_ops = {
 	.init = dib9000_wakeup,
 	.sleep = dib9000_sleep,
 
-	.set_frontend = dib9000_set_frontend,
+	.set_frontend_legacy = dib9000_set_frontend,
 	.get_tune_settings = dib9000_fe_get_tune_settings,
 	.get_frontend = dib9000_get_frontend,
 
drivers/media/dvb/frontends/drxd_hard.c +1 -1
index 955d3a5..8118bb3 100644
@@ -2956,7 +2956,7 @@ static struct dvb_frontend_ops drxd_ops = {
 	.sleep = drxd_sleep,
 	.i2c_gate_ctrl = drxd_i2c_gate_ctrl,
 
-	.set_frontend = drxd_set_frontend,
+	.set_frontend_legacy = drxd_set_frontend,
 	.get_frontend = drxd_get_frontend,
 	.get_tune_settings = drxd_get_tune_settings,
 
drivers/media/dvb/frontends/drxk_hard.c +2 -2
index 83b8474..1205944 100644
@@ -6406,7 +6406,7 @@ static struct dvb_frontend_ops drxk_c_ops = {
 	.sleep = drxk_c_sleep,
 	.i2c_gate_ctrl = drxk_gate_ctrl,
 
-	.set_frontend = drxk_set_parameters,
+	.set_frontend_legacy = drxk_set_parameters,
 	.get_frontend = drxk_c_get_frontend,
 	.get_property = drxk_c_get_property,
 	.get_tune_settings = drxk_c_get_tune_settings,
@@ -6439,7 +6439,7 @@ static struct dvb_frontend_ops drxk_t_ops = {
 	.sleep = drxk_t_sleep,
 	.i2c_gate_ctrl = drxk_gate_ctrl,
 
-	.set_frontend = drxk_set_parameters,
+	.set_frontend_legacy = drxk_set_parameters,
 	.get_frontend = drxk_t_get_frontend,
 	.get_property = drxk_t_get_property,
 
drivers/media/dvb/frontends/ds3000.c +1 -1
index 90bf573..7fa5b92 100644
@@ -1314,7 +1314,7 @@ static struct dvb_frontend_ops ds3000_ops = {
 
 	.set_property = ds3000_set_property,
 	.get_property = ds3000_get_property,
-	.set_frontend = ds3000_set_frontend,
+	.set_frontend_legacy = ds3000_set_frontend,
 	.tune = ds3000_tune,
 };
 
drivers/media/dvb/frontends/dvb_dummy_fe.c +3 -3
index e3a7e42..322bcd7 100644
@@ -192,7 +192,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
 	.init = dvb_dummy_fe_init,
 	.sleep = dvb_dummy_fe_sleep,
 
-	.set_frontend = dvb_dummy_fe_set_frontend,
+	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
 	.get_frontend = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
@@ -222,7 +222,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
 	.init = dvb_dummy_fe_init,
 	.sleep = dvb_dummy_fe_sleep,
 
-	.set_frontend = dvb_dummy_fe_set_frontend,
+	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
 	.get_frontend = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
@@ -254,7 +254,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
 	.init = dvb_dummy_fe_init,
 	.sleep = dvb_dummy_fe_sleep,
 
-	.set_frontend = dvb_dummy_fe_set_frontend,
+	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
 	.get_frontend = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
drivers/media/dvb/frontends/ec100.c +1 -1
index 1ef79f0..20decd7 100644
@@ -321,7 +321,7 @@ static struct dvb_frontend_ops ec100_ops = {
 	},
 
 	.release = ec100_release,
-	.set_frontend = ec100_set_frontend,
+	.set_frontend_legacy = ec100_set_frontend,
 	.get_tune_settings = ec100_get_tune_settings,
 	.read_status = ec100_read_status,
 	.read_ber = ec100_read_ber,
drivers/media/dvb/frontends/it913x-fe.c +1 -1
index 8857710..54d8534 100644
@@ -939,7 +939,7 @@ static struct dvb_frontend_ops it913x_fe_ofdm_ops = {
 	.init = it913x_fe_init,
 	.sleep = it913x_fe_sleep,
 
-	.set_frontend = it913x_fe_set_frontend,
+	.set_frontend_legacy = it913x_fe_set_frontend,
 	.get_frontend = it913x_fe_get_frontend,
 
 	.read_status = it913x_fe_read_status,
drivers/media/dvb/frontends/l64781.c +1 -1
index eee6bb5..fd4170a 100644
@@ -584,7 +584,7 @@ static struct dvb_frontend_ops l64781_ops = {
 	.init = l64781_init,
 	.sleep = l64781_sleep,
 
-	.set_frontend = apply_frontend_param,
+	.set_frontend_legacy = apply_frontend_param,
 	.get_frontend = get_frontend,
 	.get_tune_settings = l64781_get_tune_settings,
 
drivers/media/dvb/frontends/lgdt3305.c +2 -2
index 321f991..8f15178 100644
@@ -1176,7 +1176,7 @@ static struct dvb_frontend_ops lgdt3304_ops = {
 	},
 	.i2c_gate_ctrl        = lgdt3305_i2c_gate_ctrl,
 	.init                 = lgdt3305_init,
-	.set_frontend         = lgdt3304_set_parameters,
+	.set_frontend_legacy         = lgdt3304_set_parameters,
 	.get_frontend         = lgdt3305_get_frontend,
 	.get_tune_settings    = lgdt3305_get_tune_settings,
 	.read_status          = lgdt3305_read_status,
@@ -1199,7 +1199,7 @@ static struct dvb_frontend_ops lgdt3305_ops = {
 	.i2c_gate_ctrl        = lgdt3305_i2c_gate_ctrl,
 	.init                 = lgdt3305_init,
 	.sleep                = lgdt3305_sleep,
-	.set_frontend         = lgdt3305_set_parameters,
+	.set_frontend_legacy         = lgdt3305_set_parameters,
 	.get_frontend         = lgdt3305_get_frontend,
 	.get_tune_settings    = lgdt3305_get_tune_settings,
 	.read_status          = lgdt3305_read_status,
drivers/media/dvb/frontends/lgdt330x.c +2 -2
index 87b6a9c..bdae349 100644
@@ -773,7 +773,7 @@ static struct dvb_frontend_ops lgdt3302_ops = {
 		.caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
 	},
 	.init                 = lgdt330x_init,
-	.set_frontend         = lgdt330x_set_parameters,
+	.set_frontend_legacy         = lgdt330x_set_parameters,
 	.get_frontend         = lgdt330x_get_frontend,
 	.get_tune_settings    = lgdt330x_get_tune_settings,
 	.read_status          = lgdt3302_read_status,
@@ -796,7 +796,7 @@ static struct dvb_frontend_ops lgdt3303_ops = {
 		.caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
 	},
 	.init                 = lgdt330x_init,
-	.set_frontend         = lgdt330x_set_parameters,
+	.set_frontend_legacy         = lgdt330x_set_parameters,
 	.get_frontend         = lgdt330x_get_frontend,
 	.get_tune_settings    = lgdt330x_get_tune_settings,
 	.read_status          = lgdt3303_read_status,
drivers/media/dvb/frontends/lgs8gl5.c +1 -1
index 4a9bd99..65a5c5d 100644
@@ -434,7 +434,7 @@ static struct dvb_frontend_ops lgs8gl5_ops = {
 
 	.init = lgs8gl5_init,
 
-	.set_frontend = lgs8gl5_set_frontend,
+	.set_frontend_legacy = lgs8gl5_set_frontend,
 	.get_frontend = lgs8gl5_get_frontend,
 	.get_tune_settings = lgs8gl5_get_tune_settings,
 
drivers/media/dvb/frontends/lgs8gxx.c +1 -1
index bf9b12b..5684b61 100644
@@ -1013,7 +1013,7 @@ static struct dvb_frontend_ops lgs8gxx_ops = {
 	.write = lgs8gxx_write,
 	.i2c_gate_ctrl = lgs8gxx_i2c_gate_ctrl,
 
-	.set_frontend = lgs8gxx_set_fe,
+	.set_frontend_legacy = lgs8gxx_set_fe,
 	.get_frontend = lgs8gxx_get_fe,
 	.get_tune_settings = lgs8gxx_get_tune_settings,
 
drivers/media/dvb/frontends/mb86a20s.c +1 -1
index 8c92070..3ae6d1f 100644
@@ -627,7 +627,7 @@ static struct dvb_frontend_ops mb86a20s_ops = {
 	.release = mb86a20s_release,
 
 	.init = mb86a20s_initfe,
-	.set_frontend = mb86a20s_set_frontend,
+	.set_frontend_legacy = mb86a20s_set_frontend,
 	.get_frontend = mb86a20s_get_frontend,
 	.read_status = mb86a20s_read_status,
 	.read_signal_strength = mb86a20s_read_signal_strength,
drivers/media/dvb/frontends/mt312.c +1 -1
index 302d72a..efae45f 100644
@@ -761,7 +761,7 @@ static struct dvb_frontend_ops mt312_ops = {
 	.sleep = mt312_sleep,
 	.i2c_gate_ctrl = mt312_i2c_gate_ctrl,
 
-	.set_frontend = mt312_set_frontend,
+	.set_frontend_legacy = mt312_set_frontend,
 	.get_frontend = mt312_get_frontend,
 	.get_tune_settings = mt312_get_tune_settings,
 
drivers/media/dvb/frontends/mt352.c +1 -1
index 16a9fac..2bd68c5 100644
@@ -592,7 +592,7 @@ static struct dvb_frontend_ops mt352_ops = {
 	.sleep = mt352_sleep,
 	.write = _mt352_write,
 
-	.set_frontend = mt352_set_parameters,
+	.set_frontend_legacy = mt352_set_parameters,
 	.get_frontend = mt352_get_parameters,
 	.get_tune_settings = mt352_get_tune_settings,
 
drivers/media/dvb/frontends/nxt200x.c +1 -1
index ae5c3c3..efb8e46 100644
@@ -1220,7 +1220,7 @@ static struct dvb_frontend_ops nxt200x_ops = {
 	.init = nxt200x_init,
 	.sleep = nxt200x_sleep,
 
-	.set_frontend = nxt200x_setup_frontend_parameters,
+	.set_frontend_legacy = nxt200x_setup_frontend_parameters,
 	.get_tune_settings = nxt200x_get_tune_settings,
 
 	.read_status = nxt200x_read_status,
drivers/media/dvb/frontends/nxt6000.c +1 -1
index d17dd2d..a2419e8 100644
@@ -592,7 +592,7 @@ static struct dvb_frontend_ops nxt6000_ops = {
 
 	.get_tune_settings = nxt6000_fe_get_tune_settings,
 
-	.set_frontend = nxt6000_set_frontend,
+	.set_frontend_legacy = nxt6000_set_frontend,
 
 	.read_status = nxt6000_read_status,
 	.read_ber = nxt6000_read_ber,
drivers/media/dvb/frontends/or51132.c +1 -1
index 5cd965b..461f9fd 100644
@@ -597,7 +597,7 @@ static struct dvb_frontend_ops or51132_ops = {
 	.init = or51132_init,
 	.sleep = or51132_sleep,
 
-	.set_frontend = or51132_set_parameters,
+	.set_frontend_legacy = or51132_set_parameters,
 	.get_frontend = or51132_get_parameters,
 	.get_tune_settings = or51132_get_tune_settings,
 
drivers/media/dvb/frontends/or51211.c +1 -1
index 92d4dd8..2f2c7f8 100644
@@ -561,7 +561,7 @@ static struct dvb_frontend_ops or51211_ops = {
 	.init = or51211_init,
 	.sleep = or51211_sleep,
 
-	.set_frontend = or51211_set_parameters,
+	.set_frontend_legacy = or51211_set_parameters,
 	.get_tune_settings = or51211_get_tune_settings,
 
 	.read_status = or51211_read_status,
drivers/media/dvb/frontends/s5h1409.c +1 -1
index 5ffb19e..0b6e6c5 100644
@@ -1008,7 +1008,7 @@ static struct dvb_frontend_ops s5h1409_ops = {
 
 	.init                 = s5h1409_init,
 	.i2c_gate_ctrl        = s5h1409_i2c_gate_ctrl,
-	.set_frontend         = s5h1409_set_frontend,
+	.set_frontend_legacy         = s5h1409_set_frontend,
 	.get_frontend         = s5h1409_get_frontend,
 	.get_tune_settings    = s5h1409_get_tune_settings,
 	.read_status          = s5h1409_read_status,
drivers/media/dvb/frontends/s5h1411.c +1 -1
index 6852abe..67ab85c 100644
@@ -928,7 +928,7 @@ static struct dvb_frontend_ops s5h1411_ops = {
 	.init                 = s5h1411_init,
 	.sleep                = s5h1411_sleep,
 	.i2c_gate_ctrl        = s5h1411_i2c_gate_ctrl,
-	.set_frontend         = s5h1411_set_frontend,
+	.set_frontend_legacy         = s5h1411_set_frontend,
 	.get_frontend         = s5h1411_get_frontend,
 	.get_tune_settings    = s5h1411_get_tune_settings,
 	.read_status          = s5h1411_read_status,
drivers/media/dvb/frontends/s5h1420.c +1 -1
index c4a8a01..e2cecf4 100644
@@ -960,7 +960,7 @@ static struct dvb_frontend_ops s5h1420_ops = {
 	.sleep = s5h1420_sleep,
 	.i2c_gate_ctrl = s5h1420_i2c_gate_ctrl,
 
-	.set_frontend = s5h1420_set_frontend,
+	.set_frontend_legacy = s5h1420_set_frontend,
 	.get_frontend = s5h1420_get_frontend,
 	.get_tune_settings = s5h1420_get_tune_settings,
 
drivers/media/dvb/frontends/s5h1432.c +1 -1
index 2717bae..a0dbbdc 100644
@@ -396,7 +396,7 @@ static struct dvb_frontend_ops s5h1432_ops = {
 
 	.init = s5h1432_init,
 	.sleep = s5h1432_sleep,
-	.set_frontend = s5h1432_set_frontend,
+	.set_frontend_legacy = s5h1432_set_frontend,
 	.get_frontend = s5h1432_get_frontend,
 	.get_tune_settings = s5h1432_get_tune_settings,
 	.read_status = s5h1432_read_status,
drivers/media/dvb/frontends/s921.c +1 -1
index ca0103d..6615979 100644
@@ -534,7 +534,7 @@ static struct dvb_frontend_ops s921_ops = {
 	.release = s921_release,
 
 	.init = s921_initfe,
-	.set_frontend = s921_set_frontend,
+	.set_frontend_legacy = s921_set_frontend,
 	.get_frontend = s921_get_frontend,
 	.read_status = s921_read_status,
 	.read_signal_strength = s921_read_signal_strength,
drivers/media/dvb/frontends/si21xx.c +1 -1
index 4b0c99a..badf449 100644
@@ -910,7 +910,7 @@ static struct dvb_frontend_ops si21xx_ops = {
 
 	.set_property = si21xx_set_property,
 	.get_property = si21xx_get_property,
-	.set_frontend = si21xx_set_frontend,
+	.set_frontend_legacy = si21xx_set_frontend,
 };
 
 struct dvb_frontend *si21xx_attach(const struct si21xx_config *config,
drivers/media/dvb/frontends/sp8870.c +1 -1
index 9cff909..d49e48c 100644
@@ -600,7 +600,7 @@ static struct dvb_frontend_ops sp8870_ops = {
 	.sleep = sp8870_sleep,
 	.i2c_gate_ctrl = sp8870_i2c_gate_ctrl,
 
-	.set_frontend = sp8870_set_frontend,
+	.set_frontend_legacy = sp8870_set_frontend,
 	.get_tune_settings = sp8870_get_tune_settings,
 
 	.read_status = sp8870_read_status,
drivers/media/dvb/frontends/sp887x.c +1 -1
index efe0926..33ec08a 100644
@@ -598,7 +598,7 @@ static struct dvb_frontend_ops sp887x_ops = {
 	.sleep = sp887x_sleep,
 	.i2c_gate_ctrl = sp887x_i2c_gate_ctrl,
 
-	.set_frontend = sp887x_setup_frontend_parameters,
+	.set_frontend_legacy = sp887x_setup_frontend_parameters,
 	.get_tune_settings = sp887x_get_tune_settings,
 
 	.read_status = sp887x_read_status,
drivers/media/dvb/frontends/stv0288.c +1 -1
index a1b4933..105f0bf 100644
@@ -579,7 +579,7 @@ static struct dvb_frontend_ops stv0288_ops = {
 
 	.set_property = stv0288_set_property,
 	.get_property = stv0288_get_property,
-	.set_frontend = stv0288_set_frontend,
+	.set_frontend_legacy = stv0288_set_frontend,
 };
 
 struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
drivers/media/dvb/frontends/stv0297.c +1 -1
index daeaddf..63a3e1b 100644
@@ -706,7 +706,7 @@ static struct dvb_frontend_ops stv0297_ops = {
 	.sleep = stv0297_sleep,
 	.i2c_gate_ctrl = stv0297_i2c_gate_ctrl,
 
-	.set_frontend = stv0297_set_frontend,
+	.set_frontend_legacy = stv0297_set_frontend,
 	.get_frontend = stv0297_get_frontend,
 
 	.read_status = stv0297_read_status,
drivers/media/dvb/frontends/stv0299.c +1 -1
index bd79e05..4f248e1 100644
@@ -729,7 +729,7 @@ static struct dvb_frontend_ops stv0299_ops = {
 	.write = stv0299_write,
 	.i2c_gate_ctrl = stv0299_i2c_gate_ctrl,
 
-	.set_frontend = stv0299_set_frontend,
+	.set_frontend_legacy = stv0299_set_frontend,
 	.get_frontend = stv0299_get_frontend,
 	.get_tune_settings = stv0299_get_tune_settings,
 
drivers/media/dvb/frontends/stv0367.c +2 -2
index 586295d..7752d13 100644
@@ -2285,7 +2285,7 @@ static struct dvb_frontend_ops stv0367ter_ops = {
 	.init = stv0367ter_init,
 	.sleep = stv0367ter_sleep,
 	.i2c_gate_ctrl = stv0367ter_gate_ctrl,
-	.set_frontend = stv0367ter_set_frontend,
+	.set_frontend_legacy = stv0367ter_set_frontend,
 	.get_frontend = stv0367ter_get_frontend,
 	.get_tune_settings = stv0367_get_tune_settings,
 	.read_status = stv0367ter_read_status,
@@ -3403,7 +3403,7 @@ static struct dvb_frontend_ops stv0367cab_ops = {
 	.init					= stv0367cab_init,
 	.sleep					= stv0367cab_sleep,
 	.i2c_gate_ctrl				= stv0367cab_gate_ctrl,
-	.set_frontend				= stv0367cab_set_frontend,
+	.set_frontend_legacy				= stv0367cab_set_frontend,
 	.get_frontend				= stv0367cab_get_frontend,
 	.read_status				= stv0367cab_read_status,
 /*	.read_ber				= stv0367cab_read_ber, */
drivers/media/dvb/frontends/tda10021.c +1 -1
index a1629d1..0bbf681 100644
@@ -524,7 +524,7 @@ static struct dvb_frontend_ops tda10021_ops = {
 	.sleep = tda10021_sleep,
 	.i2c_gate_ctrl = tda10021_i2c_gate_ctrl,
 
-	.set_frontend = tda10021_set_parameters,
+	.set_frontend_legacy = tda10021_set_parameters,
 	.get_frontend = tda10021_get_frontend,
 	.get_property = tda10021_get_property,
 
drivers/media/dvb/frontends/tda10023.c +1 -1
index ecc4b55..f79841b 100644
@@ -609,7 +609,7 @@ static struct dvb_frontend_ops tda10023_ops = {
 	.sleep = tda10023_sleep,
 	.i2c_gate_ctrl = tda10023_i2c_gate_ctrl,
 
-	.set_frontend = tda10023_set_parameters,
+	.set_frontend_legacy = tda10023_set_parameters,
 	.get_frontend = tda10023_get_frontend,
 	.get_property = tda10023_get_property,
 	.read_status = tda10023_read_status,
drivers/media/dvb/frontends/tda10048.c +1 -1
index d450385..479ff85 100644
@@ -1188,7 +1188,7 @@ static struct dvb_frontend_ops tda10048_ops = {
 	.release = tda10048_release,
 	.init = tda10048_init,
 	.i2c_gate_ctrl = tda10048_i2c_gate_ctrl,
-	.set_frontend = tda10048_set_frontend,
+	.set_frontend_legacy = tda10048_set_frontend,
 	.get_frontend = tda10048_get_frontend,
 	.get_tune_settings = tda10048_get_tune_settings,
 	.read_status = tda10048_read_status,
drivers/media/dvb/frontends/tda1004x.c +2 -2
index dbac35b..dd41057 100644
@@ -1251,7 +1251,7 @@ static struct dvb_frontend_ops tda10045_ops = {
 	.write = tda1004x_write,
 	.i2c_gate_ctrl = tda1004x_i2c_gate_ctrl,
 
-	.set_frontend = tda1004x_set_fe,
+	.set_frontend_legacy = tda1004x_set_fe,
 	.get_frontend = tda1004x_get_fe,
 	.get_tune_settings = tda1004x_get_tune_settings,
 
@@ -1321,7 +1321,7 @@ static struct dvb_frontend_ops tda10046_ops = {
 	.write = tda1004x_write,
 	.i2c_gate_ctrl = tda1004x_i2c_gate_ctrl,
 
-	.set_frontend = tda1004x_set_fe,
+	.set_frontend_legacy = tda1004x_set_fe,
 	.get_frontend = tda1004x_get_fe,
 	.get_tune_settings = tda1004x_get_tune_settings,
 
drivers/media/dvb/frontends/tda10071.c +1 -1
index 0c37434..7bffa65 100644
@@ -1247,7 +1247,7 @@ static struct dvb_frontend_ops tda10071_ops = {
 	.init = tda10071_init,
 	.sleep = tda10071_sleep,
 
-	.set_frontend = tda10071_set_frontend,
+	.set_frontend_legacy = tda10071_set_frontend,
 	.get_frontend = tda10071_get_frontend,
 
 	.read_status = tda10071_read_status,
drivers/media/dvb/frontends/tda10086.c +1 -1
index 7656ff7..be4649f 100644
@@ -722,7 +722,7 @@ static struct dvb_frontend_ops tda10086_ops = {
 	.sleep = tda10086_sleep,
 	.i2c_gate_ctrl = tda10086_i2c_gate_ctrl,
 
-	.set_frontend = tda10086_set_frontend,
+	.set_frontend_legacy = tda10086_set_frontend,
 	.get_frontend = tda10086_get_frontend,
 	.get_tune_settings = tda10086_get_tune_settings,
 
drivers/media/dvb/frontends/tda8083.c +1 -1
index 3f2b1b8..9d1466f 100644
@@ -461,7 +461,7 @@ static struct dvb_frontend_ops tda8083_ops = {
 	.init = tda8083_init,
 	.sleep = tda8083_sleep,
 
-	.set_frontend = tda8083_set_frontend,
+	.set_frontend_legacy = tda8083_set_frontend,
 	.get_frontend = tda8083_get_frontend,
 
 	.read_status = tda8083_read_status,
drivers/media/dvb/frontends/ves1820.c +1 -1
index 270c7f9..6fb8eb5 100644
@@ -425,7 +425,7 @@ static struct dvb_frontend_ops ves1820_ops = {
 	.init = ves1820_init,
 	.sleep = ves1820_sleep,
 
-	.set_frontend = ves1820_set_parameters,
+	.set_frontend_legacy = ves1820_set_parameters,
 	.get_frontend = ves1820_get_frontend,
 	.get_tune_settings = ves1820_get_tune_settings,
 
drivers/media/dvb/frontends/ves1x93.c +1 -1
index 5ffbf5e..f80f152 100644
@@ -529,7 +529,7 @@ static struct dvb_frontend_ops ves1x93_ops = {
 	.sleep = ves1x93_sleep,
 	.i2c_gate_ctrl = ves1x93_i2c_gate_ctrl,
 
-	.set_frontend = ves1x93_set_frontend,
+	.set_frontend_legacy = ves1x93_set_frontend,
 	.get_frontend = ves1x93_get_frontend,
 
 	.read_status = ves1x93_read_status,
drivers/media/dvb/frontends/zl10353.c +1 -1
index 0945aa0..8b6c2a4 100644
@@ -675,7 +675,7 @@ static struct dvb_frontend_ops zl10353_ops = {
 	.i2c_gate_ctrl = zl10353_i2c_gate_ctrl,
 	.write = zl10353_write,
 
-	.set_frontend = zl10353_set_parameters,
+	.set_frontend_legacy = zl10353_set_parameters,
 	.get_frontend = zl10353_get_parameters,
 	.get_tune_settings = zl10353_get_tune_settings,
 
drivers/media/dvb/siano/smsdvb.c +1 -1
index 37c594f..fa17f02 100644
@@ -805,7 +805,7 @@ static struct dvb_frontend_ops smsdvb_fe_ops = {
 
 	.release = smsdvb_release,
 
-	.set_frontend = smsdvb_set_frontend,
+	.set_frontend_legacy = smsdvb_set_frontend,
 	.get_frontend = smsdvb_get_frontend,
 	.get_tune_settings = smsdvb_get_tune_settings,
 
drivers/media/dvb/ttpci/av7110.c +1 -1
index 371fb29..c615ed7 100644
@@ -2283,7 +2283,7 @@ static int frontend_init(struct av7110 *av7110)
 		FE_FUNC_OVERRIDE(av7110->fe->ops.set_tone, av7110->fe_set_tone, av7110_fe_set_tone);
 		FE_FUNC_OVERRIDE(av7110->fe->ops.set_voltage, av7110->fe_set_voltage, av7110_fe_set_voltage);
 		FE_FUNC_OVERRIDE(av7110->fe->ops.dishnetwork_send_legacy_command, av7110->fe_dishnetwork_send_legacy_command, av7110_fe_dishnetwork_send_legacy_command);
-		FE_FUNC_OVERRIDE(av7110->fe->ops.set_frontend, av7110->fe_set_frontend, av7110_fe_set_frontend);
+		FE_FUNC_OVERRIDE(av7110->fe->ops.set_frontend_legacy, av7110->fe_set_frontend, av7110_fe_set_frontend);
 
 		ret = dvb_register_frontend(&av7110->dvb_adapter, av7110->fe);
 		if (ret < 0) {
drivers/media/dvb/ttusb-dec/ttusbdecfe.c +2 -2
index 21260aa..20a1410 100644
@@ -257,7 +257,7 @@ static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = {
 
 	.release = ttusbdecfe_release,
 
-	.set_frontend = ttusbdecfe_dvbt_set_frontend,
+	.set_frontend_legacy = ttusbdecfe_dvbt_set_frontend,
 
 	.get_tune_settings = ttusbdecfe_dvbt_get_tune_settings,
 
@@ -281,7 +281,7 @@ static struct dvb_frontend_ops ttusbdecfe_dvbs_ops = {
 
 	.release = ttusbdecfe_release,
 
-	.set_frontend = ttusbdecfe_dvbs_set_frontend,
+	.set_frontend_legacy = ttusbdecfe_dvbs_set_frontend,
 
 	.read_status = ttusbdecfe_dvbs_read_status,
 
drivers/media/video/tlg2300/pd-dvb.c +1 -1
index d0da11a..51a7d55 100644
@@ -353,7 +353,7 @@ static struct dvb_frontend_ops poseidon_frontend_ops = {
 	.init = poseidon_fe_init,
 	.sleep = poseidon_fe_sleep,
 
-	.set_frontend = poseidon_set_fe,
+	.set_frontend_legacy = poseidon_set_fe,
 	.get_frontend = poseidon_get_fe,
 	.get_tune_settings = poseidon_fe_get_tune_settings,
 
drivers/staging/media/as102/as102_fe.c +1 -1
index c2adfe5..161bcbe 100644
@@ -296,7 +296,7 @@ static struct dvb_frontend_ops as102_fe_ops = {
 			| FE_CAN_MUTE_TS
 	},
 
-	.set_frontend		= as102_fe_set_frontend,
+	.set_frontend_legacy	= as102_fe_set_frontend,
 	.get_frontend		= as102_fe_get_frontend,
 	.get_tune_settings	= as102_fe_get_tune_settings,
 
Signature · 1 line
1.7.8.352.g876a6
#18 lore raw

RFC PATCH 18/91 cx24113: cleanup: remove unused init

In reply to Mauro Carvalho Chehab

There's no need to initialize with zero. This only wastes space at the data segment.

---
 drivers/media/dvb/frontends/cx24113.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/media/dvb/frontends/cx24113.c +0 -2
index 4b8794f..3883c3b 100644
@@ -547,11 +547,9 @@ static const struct dvb_tuner_ops cx24113_tuner_ops = {
 	.release       = cx24113_release,
 
 	.init          = cx24113_init,
-	.sleep         = NULL,
 
 	.set_params    = cx24113_set_params,
 	.get_frequency = cx24113_get_frequency,
-	.get_bandwidth = NULL,
 	.get_status    = cx24113_get_status,
 };
 
Signature · 1 line
1.7.8.352.g876a6
#40 lore raw

RFC PATCH 40/91 nxt6000: 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/dvb/frontends/nxt6000.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
drivers/media/dvb/frontends/nxt6000.c +12 -12
index a2419e8..389f490 100644
@@ -81,22 +81,21 @@ static void nxt6000_reset(struct nxt6000_state* state)
 	nxt6000_writereg(state, OFDM_COR_CTL, val | COREACT);
 }
 
-static int nxt6000_set_bandwidth(struct nxt6000_state* state, fe_bandwidth_t bandwidth)
+static int nxt6000_set_bandwidth(struct nxt6000_state* state, u32 bandwidth)
 {
 	u16 nominal_rate;
 	int result;
 
 	switch (bandwidth) {
-
-	case BANDWIDTH_6_MHZ:
+	case 6000000:
 		nominal_rate = 0x55B7;
 		break;
 
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		nominal_rate = 0x6400;
 		break;
 
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
 		nominal_rate = 0x7249;
 		break;
 
@@ -457,8 +456,9 @@ static int nxt6000_init(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *param)
+static int nxt6000_set_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct nxt6000_state* state = fe->demodulator_priv;
 	int result;
 
@@ -467,13 +467,13 @@ static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 		if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
 	}
 
-	if ((result = nxt6000_set_bandwidth(state, param->u.ofdm.bandwidth)) < 0)
+	if ((result = nxt6000_set_bandwidth(state, p->bandwidth_hz)) < 0)
 		return result;
-	if ((result = nxt6000_set_guard_interval(state, param->u.ofdm.guard_interval)) < 0)
+	if ((result = nxt6000_set_guard_interval(state, p->guard_interval)) < 0)
 		return result;
-	if ((result = nxt6000_set_transmission_mode(state, param->u.ofdm.transmission_mode)) < 0)
+	if ((result = nxt6000_set_transmission_mode(state, p->transmission_mode)) < 0)
 		return result;
-	if ((result = nxt6000_set_inversion(state, param->inversion)) < 0)
+	if ((result = nxt6000_set_inversion(state, p->inversion)) < 0)
 		return result;
 
 	msleep(500);
@@ -566,7 +566,7 @@ error:
 }
 
 static struct dvb_frontend_ops nxt6000_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "NxtWave NXT6000 DVB-T",
 		.type = FE_OFDM,
@@ -592,7 +592,7 @@ static struct dvb_frontend_ops nxt6000_ops = {
 
 	.get_tune_settings = nxt6000_fe_get_tune_settings,
 
-	.set_frontend_legacy = nxt6000_set_frontend,
+	.set_frontend = nxt6000_set_frontend,
 
 	.read_status = nxt6000_read_status,
 	.read_ber = nxt6000_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#5 lore raw

RFC PATCH 5/91 atbm8830: convert set_fontend to new way and fix delivery system

In reply to Mauro Carvalho Chehab

This is one of the cases where the frontend changes is required:
while this device lies to applications that it is a DVB-T, it is, in fact, a frontend for CTTB delivery system. So, the information provided for a DVBv3 application should be different than the one provided to a DVBv5 application.

So, fill delsys with the CTTB delivery system, and use the new way. there aren't many changes here, as everything on this driver is on auto mode, probably because of the lack of a proper API for this delivery system.

---
 drivers/media/dvb/frontends/atbm8830.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
drivers/media/dvb/frontends/atbm8830.c +13 -13
index c4e0909..c4edbbe 100644
@@ -267,8 +267,7 @@ static void atbm8830_release(struct dvb_frontend *fe)
 	kfree(state);
 }
 
-static int atbm8830_set_fe(struct dvb_frontend *fe,
-			  struct dvb_frontend_parameters *fe_params)
+static int atbm8830_set_fe(struct dvb_frontend *fe)
 {
 	struct atbm_state *priv = fe->demodulator_priv;
 	int i;
@@ -299,30 +298,30 @@ static int atbm8830_set_fe(struct dvb_frontend *fe,
 }
 
 static int atbm8830_get_fe(struct dvb_frontend *fe,
-			  struct dvb_frontend_parameters *fe_params)
+			   struct dtv_frontend_properties *c)
 {
 	dprintk("%s\n", __func__);
 
 	/* TODO: get real readings from device */
 	/* inversion status */
-	fe_params->inversion = INVERSION_OFF;
+	c->inversion = INVERSION_OFF;
 
 	/* bandwidth */
-	fe_params->u.ofdm.bandwidth = BANDWIDTH_8_MHZ;
+	c->bandwidth_hz = 8000000;
 
-	fe_params->u.ofdm.code_rate_HP = FEC_AUTO;
-	fe_params->u.ofdm.code_rate_LP = FEC_AUTO;
+	c->code_rate_HP = FEC_AUTO;
+	c->code_rate_LP = FEC_AUTO;
 
-	fe_params->u.ofdm.constellation = QAM_AUTO;
+	c->modulation = QAM_AUTO;
 
 	/* transmission mode */
-	fe_params->u.ofdm.transmission_mode = TRANSMISSION_MODE_AUTO;
+	c->transmission_mode = TRANSMISSION_MODE_AUTO;
 
 	/* guard interval */
-	fe_params->u.ofdm.guard_interval = GUARD_INTERVAL_AUTO;
+	c->guard_interval = GUARD_INTERVAL_AUTO;
 
 	/* hierarchy */
-	fe_params->u.ofdm.hierarchy_information = HIERARCHY_NONE;
+	c->hierarchy = HIERARCHY_NONE;
 
 	return 0;
 }
@@ -429,6 +428,7 @@ static int atbm8830_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
 }
 
 static struct dvb_frontend_ops atbm8830_ops = {
+	.delsys = { SYS_DMBTH },
 	.info = {
 		.name = "AltoBeam ATBM8830/8831 DMB-TH",
 		.type = FE_OFDM,
@@ -449,8 +449,8 @@ static struct dvb_frontend_ops atbm8830_ops = {
 	.write = NULL,
 	.i2c_gate_ctrl = atbm8830_i2c_gate_ctrl,
 
-	.set_frontend_legacy = atbm8830_set_fe,
-	.get_frontend_legacy = atbm8830_get_fe,
+	.set_frontend = atbm8830_set_fe,
+	.get_frontend = atbm8830_get_fe,
 	.get_tune_settings = atbm8830_get_tune_settings,
 
 	.read_status = atbm8830_read_status,
Signature · 1 line
1.7.8.352.g876a6
#9 lore raw

RFC PATCH 9/91 cx22702: 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/dvb/frontends/cx22702.c |   68 ++++++++++++++++----------------
 1 files changed, 34 insertions(+), 34 deletions(-)
drivers/media/dvb/frontends/cx22702.c +34 -34
index a04cff8..225ce84 100644
@@ -146,7 +146,7 @@ static int cx22702_set_inversion(struct cx22702_state *state, int inversion)
 
 /* Retrieve the demod settings */
 static int cx22702_get_tps(struct cx22702_state *state,
-	struct dvb_ofdm_parameters *p)
+			   struct dtv_frontend_properties *p)
 {
 	u8 val;
 
@@ -157,27 +157,27 @@ static int cx22702_get_tps(struct cx22702_state *state,
 	val = cx22702_readreg(state, 0x01);
 	switch ((val & 0x18) >> 3) {
 	case 0:
-		p->constellation = QPSK;
+		p->modulation = QPSK;
 		break;
 	case 1:
-		p->constellation = QAM_16;
+		p->modulation = QAM_16;
 		break;
 	case 2:
-		p->constellation = QAM_64;
+		p->modulation = QAM_64;
 		break;
 	}
 	switch (val & 0x07) {
 	case 0:
-		p->hierarchy_information = HIERARCHY_NONE;
+		p->hierarchy = HIERARCHY_NONE;
 		break;
 	case 1:
-		p->hierarchy_information = HIERARCHY_1;
+		p->hierarchy = HIERARCHY_1;
 		break;
 	case 2:
-		p->hierarchy_information = HIERARCHY_2;
+		p->hierarchy = HIERARCHY_2;
 		break;
 	case 3:
-		p->hierarchy_information = HIERARCHY_4;
+		p->hierarchy = HIERARCHY_4;
 		break;
 	}
 
@@ -260,9 +260,9 @@ static int cx22702_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
 }
 
 /* Talk to the demod, set the FEC, GUARD, QAM settings etc */
-static int cx22702_set_tps(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static int cx22702_set_tps(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	u8 val;
 	struct cx22702_state *state = fe->demodulator_priv;
 
@@ -277,14 +277,14 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
 
 	/* set bandwidth */
 	val = cx22702_readreg(state, 0x0C) & 0xcf;
-	switch (p->u.ofdm.bandwidth) {
-	case BANDWIDTH_6_MHZ:
+	switch (p->bandwidth_hz) {
+	case 6000000:
 		val |= 0x20;
 		break;
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		val |= 0x10;
 		break;
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
 		break;
 	default:
 		dprintk("%s: invalid bandwidth\n", __func__);
@@ -292,15 +292,15 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
 	}
 	cx22702_writereg(state, 0x0C, val);
 
-	p->u.ofdm.code_rate_LP = FEC_AUTO; /* temp hack as manual not working */
+	p->code_rate_LP = FEC_AUTO; /* temp hack as manual not working */
 
 	/* use auto configuration? */
-	if ((p->u.ofdm.hierarchy_information == HIERARCHY_AUTO) ||
-	   (p->u.ofdm.constellation == QAM_AUTO) ||
-	   (p->u.ofdm.code_rate_HP == FEC_AUTO) ||
-	   (p->u.ofdm.code_rate_LP == FEC_AUTO) ||
-	   (p->u.ofdm.guard_interval == GUARD_INTERVAL_AUTO) ||
-	   (p->u.ofdm.transmission_mode == TRANSMISSION_MODE_AUTO)) {
+	if ((p->hierarchy == HIERARCHY_AUTO) ||
+	   (p->modulation == QAM_AUTO) ||
+	   (p->code_rate_HP == FEC_AUTO) ||
+	   (p->code_rate_LP == FEC_AUTO) ||
+	   (p->guard_interval == GUARD_INTERVAL_AUTO) ||
+	   (p->transmission_mode == TRANSMISSION_MODE_AUTO)) {
 
 		/* TPS Source - use hardware driven values */
 		cx22702_writereg(state, 0x06, 0x10);
@@ -316,7 +316,7 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
 	}
 
 	/* manually programmed values */
-	switch (p->u.ofdm.constellation) {		/* mask 0x18 */
+	switch (p->modulation) {		/* mask 0x18 */
 	case QPSK:
 		val = 0x00;
 		break;
@@ -327,10 +327,10 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
 		val = 0x10;
 		break;
 	default:
-		dprintk("%s: invalid constellation\n", __func__);
+		dprintk("%s: invalid modulation\n", __func__);
 		return -EINVAL;
 	}
-	switch (p->u.ofdm.hierarchy_information) {	/* mask 0x07 */
+	switch (p->hierarchy) {	/* mask 0x07 */
 	case HIERARCHY_NONE:
 		break;
 	case HIERARCHY_1:
@@ -348,7 +348,7 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
 	}
 	cx22702_writereg(state, 0x06, val);
 
-	switch (p->u.ofdm.code_rate_HP) {		/* mask 0x38 */
+	switch (p->code_rate_HP) {		/* mask 0x38 */
 	case FEC_NONE:
 	case FEC_1_2:
 		val = 0x00;
@@ -369,7 +369,7 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
 		dprintk("%s: invalid code_rate_HP\n", __func__);
 		return -EINVAL;
 	}
-	switch (p->u.ofdm.code_rate_LP) {		/* mask 0x07 */
+	switch (p->code_rate_LP) {		/* mask 0x07 */
 	case FEC_NONE:
 	case FEC_1_2:
 		break;
@@ -391,7 +391,7 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
 	}
 	cx22702_writereg(state, 0x07, val);
 
-	switch (p->u.ofdm.guard_interval) {		/* mask 0x0c */
+	switch (p->guard_interval) {		/* mask 0x0c */
 	case GUARD_INTERVAL_1_32:
 		val = 0x00;
 		break;
@@ -408,7 +408,7 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
 		dprintk("%s: invalid guard_interval\n", __func__);
 		return -EINVAL;
 	}
-	switch (p->u.ofdm.transmission_mode) {		/* mask 0x03 */
+	switch (p->transmission_mode) {		/* mask 0x03 */
 	case TRANSMISSION_MODE_2K:
 		break;
 	case TRANSMISSION_MODE_8K:
@@ -547,14 +547,14 @@ static int cx22702_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
 }
 
 static int cx22702_get_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+				struct dtv_frontend_properties *c)
 {
 	struct cx22702_state *state = fe->demodulator_priv;
 
 	u8 reg0C = cx22702_readreg(state, 0x0C);
 
-	p->inversion = reg0C & 0x1 ? INVERSION_ON : INVERSION_OFF;
-	return cx22702_get_tps(state, &p->u.ofdm);
+	c->inversion = reg0C & 0x1 ? INVERSION_ON : INVERSION_OFF;
+	return cx22702_get_tps(state, c);
 }
 
 static int cx22702_get_tune_settings(struct dvb_frontend *fe,
@@ -603,7 +603,7 @@ error:
 EXPORT_SYMBOL(cx22702_attach);
 
 static const struct dvb_frontend_ops cx22702_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Conexant CX22702 DVB-T",
 		.type			= FE_OFDM,
@@ -622,8 +622,8 @@ static const struct dvb_frontend_ops cx22702_ops = {
 	.init = cx22702_init,
 	.i2c_gate_ctrl = cx22702_i2c_gate_ctrl,
 
-	.set_frontend_legacy = cx22702_set_tps,
-	.get_frontend_legacy = cx22702_get_frontend,
+	.set_frontend= cx22702_set_tps,
+	.get_frontend = cx22702_get_frontend,
 	.get_tune_settings = cx22702_get_tune_settings,
 
 	.read_status = cx22702_read_status,
Signature · 1 line
1.7.8.352.g876a6
#14 lore raw

RFC PATCH 14/91 cx23123: 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/dvb/frontends/cx24123.c |   40 ++++++++++++++++----------------
 1 files changed, 20 insertions(+), 20 deletions(-)
drivers/media/dvb/frontends/cx24123.c +20 -20
index 4dfe786..a8af0bd 100644
@@ -526,9 +526,9 @@ static int cx24123_set_symbolrate(struct cx24123_state *state, u32 srate)
  * to be configured and the correct band selected.
  * Calculate those values.
  */
-static int cx24123_pll_calculate(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static int cx24123_pll_calculate(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct cx24123_state *state = fe->demodulator_priv;
 	u32 ndiv = 0, adiv = 0, vco_div = 0;
 	int i = 0;
@@ -548,8 +548,8 @@ static int cx24123_pll_calculate(struct dvb_frontend *fe,
 	 * FILTUNE programming bits */
 	for (i = 0; i < ARRAY_SIZE(cx24123_AGC_vals); i++) {
 		agcv = &cx24123_AGC_vals[i];
-		if ((agcv->symbolrate_low <= p->u.qpsk.symbol_rate) &&
-		    (agcv->symbolrate_high >= p->u.qpsk.symbol_rate)) {
+		if ((agcv->symbolrate_low <= p->symbol_rate) &&
+		    (agcv->symbolrate_high >= p->symbol_rate)) {
 			state->VCAarg = agcv->VCAprogdata;
 			state->VGAarg = agcv->VGAprogdata;
 			state->FILTune = agcv->FILTune;
@@ -658,15 +658,15 @@ static int cx24123_pll_writereg(struct dvb_frontend *fe, u32 data)
 	return 0;
 }
 
-static int cx24123_pll_tune(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static int cx24123_pll_tune(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct cx24123_state *state = fe->demodulator_priv;
 	u8 val;
 
 	dprintk("frequency=%i\n", p->frequency);
 
-	if (cx24123_pll_calculate(fe, p) != 0) {
+	if (cx24123_pll_calculate(fe) != 0) {
 		err("%s: cx24123_pll_calcutate failed\n", __func__);
 		return -EINVAL;
 	}
@@ -924,10 +924,10 @@ static int cx24123_read_snr(struct dvb_frontend *fe, u16 *snr)
 	return 0;
 }
 
-static int cx24123_set_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static int cx24123_set_frontend(struct dvb_frontend *fe)
 {
 	struct cx24123_state *state = fe->demodulator_priv;
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 
 	dprintk("\n");
 
@@ -935,14 +935,14 @@ static int cx24123_set_frontend(struct dvb_frontend *fe,
 		state->config->set_ts_params(fe, 0);
 
 	state->currentfreq = p->frequency;
-	state->currentsymbolrate = p->u.qpsk.symbol_rate;
+	state->currentsymbolrate = p->symbol_rate;
 
 	cx24123_set_inversion(state, p->inversion);
-	cx24123_set_fec(state, p->u.qpsk.fec_inner);
-	cx24123_set_symbolrate(state, p->u.qpsk.symbol_rate);
+	cx24123_set_fec(state, p->fec_inner);
+	cx24123_set_symbolrate(state, p->symbol_rate);
 
 	if (!state->config->dont_use_pll)
-		cx24123_pll_tune(fe, p);
+		cx24123_pll_tune(fe);
 	else if (fe->ops.tuner_ops.set_params)
 		fe->ops.tuner_ops.set_params(fe);
 	else
@@ -960,7 +960,7 @@ static int cx24123_set_frontend(struct dvb_frontend *fe,
 }
 
 static int cx24123_get_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+				struct dtv_frontend_properties *p)
 {
 	struct cx24123_state *state = fe->demodulator_priv;
 
@@ -970,12 +970,12 @@ static int cx24123_get_frontend(struct dvb_frontend *fe,
 		err("%s: Failed to get inversion status\n", __func__);
 		return -EREMOTEIO;
 	}
-	if (cx24123_get_fec(state, &p->u.qpsk.fec_inner) != 0) {
+	if (cx24123_get_fec(state, &p->fec_inner) != 0) {
 		err("%s: Failed to get fec status\n", __func__);
 		return -EREMOTEIO;
 	}
 	p->frequency = state->currentfreq;
-	p->u.qpsk.symbol_rate = state->currentsymbolrate;
+	p->symbol_rate = state->currentsymbolrate;
 
 	return 0;
 }
@@ -1014,7 +1014,7 @@ static int cx24123_tune(struct dvb_frontend *fe,
 	int retval = 0;
 
 	if (params != NULL)
-		retval = cx24123_set_frontend(fe, params);
+		retval = cx24123_set_frontend(fe);
 
 	if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
 		cx24123_read_status(fe, status);
@@ -1125,7 +1125,7 @@ error:
 EXPORT_SYMBOL(cx24123_attach);
 
 static struct dvb_frontend_ops cx24123_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name = "Conexant CX24123/CX24109",
 		.type = FE_QPSK,
@@ -1145,8 +1145,8 @@ static struct dvb_frontend_ops cx24123_ops = {
 	.release = cx24123_release,
 
 	.init = cx24123_initfe,
-	.set_frontend_legacy = cx24123_set_frontend,
-	.get_frontend_legacy = cx24123_get_frontend,
+	.set_frontend = cx24123_set_frontend,
+	.get_frontend = cx24123_get_frontend,
 	.read_status = cx24123_read_status,
 	.read_ber = cx24123_read_ber,
 	.read_signal_strength = cx24123_read_signal_strength,
Signature · 1 line
1.7.8.352.g876a6
#15 lore raw

RFC PATCH 15/91 cxd2820r: report delivery system and cleanups

This driver already uses DVBv5 structs for both get and set frontend. All it needs is some cleanups, and to properly report the delivery systems.

---
 drivers/media/dvb/frontends/cxd2820r_c.c    |    6 +---
 drivers/media/dvb/frontends/cxd2820r_core.c |   37 ++++++++++++++-------------
 drivers/media/dvb/frontends/cxd2820r_priv.h |   15 ++++------
 drivers/media/dvb/frontends/cxd2820r_t.c    |    6 +---
 drivers/media/dvb/frontends/cxd2820r_t2.c   |    6 +---
 5 files changed, 31 insertions(+), 39 deletions(-)
drivers/media/dvb/frontends/cxd2820r_c.c +2 -4
index 26545d7..aa6fe1a 100644
@@ -21,8 +21,7 @@
 
 #include "cxd2820r_priv.h"
 
-int cxd2820r_set_frontend_c(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *params)
+int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
 {
 	struct cxd2820r_priv *priv = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -106,10 +105,9 @@ error:
 }
 
 int cxd2820r_get_frontend_c(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+			    struct dtv_frontend_properties *c)
 {
 	struct cxd2820r_priv *priv = fe->demodulator_priv;
-	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	int ret;
 	u8 buf[2];
 
drivers/media/dvb/frontends/cxd2820r_core.c +19 -18
index 97bc353..5b2d840 100644
@@ -184,7 +184,7 @@ int cxd2820r_gpio(struct dvb_frontend *fe)
 	case SYS_DVBT2:
 		gpio = priv->cfg.gpio_dvbt2;
 		break;
-	case SYS_DVBC_ANNEX_AC:
+	case SYS_DVBC_ANNEX_A:
 		gpio = priv->cfg.gpio_dvbc;
 		break;
 	default:
@@ -283,8 +283,7 @@ u32 cxd2820r_div_u64_round_closest(u64 dividend, u32 divisor)
 	return div_u64(dividend + (divisor / 2), divisor);
 }
 
-static int cxd2820r_set_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static int cxd2820r_set_frontend(struct dvb_frontend *fe)
 {
 	struct cxd2820r_priv *priv = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -301,34 +300,34 @@ static int cxd2820r_set_frontend(struct dvb_frontend *fe,
 		case SYS_UNDEFINED:
 			if (c->delivery_system == SYS_DVBT) {
 				/* SLEEP => DVB-T */
-				ret = cxd2820r_set_frontend_t(fe, p);
+				ret = cxd2820r_set_frontend_t(fe);
 			} else {
 				/* SLEEP => DVB-T2 */
-				ret = cxd2820r_set_frontend_t2(fe, p);
+				ret = cxd2820r_set_frontend_t2(fe);
 			}
 			break;
 		case SYS_DVBT:
 			if (c->delivery_system == SYS_DVBT) {
 				/* DVB-T => DVB-T */
-				ret = cxd2820r_set_frontend_t(fe, p);
+				ret = cxd2820r_set_frontend_t(fe);
 			} else if (c->delivery_system == SYS_DVBT2) {
 				/* DVB-T => DVB-T2 */
 				ret = cxd2820r_sleep_t(fe);
 				if (ret)
 					break;
-				ret = cxd2820r_set_frontend_t2(fe, p);
+				ret = cxd2820r_set_frontend_t2(fe);
 			}
 			break;
 		case SYS_DVBT2:
 			if (c->delivery_system == SYS_DVBT2) {
 				/* DVB-T2 => DVB-T2 */
-				ret = cxd2820r_set_frontend_t2(fe, p);
+				ret = cxd2820r_set_frontend_t2(fe);
 			} else if (c->delivery_system == SYS_DVBT) {
 				/* DVB-T2 => DVB-T */
 				ret = cxd2820r_sleep_t2(fe);
 				if (ret)
 					break;
-				ret = cxd2820r_set_frontend_t(fe, p);
+				ret = cxd2820r_set_frontend_t(fe);
 			}
 			break;
 		default:
@@ -342,7 +341,7 @@ static int cxd2820r_set_frontend(struct dvb_frontend *fe,
 		if (ret)
 			return ret;
 
-		ret = cxd2820r_set_frontend_c(fe, p);
+		ret = cxd2820r_set_frontend_c(fe);
 	}
 
 	return ret;
@@ -383,7 +382,7 @@ static int cxd2820r_read_status(struct dvb_frontend *fe, fe_status_t *status)
 }
 
 static int cxd2820r_get_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+				 struct dtv_frontend_properties *c)
 {
 	struct cxd2820r_priv *priv = fe->demodulator_priv;
 	int ret;
@@ -397,10 +396,10 @@ static int cxd2820r_get_frontend(struct dvb_frontend *fe,
 
 		switch (fe->dtv_property_cache.delivery_system) {
 		case SYS_DVBT:
-			ret = cxd2820r_get_frontend_t(fe, p);
+			ret = cxd2820r_get_frontend_t(fe, c);
 			break;
 		case SYS_DVBT2:
-			ret = cxd2820r_get_frontend_t2(fe, p);
+			ret = cxd2820r_get_frontend_t2(fe, c);
 			break;
 		default:
 			ret = -EINVAL;
@@ -411,7 +410,7 @@ static int cxd2820r_get_frontend(struct dvb_frontend *fe,
 		if (ret)
 			return ret;
 
-		ret = cxd2820r_get_frontend_c(fe, p);
+		ret = cxd2820r_get_frontend_c(fe, c);
 	}
 
 	return ret;
@@ -672,7 +671,7 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe,
 	}
 
 	/* set frontend */
-	ret = cxd2820r_set_frontend(fe, p);
+	ret = cxd2820r_set_frontend(fe);
 	if (ret)
 		goto error;
 
@@ -799,6 +798,7 @@ EXPORT_SYMBOL(cxd2820r_attach);
 static const struct dvb_frontend_ops cxd2820r_ops[2] = {
 	{
 		/* DVB-T/T2 */
+		.delsys = { SYS_DVBT, SYS_DVBT2 },
 		.info = {
 			.name = "Sony CXD2820R (DVB-T/T2)",
 			.type = FE_OFDM,
@@ -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_legacy = cxd2820r_get_frontend,
+		.get_frontend = cxd2820r_get_frontend,
 
 		.get_frontend_algo = cxd2820r_get_frontend_algo,
 		.search = cxd2820r_search,
@@ -836,6 +836,7 @@ static const struct dvb_frontend_ops cxd2820r_ops[2] = {
 	},
 	{
 		/* DVB-C */
+		.delsys = { SYS_DVBC_ANNEX_A },
 		.info = {
 			.name = "Sony CXD2820R (DVB-C)",
 			.type = FE_QAM,
@@ -852,8 +853,8 @@ static const struct dvb_frontend_ops cxd2820r_ops[2] = {
 		.get_tune_settings = cxd2820r_get_tune_settings,
 		.i2c_gate_ctrl = cxd2820r_i2c_gate_ctrl,
 
-		.set_frontend_legacy = cxd2820r_set_frontend,
-		.get_frontend_legacy = cxd2820r_get_frontend,
+		.set_frontend = cxd2820r_set_frontend,
+		.get_frontend = cxd2820r_get_frontend,
 
 		.read_status = cxd2820r_read_status,
 		.read_snr = cxd2820r_read_snr,
drivers/media/dvb/frontends/cxd2820r_priv.h +6 -9
index 9553913..3371fdb 100644
@@ -90,10 +90,9 @@ int cxd2820r_rd_reg(struct cxd2820r_priv *priv, u32 reg, u8 *val);
 /* cxd2820r_c.c */
 
 int cxd2820r_get_frontend_c(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p);
+			    struct dtv_frontend_properties *c);
 
-int cxd2820r_set_frontend_c(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *params);
+int cxd2820r_set_frontend_c(struct dvb_frontend *fe);
 
 int cxd2820r_read_status_c(struct dvb_frontend *fe, fe_status_t *status);
 
@@ -115,10 +114,9 @@ int cxd2820r_get_tune_settings_c(struct dvb_frontend *fe,
 /* cxd2820r_t.c */
 
 int cxd2820r_get_frontend_t(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p);
+			    struct dtv_frontend_properties *c);
 
-int cxd2820r_set_frontend_t(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *params);
+int cxd2820r_set_frontend_t(struct dvb_frontend *fe);
 
 int cxd2820r_read_status_t(struct dvb_frontend *fe, fe_status_t *status);
 
@@ -140,10 +138,9 @@ int cxd2820r_get_tune_settings_t(struct dvb_frontend *fe,
 /* cxd2820r_t2.c */
 
 int cxd2820r_get_frontend_t2(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p);
+			     struct dtv_frontend_properties *c);
 
-int cxd2820r_set_frontend_t2(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *params);
+int cxd2820r_set_frontend_t2(struct dvb_frontend *fe);
 
 int cxd2820r_read_status_t2(struct dvb_frontend *fe, fe_status_t *status);
 
drivers/media/dvb/frontends/cxd2820r_t.c +2 -4
index a12ba74..f09d856 100644
@@ -21,8 +21,7 @@
 
 #include "cxd2820r_priv.h"
 
-int cxd2820r_set_frontend_t(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
 {
 	struct cxd2820r_priv *priv = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -143,10 +142,9 @@ error:
 }
 
 int cxd2820r_get_frontend_t(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+			    struct dtv_frontend_properties *c)
 {
 	struct cxd2820r_priv *priv = fe->demodulator_priv;
-	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	int ret;
 	u8 buf[2];
 
drivers/media/dvb/frontends/cxd2820r_t2.c +2 -4
index 52ed2c4..b7ddae0 100644
@@ -21,8 +21,7 @@
 
 #include "cxd2820r_priv.h"
 
-int cxd2820r_set_frontend_t2(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *params)
+int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
 {
 	struct cxd2820r_priv *priv = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -157,10 +156,9 @@ error:
 }
 
 int cxd2820r_get_frontend_t2(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+			     struct dtv_frontend_properties *c)
 {
 	struct cxd2820r_priv *priv = fe->demodulator_priv;
-	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	int ret;
 	u8 buf[2];
 
Signature · 1 line
1.7.8.352.g876a6
#22 lore raw

RFC PATCH 22/91 dib9000: get rid of unused dvb_frontend_parameters

In reply to Mauro Carvalho Chehab

This parameter is passed as NULL, and it is never used. Just remove it.

---
 drivers/media/dvb/frontends/dib9000.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/media/dvb/frontends/dib9000.c +6 -6
index a3a9fb1..974c2b7 100644
@@ -1309,7 +1309,7 @@ error:
 	return ret;
 }
 
-static int dib9000_fw_set_channel_union(struct dvb_frontend *fe, struct dvb_frontend_parameters *channel)
+static int dib9000_fw_set_channel_union(struct dvb_frontend *fe)
 {
 	struct dib9000_state *state = fe->demodulator_priv;
 	struct dibDVBTChannel {
@@ -1454,7 +1454,7 @@ static int dib9000_fw_set_channel_union(struct dvb_frontend *fe, struct dvb_fron
 	return 0;
 }
 
-static int dib9000_fw_tune(struct dvb_frontend *fe, struct dvb_frontend_parameters *ch)
+static int dib9000_fw_tune(struct dvb_frontend *fe)
 {
 	struct dib9000_state *state = fe->demodulator_priv;
 	int ret = 10, search = state->channel_status.status == CHANNEL_STATUS_PARAMETERS_UNKNOWN;
@@ -1471,7 +1471,7 @@ static int dib9000_fw_tune(struct dvb_frontend *fe, struct dvb_frontend_paramete
 		if (search)
 			dib9000_mbx_send(state, OUT_MSG_FE_CHANNEL_SEARCH, NULL, 0);
 		else {
-			dib9000_fw_set_channel_union(fe, ch);
+			dib9000_fw_set_channel_union(fe);
 			dib9000_mbx_send(state, OUT_MSG_FE_CHANNEL_TUNE, NULL, 0);
 		}
 		state->tune_state = CT_DEMOD_STEP_1;
@@ -2010,9 +2010,9 @@ static int dib9000_set_frontend(struct dvb_frontend *fe)
 	exit_condition = 0;	/* 0: tune pending; 1: tune failed; 2:tune success */
 	index_frontend_success = 0;
 	do {
-		sleep_time = dib9000_fw_tune(state->fe[0], NULL);
+		sleep_time = dib9000_fw_tune(state->fe[0]);
 		for (index_frontend = 1; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) {
-			sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend], NULL);
+			sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend]);
 			if (sleep_time == FE_CALLBACK_TIME_NEVER)
 				sleep_time = sleep_time_slave;
 			else if ((sleep_time_slave != FE_CALLBACK_TIME_NEVER) && (sleep_time_slave > sleep_time))
@@ -2070,7 +2070,7 @@ static int dib9000_set_frontend(struct dvb_frontend *fe)
 		sleep_time = FE_CALLBACK_TIME_NEVER;
 		for (index_frontend = 0; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) {
 			if (index_frontend != index_frontend_success) {
-				sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend], NULL);
+				sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend]);
 				if (sleep_time == FE_CALLBACK_TIME_NEVER)
 					sleep_time = sleep_time_slave;
 				else if ((sleep_time_slave != FE_CALLBACK_TIME_NEVER) && (sleep_time_slave > sleep_time))
Signature · 1 line
1.7.8.352.g876a6
#26 lore raw

RFC PATCH 26/91 drxk: 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/dvb/frontends/drxk_hard.c |  127 +++++++++++--------------------
 drivers/media/dvb/frontends/drxk_hard.h |    2 +-
 2 files changed, 44 insertions(+), 85 deletions(-)
drivers/media/dvb/frontends/drxk_hard.c +43 -84
index 2299e1d3..36e1c82 100644
@@ -1885,7 +1885,7 @@ static int Start(struct drxk_state *state, s32 offsetFreq,
 		state->m_DrxkState != DRXK_DTV_STARTED)
 		goto error;
 
-	state->m_bMirrorFreqSpect = (state->param.inversion == INVERSION_ON);
+	state->m_bMirrorFreqSpect = (state->props.inversion == INVERSION_ON);
 
 	if (IntermediateFrequency < 0) {
 		state->m_bMirrorFreqSpect = !state->m_bMirrorFreqSpect;
@@ -2507,7 +2507,7 @@ static int GetQAMSignalToNoise(struct drxk_state *state,
 	u16 qamSlErrPower = 0;	/* accum. error between
 					raw and sliced symbols */
 	u32 qamSlSigPower = 0;	/* used for MER, depends of
-					QAM constellation */
+					QAM modulation */
 	u32 qamSlMer = 0;	/* QAM MER */
 
 	dprintk(1, "\n");
@@ -2521,7 +2521,7 @@ static int GetQAMSignalToNoise(struct drxk_state *state,
 		return -EINVAL;
 	}
 
-	switch (state->param.u.qam.modulation) {
+	switch (state->props.modulation) {
 	case QAM_16:
 		qamSlSigPower = DRXK_QAM_SL_SIG_POWER_QAM16 << 2;
 		break;
@@ -2752,7 +2752,7 @@ static int GetDVBCQuality(struct drxk_state *state, s32 *pQuality)
 		if (status < 0)
 			break;
 
-		switch (state->param.u.qam.modulation) {
+		switch (state->props.modulation) {
 		case QAM_16:
 			SignalToNoiseRel = SignalToNoise - 200;
 			break;
@@ -3817,7 +3817,7 @@ static int SetDVBT(struct drxk_state *state, u16 IntermediateFreqkHz,
 	/*== Write channel settings to device =====================================*/
 
 	/* mode */
-	switch (state->param.u.ofdm.transmission_mode) {
+	switch (state->props.transmission_mode) {
 	case TRANSMISSION_MODE_AUTO:
 	default:
 		operationMode |= OFDM_SC_RA_RAM_OP_AUTO_MODE__M;
@@ -3831,7 +3831,7 @@ static int SetDVBT(struct drxk_state *state, u16 IntermediateFreqkHz,
 	}
 
 	/* guard */
-	switch (state->param.u.ofdm.guard_interval) {
+	switch (state->props.guard_interval) {
 	default:
 	case GUARD_INTERVAL_AUTO:
 		operationMode |= OFDM_SC_RA_RAM_OP_AUTO_GUARD__M;
@@ -3851,7 +3851,7 @@ static int SetDVBT(struct drxk_state *state, u16 IntermediateFreqkHz,
 	}
 
 	/* hierarchy */
-	switch (state->param.u.ofdm.hierarchy_information) {
+	switch (state->props.hierarchy) {
 	case HIERARCHY_AUTO:
 	case HIERARCHY_NONE:
 	default:
@@ -3871,8 +3871,8 @@ static int SetDVBT(struct drxk_state *state, u16 IntermediateFreqkHz,
 	}
 
 
-	/* constellation */
-	switch (state->param.u.ofdm.constellation) {
+	/* modulation */
+	switch (state->props.modulation) {
 	case QAM_AUTO:
 	default:
 		operationMode |= OFDM_SC_RA_RAM_OP_AUTO_CONST__M;
@@ -3915,7 +3915,7 @@ static int SetDVBT(struct drxk_state *state, u16 IntermediateFreqkHz,
 #endif
 
 	/* coderate */
-	switch (state->param.u.ofdm.code_rate_HP) {
+	switch (state->props.code_rate_HP) {
 	case FEC_AUTO:
 	default:
 		operationMode |= OFDM_SC_RA_RAM_OP_AUTO_RATE__M;
@@ -3944,9 +3944,11 @@ static int SetDVBT(struct drxk_state *state, u16 IntermediateFreqkHz,
 	/* Also set parameters for EC_OC fix, note EC_OC_REG_TMD_HIL_MAR is changed
 		by SC for fix for some 8K,1/8 guard but is restored by InitEC and ResetEC
 		functions */
-	switch (state->param.u.ofdm.bandwidth) {
-	case BANDWIDTH_AUTO:
-	case BANDWIDTH_8_MHZ:
+	switch (state->props.bandwidth_hz) {
+	case 0:
+		state->props.bandwidth_hz = 8000000;
+		/* fall though */
+	case 8000000:
 		bandwidth = DRXK_BANDWIDTH_8MHZ_IN_HZ;
 		status = write16(state, OFDM_SC_RA_RAM_SRMM_FIX_FACT_8K__A, 3052);
 		if (status < 0)
@@ -3965,7 +3967,7 @@ static int SetDVBT(struct drxk_state *state, u16 IntermediateFreqkHz,
 		if (status < 0)
 			goto error;
 		break;
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		bandwidth = DRXK_BANDWIDTH_7MHZ_IN_HZ;
 		status = write16(state, OFDM_SC_RA_RAM_SRMM_FIX_FACT_8K__A, 3491);
 		if (status < 0)
@@ -3984,7 +3986,7 @@ static int SetDVBT(struct drxk_state *state, u16 IntermediateFreqkHz,
 		if (status < 0)
 			goto error;
 		break;
-	case BANDWIDTH_6_MHZ:
+	case 6000000:
 		bandwidth = DRXK_BANDWIDTH_6MHZ_IN_HZ;
 		status = write16(state, OFDM_SC_RA_RAM_SRMM_FIX_FACT_8K__A, 4073);
 		if (status < 0)
@@ -4191,7 +4193,7 @@ error:
 /**
 * \brief Setup of the QAM Measurement intervals for signal quality
 * \param demod instance of demod.
-* \param constellation current constellation.
+* \param modulation current modulation.
 * \return DRXStatus_t.
 *
 *  NOTE:
@@ -4200,7 +4202,7 @@ error:
 *
 */
 static int SetQAMMeasurement(struct drxk_state *state,
-			     enum EDrxkConstellation constellation,
+			     enum EDrxkConstellation modulation,
 			     u32 symbolRate)
 {
 	u32 fecBitsDesired = 0;	/* BER accounting period */
@@ -4214,11 +4216,11 @@ static int SetQAMMeasurement(struct drxk_state *state,
 	fecRsPrescale = 1;
 	/* fecBitsDesired = symbolRate [kHz] *
 		FrameLenght [ms] *
-		(constellation + 1) *
+		(modulation + 1) *
 		SyncLoss (== 1) *
 		ViterbiLoss (==1)
 		*/
-	switch (constellation) {
+	switch (modulation) {
 	case DRX_CONSTELLATION_QAM16:
 		fecBitsDesired = 4 * symbolRate;
 		break;
@@ -5285,12 +5287,12 @@ static int QAMSetSymbolrate(struct drxk_state *state)
 	/* Select & calculate correct IQM rate */
 	adcFrequency = (state->m_sysClockFreq * 1000) / 3;
 	ratesel = 0;
-	/* printk(KERN_DEBUG "drxk: SR %d\n", state->param.u.qam.symbol_rate); */
-	if (state->param.u.qam.symbol_rate <= 1188750)
+	/* printk(KERN_DEBUG "drxk: SR %d\n", state->props.symbol_rate); */
+	if (state->props.symbol_rate <= 1188750)
 		ratesel = 3;
-	else if (state->param.u.qam.symbol_rate <= 2377500)
+	else if (state->props.symbol_rate <= 2377500)
 		ratesel = 2;
-	else if (state->param.u.qam.symbol_rate <= 4755000)
+	else if (state->props.symbol_rate <= 4755000)
 		ratesel = 1;
 	status = write16(state, IQM_FD_RATESEL__A, ratesel);
 	if (status < 0)
@@ -5299,7 +5301,7 @@ static int QAMSetSymbolrate(struct drxk_state *state)
 	/*
 		IqmRcRate = ((Fadc / (symbolrate * (4<<ratesel))) - 1) * (1<<23)
 		*/
-	symbFreq = state->param.u.qam.symbol_rate * (1 << ratesel);
+	symbFreq = state->props.symbol_rate * (1 << ratesel);
 	if (symbFreq == 0) {
 		/* Divide by zero */
 		status = -EINVAL;
@@ -5315,7 +5317,7 @@ static int QAMSetSymbolrate(struct drxk_state *state)
 	/*
 		LcSymbFreq = round (.125 *  symbolrate / adcFreq * (1<<15))
 		*/
-	symbFreq = state->param.u.qam.symbol_rate;
+	symbFreq = state->props.symbol_rate;
 	if (adcFrequency == 0) {
 		/* Divide by zero */
 		status = -EINVAL;
@@ -5416,7 +5418,7 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateFreqkHz,
 		goto error;
 
 	/* Set params */
-	switch (state->param.u.qam.modulation) {
+	switch (state->props.modulation) {
 	case QAM_256:
 		state->m_Constellation = DRX_CONSTELLATION_QAM256;
 		break;
@@ -5439,7 +5441,7 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateFreqkHz,
 	}
 	if (status < 0)
 		goto error;
-	setParamParameters[0] = state->m_Constellation;	/* constellation     */
+	setParamParameters[0] = state->m_Constellation;	/* modulation     */
 	setParamParameters[1] = DRXK_QAM_I12_J17;	/* interleave mode   */
 	if (state->m_OperationMode == OM_QAM_ITU_C)
 		setParamParameters[2] = QAM_TOP_ANNEX_C;
@@ -5461,7 +5463,7 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateFreqkHz,
 		if (status < 0)
 			goto error;
 
-		setParamParameters[0] = state->m_Constellation; /* constellation     */
+		setParamParameters[0] = state->m_Constellation; /* modulation     */
 		setParamParameters[1] = DRXK_QAM_I12_J17;       /* interleave mode   */
 		status = scu_command(state, SCU_RAM_COMMAND_STANDARD_QAM | SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM, 2, setParamParameters, 1, &cmdResult);
 	}
@@ -5470,7 +5472,7 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateFreqkHz,
 
 	/*
 	 * STEP 3: enable the system in a mode where the ADC provides valid
-	 * signal setup constellation independent registers
+	 * signal setup modulation independent registers
 	 */
 #if 0
 	status = SetFrequency(channel, tunerFreqOffset));
@@ -5482,7 +5484,7 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateFreqkHz,
 		goto error;
 
 	/* Setup BER measurement */
-	status = SetQAMMeasurement(state, state->m_Constellation, state->param.u. qam.symbol_rate);
+	status = SetQAMMeasurement(state, state->m_Constellation, state->props.symbol_rate);
 	if (status < 0)
 		goto error;
 
@@ -5564,8 +5566,8 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateFreqkHz,
 	if (status < 0)
 		goto error;
 
-	/* STEP 4: constellation specific setup */
-	switch (state->param.u.qam.modulation) {
+	/* STEP 4: modulation specific setup */
+	switch (state->props.modulation) {
 	case QAM_16:
 		status = SetQAM16(state);
 		break;
@@ -5595,7 +5597,7 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateFreqkHz,
 		goto error;
 
 	/* Re-configure MPEG output, requires knowledge of channel bitrate */
-	/* extAttr->currentChannel.constellation = channel->constellation; */
+	/* extAttr->currentChannel.modulation = channel->modulation; */
 	/* extAttr->currentChannel.symbolrate    = channel->symbolrate; */
 	status = MPEGTSDtoSetup(state, state->m_OperationMode);
 	if (status < 0)
@@ -6211,11 +6213,11 @@ static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable)
 	return ConfigureI2CBridge(state, enable ? true : false);
 }
 
-static int drxk_set_parameters(struct dvb_frontend *fe,
-			       struct dvb_frontend_parameters *p)
+static int drxk_set_parameters(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
+	u32 delsys  = p->delivery_system;
 	struct drxk_state *state = fe->demodulator_priv;
-	u32 delsys  = fe->dtv_property_cache.delivery_system;
 	u32 IF;
 
 	dprintk(1, "\n");
@@ -6243,7 +6245,7 @@ static int drxk_set_parameters(struct dvb_frontend *fe,
 		fe->ops.tuner_ops.set_params(fe);
 	if (fe->ops.i2c_gate_ctrl)
 		fe->ops.i2c_gate_ctrl(fe, 0);
-	state->param = *p;
+	state->props = *p;
 	fe->ops.tuner_ops.get_if_frequency(fe, &IF);
 	Start(state, 0, IF);
 
@@ -6252,13 +6254,6 @@ static int drxk_set_parameters(struct dvb_frontend *fe,
 	return 0;
 }
 
-static int drxk_c_get_frontend(struct dvb_frontend *fe,
-			       struct dvb_frontend_parameters *p)
-{
-	dprintk(1, "\n");
-	return 0;
-}
-
 static int drxk_read_status(struct dvb_frontend *fe, fe_status_t *status)
 {
 	struct drxk_state *state = fe->demodulator_priv;
@@ -6356,41 +6351,8 @@ static int drxk_t_sleep(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int drxk_t_get_frontend(struct dvb_frontend *fe,
-			       struct dvb_frontend_parameters *p)
-{
-	dprintk(1, "\n");
-
-	return 0;
-}
-
-static int drxk_c_get_property(struct dvb_frontend *fe, struct dtv_property *p)
-{
-	switch (p->cmd) {
-	case DTV_ENUM_DELSYS:
-		p->u.buffer.data[0] = SYS_DVBC_ANNEX_A;
-		p->u.buffer.data[1] = SYS_DVBC_ANNEX_C;
-		p->u.buffer.len = 2;
-		break;
-	default:
-		break;
-	}
-	return 0;
-}
-static int drxk_t_get_property(struct dvb_frontend *fe, struct dtv_property *p)
-{
-	switch (p->cmd) {
-	case DTV_ENUM_DELSYS:
-		p->u.buffer.data[0] = SYS_DVBT;
-		p->u.buffer.len = 1;
-		break;
-	default:
-		break;
-	}
-	return 0;
-}
-
 static struct dvb_frontend_ops drxk_c_ops = {
+	.delsys = { SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_C },
 	.info = {
 		 .name = "DRXK DVB-C",
 		 .type = FE_QAM,
@@ -6406,9 +6368,7 @@ static struct dvb_frontend_ops drxk_c_ops = {
 	.sleep = drxk_c_sleep,
 	.i2c_gate_ctrl = drxk_gate_ctrl,
 
-	.set_frontend_legacy = drxk_set_parameters,
-	.get_frontend_legacy = drxk_c_get_frontend,
-	.get_property = drxk_c_get_property,
+	.set_frontend = drxk_set_parameters,
 	.get_tune_settings = drxk_c_get_tune_settings,
 
 	.read_status = drxk_read_status,
@@ -6419,6 +6379,7 @@ static struct dvb_frontend_ops drxk_c_ops = {
 };
 
 static struct dvb_frontend_ops drxk_t_ops = {
+	.delsys = { SYS_DVBT },
 	.info = {
 		 .name = "DRXK DVB-T",
 		 .type = FE_OFDM,
@@ -6439,9 +6400,7 @@ static struct dvb_frontend_ops drxk_t_ops = {
 	.sleep = drxk_t_sleep,
 	.i2c_gate_ctrl = drxk_gate_ctrl,
 
-	.set_frontend_legacy = drxk_set_parameters,
-	.get_frontend_legacy = drxk_t_get_frontend,
-	.get_property = drxk_t_get_property,
+	.set_frontend = drxk_set_parameters,
 
 	.read_status = drxk_read_status,
 	.read_ber = drxk_read_ber,
drivers/media/dvb/frontends/drxk_hard.h +1 -1
index 85a423f..60bcd61 100644
@@ -197,7 +197,7 @@ struct DRXKOfdmScCmd_t {
 struct drxk_state {
 	struct dvb_frontend c_frontend;
 	struct dvb_frontend t_frontend;
-	struct dvb_frontend_parameters param;
+	struct dtv_frontend_properties props;
 	struct device *dev;
 
 	struct i2c_adapter *i2c;
Signature · 1 line
1.7.8.352.g876a6
#37 lore raw

RFC PATCH 37/91 mb86a16: Add delivery system type at fe struct

In reply to Mauro Carvalho Chehab
---
 drivers/media/dvb/frontends/mb86a16.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/media/dvb/frontends/mb86a16.c +1 -0
index c283112..292ba7b 100644
@@ -1814,6 +1814,7 @@ static enum dvbfe_algo mb86a16_frontend_algo(struct dvb_frontend *fe)
 }
 
 static struct dvb_frontend_ops mb86a16_ops = {
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "Fujitsu MB86A16 DVB-S",
 		.type			= FE_QPSK,
Signature · 1 line
1.7.8.352.g876a6
#38 lore raw

RFC PATCH 38/91 mb86a20s: convert set_fontend to use DVBv5 parameters

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

Actually, this driver needs to fill/use the ISDB-T proprieties.

Also, fill the supported delivery systems at dvb_frontend_ops struct.

---
 drivers/media/dvb/frontends/mb86a20s.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)
drivers/media/dvb/frontends/mb86a20s.c +16 -10
index 2dfea6c..a67d7ef 100644
@@ -485,11 +485,16 @@ static int mb86a20s_read_status(struct dvb_frontend *fe, fe_status_t *status)
 	return 0;
 }
 
-static int mb86a20s_set_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static int mb86a20s_set_frontend(struct dvb_frontend *fe)
 {
 	struct mb86a20s_state *state = fe->demodulator_priv;
 	int rc;
+#if 0
+	/*
+	 * FIXME: Properly implement the set frontend properties
+	 */
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
+#endif
 
 	dprintk("\n");
 
@@ -521,15 +526,15 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe,
 }
 
 static int mb86a20s_get_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+				 struct dtv_frontend_properties *p)
 {
 
 	/* FIXME: For now, it does nothing */
 
-	fe->dtv_property_cache.bandwidth_hz = 6000000;
-	fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_AUTO;
-	fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_AUTO;
-	fe->dtv_property_cache.isdbt_partial_reception = 0;
+	p->bandwidth_hz = 6000000;
+	p->transmission_mode = TRANSMISSION_MODE_AUTO;
+	p->guard_interval = GUARD_INTERVAL_AUTO;
+	p->isdbt_partial_reception = 0;
 
 	return 0;
 }
@@ -545,7 +550,7 @@ static int mb86a20s_tune(struct dvb_frontend *fe,
 	dprintk("\n");
 
 	if (params != NULL)
-		rc = mb86a20s_set_frontend(fe, params);
+		rc = mb86a20s_set_frontend(fe);
 
 	if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
 		mb86a20s_read_status(fe, status);
@@ -608,6 +613,7 @@ error:
 EXPORT_SYMBOL(mb86a20s_attach);
 
 static struct dvb_frontend_ops mb86a20s_ops = {
+	.delsys = { SYS_ISDBT },
 	/* Use dib8000 values per default */
 	.info = {
 		.name = "Fujitsu mb86A20s",
@@ -627,8 +633,8 @@ static struct dvb_frontend_ops mb86a20s_ops = {
 	.release = mb86a20s_release,
 
 	.init = mb86a20s_initfe,
-	.set_frontend_legacy = mb86a20s_set_frontend,
-	.get_frontend_legacy = mb86a20s_get_frontend,
+	.set_frontend = mb86a20s_set_frontend,
+	.get_frontend = mb86a20s_get_frontend,
 	.read_status = mb86a20s_read_status,
 	.read_signal_strength = mb86a20s_read_signal_strength,
 	.tune = mb86a20s_tune,
Signature · 1 line
1.7.8.352.g876a6
#39 lore raw

RFC PATCH 39/91 mt352: convert set_fontend to use DVBv5 parameters

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/mt352.c |   62 +++++++++++++++++------------------
 1 files changed, 30 insertions(+), 32 deletions(-)
drivers/media/dvb/frontends/mt352.c +30 -32
index 021108d..0155fa8 100644
@@ -111,20 +111,20 @@ static int mt352_sleep(struct dvb_frontend* fe)
 }
 
 static void mt352_calc_nominal_rate(struct mt352_state* state,
-				    enum fe_bandwidth bandwidth,
+				    u32 bandwidth,
 				    unsigned char *buf)
 {
 	u32 adc_clock = 20480; /* 20.340 MHz */
 	u32 bw,value;
 
 	switch (bandwidth) {
-	case BANDWIDTH_6_MHZ:
+	case 6000000:
 		bw = 6;
 		break;
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		bw = 7;
 		break;
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
 	default:
 		bw = 8;
 		break;
@@ -166,15 +166,14 @@ static void mt352_calc_input_freq(struct mt352_state* state,
 	buf[1] = lsb(value);
 }
 
-static int mt352_set_parameters(struct dvb_frontend* fe,
-				struct dvb_frontend_parameters *param)
+static int mt352_set_parameters(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *op = &fe->dtv_property_cache;
 	struct mt352_state* state = fe->demodulator_priv;
 	unsigned char buf[13];
 	static unsigned char tuner_go[] = { 0x5d, 0x01 };
 	static unsigned char fsm_go[]   = { 0x5e, 0x01 };
 	unsigned int tps = 0;
-	struct dvb_ofdm_parameters *op = &param->u.ofdm;
 
 	switch (op->code_rate_HP) {
 		case FEC_2_3:
@@ -213,14 +212,14 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
 		case FEC_AUTO:
 			break;
 		case FEC_NONE:
-			if (op->hierarchy_information == HIERARCHY_AUTO ||
-			    op->hierarchy_information == HIERARCHY_NONE)
+			if (op->hierarchy == HIERARCHY_AUTO ||
+			    op->hierarchy == HIERARCHY_NONE)
 				break;
 		default:
 			return -EINVAL;
 	}
 
-	switch (op->constellation) {
+	switch (op->modulation) {
 		case QPSK:
 			break;
 		case QAM_AUTO:
@@ -262,7 +261,7 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
 			return -EINVAL;
 	}
 
-	switch (op->hierarchy_information) {
+	switch (op->hierarchy) {
 		case HIERARCHY_AUTO:
 		case HIERARCHY_NONE:
 			break;
@@ -288,7 +287,7 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
 	buf[3] = 0x50;  // old
 //	buf[3] = 0xf4;  // pinnacle
 
-	mt352_calc_nominal_rate(state, op->bandwidth, buf+4);
+	mt352_calc_nominal_rate(state, op->bandwidth_hz, buf+4);
 	mt352_calc_input_freq(state, buf+6);
 
 	if (state->config.no_tuner) {
@@ -313,13 +312,12 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
 }
 
 static int mt352_get_parameters(struct dvb_frontend* fe,
-				struct dvb_frontend_parameters *param)
+				struct dtv_frontend_properties *op)
 {
 	struct mt352_state* state = fe->demodulator_priv;
 	u16 tps;
 	u16 div;
 	u8 trl;
-	struct dvb_ofdm_parameters *op = &param->u.ofdm;
 	static const u8 tps_fec_to_api[8] =
 	{
 		FEC_1_2,
@@ -348,16 +346,16 @@ static int mt352_get_parameters(struct dvb_frontend* fe,
 	switch ( (tps >> 13) & 3)
 	{
 		case 0:
-			op->constellation = QPSK;
+			op->modulation = QPSK;
 			break;
 		case 1:
-			op->constellation = QAM_16;
+			op->modulation = QAM_16;
 			break;
 		case 2:
-			op->constellation = QAM_64;
+			op->modulation = QAM_64;
 			break;
 		default:
-			op->constellation = QAM_AUTO;
+			op->modulation = QAM_AUTO;
 			break;
 	}
 
@@ -385,36 +383,36 @@ static int mt352_get_parameters(struct dvb_frontend* fe,
 	switch ( (tps >> 10) & 7)
 	{
 		case 0:
-			op->hierarchy_information = HIERARCHY_NONE;
+			op->hierarchy = HIERARCHY_NONE;
 			break;
 		case 1:
-			op->hierarchy_information = HIERARCHY_1;
+			op->hierarchy = HIERARCHY_1;
 			break;
 		case 2:
-			op->hierarchy_information = HIERARCHY_2;
+			op->hierarchy = HIERARCHY_2;
 			break;
 		case 3:
-			op->hierarchy_information = HIERARCHY_4;
+			op->hierarchy = HIERARCHY_4;
 			break;
 		default:
-			op->hierarchy_information = HIERARCHY_AUTO;
+			op->hierarchy = HIERARCHY_AUTO;
 			break;
 	}
 
-	param->frequency = ( 500 * (div - IF_FREQUENCYx6) ) / 3 * 1000;
+	op->frequency = ( 500 * (div - IF_FREQUENCYx6) ) / 3 * 1000;
 
 	if (trl == 0x72)
-		op->bandwidth = BANDWIDTH_8_MHZ;
+		op->bandwidth_hz = 8000000;
 	else if (trl == 0x64)
-		op->bandwidth = BANDWIDTH_7_MHZ;
+		op->bandwidth_hz = 7000000;
 	else
-		op->bandwidth = BANDWIDTH_6_MHZ;
+		op->bandwidth_hz = 6000000;
 
 
 	if (mt352_read_register(state, STATUS_2) & 0x02)
-		param->inversion = INVERSION_OFF;
+		op->inversion = INVERSION_OFF;
 	else
-		param->inversion = INVERSION_ON;
+		op->inversion = INVERSION_ON;
 
 	return 0;
 }
@@ -569,7 +567,7 @@ error:
 }
 
 static struct dvb_frontend_ops mt352_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Zarlink MT352 DVB-T",
 		.type			= FE_OFDM,
@@ -592,8 +590,8 @@ static struct dvb_frontend_ops mt352_ops = {
 	.sleep = mt352_sleep,
 	.write = _mt352_write,
 
-	.set_frontend_legacy = mt352_set_parameters,
-	.get_frontend_legacy = mt352_get_parameters,
+	.set_frontend = mt352_set_parameters,
+	.get_frontend = mt352_get_parameters,
 	.get_tune_settings = mt352_get_tune_settings,
 
 	.read_status = mt352_read_status,
Signature · 1 line
1.7.8.352.g876a6
#8 lore raw

RFC PATCH 8/91 cx22700: 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/dvb/frontends/cx22700.c |   52 +++++++++++++++++---------------
 1 files changed, 28 insertions(+), 24 deletions(-)
drivers/media/dvb/frontends/cx22700.c +28 -24
index 7ac95de..3c571b9 100644
@@ -121,7 +121,8 @@ static int cx22700_set_inversion (struct cx22700_state* state, int inversion)
 	}
 }
 
-static int cx22700_set_tps (struct cx22700_state *state, struct dvb_ofdm_parameters *p)
+static int cx22700_set_tps(struct cx22700_state *state,
+			   struct dtv_frontend_properties *p)
 {
 	static const u8 qam_tab [4] = { 0, 1, 0, 2 };
 	static const u8 fec_tab [6] = { 0, 1, 2, 0, 3, 4 };
@@ -146,25 +147,25 @@ static int cx22700_set_tps (struct cx22700_state *state, struct dvb_ofdm_paramet
 	    p->transmission_mode != TRANSMISSION_MODE_8K)
 		return -EINVAL;
 
-	if (p->constellation != QPSK &&
-	    p->constellation != QAM_16 &&
-	    p->constellation != QAM_64)
+	if (p->modulation != QPSK &&
+	    p->modulation != QAM_16 &&
+	    p->modulation != QAM_64)
 		return -EINVAL;
 
-	if (p->hierarchy_information < HIERARCHY_NONE ||
-	    p->hierarchy_information > HIERARCHY_4)
+	if (p->hierarchy < HIERARCHY_NONE ||
+	    p->hierarchy > HIERARCHY_4)
 		return -EINVAL;
 
-	if (p->bandwidth < BANDWIDTH_8_MHZ || p->bandwidth > BANDWIDTH_6_MHZ)
+	if (p->bandwidth_hz > 8000000 || p->bandwidth_hz < 6000000)
 		return -EINVAL;
 
-	if (p->bandwidth == BANDWIDTH_7_MHZ)
+	if (p->bandwidth_hz == 7000000)
 		cx22700_writereg (state, 0x09, cx22700_readreg (state, 0x09 | 0x10));
 	else
 		cx22700_writereg (state, 0x09, cx22700_readreg (state, 0x09 & ~0x10));
 
-	val = qam_tab[p->constellation - QPSK];
-	val |= p->hierarchy_information - HIERARCHY_NONE;
+	val = qam_tab[p->modulation - QPSK];
+	val |= p->hierarchy - HIERARCHY_NONE;
 
 	cx22700_writereg (state, 0x04, val);
 
@@ -184,7 +185,8 @@ static int cx22700_set_tps (struct cx22700_state *state, struct dvb_ofdm_paramet
 	return 0;
 }
 
-static int cx22700_get_tps (struct cx22700_state* state, struct dvb_ofdm_parameters *p)
+static int cx22700_get_tps(struct cx22700_state *state,
+			   struct dtv_frontend_properties *p)
 {
 	static const fe_modulation_t qam_tab [3] = { QPSK, QAM_16, QAM_64 };
 	static const fe_code_rate_t fec_tab [5] = { FEC_1_2, FEC_2_3, FEC_3_4,
@@ -199,14 +201,14 @@ static int cx22700_get_tps (struct cx22700_state* state, struct dvb_ofdm_paramet
 	val = cx22700_readreg (state, 0x01);
 
 	if ((val & 0x7) > 4)
-		p->hierarchy_information = HIERARCHY_AUTO;
+		p->hierarchy = HIERARCHY_AUTO;
 	else
-		p->hierarchy_information = HIERARCHY_NONE + (val & 0x7);
+		p->hierarchy = HIERARCHY_NONE + (val & 0x7);
 
 	if (((val >> 3) & 0x3) > 2)
-		p->constellation = QAM_AUTO;
+		p->modulation = QAM_AUTO;
 	else
-		p->constellation = qam_tab[(val >> 3) & 0x3];
+		p->modulation = qam_tab[(val >> 3) & 0x3];
 
 	val = cx22700_readreg (state, 0x02);
 
@@ -318,8 +320,9 @@ static int cx22700_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int cx22700_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int cx22700_set_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct cx22700_state* state = fe->demodulator_priv;
 
 	cx22700_writereg (state, 0x00, 0x02); /* XXX CHECKME: soft reset*/
@@ -330,21 +333,22 @@ static int cx22700_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 		if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
 	}
 
-	cx22700_set_inversion (state, p->inversion);
-	cx22700_set_tps (state, &p->u.ofdm);
+	cx22700_set_inversion(state, c->inversion);
+	cx22700_set_tps(state, c);
 	cx22700_writereg (state, 0x37, 0x01);  /* PAL loop filter off */
 	cx22700_writereg (state, 0x00, 0x01);  /* restart acquire */
 
 	return 0;
 }
 
-static int cx22700_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int cx22700_get_frontend(struct dvb_frontend* fe,
+				struct dtv_frontend_properties *c)
 {
 	struct cx22700_state* state = fe->demodulator_priv;
 	u8 reg09 = cx22700_readreg (state, 0x09);
 
-	p->inversion = reg09 & 0x1 ? INVERSION_ON : INVERSION_OFF;
-	return cx22700_get_tps (state, &p->u.ofdm);
+	c->inversion = reg09 & 0x1 ? INVERSION_ON : INVERSION_OFF;
+	return cx22700_get_tps(state, c);
 }
 
 static int cx22700_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
@@ -401,7 +405,7 @@ error:
 }
 
 static struct dvb_frontend_ops cx22700_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Conexant CX22700 DVB-T",
 		.type			= FE_OFDM,
@@ -419,8 +423,8 @@ static struct dvb_frontend_ops cx22700_ops = {
 	.init = cx22700_init,
 	.i2c_gate_ctrl = cx22700_i2c_gate_ctrl,
 
-	.set_frontend_legacy = cx22700_set_frontend,
-	.get_frontend_legacy = cx22700_get_frontend,
+	.set_frontend = cx22700_set_frontend,
+	.get_frontend = cx22700_get_frontend,
 	.get_tune_settings = cx22700_get_tune_settings,
 
 	.read_status = cx22700_read_status,
Signature · 1 line
1.7.8.352.g876a6
#83 lore raw

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

In reply to Mauro Carvalho Chehab

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
#88 lore raw

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

In reply to Mauro Carvalho Chehab

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
#35 lore raw

RFC PATCH 35/91 lgs8gxx: 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/dvb/frontends/lgs8gxx.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)
drivers/media/dvb/frontends/lgs8gxx.c +13 -12
index 05bfa05..da7d8f6 100644
@@ -669,9 +669,9 @@ static int lgs8gxx_write(struct dvb_frontend *fe, const u8 buf[], int len)
 	return lgs8gxx_write_reg(priv, buf[0], buf[1]);
 }
 
-static int lgs8gxx_set_fe(struct dvb_frontend *fe,
-			  struct dvb_frontend_parameters *fe_params)
+static int lgs8gxx_set_fe(struct dvb_frontend *fe)
 {
+
 	struct lgs8gxx_state *priv = fe->demodulator_priv;
 
 	dprintk("%s\n", __func__);
@@ -692,7 +692,7 @@ static int lgs8gxx_set_fe(struct dvb_frontend *fe,
 }
 
 static int lgs8gxx_get_fe(struct dvb_frontend *fe,
-			  struct dvb_frontend_parameters *fe_params)
+			  struct dtv_frontend_properties *fe_params)
 {
 	dprintk("%s\n", __func__);
 
@@ -701,21 +701,21 @@ static int lgs8gxx_get_fe(struct dvb_frontend *fe,
 	fe_params->inversion = INVERSION_OFF;
 
 	/* bandwidth */
-	fe_params->u.ofdm.bandwidth = BANDWIDTH_8_MHZ;
+	fe_params->bandwidth_hz = 8000000;
 
-	fe_params->u.ofdm.code_rate_HP = FEC_AUTO;
-	fe_params->u.ofdm.code_rate_LP = FEC_AUTO;
+	fe_params->code_rate_HP = FEC_AUTO;
+	fe_params->code_rate_LP = FEC_AUTO;
 
-	fe_params->u.ofdm.constellation = QAM_AUTO;
+	fe_params->modulation = QAM_AUTO;
 
 	/* transmission mode */
-	fe_params->u.ofdm.transmission_mode = TRANSMISSION_MODE_AUTO;
+	fe_params->transmission_mode = TRANSMISSION_MODE_AUTO;
 
 	/* guard interval */
-	fe_params->u.ofdm.guard_interval = GUARD_INTERVAL_AUTO;
+	fe_params->guard_interval = GUARD_INTERVAL_AUTO;
 
 	/* hierarchy */
-	fe_params->u.ofdm.hierarchy_information = HIERARCHY_NONE;
+	fe_params->hierarchy = HIERARCHY_NONE;
 
 	return 0;
 }
@@ -994,6 +994,7 @@ static int lgs8gxx_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
 }
 
 static struct dvb_frontend_ops lgs8gxx_ops = {
+	.delsys = { SYS_DMBTH },
 	.info = {
 		.name = "Legend Silicon LGS8913/LGS8GXX DMB-TH",
 		.type = FE_OFDM,
@@ -1013,8 +1014,8 @@ static struct dvb_frontend_ops lgs8gxx_ops = {
 	.write = lgs8gxx_write,
 	.i2c_gate_ctrl = lgs8gxx_i2c_gate_ctrl,
 
-	.set_frontend_legacy = lgs8gxx_set_fe,
-	.get_frontend_legacy = lgs8gxx_get_fe,
+	.set_frontend = lgs8gxx_set_fe,
+	.get_frontend = lgs8gxx_get_fe,
 	.get_tune_settings = lgs8gxx_get_tune_settings,
 
 	.read_status = lgs8gxx_read_status,
Signature · 1 line
1.7.8.352.g876a6
#63 lore raw

RFC PATCH 63/91 or51132: 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/dvb/frontends/or51132.c |   34 ++++++++++++++++----------------
 1 files changed, 17 insertions(+), 17 deletions(-)
drivers/media/dvb/frontends/or51132.c +17 -17
index e0c952c..2d9e81b 100644
@@ -306,9 +306,9 @@ static int modulation_fw_class(fe_modulation_t modulation)
 	}
 }
 
-static int or51132_set_parameters(struct dvb_frontend* fe,
-				  struct dvb_frontend_parameters *param)
+static int or51132_set_parameters(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	int ret;
 	struct or51132_state* state = fe->demodulator_priv;
 	const struct firmware *fw;
@@ -317,8 +317,8 @@ static int or51132_set_parameters(struct dvb_frontend* fe,
 
 	/* Upload new firmware only if we need a different one */
 	if (modulation_fw_class(state->current_modulation) !=
-	    modulation_fw_class(param->u.vsb.modulation)) {
-		switch(modulation_fw_class(param->u.vsb.modulation)) {
+	    modulation_fw_class(p->modulation)) {
+		switch(modulation_fw_class(p->modulation)) {
 		case MOD_FWCLASS_VSB:
 			dprintk("set_parameters VSB MODE\n");
 			fwname = OR51132_VSB_FIRMWARE;
@@ -335,7 +335,7 @@ static int or51132_set_parameters(struct dvb_frontend* fe,
 			break;
 		default:
 			printk("or51132: Modulation type(%d) UNSUPPORTED\n",
-			       param->u.vsb.modulation);
+			       p->modulation);
 			return -1;
 		}
 		printk("or51132: Waiting for firmware upload(%s)...\n",
@@ -357,8 +357,8 @@ static int or51132_set_parameters(struct dvb_frontend* fe,
 		state->config->set_ts_params(fe, clock_mode);
 	}
 	/* Change only if we are actually changing the modulation */
-	if (state->current_modulation != param->u.vsb.modulation) {
-		state->current_modulation = param->u.vsb.modulation;
+	if (state->current_modulation != p->modulation) {
+		state->current_modulation = p->modulation;
 		or51132_setmode(fe);
 	}
 
@@ -371,12 +371,12 @@ static int or51132_set_parameters(struct dvb_frontend* fe,
 	or51132_setmode(fe);
 
 	/* Update current frequency */
-	state->current_frequency = param->frequency;
+	state->current_frequency = p->frequency;
 	return 0;
 }
 
 static int or51132_get_parameters(struct dvb_frontend* fe,
-				  struct dvb_frontend_parameters *param)
+				  struct dtv_frontend_properties *p)
 {
 	struct or51132_state* state = fe->demodulator_priv;
 	int status;
@@ -389,9 +389,9 @@ start:
 		return -EREMOTEIO;
 	}
 	switch(status&0xff) {
-		case 0x06: param->u.vsb.modulation = VSB_8; break;
-		case 0x43: param->u.vsb.modulation = QAM_64; break;
-		case 0x45: param->u.vsb.modulation = QAM_256; break;
+		case 0x06: p->modulation = VSB_8; break;
+		case 0x43: p->modulation = QAM_64; break;
+		case 0x45: p->modulation = QAM_256; break;
 		default:
 			if (retry--) goto start;
 			printk(KERN_WARNING "or51132: unknown status 0x%02x\n",
@@ -400,10 +400,10 @@ start:
 	}
 
 	/* FIXME: Read frequency from frontend, take AFC into account */
-	param->frequency = state->current_frequency;
+	p->frequency = state->current_frequency;
 
 	/* FIXME: How to read inversion setting? Receiver 6 register? */
-	param->inversion = INVERSION_AUTO;
+	p->inversion = INVERSION_AUTO;
 
 	return 0;
 }
@@ -579,7 +579,7 @@ struct dvb_frontend* or51132_attach(const struct or51132_config* config,
 }
 
 static struct dvb_frontend_ops or51132_ops = {
-
+	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name			= "Oren OR51132 VSB/QAM Frontend",
 		.type			= FE_ATSC,
@@ -597,8 +597,8 @@ static struct dvb_frontend_ops or51132_ops = {
 	.init = or51132_init,
 	.sleep = or51132_sleep,
 
-	.set_frontend_legacy = or51132_set_parameters,
-	.get_frontend_legacy = or51132_get_parameters,
+	.set_frontend = or51132_set_parameters,
+	.get_frontend = or51132_get_parameters,
 	.get_tune_settings = or51132_get_tune_settings,
 
 	.read_status = or51132_read_status,
Signature · 1 line
1.7.8.352.g876a6
#84 lore raw

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

In reply to Mauro Carvalho Chehab

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
#87 lore raw

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

In reply to Mauro Carvalho Chehab

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
#6 lore raw

RFC PATCH 6/91 au8522_dig: 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/dvb/frontends/au8522_dig.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
drivers/media/dvb/frontends/au8522_dig.c +13 -13
index 327d6fe..027d45d 100644
@@ -576,19 +576,19 @@ static int au8522_enable_modulation(struct dvb_frontend *fe,
 }
 
 /* Talk to the demod, set the FEC, GUARD, QAM settings etc */
-static int au8522_set_frontend(struct dvb_frontend *fe,
-			       struct dvb_frontend_parameters *p)
+static int au8522_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct au8522_state *state = fe->demodulator_priv;
 	int ret = -EINVAL;
 
-	dprintk("%s(frequency=%d)\n", __func__, p->frequency);
+	dprintk("%s(frequency=%d)\n", __func__, c->frequency);
 
-	if ((state->current_frequency == p->frequency) &&
-	    (state->current_modulation == p->u.vsb.modulation))
+	if ((state->current_frequency == c->frequency) &&
+	    (state->current_modulation == c->modulation))
 		return 0;
 
-	au8522_enable_modulation(fe, p->u.vsb.modulation);
+	au8522_enable_modulation(fe, c->modulation);
 
 	/* Allow the demod to settle */
 	msleep(100);
@@ -604,7 +604,7 @@ static int au8522_set_frontend(struct dvb_frontend *fe,
 	if (ret < 0)
 		return ret;
 
-	state->current_frequency = p->frequency;
+	state->current_frequency = c->frequency;
 
 	return 0;
 }
@@ -912,12 +912,12 @@ static int au8522_read_ber(struct dvb_frontend *fe, u32 *ber)
 }
 
 static int au8522_get_frontend(struct dvb_frontend *fe,
-				struct dvb_frontend_parameters *p)
+			       struct dtv_frontend_properties *c)
 {
 	struct au8522_state *state = fe->demodulator_priv;
 
-	p->frequency = state->current_frequency;
-	p->u.vsb.modulation = state->current_modulation;
+	c->frequency = state->current_frequency;
+	c->modulation = state->current_modulation;
 
 	return 0;
 }
@@ -1010,7 +1010,7 @@ error:
 EXPORT_SYMBOL(au8522_attach);
 
 static struct dvb_frontend_ops au8522_ops = {
-
+	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name			= "Auvitek AU8522 QAM/8VSB Frontend",
 		.type			= FE_ATSC,
@@ -1023,8 +1023,8 @@ static struct dvb_frontend_ops au8522_ops = {
 	.init                 = au8522_init,
 	.sleep                = au8522_sleep,
 	.i2c_gate_ctrl        = au8522_i2c_gate_ctrl,
-	.set_frontend_legacy         = au8522_set_frontend,
-	.get_frontend_legacy = au8522_get_frontend,
+	.set_frontend         = au8522_set_frontend,
+	.get_frontend         = au8522_get_frontend,
 	.get_tune_settings    = au8522_get_tune_settings,
 	.read_status          = au8522_read_status,
 	.read_ber             = au8522_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#11 lore raw

RFC PATCH 11/91 cx24116: report delivery system and cleanups

In reply to Mauro Carvalho Chehab

This is one of the first drivers using DVBv5. It relies only on DVBv5 way, but still it contains some stub for unused methods. Remove them, add the delivery system and do some trivial cleanups.

---
 drivers/media/dvb/frontends/cx24116.c |   33 ++++++++++++---------------------
 1 files changed, 12 insertions(+), 21 deletions(-)
drivers/media/dvb/frontends/cx24116.c +12 -21
index 445ae88..f24819a 100644
@@ -1212,25 +1212,10 @@ static int cx24116_sleep(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int cx24116_set_property(struct dvb_frontend *fe,
-	struct dtv_property *tvp)
-{
-	dprintk("%s(..)\n", __func__);
-	return 0;
-}
-
-static int cx24116_get_property(struct dvb_frontend *fe,
-	struct dtv_property *tvp)
-{
-	dprintk("%s(..)\n", __func__);
-	return 0;
-}
-
 /* dvb-core told us to tune, the tv property cache will be complete,
  * it's safe for is to pull values and use them for tuning purposes.
  */
-static int cx24116_set_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static int cx24116_set_frontend(struct dvb_frontend *fe)
 {
 	struct cx24116_state *state = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -1458,9 +1443,17 @@ tuned:  /* Set/Reset B/W */
 static int cx24116_tune(struct dvb_frontend *fe, struct dvb_frontend_parameters *params,
 	unsigned int mode_flags, unsigned int *delay, fe_status_t *status)
 {
+	/*
+	 * It is safe to discard "params" here, as the DVB core will sync
+	 * fe->dtv_property_cache with fepriv->parameters_in, where the
+	 * DVBv3 params are stored. The only practical usage for it indicate
+	 * that re-tuning is needed, e. g. (fepriv->state & FESTATE_RETUNE) is
+	 * true.
+	 */
+
 	*delay = HZ / 5;
 	if (params) {
-		int ret = cx24116_set_frontend(fe, params);
+		int ret = cx24116_set_frontend(fe);
 		if (ret)
 			return ret;
 	}
@@ -1473,7 +1466,7 @@ static int cx24116_get_algo(struct dvb_frontend *fe)
 }
 
 static struct dvb_frontend_ops cx24116_ops = {
-
+	.delsys = { SYS_DVBS, SYS_DVBS2 },
 	.info = {
 		.name = "Conexant CX24116/CX24118",
 		.type = FE_QPSK,
@@ -1507,9 +1500,7 @@ static struct dvb_frontend_ops cx24116_ops = {
 	.get_frontend_algo = cx24116_get_algo,
 	.tune = cx24116_tune,
 
-	.set_property = cx24116_set_property,
-	.get_property = cx24116_get_property,
-	.set_frontend_legacy = cx24116_set_frontend,
+	.set_frontend = cx24116_set_frontend,
 };
 
 MODULE_DESCRIPTION("DVB Frontend module for Conexant cx24116/cx24118 hardware");
Signature · 1 line
1.7.8.352.g876a6
#32 lore raw

RFC PATCH 32/91 lgs8gl5: 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/dvb/frontends/lgs8gl5.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)
drivers/media/dvb/frontends/lgs8gl5.c +14 -14
index f4e82a6..0f4bc16 100644
@@ -311,14 +311,14 @@ lgs8gl5_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
 
 
 static int
-lgs8gl5_set_frontend(struct dvb_frontend *fe,
-		struct dvb_frontend_parameters *p)
+lgs8gl5_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct lgs8gl5_state *state = fe->demodulator_priv;
 
 	dprintk("%s\n", __func__);
 
-	if (p->u.ofdm.bandwidth != BANDWIDTH_8_MHZ)
+	if (p->bandwidth_hz != 8000000)
 		return -EINVAL;
 
 	if (fe->ops.tuner_ops.set_params) {
@@ -337,21 +337,20 @@ lgs8gl5_set_frontend(struct dvb_frontend *fe,
 
 static int
 lgs8gl5_get_frontend(struct dvb_frontend *fe,
-		struct dvb_frontend_parameters *p)
+		struct dtv_frontend_properties *p)
 {
 	struct lgs8gl5_state *state = fe->demodulator_priv;
 	u8 inv = lgs8gl5_read_reg(state, REG_INVERSION);
-	struct dvb_ofdm_parameters *o = &p->u.ofdm;
 
 	p->inversion = (inv & REG_INVERSION_ON) ? INVERSION_ON : INVERSION_OFF;
 
-	o->code_rate_HP = FEC_1_2;
-	o->code_rate_LP = FEC_7_8;
-	o->guard_interval = GUARD_INTERVAL_1_32;
-	o->transmission_mode = TRANSMISSION_MODE_2K;
-	o->constellation = QAM_64;
-	o->hierarchy_information = HIERARCHY_NONE;
-	o->bandwidth = BANDWIDTH_8_MHZ;
+	p->code_rate_HP = FEC_1_2;
+	p->code_rate_LP = FEC_7_8;
+	p->guard_interval = GUARD_INTERVAL_1_32;
+	p->transmission_mode = TRANSMISSION_MODE_2K;
+	p->modulation = QAM_64;
+	p->hierarchy = HIERARCHY_NONE;
+	p->bandwidth_hz = 8000000;
 
 	return 0;
 }
@@ -413,6 +412,7 @@ EXPORT_SYMBOL(lgs8gl5_attach);
 
 
 static struct dvb_frontend_ops lgs8gl5_ops = {
+	.delsys = { SYS_DMBTH },
 	.info = {
 		.name			= "Legend Silicon LGS-8GL5 DMB-TH",
 		.type			= FE_OFDM,
@@ -434,8 +434,8 @@ static struct dvb_frontend_ops lgs8gl5_ops = {
 
 	.init = lgs8gl5_init,
 
-	.set_frontend_legacy = lgs8gl5_set_frontend,
-	.get_frontend_legacy = lgs8gl5_get_frontend,
+	.set_frontend = lgs8gl5_set_frontend,
+	.get_frontend = lgs8gl5_get_frontend,
 	.get_tune_settings = lgs8gl5_get_tune_settings,
 
 	.read_status = lgs8gl5_read_status,
Signature · 1 line
1.7.8.352.g876a6
#68 lore raw

RFC PATCH 68/91 vez1820: 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/dvb/frontends/ves1820.c |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)
drivers/media/dvb/frontends/ves1820.c +12 -11
index 7961231..ef1b5fe 100644
@@ -205,15 +205,16 @@ static int ves1820_init(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int ves1820_set_parameters(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ves1820_state* state = fe->demodulator_priv;
 	static const u8 reg0x00[] = { 0x00, 0x04, 0x08, 0x0c, 0x10 };
 	static const u8 reg0x01[] = { 140, 140, 106, 100, 92 };
 	static const u8 reg0x05[] = { 135, 100, 70, 54, 38 };
 	static const u8 reg0x08[] = { 162, 116, 67, 52, 35 };
 	static const u8 reg0x09[] = { 145, 150, 106, 126, 107 };
-	int real_qam = p->u.qam.modulation - QAM_16;
+	int real_qam = p->modulation - QAM_16;
 
 	if (real_qam < 0 || real_qam > 4)
 		return -EINVAL;
@@ -223,7 +224,7 @@ static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_p
 		if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
 	}
 
-	ves1820_set_symbolrate(state, p->u.qam.symbol_rate);
+	ves1820_set_symbolrate(state, p->symbol_rate);
 	ves1820_writereg(state, 0x34, state->pwm);
 
 	ves1820_writereg(state, 0x01, reg0x01[real_qam]);
@@ -309,7 +310,7 @@ static int ves1820_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int ves1820_get_frontend(struct dvb_frontend* fe, struct dtv_frontend_properties *p)
 {
 	struct ves1820_state* state = fe->demodulator_priv;
 	int sync;
@@ -320,7 +321,7 @@ static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 	if (verbose) {
 		/* AFC only valid when carrier has been recovered */
 		printk(sync & 2 ? "ves1820: AFC (%d) %dHz\n" :
-			"ves1820: [AFC (%d) %dHz]\n", afc, -((s32) p->u.qam.symbol_rate * afc) >> 10);
+			"ves1820: [AFC (%d) %dHz]\n", afc, -((s32) p->symbol_rate * afc) >> 10);
 	}
 
 	if (!state->config->invert) {
@@ -329,13 +330,13 @@ static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 		p->inversion = (!(state->reg0 & 0x20)) ? INVERSION_ON : INVERSION_OFF;
 	}
 
-	p->u.qam.modulation = ((state->reg0 >> 2) & 7) + QAM_16;
+	p->modulation = ((state->reg0 >> 2) & 7) + QAM_16;
 
-	p->u.qam.fec_inner = FEC_NONE;
+	p->fec_inner = FEC_NONE;
 
 	p->frequency = ((p->frequency + 31250) / 62500) * 62500;
 	if (sync & 2)
-		p->frequency -= ((s32) p->u.qam.symbol_rate * afc) >> 10;
+		p->frequency -= ((s32) p->symbol_rate * afc) >> 10;
 
 	return 0;
 }
@@ -405,7 +406,7 @@ error:
 }
 
 static struct dvb_frontend_ops ves1820_ops = {
-
+	.delsys = { SYS_DVBC_ANNEX_A },
 	.info = {
 		.name = "VLSI VES1820 DVB-C",
 		.type = FE_QAM,
@@ -425,8 +426,8 @@ static struct dvb_frontend_ops ves1820_ops = {
 	.init = ves1820_init,
 	.sleep = ves1820_sleep,
 
-	.set_frontend_legacy = ves1820_set_parameters,
-	.get_frontend_legacy = ves1820_get_frontend,
+	.set_frontend = ves1820_set_parameters,
+	.get_frontend = ves1820_get_frontend,
 	.get_tune_settings = ves1820_get_tune_settings,
 
 	.read_status = ves1820_read_status,
Signature · 1 line
1.7.8.352.g876a6
#70 lore raw

RFC PATCH 70/91 dst: 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/dvb/bt8xx/dst.c |   63 +++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 31 deletions(-)
drivers/media/dvb/bt8xx/dst.c +32 -31
index 6afc083..7d60893 100644
@@ -386,7 +386,7 @@ static int dst_set_freq(struct dst_state *state, u32 freq)
 	return 0;
 }
 
-static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth)
+static int dst_set_bandwidth(struct dst_state *state, u32 bandwidth)
 {
 	state->bandwidth = bandwidth;
 
@@ -394,7 +394,7 @@ static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth)
 		return -EOPNOTSUPP;
 
 	switch (bandwidth) {
-	case BANDWIDTH_6_MHZ:
+	case 6000000:
 		if (state->dst_hw_cap & DST_TYPE_HAS_CA)
 			state->tx_tuna[7] = 0x06;
 		else {
@@ -402,7 +402,7 @@ static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth)
 			state->tx_tuna[7] = 0x00;
 		}
 		break;
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		if (state->dst_hw_cap & DST_TYPE_HAS_CA)
 			state->tx_tuna[7] = 0x07;
 		else {
@@ -410,7 +410,7 @@ static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth)
 			state->tx_tuna[7] = 0x00;
 		}
 		break;
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
 		if (state->dst_hw_cap & DST_TYPE_HAS_CA)
 			state->tx_tuna[7] = 0x08;
 		else {
@@ -1561,7 +1561,7 @@ static int dst_init(struct dvb_frontend *fe)
 	state->tone = SEC_TONE_OFF;
 	state->diseq_flags = 0;
 	state->k22 = 0x02;
-	state->bandwidth = BANDWIDTH_7_MHZ;
+	state->bandwidth = 7000000;
 	state->cur_jiff = jiffies;
 	if (state->dst_type == DST_TYPE_IS_SAT)
 		memcpy(state->tx_tuna, ((state->type_flags & DST_TYPE_HAS_VLF) ? sat_tuna_188 : sat_tuna_204), sizeof (sat_tuna_204));
@@ -1609,8 +1609,9 @@ static int dst_read_snr(struct dvb_frontend *fe, u16 *snr)
 	return retval;
 }
 
-static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
+static int dst_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	int retval = -EINVAL;
 	struct dst_state *state = fe->demodulator_priv;
 
@@ -1623,17 +1624,17 @@ static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet
 		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);
 		}
 		retval = dst_write_tuna(fe);
 	}
@@ -1683,7 +1684,7 @@ 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 dvb_frontend_parameters *p)
+static int dst_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
 {
 	struct dst_state *state = fe->demodulator_priv;
 
@@ -1691,14 +1692,14 @@ static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet
 	if (state->dst_type == DST_TYPE_IS_SAT) {
 		if (state->type_flags & DST_TYPE_HAS_OBS_REGS)
 			p->inversion = state->inversion;
-		p->u.qpsk.symbol_rate = state->symbol_rate;
-		p->u.qpsk.fec_inner = dst_get_fec(state);
+		p->symbol_rate = state->symbol_rate;
+		p->fec_inner = dst_get_fec(state);
 	} else if (state->dst_type == DST_TYPE_IS_TERR) {
-		p->u.ofdm.bandwidth = state->bandwidth;
+		p->bandwidth_hz = state->bandwidth;
 	} else if (state->dst_type == DST_TYPE_IS_CABLE) {
-		p->u.qam.symbol_rate = state->symbol_rate;
-		p->u.qam.fec_inner = dst_get_fec(state);
-		p->u.qam.modulation = dst_get_modulation(state);
+		p->symbol_rate = state->symbol_rate;
+		p->fec_inner = dst_get_fec(state);
+		p->modulation = dst_get_modulation(state);
 	}
 
 	return 0;
@@ -1756,7 +1757,7 @@ struct dst_state *dst_attach(struct dst_state *state, struct dvb_adapter *dvb_ad
 EXPORT_SYMBOL(dst_attach);
 
 static struct dvb_frontend_ops dst_dvbt_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "DST DVB-T",
 		.type = FE_OFDM,
@@ -1777,8 +1778,8 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
 	.release = dst_release,
 	.init = dst_init,
 	.tune = dst_tune_frontend,
-	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend_legacy = dst_get_frontend,
+	.set_frontend = dst_set_frontend,
+	.get_frontend = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1786,7 +1787,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
 };
 
 static struct dvb_frontend_ops dst_dvbs_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name = "DST DVB-S",
 		.type = FE_QPSK,
@@ -1803,8 +1804,8 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
 	.release = dst_release,
 	.init = dst_init,
 	.tune = dst_tune_frontend,
-	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend_legacy = dst_get_frontend,
+	.set_frontend = dst_set_frontend,
+	.get_frontend = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1816,7 +1817,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
 };
 
 static struct dvb_frontend_ops dst_dvbc_ops = {
-
+	.delsys = { SYS_DVBC_ANNEX_A },
 	.info = {
 		.name = "DST DVB-C",
 		.type = FE_QAM,
@@ -1837,8 +1838,8 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
 	.release = dst_release,
 	.init = dst_init,
 	.tune = dst_tune_frontend,
-	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend_legacy = dst_get_frontend,
+	.set_frontend = dst_set_frontend,
+	.get_frontend = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
@@ -1860,8 +1861,8 @@ static struct dvb_frontend_ops dst_atsc_ops = {
 	.release = dst_release,
 	.init = dst_init,
 	.tune = dst_tune_frontend,
-	.set_frontend_legacy = dst_set_frontend,
-	.get_frontend_legacy = dst_get_frontend,
+	.set_frontend = dst_set_frontend,
+	.get_frontend = dst_get_frontend,
 	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
Signature · 1 line
1.7.8.352.g876a6
#71 lore raw

RFC PATCH 71/91 af9005-fe: convert set_fontend to use DVBv5 parameters

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/dvb-usb/af9005-fe.c |  101 +++++++++++++++++----------------
 1 files changed, 51 insertions(+), 50 deletions(-)
drivers/media/dvb/dvb-usb/af9005-fe.c +51 -50
index e9addd8..6c1ef61 100644
@@ -303,7 +303,7 @@ static int af9005_get_pre_vit_err_bit_count(struct dvb_frontend *fe,
 		return -EINVAL;
 	}
 
-	/* read constellation mode */
+	/* read modulation mode */
 	ret =
 	    af9005_read_register_bits(state->d, xd_g_reg_tpsd_const,
 				      reg_tpsd_const_pos, reg_tpsd_const_len,
@@ -321,7 +321,7 @@ static int af9005_get_pre_vit_err_bit_count(struct dvb_frontend *fe,
 		bits = 6;
 		break;
 	default:
-		err("invalid constellation mode");
+		err("invalid modulation mode");
 		return -EINVAL;
 	}
 	*pre_bit_count = super_frame_count * 68 * 4 * x * bits;
@@ -533,13 +533,13 @@ static int af9005_fe_read_signal_strength(struct dvb_frontend *fe,
 
 static int af9005_fe_read_snr(struct dvb_frontend *fe, u16 * snr)
 {
-	/* the snr can be derived from the ber and the constellation
+	/* the snr can be derived from the ber and the modulation
 	   but I don't think this kind of complex calculations belong
 	   in the driver. I may be wrong.... */
 	return -ENOSYS;
 }
 
-static int af9005_fe_program_cfoe(struct dvb_usb_device *d, fe_bandwidth_t bw)
+static int af9005_fe_program_cfoe(struct dvb_usb_device *d, u32 bw)
 {
 	u8 temp0, temp1, temp2, temp3, buf[4];
 	int ret;
@@ -551,7 +551,7 @@ static int af9005_fe_program_cfoe(struct dvb_usb_device *d, fe_bandwidth_t bw)
 	u32 NS_coeff2_8k;
 
 	switch (bw) {
-	case BANDWIDTH_6_MHZ:
+	case 6000000:
 		NS_coeff1_2048Nu = 0x2ADB6DC;
 		NS_coeff1_8191Nu = 0xAB7313;
 		NS_coeff1_8192Nu = 0xAB6DB7;
@@ -560,7 +560,7 @@ static int af9005_fe_program_cfoe(struct dvb_usb_device *d, fe_bandwidth_t bw)
 		NS_coeff2_8k = 0x55B6DC;
 		break;
 
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		NS_coeff1_2048Nu = 0x3200001;
 		NS_coeff1_8191Nu = 0xC80640;
 		NS_coeff1_8192Nu = 0xC80000;
@@ -569,7 +569,7 @@ static int af9005_fe_program_cfoe(struct dvb_usb_device *d, fe_bandwidth_t bw)
 		NS_coeff2_8k = 0x640000;
 		break;
 
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
 		NS_coeff1_2048Nu = 0x3924926;
 		NS_coeff1_8191Nu = 0xE4996E;
 		NS_coeff1_8192Nu = 0xE49249;
@@ -773,17 +773,17 @@ static int af9005_fe_program_cfoe(struct dvb_usb_device *d, fe_bandwidth_t bw)
 
 }
 
-static int af9005_fe_select_bw(struct dvb_usb_device *d, fe_bandwidth_t bw)
+static int af9005_fe_select_bw(struct dvb_usb_device *d, u32 bw)
 {
 	u8 temp;
 	switch (bw) {
-	case BANDWIDTH_6_MHZ:
+	case 6000000:
 		temp = 0;
 		break;
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		temp = 1;
 		break;
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
 		temp = 2;
 		break;
 	default:
@@ -930,10 +930,10 @@ static int af9005_fe_init(struct dvb_frontend *fe)
 
 	/* init other parameters: program cfoe and select bandwidth */
 	deb_info("program cfoe\n");
-	if ((ret = af9005_fe_program_cfoe(state->d, BANDWIDTH_6_MHZ)))
+	if ((ret = af9005_fe_program_cfoe(state->d, 6000000)))
 		return ret;
-	/* set read-update bit for constellation */
-	deb_info("set read-update bit for constellation\n");
+	/* set read-update bit for modulation */
+	deb_info("set read-update bit for modulation\n");
 	if ((ret =
 	     af9005_write_register_bits(state->d, xd_p_reg_feq_read_update,
 					reg_feq_read_update_pos,
@@ -943,8 +943,8 @@ static int af9005_fe_init(struct dvb_frontend *fe)
 	/* sample code has a set MPEG TS code here
 	   but sniffing reveals that it doesn't do it */
 
-	/* set read-update bit to 1 for DCA constellation */
-	deb_info("set read-update bit 1 for DCA constellation\n");
+	/* set read-update bit to 1 for DCA modulation */
+	deb_info("set read-update bit 1 for DCA modulation\n");
 	if ((ret =
 	     af9005_write_register_bits(state->d, xd_p_reg_dca_read_update,
 					reg_dca_read_update_pos,
@@ -1099,15 +1099,15 @@ static int af9005_ts_bus_ctrl(struct dvb_frontend *fe, int acquire)
 	return 0;
 }
 
-static int af9005_fe_set_frontend(struct dvb_frontend *fe,
-				  struct dvb_frontend_parameters *fep)
+static int af9005_fe_set_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, temp0, temp1, temp2;
 
 	deb_info("af9005_fe_set_frontend freq %d bw %d\n", fep->frequency,
-		 fep->u.ofdm.bandwidth);
+		 fep->bandwidth_hz);
 	if (fe->ops.tuner_ops.release == NULL) {
 		err("Tuner not attached");
 		return -ENODEV;
@@ -1167,10 +1167,10 @@ static int af9005_fe_set_frontend(struct dvb_frontend *fe,
 
 	/* select bandwidth */
 	deb_info("select bandwidth");
-	ret = af9005_fe_select_bw(state->d, fep->u.ofdm.bandwidth);
+	ret = af9005_fe_select_bw(state->d, fep->bandwidth_hz);
 	if (ret)
 		return ret;
-	ret = af9005_fe_program_cfoe(state->d, fep->u.ofdm.bandwidth);
+	ret = af9005_fe_program_cfoe(state->d, fep->bandwidth_hz);
 	if (ret)
 		return ret;
 
@@ -1226,7 +1226,7 @@ static int af9005_fe_set_frontend(struct dvb_frontend *fe,
 }
 
 static int af9005_fe_get_frontend(struct dvb_frontend *fe,
-				  struct dvb_frontend_parameters *fep)
+				  struct dtv_frontend_properties *fep)
 {
 	struct af9005_fe_state *state = fe->demodulator_priv;
 	int ret;
@@ -1243,15 +1243,15 @@ static int af9005_fe_get_frontend(struct dvb_frontend *fe,
 	deb_info("CONSTELLATION ");
 	switch (temp) {
 	case 0:
-		fep->u.ofdm.constellation = QPSK;
+		fep->modulation = QPSK;
 		deb_info("QPSK\n");
 		break;
 	case 1:
-		fep->u.ofdm.constellation = QAM_16;
+		fep->modulation = QAM_16;
 		deb_info("QAM_16\n");
 		break;
 	case 2:
-		fep->u.ofdm.constellation = QAM_64;
+		fep->modulation = QAM_64;
 		deb_info("QAM_64\n");
 		break;
 	}
@@ -1266,19 +1266,19 @@ static int af9005_fe_get_frontend(struct dvb_frontend *fe,
 	deb_info("HIERARCHY ");
 	switch (temp) {
 	case 0:
-		fep->u.ofdm.hierarchy_information = HIERARCHY_NONE;
+		fep->hierarchy = HIERARCHY_NONE;
 		deb_info("NONE\n");
 		break;
 	case 1:
-		fep->u.ofdm.hierarchy_information = HIERARCHY_1;
+		fep->hierarchy = HIERARCHY_1;
 		deb_info("1\n");
 		break;
 	case 2:
-		fep->u.ofdm.hierarchy_information = HIERARCHY_2;
+		fep->hierarchy = HIERARCHY_2;
 		deb_info("2\n");
 		break;
 	case 3:
-		fep->u.ofdm.hierarchy_information = HIERARCHY_4;
+		fep->hierarchy = HIERARCHY_4;
 		deb_info("4\n");
 		break;
 	}
@@ -1302,23 +1302,23 @@ static int af9005_fe_get_frontend(struct dvb_frontend *fe,
 	deb_info("CODERATE HP ");
 	switch (temp) {
 	case 0:
-		fep->u.ofdm.code_rate_HP = FEC_1_2;
+		fep->code_rate_HP = FEC_1_2;
 		deb_info("FEC_1_2\n");
 		break;
 	case 1:
-		fep->u.ofdm.code_rate_HP = FEC_2_3;
+		fep->code_rate_HP = FEC_2_3;
 		deb_info("FEC_2_3\n");
 		break;
 	case 2:
-		fep->u.ofdm.code_rate_HP = FEC_3_4;
+		fep->code_rate_HP = FEC_3_4;
 		deb_info("FEC_3_4\n");
 		break;
 	case 3:
-		fep->u.ofdm.code_rate_HP = FEC_5_6;
+		fep->code_rate_HP = FEC_5_6;
 		deb_info("FEC_5_6\n");
 		break;
 	case 4:
-		fep->u.ofdm.code_rate_HP = FEC_7_8;
+		fep->code_rate_HP = FEC_7_8;
 		deb_info("FEC_7_8\n");
 		break;
 	}
@@ -1333,23 +1333,23 @@ static int af9005_fe_get_frontend(struct dvb_frontend *fe,
 	deb_info("CODERATE LP ");
 	switch (temp) {
 	case 0:
-		fep->u.ofdm.code_rate_LP = FEC_1_2;
+		fep->code_rate_LP = FEC_1_2;
 		deb_info("FEC_1_2\n");
 		break;
 	case 1:
-		fep->u.ofdm.code_rate_LP = FEC_2_3;
+		fep->code_rate_LP = FEC_2_3;
 		deb_info("FEC_2_3\n");
 		break;
 	case 2:
-		fep->u.ofdm.code_rate_LP = FEC_3_4;
+		fep->code_rate_LP = FEC_3_4;
 		deb_info("FEC_3_4\n");
 		break;
 	case 3:
-		fep->u.ofdm.code_rate_LP = FEC_5_6;
+		fep->code_rate_LP = FEC_5_6;
 		deb_info("FEC_5_6\n");
 		break;
 	case 4:
-		fep->u.ofdm.code_rate_LP = FEC_7_8;
+		fep->code_rate_LP = FEC_7_8;
 		deb_info("FEC_7_8\n");
 		break;
 	}
@@ -1363,19 +1363,19 @@ static int af9005_fe_get_frontend(struct dvb_frontend *fe,
 	deb_info("GUARD INTERVAL ");
 	switch (temp) {
 	case 0:
-		fep->u.ofdm.guard_interval = GUARD_INTERVAL_1_32;
+		fep->guard_interval = GUARD_INTERVAL_1_32;
 		deb_info("1_32\n");
 		break;
 	case 1:
-		fep->u.ofdm.guard_interval = GUARD_INTERVAL_1_16;
+		fep->guard_interval = GUARD_INTERVAL_1_16;
 		deb_info("1_16\n");
 		break;
 	case 2:
-		fep->u.ofdm.guard_interval = GUARD_INTERVAL_1_8;
+		fep->guard_interval = GUARD_INTERVAL_1_8;
 		deb_info("1_8\n");
 		break;
 	case 3:
-		fep->u.ofdm.guard_interval = GUARD_INTERVAL_1_4;
+		fep->guard_interval = GUARD_INTERVAL_1_4;
 		deb_info("1_4\n");
 		break;
 	}
@@ -1390,11 +1390,11 @@ static int af9005_fe_get_frontend(struct dvb_frontend *fe,
 	deb_info("TRANSMISSION MODE ");
 	switch (temp) {
 	case 0:
-		fep->u.ofdm.transmission_mode = TRANSMISSION_MODE_2K;
+		fep->transmission_mode = TRANSMISSION_MODE_2K;
 		deb_info("2K\n");
 		break;
 	case 1:
-		fep->u.ofdm.transmission_mode = TRANSMISSION_MODE_8K;
+		fep->transmission_mode = TRANSMISSION_MODE_8K;
 		deb_info("8K\n");
 		break;
 	}
@@ -1406,15 +1406,15 @@ static int af9005_fe_get_frontend(struct dvb_frontend *fe,
 	deb_info("BANDWIDTH ");
 	switch (temp) {
 	case 0:
-		fep->u.ofdm.bandwidth = BANDWIDTH_6_MHZ;
+		fep->bandwidth_hz = 6000000;
 		deb_info("6\n");
 		break;
 	case 1:
-		fep->u.ofdm.bandwidth = BANDWIDTH_7_MHZ;
+		fep->bandwidth_hz = 7000000;
 		deb_info("7\n");
 		break;
 	case 2:
-		fep->u.ofdm.bandwidth = BANDWIDTH_8_MHZ;
+		fep->bandwidth_hz = 8000000;
 		deb_info("8\n");
 		break;
 	}
@@ -1454,6 +1454,7 @@ struct dvb_frontend *af9005_fe_attach(struct dvb_usb_device *d)
 }
 
 static struct dvb_frontend_ops af9005_fe_ops = {
+	.delsys = { SYS_DVBT },
 	.info = {
 		 .name = "AF9005 USB DVB-T",
 		 .type = FE_OFDM,
@@ -1475,8 +1476,8 @@ static struct dvb_frontend_ops af9005_fe_ops = {
 	.sleep = af9005_fe_sleep,
 	.ts_bus_ctrl = af9005_ts_bus_ctrl,
 
-	.set_frontend_legacy = af9005_fe_set_frontend,
-	.get_frontend_legacy = af9005_fe_get_frontend,
+	.set_frontend = af9005_fe_set_frontend,
+	.get_frontend = af9005_fe_get_frontend,
 
 	.read_status = af9005_fe_read_status,
 	.read_ber = af9005_fe_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#81 lore raw

RFC PATCH 81/91 ttusb-dec: 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/dvb/ttusb-dec/ttusbdecfe.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
drivers/media/dvb/ttusb-dec/ttusbdecfe.c +9 -7
index 20a1410..96e2fdb 100644
@@ -87,8 +87,9 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
 	return 0;
 }
 
-static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv;
 	u8 b[] = { 0x00, 0x00, 0x00, 0x03,
 		   0x00, 0x00, 0x00, 0x00,
@@ -113,8 +114,9 @@ static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
 		return 0;
 }
 
-static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv;
 
 	u8 b[] = { 0x00, 0x00, 0x00, 0x01,
@@ -135,7 +137,7 @@ static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend* fe, struct dvb_fron
 	freq = htonl(p->frequency +
 	       (state->hi_band ? LOF_HI : LOF_LO));
 	memcpy(&b[4], &freq, sizeof(u32));
-	sym_rate = htonl(p->u.qam.symbol_rate);
+	sym_rate = htonl(p->symbol_rate);
 	memcpy(&b[12], &sym_rate, sizeof(u32));
 	band = htonl(state->hi_band ? LOF_HI : LOF_LO);
 	memcpy(&b[24], &band, sizeof(u32));
@@ -241,7 +243,7 @@ struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* conf
 }
 
 static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "TechnoTrend/Hauppauge DEC2000-t Frontend",
 		.type			= FE_OFDM,
@@ -257,7 +259,7 @@ static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = {
 
 	.release = ttusbdecfe_release,
 
-	.set_frontend_legacy = ttusbdecfe_dvbt_set_frontend,
+	.set_frontend = ttusbdecfe_dvbt_set_frontend,
 
 	.get_tune_settings = ttusbdecfe_dvbt_get_tune_settings,
 
@@ -265,7 +267,7 @@ static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = {
 };
 
 static struct dvb_frontend_ops ttusbdecfe_dvbs_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "TechnoTrend/Hauppauge DEC3000-s Frontend",
 		.type			= FE_QPSK,
@@ -281,7 +283,7 @@ static struct dvb_frontend_ops ttusbdecfe_dvbs_ops = {
 
 	.release = ttusbdecfe_release,
 
-	.set_frontend_legacy = ttusbdecfe_dvbs_set_frontend,
+	.set_frontend = ttusbdecfe_dvbs_set_frontend,
 
 	.read_status = ttusbdecfe_dvbs_read_status,
 
Signature · 1 line
1.7.8.352.g876a6
#7 lore raw

RFC PATCH 7/91 bcm3510: 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/dvb/frontends/bcm3510.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
drivers/media/dvb/frontends/bcm3510.c +11 -8
index 43b17fa..a53f83a 100644
@@ -479,16 +479,16 @@ static int bcm3510_set_freq(struct bcm3510_state* st,u32 freq)
 	return -EINVAL;
 }
 
-static int bcm3510_set_frontend(struct dvb_frontend* fe,
-					     struct dvb_frontend_parameters *p)
+static int bcm3510_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct bcm3510_state* st = fe->demodulator_priv;
 	struct bcm3510_hab_cmd_ext_acquire cmd;
 	struct bcm3510_hab_cmd_bert_control bert;
 	int ret;
 
 	memset(&cmd,0,sizeof(cmd));
-	switch (p->u.vsb.modulation) {
+	switch (c->modulation) {
 		case QAM_256:
 			cmd.ACQUIRE0.MODE = 0x1;
 			cmd.ACQUIRE1.SYM_RATE = 0x1;
@@ -499,7 +499,8 @@ static int bcm3510_set_frontend(struct dvb_frontend* fe,
 			cmd.ACQUIRE1.SYM_RATE = 0x2;
 			cmd.ACQUIRE1.IF_FREQ = 0x1;
 			break;
-/*		case QAM_256:
+#if 0
+		case QAM_256:
 			cmd.ACQUIRE0.MODE = 0x3;
 			break;
 		case QAM_128:
@@ -513,7 +514,8 @@ static int bcm3510_set_frontend(struct dvb_frontend* fe,
 			break;
 		case QAM_16:
 			cmd.ACQUIRE0.MODE = 0x7;
-			break;*/
+			break;
+#endif
 		case VSB_8:
 			cmd.ACQUIRE0.MODE = 0x8;
 			cmd.ACQUIRE1.SYM_RATE = 0x0;
@@ -552,7 +554,8 @@ static int bcm3510_set_frontend(struct dvb_frontend* fe,
 
 	bcm3510_bert_reset(st);
 
-	if ((ret = bcm3510_set_freq(st,p->frequency)) < 0)
+	ret = bcm3510_set_freq(st, c->frequency);
+	if (ret < 0)
 		return ret;
 
 	memset(&st->status1,0,sizeof(st->status1));
@@ -819,7 +822,7 @@ error:
 EXPORT_SYMBOL(bcm3510_attach);
 
 static struct dvb_frontend_ops bcm3510_ops = {
-
+	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name = "Broadcom BCM3510 VSB/QAM frontend",
 		.type = FE_ATSC,
@@ -839,7 +842,7 @@ static struct dvb_frontend_ops bcm3510_ops = {
 	.init = bcm3510_init,
 	.sleep = bcm3510_sleep,
 
-	.set_frontend_legacy = bcm3510_set_frontend,
+	.set_frontend = bcm3510_set_frontend,
 	.get_tune_settings = bcm3510_get_tune_settings,
 
 	.read_status = bcm3510_read_status,
Signature · 1 line
1.7.8.352.g876a6
#28 lore raw

RFC PATCH 28/91 dvb_dummy_fe: 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/dvb/frontends/dvb_dummy_fe.c |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)
drivers/media/dvb/frontends/dvb_dummy_fe.c +12 -11
index 31e1dd6..b5e2a70 100644
@@ -68,12 +68,13 @@ 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 dvb_frontend_parameters *p)
+static int dvb_dummy_fe_get_frontend(struct dvb_frontend *fe,
+				     struct dtv_frontend_properties *c)
 {
 	return 0;
 }
 
-static int dvb_dummy_fe_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int dvb_dummy_fe_set_frontend(struct dvb_frontend* fe)
 {
 	if (fe->ops.tuner_ops.set_params) {
 		fe->ops.tuner_ops.set_params(fe);
@@ -171,7 +172,7 @@ error:
 }
 
 static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Dummy DVB-T",
 		.type			= FE_OFDM,
@@ -192,8 +193,8 @@ static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
 	.init = dvb_dummy_fe_init,
 	.sleep = dvb_dummy_fe_sleep,
 
-	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
-	.get_frontend_legacy = dvb_dummy_fe_get_frontend,
+	.set_frontend = dvb_dummy_fe_set_frontend,
+	.get_frontend = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
 	.read_ber = dvb_dummy_fe_read_ber,
@@ -203,7 +204,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
 };
 
 static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
-
+	.delsys = { SYS_DVBC_ANNEX_A },
 	.info = {
 		.name			= "Dummy DVB-C",
 		.type			= FE_QAM,
@@ -222,8 +223,8 @@ static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
 	.init = dvb_dummy_fe_init,
 	.sleep = dvb_dummy_fe_sleep,
 
-	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
-	.get_frontend_legacy = dvb_dummy_fe_get_frontend,
+	.set_frontend = dvb_dummy_fe_set_frontend,
+	.get_frontend = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
 	.read_ber = dvb_dummy_fe_read_ber,
@@ -233,7 +234,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
 };
 
 static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "Dummy DVB-S",
 		.type			= FE_QPSK,
@@ -254,8 +255,8 @@ static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
 	.init = dvb_dummy_fe_init,
 	.sleep = dvb_dummy_fe_sleep,
 
-	.set_frontend_legacy = dvb_dummy_fe_set_frontend,
-	.get_frontend_legacy = dvb_dummy_fe_get_frontend,
+	.set_frontend = dvb_dummy_fe_set_frontend,
+	.get_frontend = dvb_dummy_fe_get_frontend,
 
 	.read_status = dvb_dummy_fe_read_status,
 	.read_ber = dvb_dummy_fe_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#45 lore raw

RFC PATCH 45/91 tda10048: 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/dvb/frontends/tda10048.c |   78 +++++++++++++-------------------
 1 files changed, 32 insertions(+), 46 deletions(-)
drivers/media/dvb/frontends/tda10048.c +32 -46
index bba249b..80de9f6 100644
@@ -341,21 +341,14 @@ static int tda10048_set_wref(struct dvb_frontend *fe, u32 sample_freq_hz,
 {
 	struct tda10048_state *state = fe->demodulator_priv;
 	u64 t, z;
-	u32 b = 8000000;
 
 	dprintk(1, "%s()\n", __func__);
 
 	if (sample_freq_hz == 0)
 		return -EINVAL;
 
-	if (bw == BANDWIDTH_6_MHZ)
-		b = 6000000;
-	else
-	if (bw == BANDWIDTH_7_MHZ)
-		b = 7000000;
-
 	/* WREF = (B / (7 * fs)) * 2^31 */
-	t = b * 10;
+	t = bw * 10;
 	/* avoid warning: this decimal constant is unsigned only in ISO C90 */
 	/* t *= 2147483648 on 32bit platforms */
 	t *= (2048 * 1024);
@@ -378,25 +371,18 @@ static int tda10048_set_invwref(struct dvb_frontend *fe, u32 sample_freq_hz,
 {
 	struct tda10048_state *state = fe->demodulator_priv;
 	u64 t;
-	u32 b = 8000000;
 
 	dprintk(1, "%s()\n", __func__);
 
 	if (sample_freq_hz == 0)
 		return -EINVAL;
 
-	if (bw == BANDWIDTH_6_MHZ)
-		b = 6000000;
-	else
-	if (bw == BANDWIDTH_7_MHZ)
-		b = 7000000;
-
 	/* INVWREF = ((7 * fs) / B) * 2^5 */
 	t = sample_freq_hz;
 	t *= 7;
 	t *= 32;
 	t *= 10;
-	do_div(t, b);
+	do_div(t, bw);
 	t += 5;
 	do_div(t, 10);
 
@@ -407,16 +393,16 @@ static int tda10048_set_invwref(struct dvb_frontend *fe, u32 sample_freq_hz,
 }
 
 static int tda10048_set_bandwidth(struct dvb_frontend *fe,
-	enum fe_bandwidth bw)
+	u32 bw)
 {
 	struct tda10048_state *state = fe->demodulator_priv;
 	dprintk(1, "%s(bw=%d)\n", __func__, bw);
 
 	/* Bandwidth setting may need to be adjusted */
 	switch (bw) {
-	case BANDWIDTH_6_MHZ:
-	case BANDWIDTH_7_MHZ:
-	case BANDWIDTH_8_MHZ:
+	case 6000000:
+	case 7000000:
+	case 8000000:
 		tda10048_set_wref(fe, state->sample_freq, bw);
 		tda10048_set_invwref(fe, state->sample_freq, bw);
 		break;
@@ -430,7 +416,7 @@ static int tda10048_set_bandwidth(struct dvb_frontend *fe,
 	return 0;
 }
 
-static int tda10048_set_if(struct dvb_frontend *fe, enum fe_bandwidth bw)
+static int tda10048_set_if(struct dvb_frontend *fe, u32 bw)
 {
 	struct tda10048_state *state = fe->demodulator_priv;
 	struct tda10048_config *config = &state->config;
@@ -441,13 +427,13 @@ static int tda10048_set_if(struct dvb_frontend *fe, enum fe_bandwidth bw)
 
 	/* based on target bandwidth and clk we calculate pll factors */
 	switch (bw) {
-	case BANDWIDTH_6_MHZ:
+	case 6000000:
 		if_freq_khz = config->dtv6_if_freq_khz;
 		break;
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		if_freq_khz = config->dtv7_if_freq_khz;
 		break;
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
 		if_freq_khz = config->dtv8_if_freq_khz;
 		break;
 	default:
@@ -601,7 +587,7 @@ static int tda10048_set_inversion(struct dvb_frontend *fe, int inversion)
 
 /* Retrieve the demod settings */
 static int tda10048_get_tps(struct tda10048_state *state,
-	struct dvb_ofdm_parameters *p)
+	struct dtv_frontend_properties *p)
 {
 	u8 val;
 
@@ -612,27 +598,27 @@ static int tda10048_get_tps(struct tda10048_state *state,
 	val = tda10048_readreg(state, TDA10048_OUT_CONF2);
 	switch ((val & 0x60) >> 5) {
 	case 0:
-		p->constellation = QPSK;
+		p->modulation = QPSK;
 		break;
 	case 1:
-		p->constellation = QAM_16;
+		p->modulation = QAM_16;
 		break;
 	case 2:
-		p->constellation = QAM_64;
+		p->modulation = QAM_64;
 		break;
 	}
 	switch ((val & 0x18) >> 3) {
 	case 0:
-		p->hierarchy_information = HIERARCHY_NONE;
+		p->hierarchy = HIERARCHY_NONE;
 		break;
 	case 1:
-		p->hierarchy_information = HIERARCHY_1;
+		p->hierarchy = HIERARCHY_1;
 		break;
 	case 2:
-		p->hierarchy_information = HIERARCHY_2;
+		p->hierarchy = HIERARCHY_2;
 		break;
 	case 3:
-		p->hierarchy_information = HIERARCHY_4;
+		p->hierarchy = HIERARCHY_4;
 		break;
 	}
 	switch (val & 0x07) {
@@ -738,17 +724,17 @@ static int tda10048_output_mode(struct dvb_frontend *fe, int serial)
 
 /* Talk to the demod, set the FEC, GUARD, QAM settings etc */
 /* TODO: Support manual tuning with specific params */
-static int tda10048_set_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static int tda10048_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct tda10048_state *state = fe->demodulator_priv;
 
 	dprintk(1, "%s(frequency=%d)\n", __func__, p->frequency);
 
 	/* Update the I/F pll's if the bandwidth changes */
-	if (p->u.ofdm.bandwidth != state->bandwidth) {
-		tda10048_set_if(fe, p->u.ofdm.bandwidth);
-		tda10048_set_bandwidth(fe, p->u.ofdm.bandwidth);
+	if (p->bandwidth_hz != state->bandwidth) {
+		tda10048_set_if(fe, p->bandwidth_hz);
+		tda10048_set_bandwidth(fe, p->bandwidth_hz);
 	}
 
 	if (fe->ops.tuner_ops.set_params) {
@@ -797,8 +783,8 @@ static int tda10048_init(struct dvb_frontend *fe)
 	tda10048_set_inversion(fe, config->inversion);
 
 	/* Establish default RF values */
-	tda10048_set_if(fe, BANDWIDTH_8_MHZ);
-	tda10048_set_bandwidth(fe, BANDWIDTH_8_MHZ);
+	tda10048_set_if(fe, 8000000);
+	tda10048_set_bandwidth(fe, 8000000);
 
 	/* Ensure we leave the gate closed */
 	tda10048_i2c_gate_ctrl(fe, 0);
@@ -1043,7 +1029,7 @@ static int tda10048_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
 }
 
 static int tda10048_get_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+	struct dtv_frontend_properties *p)
 {
 	struct tda10048_state *state = fe->demodulator_priv;
 
@@ -1052,7 +1038,7 @@ static int tda10048_get_frontend(struct dvb_frontend *fe,
 	p->inversion = tda10048_readreg(state, TDA10048_CONF_C1_1)
 		& 0x20 ? INVERSION_ON : INVERSION_OFF;
 
-	return tda10048_get_tps(state, &p->u.ofdm);
+	return tda10048_get_tps(state, p);
 }
 
 static int tda10048_get_tune_settings(struct dvb_frontend *fe,
@@ -1126,7 +1112,7 @@ struct dvb_frontend *tda10048_attach(const struct tda10048_config *config,
 	memcpy(&state->config, config, sizeof(*config));
 	state->i2c = i2c;
 	state->fwloaded = config->no_firmware;
-	state->bandwidth = BANDWIDTH_8_MHZ;
+	state->bandwidth = 8000000;
 
 	/* check if the demod is present */
 	if (tda10048_readreg(state, TDA10048_IDENTITY) != 0x048)
@@ -1152,11 +1138,11 @@ struct dvb_frontend *tda10048_attach(const struct tda10048_config *config,
 	tda10048_establish_defaults(&state->frontend);
 
 	/* Set the xtal and freq defaults */
-	if (tda10048_set_if(&state->frontend, BANDWIDTH_8_MHZ) != 0)
+	if (tda10048_set_if(&state->frontend, 8000000) != 0)
 		goto error;
 
 	/* Default bandwidth */
-	if (tda10048_set_bandwidth(&state->frontend, BANDWIDTH_8_MHZ) != 0)
+	if (tda10048_set_bandwidth(&state->frontend, 8000000) != 0)
 		goto error;
 
 	/* Leave the gate closed */
@@ -1188,8 +1174,8 @@ static struct dvb_frontend_ops tda10048_ops = {
 	.release = tda10048_release,
 	.init = tda10048_init,
 	.i2c_gate_ctrl = tda10048_i2c_gate_ctrl,
-	.set_frontend_legacy = tda10048_set_frontend,
-	.get_frontend_legacy = tda10048_get_frontend,
+	.set_frontend = tda10048_set_frontend,
+	.get_frontend = tda10048_get_frontend,
 	.get_tune_settings = tda10048_get_tune_settings,
 	.read_status = tda10048_read_status,
 	.read_ber = tda10048_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#49 lore raw

RFC PATCH 49/91 s5h1420: 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/dvb/frontends/s5h1420.c |   54 ++++++++++++++++----------------
 1 files changed, 27 insertions(+), 27 deletions(-)
drivers/media/dvb/frontends/s5h1420.c +27 -27
index 44ec27d..3bdfcbe 100644
@@ -472,15 +472,15 @@ static void s5h1420_reset(struct s5h1420_state* state)
 }
 
 static void s5h1420_setsymbolrate(struct s5h1420_state* state,
-				  struct dvb_frontend_parameters *p)
+				  struct dtv_frontend_properties *p)
 {
 	u8 v;
 	u64 val;
 
 	dprintk("enter %s\n", __func__);
 
-	val = ((u64) p->u.qpsk.symbol_rate / 1000ULL) * (1ULL<<24);
-	if (p->u.qpsk.symbol_rate < 29000000)
+	val = ((u64) p->symbol_rate / 1000ULL) * (1ULL<<24);
+	if (p->symbol_rate < 29000000)
 		val *= 2;
 	do_div(val, (state->fclk / 1000));
 
@@ -543,7 +543,7 @@ static int s5h1420_getfreqoffset(struct s5h1420_state* state)
 }
 
 static void s5h1420_setfec_inversion(struct s5h1420_state* state,
-				     struct dvb_frontend_parameters *p)
+				     struct dtv_frontend_properties *p)
 {
 	u8 inversion = 0;
 	u8 vit08, vit09;
@@ -555,11 +555,11 @@ static void s5h1420_setfec_inversion(struct s5h1420_state* state,
 	else if (p->inversion == INVERSION_ON)
 		inversion = state->config->invert ? 0 : 0x08;
 
-	if ((p->u.qpsk.fec_inner == FEC_AUTO) || (p->inversion == INVERSION_AUTO)) {
+	if ((p->fec_inner == FEC_AUTO) || (p->inversion == INVERSION_AUTO)) {
 		vit08 = 0x3f;
 		vit09 = 0;
 	} else {
-		switch(p->u.qpsk.fec_inner) {
+		switch(p->fec_inner) {
 		case FEC_1_2:
 			vit08 = 0x01; vit09 = 0x10;
 			break;
@@ -628,9 +628,9 @@ static fe_spectral_inversion_t s5h1420_getinversion(struct s5h1420_state* state)
 	return INVERSION_OFF;
 }
 
-static int s5h1420_set_frontend(struct dvb_frontend* fe,
-				struct dvb_frontend_parameters *p)
+static int s5h1420_set_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct s5h1420_state* state = fe->demodulator_priv;
 	int frequency_delta;
 	struct dvb_frontend_tune_settings fesettings;
@@ -639,14 +639,14 @@ 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 dvb_frontend_parameters));
+	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) &&
 			(frequency_delta < fesettings.max_drift) &&
 			(frequency_delta != 0) &&
-			(state->fec_inner == p->u.qpsk.fec_inner) &&
-			(state->symbol_rate == p->u.qpsk.symbol_rate)) {
+			(state->fec_inner == p->fec_inner) &&
+			(state->symbol_rate == p->symbol_rate)) {
 
 		if (fe->ops.tuner_ops.set_params) {
 			fe->ops.tuner_ops.set_params(fe);
@@ -669,13 +669,13 @@ static int s5h1420_set_frontend(struct dvb_frontend* fe,
 	s5h1420_reset(state);
 
 	/* set s5h1420 fclk PLL according to desired symbol rate */
-	if (p->u.qpsk.symbol_rate > 33000000)
+	if (p->symbol_rate > 33000000)
 		state->fclk = 80000000;
-	else if (p->u.qpsk.symbol_rate > 28500000)
+	else if (p->symbol_rate > 28500000)
 		state->fclk = 59000000;
-	else if (p->u.qpsk.symbol_rate > 25000000)
+	else if (p->symbol_rate > 25000000)
 		state->fclk = 86000000;
-	else if (p->u.qpsk.symbol_rate > 1900000)
+	else if (p->symbol_rate > 1900000)
 		state->fclk = 88000000;
 	else
 		state->fclk = 44000000;
@@ -705,7 +705,7 @@ static int s5h1420_set_frontend(struct dvb_frontend* fe,
 	s5h1420_writereg(state, DiS01, (state->fclk + (TONE_FREQ * 32) - 1) / (TONE_FREQ * 32));
 
 	/* TODO DC offset removal, config parameter ? */
-	if (p->u.qpsk.symbol_rate > 29000000)
+	if (p->symbol_rate > 29000000)
 		s5h1420_writereg(state, QPSK01, 0xae | 0x10);
 	else
 		s5h1420_writereg(state, QPSK01, 0xac | 0x10);
@@ -718,15 +718,15 @@ static int s5h1420_set_frontend(struct dvb_frontend* fe,
 	s5h1420_writereg(state, Loop01, 0xF0);
 	s5h1420_writereg(state, Loop02, 0x2a); /* e7 for s5h1420 */
 	s5h1420_writereg(state, Loop03, 0x79); /* 78 for s5h1420 */
-	if (p->u.qpsk.symbol_rate > 20000000)
+	if (p->symbol_rate > 20000000)
 		s5h1420_writereg(state, Loop04, 0x79);
 	else
 		s5h1420_writereg(state, Loop04, 0x58);
 	s5h1420_writereg(state, Loop05, 0x6b);
 
-	if (p->u.qpsk.symbol_rate >= 8000000)
+	if (p->symbol_rate >= 8000000)
 		s5h1420_writereg(state, Post01, (0 << 6) | 0x10);
-	else if (p->u.qpsk.symbol_rate >= 4000000)
+	else if (p->symbol_rate >= 4000000)
 		s5h1420_writereg(state, Post01, (1 << 6) | 0x10);
 	else
 		s5h1420_writereg(state, Post01, (3 << 6) | 0x10);
@@ -757,8 +757,8 @@ static int s5h1420_set_frontend(struct dvb_frontend* fe,
 	/* start QPSK */
 	s5h1420_writereg(state, QPSK01, s5h1420_readreg(state, QPSK01) | 1);
 
-	state->fec_inner = p->u.qpsk.fec_inner;
-	state->symbol_rate = p->u.qpsk.symbol_rate;
+	state->fec_inner = p->fec_inner;
+	state->symbol_rate = p->symbol_rate;
 	state->postlocked = 0;
 	state->tunedfreq = p->frequency;
 
@@ -767,14 +767,14 @@ static int s5h1420_set_frontend(struct dvb_frontend* fe,
 }
 
 static int s5h1420_get_frontend(struct dvb_frontend* fe,
-				struct dvb_frontend_parameters *p)
+				struct dtv_frontend_properties *p)
 {
 	struct s5h1420_state* state = fe->demodulator_priv;
 
 	p->frequency = state->tunedfreq + s5h1420_getfreqoffset(state);
 	p->inversion = s5h1420_getinversion(state);
-	p->u.qpsk.symbol_rate = s5h1420_getsymbolrate(state);
-	p->u.qpsk.fec_inner = s5h1420_getfec(state);
+	p->symbol_rate = s5h1420_getsymbolrate(state);
+	p->fec_inner = s5h1420_getfec(state);
 
 	return 0;
 }
@@ -937,7 +937,7 @@ error:
 EXPORT_SYMBOL(s5h1420_attach);
 
 static struct dvb_frontend_ops s5h1420_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name     = "Samsung S5H1420/PnpNetwork PN1010 DVB-S",
 		.type     = FE_QPSK,
@@ -960,8 +960,8 @@ static struct dvb_frontend_ops s5h1420_ops = {
 	.sleep = s5h1420_sleep,
 	.i2c_gate_ctrl = s5h1420_i2c_gate_ctrl,
 
-	.set_frontend_legacy = s5h1420_set_frontend,
-	.get_frontend_legacy = s5h1420_get_frontend,
+	.set_frontend = s5h1420_set_frontend,
+	.get_frontend = s5h1420_get_frontend,
 	.get_tune_settings = s5h1420_get_tune_settings,
 
 	.read_status = s5h1420_read_status,
Signature · 1 line
1.7.8.352.g876a6
#52 lore raw

RFC PATCH 52/91 stb6100: use get_frontend, instead of get_frontend_legacy()

In reply to Mauro Carvalho Chehab
---
 drivers/media/dvb/frontends/stb6100.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/media/dvb/frontends/stb6100.c +4 -4
index 7f68fd3..a566763 100644
@@ -327,7 +327,7 @@ static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency)
 	int rc;
 	const struct stb6100_lkup *ptr;
 	struct stb6100_state *state = fe->tuner_priv;
-	struct dvb_frontend_parameters p;
+	struct dtv_frontend_properties p;
 
 	u32 srate = 0, fvco, nint, nfrac;
 	u8 regs[STB6100_NUMREGS];
@@ -335,11 +335,11 @@ 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_legacy) {
+	if (fe->ops.get_frontend) {
 		dprintk(verbose, FE_DEBUG, 1, "Get frontend parameters");
-		fe->ops.get_frontend_legacy(fe, &p);
+		fe->ops.get_frontend(fe, &p);
 	}
-	srate = p.u.qpsk.symbol_rate;
+	srate = p.symbol_rate;
 
 	/* Set up tuner cleanly, LPF calibration on */
 	rc = stb6100_write_reg(state, STB6100_FCCK, 0x4d | STB6100_FCCK_FCCK);
Signature · 1 line
1.7.8.352.g876a6
#53 lore raw

RFC PATCH 53/91 stv0288: convert set_fontend to use DVBv5 parameters

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/stv0288.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
drivers/media/dvb/frontends/stv0288.c +3 -6
index 105f0bf..b0ddebc 100644
@@ -458,8 +458,7 @@ static int stv0288_get_property(struct dvb_frontend *fe, struct dtv_property *p)
 	return 0;
 }
 
-static int stv0288_set_frontend(struct dvb_frontend *fe,
-					struct dvb_frontend_parameters *dfp)
+static int stv0288_set_frontend(struct dvb_frontend *fe)
 {
 	struct stv0288_state *state = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -481,8 +480,6 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,
 		state->config->set_ts_params(fe, 0);
 
 	/* only frequency & symbol_rate are used for tuner*/
-	dfp->frequency = c->frequency;
-	dfp->u.qpsk.symbol_rate = c->symbol_rate;
 	if (fe->ops.tuner_ops.set_params) {
 		fe->ops.tuner_ops.set_params(fe);
 		if (fe->ops.i2c_gate_ctrl)
@@ -545,7 +542,7 @@ static void stv0288_release(struct dvb_frontend *fe)
 }
 
 static struct dvb_frontend_ops stv0288_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "ST STV0288 DVB-S",
 		.type			= FE_QPSK,
@@ -579,7 +576,7 @@ static struct dvb_frontend_ops stv0288_ops = {
 
 	.set_property = stv0288_set_property,
 	.get_property = stv0288_get_property,
-	.set_frontend_legacy = stv0288_set_frontend,
+	.set_frontend = stv0288_set_frontend,
 };
 
 struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
Signature · 1 line
1.7.8.352.g876a6
#64 lore raw

RFC PATCH 64/91 or51211: 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/dvb/frontends/or51211.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/media/dvb/frontends/or51211.c +6 -6
index 2f2c7f8..58ddf55 100644
@@ -218,13 +218,13 @@ static int or51211_setmode(struct dvb_frontend* fe, int mode)
 	return 0;
 }
 
-static int or51211_set_parameters(struct dvb_frontend* fe,
-				  struct dvb_frontend_parameters *param)
+static int or51211_set_parameters(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct or51211_state* state = fe->demodulator_priv;
 
 	/* Change only if we are actually changing the channel */
-	if (state->current_frequency != param->frequency) {
+	if (state->current_frequency != p->frequency) {
 		if (fe->ops.tuner_ops.set_params) {
 			fe->ops.tuner_ops.set_params(fe);
 			if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
@@ -234,7 +234,7 @@ static int or51211_set_parameters(struct dvb_frontend* fe,
 		or51211_setmode(fe,0);
 
 		/* Update current frequency */
-		state->current_frequency = param->frequency;
+		state->current_frequency = p->frequency;
 	}
 	return 0;
 }
@@ -544,7 +544,7 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config,
 }
 
 static struct dvb_frontend_ops or51211_ops = {
-
+        .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name               = "Oren OR51211 VSB Frontend",
 		.type               = FE_ATSC,
@@ -561,7 +561,7 @@ static struct dvb_frontend_ops or51211_ops = {
 	.init = or51211_init,
 	.sleep = or51211_sleep,
 
-	.set_frontend_legacy = or51211_set_parameters,
+	.set_frontend = or51211_set_parameters,
 	.get_tune_settings = or51211_get_tune_settings,
 
 	.read_status = or51211_read_status,
Signature · 1 line
1.7.8.352.g876a6
#67 lore raw

RFC PATCH 67/91 tda8083: 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/dvb/frontends/tda8083.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
drivers/media/dvb/frontends/tda8083.c +10 -9
index 7ff2946..88a22d3 100644
@@ -315,8 +315,9 @@ static int tda8083_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int tda8083_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int tda8083_set_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct tda8083_state* state = fe->demodulator_priv;
 
 	if (fe->ops.tuner_ops.set_params) {
@@ -325,8 +326,8 @@ static int tda8083_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 	}
 
 	tda8083_set_inversion (state, p->inversion);
-	tda8083_set_fec (state, p->u.qpsk.fec_inner);
-	tda8083_set_symbolrate (state, p->u.qpsk.symbol_rate);
+	tda8083_set_fec (state, p->fec_inner);
+	tda8083_set_symbolrate (state, p->symbol_rate);
 
 	tda8083_writereg (state, 0x00, 0x3c);
 	tda8083_writereg (state, 0x00, 0x04);
@@ -334,7 +335,7 @@ static int tda8083_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 	return 0;
 }
 
-static int tda8083_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int tda8083_get_frontend(struct dvb_frontend* fe, struct dtv_frontend_properties *p)
 {
 	struct tda8083_state* state = fe->demodulator_priv;
 
@@ -342,8 +343,8 @@ static int tda8083_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 	/*p->frequency = ???;*/
 	p->inversion = (tda8083_readreg (state, 0x0e) & 0x80) ?
 			INVERSION_ON : INVERSION_OFF;
-	p->u.qpsk.fec_inner = tda8083_get_fec (state);
-	/*p->u.qpsk.symbol_rate = tda8083_get_symbolrate (state);*/
+	p->fec_inner = tda8083_get_fec (state);
+	/*p->symbol_rate = tda8083_get_symbolrate (state);*/
 
 	return 0;
 }
@@ -438,7 +439,7 @@ error:
 }
 
 static struct dvb_frontend_ops tda8083_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "Philips TDA8083 DVB-S",
 		.type			= FE_QPSK,
@@ -461,8 +462,8 @@ static struct dvb_frontend_ops tda8083_ops = {
 	.init = tda8083_init,
 	.sleep = tda8083_sleep,
 
-	.set_frontend_legacy = tda8083_set_frontend,
-	.get_frontend_legacy = tda8083_get_frontend,
+	.set_frontend = tda8083_set_frontend,
+	.get_frontend = tda8083_get_frontend,
 
 	.read_status = tda8083_read_status,
 	.read_signal_strength = tda8083_read_signal_strength,
Signature · 1 line
1.7.8.352.g876a6
#74 lore raw

RFC PATCH 74/91 friio-fe: 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/dvb/dvb-usb/friio-fe.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)
drivers/media/dvb/dvb-usb/friio-fe.c +15 -15
index 7973aaf..375815d 100644
@@ -283,22 +283,23 @@ static int jdvbt90502_set_property(struct dvb_frontend *fe,
 }
 
 static int jdvbt90502_get_frontend(struct dvb_frontend *fe,
-				   struct dvb_frontend_parameters *p)
+				   struct dtv_frontend_properties *p)
 {
 	p->inversion = INVERSION_AUTO;
-	p->u.ofdm.bandwidth = BANDWIDTH_6_MHZ;
-	p->u.ofdm.code_rate_HP = FEC_AUTO;
-	p->u.ofdm.code_rate_LP = FEC_AUTO;
-	p->u.ofdm.constellation = QAM_64;
-	p->u.ofdm.transmission_mode = TRANSMISSION_MODE_AUTO;
-	p->u.ofdm.guard_interval = GUARD_INTERVAL_AUTO;
-	p->u.ofdm.hierarchy_information = HIERARCHY_AUTO;
+	p->bandwidth_hz = 6000000;
+	p->code_rate_HP = FEC_AUTO;
+	p->code_rate_LP = FEC_AUTO;
+	p->modulation = QAM_64;
+	p->transmission_mode = TRANSMISSION_MODE_AUTO;
+	p->guard_interval = GUARD_INTERVAL_AUTO;
+	p->hierarchy = HIERARCHY_AUTO;
 	return 0;
 }
 
-static int jdvbt90502_set_frontend(struct dvb_frontend *fe,
-				   struct dvb_frontend_parameters *p)
+static int jdvbt90502_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
+
 	/**
 	 * NOTE: ignore all the parameters except frequency.
 	 *       others should be fixed to the proper value for ISDB-T,
@@ -438,14 +439,13 @@ error:
 }
 
 static struct dvb_frontend_ops jdvbt90502_ops = {
-
+	.delsys = { SYS_ISDBT },
 	.info = {
 		.name			= "Comtech JDVBT90502 ISDB-T",
 		.type			= FE_OFDM,
 		.frequency_min		= 473000000, /* UHF 13ch, center */
 		.frequency_max		= 767142857, /* UHF 62ch, center */
-		.frequency_stepsize	= JDVBT90502_PLL_CLK /
-							JDVBT90502_PLL_DIVIDER,
+		.frequency_stepsize	= JDVBT90502_PLL_CLK / JDVBT90502_PLL_DIVIDER,
 		.frequency_tolerance	= 0,
 
 		/* NOTE: this driver ignores all parameters but frequency. */
@@ -466,8 +466,8 @@ static struct dvb_frontend_ops jdvbt90502_ops = {
 
 	.set_property = jdvbt90502_set_property,
 
-	.set_frontend_legacy = jdvbt90502_set_frontend,
-	.get_frontend_legacy = jdvbt90502_get_frontend,
+	.set_frontend = jdvbt90502_set_frontend,
+	.get_frontend = jdvbt90502_get_frontend,
 
 	.read_status = jdvbt90502_read_status,
 	.read_signal_strength = jdvbt90502_read_signal_strength,
Signature · 1 line
1.7.8.352.g876a6
#29 lore raw

RFC PATCH 29/91 ec100: 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/dvb/frontends/ec100.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
drivers/media/dvb/frontends/ec100.c +10 -9
index 20decd7..39e0811 100644
@@ -76,15 +76,15 @@ static int ec100_read_reg(struct ec100_state *state, u8 reg, u8 *val)
 	return 0;
 }
 
-static int ec100_set_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *params)
+static int ec100_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct ec100_state *state = fe->demodulator_priv;
 	int ret;
 	u8 tmp, tmp2;
 
-	deb_info("%s: freq:%d bw:%d\n", __func__, params->frequency,
-		params->u.ofdm.bandwidth);
+	deb_info("%s: freq:%d bw:%d\n", __func__, c->frequency,
+		c->bandwidth_hz);
 
 	/* program tuner */
 	if (fe->ops.tuner_ops.set_params)
@@ -108,16 +108,16 @@ static int ec100_set_frontend(struct dvb_frontend *fe,
 	   B 0x1b | 0xb7 | 0x00 | 0x49
 	   B 0x1c | 0x55 | 0x64 | 0x72 */
 
-	switch (params->u.ofdm.bandwidth) {
-	case BANDWIDTH_6_MHZ:
+	switch (c->bandwidth_hz) {
+	case 6000000:
 		tmp = 0xb7;
 		tmp2 = 0x55;
 		break;
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		tmp = 0x00;
 		tmp2 = 0x64;
 		break;
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
 	default:
 		tmp = 0x49;
 		tmp2 = 0x72;
@@ -306,6 +306,7 @@ error:
 EXPORT_SYMBOL(ec100_attach);
 
 static struct dvb_frontend_ops ec100_ops = {
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "E3C EC100 DVB-T",
 		.type = FE_OFDM,
@@ -321,7 +322,7 @@ static struct dvb_frontend_ops ec100_ops = {
 	},
 
 	.release = ec100_release,
-	.set_frontend_legacy = ec100_set_frontend,
+	.set_frontend = ec100_set_frontend,
 	.get_tune_settings = ec100_get_tune_settings,
 	.read_status = ec100_read_status,
 	.read_ber = ec100_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#89 lore raw

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

In reply to Mauro Carvalho Chehab

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
#25 lore raw

RFC PATCH 25/91 drxd: 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/dvb/frontends/drxd.h      |    2 -
 drivers/media/dvb/frontends/drxd_hard.c |   58 ++++++++++++-------------------
 2 files changed, 22 insertions(+), 38 deletions(-)
drivers/media/dvb/frontends/drxd.h +0 -2
index 7113535..3439873 100644
@@ -48,8 +48,6 @@ struct drxd_config {
 	u8 disable_i2c_gate_ctrl;
 
 	u32 IF;
-	int (*pll_set) (void *priv, void *priv_params,
-			u8 pll_addr, u8 demoda_addr, s32 *off);
 	 s16(*osc_deviation) (void *priv, s16 dev, int flag);
 };
 
drivers/media/dvb/frontends/drxd_hard.c +22 -36

155 lines not on this page · raw message

Signature · 1 line
1.7.8.352.g876a6
#27 lore raw

RFC PATCH 27/91 ds3000: 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/dvb/frontends/ds3000.c |   33 ++++++++-------------------------
 1 files changed, 8 insertions(+), 25 deletions(-)
drivers/media/dvb/frontends/ds3000.c +8 -25
index 7fa5b92..f8fa80a 100644
@@ -934,20 +934,6 @@ error2:
 }
 EXPORT_SYMBOL(ds3000_attach);
 
-static int ds3000_set_property(struct dvb_frontend *fe,
-	struct dtv_property *tvp)
-{
-	dprintk("%s(..)\n", __func__);
-	return 0;
-}
-
-static int ds3000_get_property(struct dvb_frontend *fe,
-	struct dtv_property *tvp)
-{
-	dprintk("%s(..)\n", __func__);
-	return 0;
-}
-
 static int ds3000_set_carrier_offset(struct dvb_frontend *fe,
 					s32 carrier_offset_khz)
 {
@@ -967,8 +953,7 @@ static int ds3000_set_carrier_offset(struct dvb_frontend *fe,
 	return 0;
 }
 
-static int ds3000_set_frontend(struct dvb_frontend *fe,
-				struct dvb_frontend_parameters *p)
+static int ds3000_set_frontend(struct dvb_frontend *fe)
 {
 	struct ds3000_state *state = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -994,15 +979,15 @@ static int ds3000_set_frontend(struct dvb_frontend *fe,
 	div4 = 0;
 
 	/* calculate and set freq divider */
-	if (p->frequency < 1146000) {
+	if (c->frequency < 1146000) {
 		ds3000_tuner_writereg(state, 0x10, 0x11);
 		div4 = 1;
-		ndiv = ((p->frequency * (6 + 8) * 4) +
+		ndiv = ((c->frequency * (6 + 8) * 4) +
 				(DS3000_XTAL_FREQ / 2)) /
 				DS3000_XTAL_FREQ - 1024;
 	} else {
 		ds3000_tuner_writereg(state, 0x10, 0x01);
-		ndiv = ((p->frequency * (6 + 8) * 2) +
+		ndiv = ((c->frequency * (6 + 8) * 2) +
 				(DS3000_XTAL_FREQ / 2)) /
 				DS3000_XTAL_FREQ - 1024;
 	}
@@ -1101,7 +1086,7 @@ static int ds3000_set_frontend(struct dvb_frontend *fe,
 	msleep(60);
 
 	offset_khz = (ndiv - ndiv % 2 + 1024) * DS3000_XTAL_FREQ
-		/ (6 + 8) / (div4 + 1) / 2 - p->frequency;
+		/ (6 + 8) / (div4 + 1) / 2 - c->frequency;
 
 	/* ds3000 global reset */
 	ds3000_writereg(state, 0x07, 0x80);
@@ -1226,7 +1211,7 @@ static int ds3000_tune(struct dvb_frontend *fe,
 			fe_status_t *status)
 {
 	if (p) {
-		int ret = ds3000_set_frontend(fe, p);
+		int ret = ds3000_set_frontend(fe);
 		if (ret)
 			return ret;
 	}
@@ -1279,7 +1264,7 @@ static int ds3000_sleep(struct dvb_frontend *fe)
 }
 
 static struct dvb_frontend_ops ds3000_ops = {
-
+	.delsys = { SYS_DVBS, SYS_DVBS2},
 	.info = {
 		.name = "Montage Technology DS3000/TS2020",
 		.type = FE_QPSK,
@@ -1312,9 +1297,7 @@ static struct dvb_frontend_ops ds3000_ops = {
 	.diseqc_send_burst = ds3000_diseqc_send_burst,
 	.get_frontend_algo = ds3000_get_algo,
 
-	.set_property = ds3000_set_property,
-	.get_property = ds3000_get_property,
-	.set_frontend_legacy = ds3000_set_frontend,
+	.set_frontend = ds3000_set_frontend,
 	.tune = ds3000_tune,
 };
 
Signature · 1 line
1.7.8.352.g876a6
#30 lore raw

RFC PATCH 30/91 it913x-fe: 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/dvb/frontends/it913x-fe-priv.h |   64 ++++++++++----------
 drivers/media/dvb/frontends/it913x-fe.c      |   79 ++++++++++++++-----------
 2 files changed, 76 insertions(+), 67 deletions(-)
drivers/media/dvb/frontends/it913x-fe-priv.h +32 -32
index ad2b644..93b086e 100644
@@ -22,126 +22,126 @@ struct adctable {	u32 adcFrequency;
 /* clock and coeff tables only table 3 is used with IT9137*/
 /* TODO other tables relate AF9035 may be removed */
 static struct adctable tab1[] = {
-	{	20156250, BANDWIDTH_6_MHZ,
+	{	20156250, 6000000,
 		0x02b8ba6e, 0x015c5d37, 0x00ae340d, 0x00ae2e9b, 0x00ae292a,
 		0x015c5d37, 0x00ae2e9b, 0x0057174e, 0x02f1, 0x015c	},
-	{	20156250, BANDWIDTH_7_MHZ,
+	{	20156250, 7000000,
 		0x032cd980, 0x01966cc0, 0x00cb3cba, 0x00cb3660, 0x00cb3007,
 		0x01966cc0, 0x00cb3660, 0x00659b30, 0x0285, 0x0196	},
-	{	20156250, BANDWIDTH_8_MHZ,
+	{	20156250, 8000000,
 		0x03a0f893, 0x01d07c49, 0x00e84567, 0x00e83e25, 0x00e836e3,
 		0x01d07c49, 0x00e83e25, 0x00741f12, 0x0234, 0x01d0	},
-	{	20156250, BANDWIDTH_5_MHZ,
+	{	20156250, 5000000,
 		0x02449b5c, 0x01224dae, 0x00912b60, 0x009126d7, 0x0091224e,
 		0x01224dae, 0x009126d7, 0x0048936b, 0x0387, 0x0122	}
 };
 
 static struct adctable tab2[] = {
-	{	20187500, BANDWIDTH_6_MHZ,
+	{	20187500, 6000000,
 		0x02b7a654, 0x015bd32a, 0x00adef04, 0x00ade995, 0x00ade426,
 		0x015bd32a, 0x00ade995, 0x0056f4ca, 0x02f2, 0x015c	},
-	{	20187500, BANDWIDTH_7_MHZ,
+	{	20187500, 7000000,
 		0x032b9761, 0x0195cbb1, 0x00caec30, 0x00cae5d8, 0x00cadf81,
 		0x0195cbb1, 0x00cae5d8, 0x006572ec, 0x0286, 0x0196	},
-	{	20187500, BANDWIDTH_8_MHZ,
+	{	20187500, 8000000,
 		0x039f886f, 0x01cfc438, 0x00e7e95b, 0x00e7e21c, 0x00e7dadd,
 		0x01cfc438, 0x00e7e21c, 0x0073f10e, 0x0235, 0x01d0	},
-	{	20187500, BANDWIDTH_5_MHZ,
+	{	20187500, 5000000,
 		0x0243b546, 0x0121daa3, 0x0090f1d9, 0x0090ed51, 0x0090e8ca,
 		0x0121daa3, 0x0090ed51, 0x004876a9, 0x0388, 0x0122	}
 
 };
 
 static struct adctable tab3[] = {
-	{	20250000, BANDWIDTH_6_MHZ,
+	{	20250000, 6000000,
 		0x02b580ad, 0x015ac057, 0x00ad6597, 0x00ad602b, 0x00ad5ac1,
 		0x015ac057, 0x00ad602b, 0x0056b016, 0x02f4, 0x015b	},
-	{	20250000, BANDWIDTH_7_MHZ,
+	{	20250000, 7000000,
 		0x03291620, 0x01948b10, 0x00ca4bda, 0x00ca4588, 0x00ca3f36,
 		0x01948b10, 0x00ca4588, 0x006522c4, 0x0288, 0x0195	},
-	{	20250000, BANDWIDTH_8_MHZ,
+	{	20250000, 8000000,
 		0x039cab92, 0x01ce55c9, 0x00e7321e, 0x00e72ae4, 0x00e723ab,
 		0x01ce55c9, 0x00e72ae4, 0x00739572, 0x0237, 0x01ce	},
-	{	20250000, BANDWIDTH_5_MHZ,
+	{	20250000, 5000000,
 		0x0241eb3b, 0x0120f59e, 0x00907f53, 0x00907acf, 0x0090764b,
 		0x0120f59e, 0x00907acf, 0x00483d67, 0x038b, 0x0121	}
 
 };
 
 static struct adctable tab4[] = {
-	{	20583333, BANDWIDTH_6_MHZ,
+	{	20583333, 6000000,
 		0x02aa4598, 0x015522cc, 0x00aa96bb, 0x00aa9166, 0x00aa8c12,
 		0x015522cc, 0x00aa9166, 0x005548b3, 0x0300, 0x0155	},
-	{	20583333, BANDWIDTH_7_MHZ,
+	{	20583333, 7000000,
 		0x031bfbdc, 0x018dfdee, 0x00c7052f, 0x00c6fef7, 0x00c6f8bf,
 		0x018dfdee, 0x00c6fef7, 0x00637f7b, 0x0293, 0x018e	},
-	{	20583333, BANDWIDTH_8_MHZ,
+	{	20583333, 8000000,
 		0x038db21f, 0x01c6d910, 0x00e373a3, 0x00e36c88, 0x00e3656d,
 		0x01c6d910, 0x00e36c88, 0x0071b644, 0x0240, 0x01c7	},
-	{	20583333, BANDWIDTH_5_MHZ,
+	{	20583333, 5000000,
 		0x02388f54, 0x011c47aa, 0x008e2846, 0x008e23d5, 0x008e1f64,
 		0x011c47aa, 0x008e23d5, 0x004711ea, 0x039a, 0x011c	}
 
 };
 
 static struct adctable tab5[] = {
-	{	20416667, BANDWIDTH_6_MHZ,
+	{	20416667, 6000000,
 		0x02afd765, 0x0157ebb3, 0x00abfb39, 0x00abf5d9, 0x00abf07a,
 		0x0157ebb3, 0x00abf5d9, 0x0055faed, 0x02fa, 0x0158	},
-	{	20416667, BANDWIDTH_7_MHZ,
+	{	20416667, 7000000,
 		0x03227b4b, 0x01913da6, 0x00c8a518, 0x00c89ed3, 0x00c8988e,
 		0x01913da6, 0x00c89ed3, 0x00644f69, 0x028d, 0x0191	},
-	{	20416667, BANDWIDTH_8_MHZ,
+	{	20416667, 8000000,
 		0x03951f32, 0x01ca8f99, 0x00e54ef7, 0x00e547cc, 0x00e540a2,
 		0x01ca8f99, 0x00e547cc, 0x0072a3e6, 0x023c, 0x01cb	},
-	{	20416667, BANDWIDTH_5_MHZ,
+	{	20416667, 5000000,
 		0x023d337f, 0x011e99c0, 0x008f515a, 0x008f4ce0, 0x008f4865,
 		0x011e99c0, 0x008f4ce0, 0x0047a670, 0x0393, 0x011f	}
 
 };
 
 static struct adctable tab6[] = {
-	{	20480000, BANDWIDTH_6_MHZ,
+	{	20480000, 6000000,
 		0x02adb6db, 0x0156db6e, 0x00ab7312, 0x00ab6db7, 0x00ab685c,
 		0x0156db6e, 0x00ab6db7, 0x0055b6db, 0x02fd, 0x0157	},
-	{	20480000, BANDWIDTH_7_MHZ,
+	{	20480000, 7000000,
 		0x03200000, 0x01900000, 0x00c80640, 0x00c80000, 0x00c7f9c0,
 		0x01900000, 0x00c80000, 0x00640000, 0x028f, 0x0190	},
-	{	20480000, BANDWIDTH_8_MHZ,
+	{	20480000, 8000000,
 		0x03924925, 0x01c92492, 0x00e4996e, 0x00e49249, 0x00e48b25,
 		0x01c92492, 0x00e49249, 0x00724925, 0x023d, 0x01c9	},
-	{	20480000, BANDWIDTH_5_MHZ,
+	{	20480000, 5000000,
 		0x023b6db7, 0x011db6db, 0x008edfe5, 0x008edb6e, 0x008ed6f7,
 		0x011db6db, 0x008edb6e, 0x00476db7, 0x0396, 0x011e	}
 };
 
 static struct adctable tab7[] = {
-	{	20500000, BANDWIDTH_6_MHZ,
+	{	20500000, 6000000,
 		0x02ad0b99, 0x015685cc, 0x00ab4840, 0x00ab42e6, 0x00ab3d8c,
 		0x015685cc, 0x00ab42e6, 0x0055a173, 0x02fd, 0x0157	},
-	{	20500000, BANDWIDTH_7_MHZ,
+	{	20500000, 7000000,
 		0x031f3832, 0x018f9c19, 0x00c7d44b, 0x00c7ce0c, 0x00c7c7ce,
 		0x018f9c19, 0x00c7ce0c, 0x0063e706, 0x0290, 0x0190	},
-	{	20500000, BANDWIDTH_8_MHZ,
+	{	20500000, 8000000,
 		0x039164cb, 0x01c8b266, 0x00e46056, 0x00e45933, 0x00e45210,
 		0x01c8b266, 0x00e45933, 0x00722c99, 0x023e, 0x01c9	},
-	{	20500000, BANDWIDTH_5_MHZ,
+	{	20500000, 5000000,
 		0x023adeff, 0x011d6f80, 0x008ebc36, 0x008eb7c0, 0x008eb34a,
 		0x011d6f80, 0x008eb7c0, 0x00475be0, 0x0396, 0x011d	}
 
 };
 
 static struct adctable tab8[] = {
-	{	20625000, BANDWIDTH_6_MHZ,
+	{	20625000, 6000000,
 		0x02a8e4bd, 0x0154725e, 0x00aa3e81, 0x00aa392f, 0x00aa33de,
 		0x0154725e, 0x00aa392f, 0x00551c98, 0x0302, 0x0154	},
-	{	20625000, BANDWIDTH_7_MHZ,
+	{	20625000, 7000000,
 		0x031a6032, 0x018d3019, 0x00c69e41, 0x00c6980c, 0x00c691d8,
 		0x018d3019, 0x00c6980c, 0x00634c06, 0x0294, 0x018d	},
-	{	20625000, BANDWIDTH_8_MHZ,
+	{	20625000, 8000000,
 		0x038bdba6, 0x01c5edd3, 0x00e2fe02, 0x00e2f6ea, 0x00e2efd2,
 		0x01c5edd3, 0x00e2f6ea, 0x00717b75, 0x0242, 0x01c6	},
-	{	20625000, BANDWIDTH_5_MHZ,
+	{	20625000, 5000000,
 		0x02376948, 0x011bb4a4, 0x008ddec1, 0x008dda52, 0x008dd5e3,
 		0x011bb4a4, 0x008dda52, 0x0046ed29, 0x039c, 0x011c	}
 
drivers/media/dvb/frontends/it913x-fe.c +44 -35

165 lines not on this page · raw message

Signature · 1 line
1.7.8.352.g876a6
#47 lore raw

RFC PATCH 47/91 s921: 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/dvb/frontends/s921.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
drivers/media/dvb/frontends/s921.c +10 -9
index 5e8f2a8..4c452f4 100644
@@ -262,9 +262,9 @@ static int s921_i2c_readreg(struct s921_state *state, u8 i2c_addr, u8 reg)
 	s921_i2c_writeregdata(state, state->config->demod_address, \
 	regdata, ARRAY_SIZE(regdata))
 
-static int s921_pll_tune(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static int s921_pll_tune(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct s921_state *state = fe->demodulator_priv;
 	int band, rc, i;
 	unsigned long f_offset;
@@ -414,9 +414,9 @@ static int s921_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
 	return 0;
 }
 
-static int s921_set_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static int s921_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct s921_state *state = fe->demodulator_priv;
 	int rc;
 
@@ -424,7 +424,7 @@ static int s921_set_frontend(struct dvb_frontend *fe,
 
 	/* FIXME: We don't know how to use non-auto mode */
 
-	rc = s921_pll_tune(fe, p);
+	rc = s921_pll_tune(fe);
 	if (rc < 0)
 		return rc;
 
@@ -434,7 +434,7 @@ static int s921_set_frontend(struct dvb_frontend *fe,
 }
 
 static int s921_get_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+	struct dtv_frontend_properties *p)
 {
 	struct s921_state *state = fe->demodulator_priv;
 
@@ -455,7 +455,7 @@ static int s921_tune(struct dvb_frontend *fe,
 	dprintk("\n");
 
 	if (params != NULL)
-		rc = s921_set_frontend(fe, params);
+		rc = s921_set_frontend(fe);
 
 	if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
 		s921_read_status(fe, status);
@@ -510,6 +510,7 @@ rcor:
 EXPORT_SYMBOL(s921_attach);
 
 static struct dvb_frontend_ops s921_ops = {
+	.delsys = { SYS_ISDBT },
 	/* Use dib8000 values per default */
 	.info = {
 		.name = "Sharp S921",
@@ -534,8 +535,8 @@ static struct dvb_frontend_ops s921_ops = {
 	.release = s921_release,
 
 	.init = s921_initfe,
-	.set_frontend_legacy = s921_set_frontend,
-	.get_frontend_legacy = s921_get_frontend,
+	.set_frontend = s921_set_frontend,
+	.get_frontend = s921_get_frontend,
 	.read_status = s921_read_status,
 	.read_signal_strength = s921_read_signal_strength,
 	.tune = s921_tune,
Signature · 1 line
1.7.8.352.g876a6
#56 lore raw

RFC PATCH 56/91 stv900: 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/dvb/frontends/stv0900_core.c |   35 +++------------------------
 1 files changed, 4 insertions(+), 31 deletions(-)
drivers/media/dvb/frontends/stv0900_core.c +4 -31
index df46654..3f7e62f 100644
@@ -973,31 +973,6 @@ static enum dvbfe_algo stv0900_frontend_algo(struct dvb_frontend *fe)
 	return DVBFE_ALGO_CUSTOM;
 }
 
-static int stb0900_set_property(struct dvb_frontend *fe,
-				struct dtv_property *tvp)
-{
-	dprintk("%s(..)\n", __func__);
-
-	return 0;
-}
-
-static int stb0900_get_property(struct dvb_frontend *fe,
-				struct dtv_property *tvp)
-{
-	dprintk("%s(..)\n", __func__);
-	switch (tvp->cmd) {
-	case DTV_ENUM_DELSYS:
-		tvp->u.buffer.data[0] = SYS_DSS;
-		tvp->u.buffer.data[1] = SYS_DVBS;
-		tvp->u.buffer.data[2] = SYS_DVBS2;
-		tvp->u.buffer.len = 3;
-		break;
-	default:
-		break;
-	}
-	return 0;
-}
-
 void stv0900_start_search(struct stv0900_internal *intp,
 				enum fe_stv0900_demod_num demod)
 {
@@ -1876,7 +1851,7 @@ static int stv0900_sleep(struct dvb_frontend *fe)
 }
 
 static int stv0900_get_frontend(struct dvb_frontend *fe,
-				struct dvb_frontend_parameters *p)
+				struct dtv_frontend_properties *p)
 {
 	struct stv0900_state *state = fe->demodulator_priv;
 	struct stv0900_internal *intp = state->internal;
@@ -1884,12 +1859,12 @@ static int stv0900_get_frontend(struct dvb_frontend *fe,
 	struct stv0900_signal_info p_result = intp->result[demod];
 
 	p->frequency = p_result.locked ? p_result.frequency : 0;
-	p->u.qpsk.symbol_rate = p_result.locked ? p_result.symbol_rate : 0;
+	p->symbol_rate = p_result.locked ? p_result.symbol_rate : 0;
 	return 0;
 }
 
 static struct dvb_frontend_ops stv0900_ops = {
-
+	.delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS },
 	.info = {
 		.name			= "STV0900 frontend",
 		.type			= FE_QPSK,
@@ -1908,7 +1883,7 @@ static struct dvb_frontend_ops stv0900_ops = {
 	},
 	.release			= stv0900_release,
 	.init				= stv0900_init,
-	.get_frontend_legacy = stv0900_get_frontend,
+	.get_frontend                   = stv0900_get_frontend,
 	.sleep				= stv0900_sleep,
 	.get_frontend_algo		= stv0900_frontend_algo,
 	.i2c_gate_ctrl			= stv0900_i2c_gate_ctrl,
@@ -1916,8 +1891,6 @@ static struct dvb_frontend_ops stv0900_ops = {
 	.diseqc_send_burst		= stv0900_send_burst,
 	.diseqc_recv_slave_reply	= stv0900_recv_slave_reply,
 	.set_tone			= stv0900_set_tone,
-	.set_property			= stb0900_set_property,
-	.get_property			= stb0900_get_property,
 	.search				= stv0900_search,
 	.track				= stv0900_track,
 	.read_status			= stv0900_read_status,
Signature · 1 line
1.7.8.352.g876a6
#61 lore raw

RFC PATCH 61/91 tda10086: 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/dvb/frontends/tda10086.c |   46 ++++++++++++++++----------------
 1 files changed, 23 insertions(+), 23 deletions(-)
drivers/media/dvb/frontends/tda10086.c +23 -23
index 8501100..81fa57b 100644
@@ -267,7 +267,7 @@ static int tda10086_send_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t minic
 }
 
 static int tda10086_set_inversion(struct tda10086_state *state,
-				  struct dvb_frontend_parameters *fe_params)
+				  struct dtv_frontend_properties *fe_params)
 {
 	u8 invval = 0x80;
 
@@ -292,7 +292,7 @@ static int tda10086_set_inversion(struct tda10086_state *state,
 }
 
 static int tda10086_set_symbol_rate(struct tda10086_state *state,
-				    struct dvb_frontend_parameters *fe_params)
+				    struct dtv_frontend_properties *fe_params)
 {
 	u8 dfn = 0;
 	u8 afs = 0;
@@ -303,7 +303,7 @@ static int tda10086_set_symbol_rate(struct tda10086_state *state,
 	u32 tmp;
 	u32 bdr;
 	u32 bdri;
-	u32 symbol_rate = fe_params->u.qpsk.symbol_rate;
+	u32 symbol_rate = fe_params->symbol_rate;
 
 	dprintk ("%s %i\n", __func__, symbol_rate);
 
@@ -367,13 +367,13 @@ static int tda10086_set_symbol_rate(struct tda10086_state *state,
 }
 
 static int tda10086_set_fec(struct tda10086_state *state,
-			    struct dvb_frontend_parameters *fe_params)
+			    struct dtv_frontend_properties *fe_params)
 {
 	u8 fecval;
 
-	dprintk ("%s %i\n", __func__, fe_params->u.qpsk.fec_inner);
+	dprintk ("%s %i\n", __func__, fe_params->fec_inner);
 
-	switch(fe_params->u.qpsk.fec_inner) {
+	switch(fe_params->fec_inner) {
 	case FEC_1_2:
 		fecval = 0x00;
 		break;
@@ -409,9 +409,9 @@ static int tda10086_set_fec(struct tda10086_state *state,
 	return 0;
 }
 
-static int tda10086_set_frontend(struct dvb_frontend* fe,
-				 struct dvb_frontend_parameters *fe_params)
+static int tda10086_set_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache;
 	struct tda10086_state *state = fe->demodulator_priv;
 	int ret;
 	u32 freq = 0;
@@ -452,12 +452,12 @@ static int tda10086_set_frontend(struct dvb_frontend* fe,
 	tda10086_write_mask(state, 0x10, 0x40, 0x40);
 	tda10086_write_mask(state, 0x00, 0x01, 0x00);
 
-	state->symbol_rate = fe_params->u.qpsk.symbol_rate;
+	state->symbol_rate = fe_params->symbol_rate;
 	state->frequency = fe_params->frequency;
 	return 0;
 }
 
-static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *fe_params)
+static int tda10086_get_frontend(struct dvb_frontend* fe, struct dtv_frontend_properties *fe_params)
 {
 	struct tda10086_state* state = fe->demodulator_priv;
 	u8 val;
@@ -467,7 +467,7 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
 	dprintk ("%s\n", __func__);
 
 	/* check for invalid symbol rate */
-	if (fe_params->u.qpsk.symbol_rate < 500000)
+	if (fe_params->symbol_rate < 500000)
 		return -EINVAL;
 
 	/* calculate the updated frequency (note: we convert from Hz->kHz) */
@@ -516,34 +516,34 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
 		tmp |= 0xffffff00;
 	tmp = (tmp * 480 * (1<<1)) / 128;
 	tmp = ((state->symbol_rate/1000) * tmp) / (1000000/1000);
-	fe_params->u.qpsk.symbol_rate = state->symbol_rate + tmp;
+	fe_params->symbol_rate = state->symbol_rate + tmp;
 
 	/* the FEC */
 	val = (tda10086_read_byte(state, 0x0d) & 0x70) >> 4;
 	switch(val) {
 	case 0x00:
-		fe_params->u.qpsk.fec_inner = FEC_1_2;
+		fe_params->fec_inner = FEC_1_2;
 		break;
 	case 0x01:
-		fe_params->u.qpsk.fec_inner = FEC_2_3;
+		fe_params->fec_inner = FEC_2_3;
 		break;
 	case 0x02:
-		fe_params->u.qpsk.fec_inner = FEC_3_4;
+		fe_params->fec_inner = FEC_3_4;
 		break;
 	case 0x03:
-		fe_params->u.qpsk.fec_inner = FEC_4_5;
+		fe_params->fec_inner = FEC_4_5;
 		break;
 	case 0x04:
-		fe_params->u.qpsk.fec_inner = FEC_5_6;
+		fe_params->fec_inner = FEC_5_6;
 		break;
 	case 0x05:
-		fe_params->u.qpsk.fec_inner = FEC_6_7;
+		fe_params->fec_inner = FEC_6_7;
 		break;
 	case 0x06:
-		fe_params->u.qpsk.fec_inner = FEC_7_8;
+		fe_params->fec_inner = FEC_7_8;
 		break;
 	case 0x07:
-		fe_params->u.qpsk.fec_inner = FEC_8_9;
+		fe_params->fec_inner = FEC_8_9;
 		break;
 	}
 
@@ -701,7 +701,7 @@ static void tda10086_release(struct dvb_frontend* fe)
 }
 
 static struct dvb_frontend_ops tda10086_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name     = "Philips TDA10086 DVB-S",
 		.type     = FE_QPSK,
@@ -722,8 +722,8 @@ static struct dvb_frontend_ops tda10086_ops = {
 	.sleep = tda10086_sleep,
 	.i2c_gate_ctrl = tda10086_i2c_gate_ctrl,
 
-	.set_frontend_legacy = tda10086_set_frontend,
-	.get_frontend_legacy = tda10086_get_frontend,
+	.set_frontend = tda10086_set_frontend,
+	.get_frontend = tda10086_get_frontend,
 	.get_tune_settings = tda10086_get_tune_settings,
 
 	.read_status = tda10086_read_status,
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

In reply to Mauro Carvalho Chehab

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
#42 lore raw

RFC PATCH 42/91 sp8870: 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/dvb/frontends/sp8870.c |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)
drivers/media/dvb/frontends/sp8870.c +14 -13
index d49e48c..bad1832 100644
@@ -168,13 +168,13 @@ static int sp8870_read_data_valid_signal(struct sp8870_state* state)
 	return (sp8870_readreg(state, 0x0D02) > 0);
 }
 
-static int configure_reg0xc05 (struct dvb_frontend_parameters *p, u16 *reg0xc05)
+static int configure_reg0xc05 (struct dtv_frontend_properties *p, u16 *reg0xc05)
 {
 	int known_parameters = 1;
 
 	*reg0xc05 = 0x000;
 
-	switch (p->u.ofdm.constellation) {
+	switch (p->modulation) {
 	case QPSK:
 		break;
 	case QAM_16:
@@ -190,7 +190,7 @@ static int configure_reg0xc05 (struct dvb_frontend_parameters *p, u16 *reg0xc05)
 		return -EINVAL;
 	};
 
-	switch (p->u.ofdm.hierarchy_information) {
+	switch (p->hierarchy) {
 	case HIERARCHY_NONE:
 		break;
 	case HIERARCHY_1:
@@ -209,7 +209,7 @@ static int configure_reg0xc05 (struct dvb_frontend_parameters *p, u16 *reg0xc05)
 		return -EINVAL;
 	};
 
-	switch (p->u.ofdm.code_rate_HP) {
+	switch (p->code_rate_HP) {
 	case FEC_1_2:
 		break;
 	case FEC_2_3:
@@ -245,9 +245,9 @@ static int sp8870_wake_up(struct sp8870_state* state)
 	return sp8870_writereg(state, 0xC18, 0x00D);
 }
 
-static int sp8870_set_frontend_parameters (struct dvb_frontend* fe,
-					   struct dvb_frontend_parameters *p)
+static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct sp8870_state* state = fe->demodulator_priv;
 	int  err;
 	u16 reg0xc05;
@@ -277,15 +277,15 @@ static int sp8870_set_frontend_parameters (struct dvb_frontend* fe,
 	sp8870_writereg(state, 0x030A, 0x0000);
 
 	// filter for 6/7/8 Mhz channel
-	if (p->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
+	if (p->bandwidth_hz == 6000000)
 		sp8870_writereg(state, 0x0311, 0x0002);
-	else if (p->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)
+	else if (p->bandwidth_hz == 7000000)
 		sp8870_writereg(state, 0x0311, 0x0001);
 	else
 		sp8870_writereg(state, 0x0311, 0x0000);
 
 	// scan order: 2k first = 0x0000, 8k first = 0x0001
-	if (p->u.ofdm.transmission_mode == TRANSMISSION_MODE_2K)
+	if (p->transmission_mode == TRANSMISSION_MODE_2K)
 		sp8870_writereg(state, 0x0338, 0x0000);
 	else
 		sp8870_writereg(state, 0x0338, 0x0001);
@@ -459,8 +459,9 @@ static int lockups;
 /* only for debugging: counter for channel switches */
 static int switches;
 
-static int sp8870_set_frontend (struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int sp8870_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct sp8870_state* state = fe->demodulator_priv;
 
 	/*
@@ -479,7 +480,7 @@ static int sp8870_set_frontend (struct dvb_frontend* fe, struct dvb_frontend_par
 
 	for (trials = 1; trials <= MAXTRIALS; trials++) {
 
-		if ((err = sp8870_set_frontend_parameters(fe, p)))
+		if ((err = sp8870_set_frontend_parameters(fe)))
 			return err;
 
 		for (check_count = 0; check_count < MAXCHECKS; check_count++) {
@@ -579,7 +580,7 @@ error:
 }
 
 static struct dvb_frontend_ops sp8870_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Spase SP8870 DVB-T",
 		.type			= FE_OFDM,
@@ -600,7 +601,7 @@ static struct dvb_frontend_ops sp8870_ops = {
 	.sleep = sp8870_sleep,
 	.i2c_gate_ctrl = sp8870_i2c_gate_ctrl,
 
-	.set_frontend_legacy = sp8870_set_frontend,
+	.set_frontend = sp8870_set_frontend,
 	.get_tune_settings = sp8870_get_tune_settings,
 
 	.read_status = sp8870_read_status,
Signature · 1 line
1.7.8.352.g876a6
#62 lore raw

RFC PATCH 62/91 nxt200x: 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/dvb/frontends/nxt200x.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
drivers/media/dvb/frontends/nxt200x.c +8 -8
index efb8e46..b541614 100644
@@ -528,9 +528,9 @@ static int nxt2004_load_firmware (struct dvb_frontend* fe, const struct firmware
 	return 0;
 };
 
-static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
-					     struct dvb_frontend_parameters *p)
+static int nxt200x_setup_frontend_parameters(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct nxt200x_state* state = fe->demodulator_priv;
 	u8 buf[5];
 
@@ -546,7 +546,7 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
 	}
 
 	/* set additional params */
-	switch (p->u.vsb.modulation) {
+	switch (p->modulation) {
 		case QAM_64:
 		case QAM_256:
 			/* Set punctured clock for QAM */
@@ -576,7 +576,7 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
 	nxt200x_agc_reset(state);
 
 	/* set target power level */
-	switch (p->u.vsb.modulation) {
+	switch (p->modulation) {
 		case QAM_64:
 		case QAM_256:
 			buf[0] = 0x74;
@@ -620,7 +620,7 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
 	}
 
 	/* write sdmx input */
-	switch (p->u.vsb.modulation) {
+	switch (p->modulation) {
 		case QAM_64:
 				buf[0] = 0x68;
 				break;
@@ -714,7 +714,7 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
 	}
 
 	/* write agc ucgp0 */
-	switch (p->u.vsb.modulation) {
+	switch (p->modulation) {
 		case QAM_64:
 				buf[0] = 0x02;
 				break;
@@ -1203,7 +1203,7 @@ error:
 }
 
 static struct dvb_frontend_ops nxt200x_ops = {
-
+	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name = "Nextwave NXT200X VSB/QAM frontend",
 		.type = FE_ATSC,
@@ -1220,7 +1220,7 @@ static struct dvb_frontend_ops nxt200x_ops = {
 	.init = nxt200x_init,
 	.sleep = nxt200x_sleep,
 
-	.set_frontend_legacy = nxt200x_setup_frontend_parameters,
+	.set_frontend = nxt200x_setup_frontend_parameters,
 	.get_tune_settings = nxt200x_get_tune_settings,
 
 	.read_status = nxt200x_read_status,
Signature · 1 line
1.7.8.352.g876a6
#77 lore raw

RFC PATCH 77/91 vp702x-fe: 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/dvb/dvb-usb/vp702x-fe.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
drivers/media/dvb/dvb-usb/vp702x-fe.c +9 -8
index 8ff5aab..fa0b811 100644
@@ -135,9 +135,9 @@ static int vp702x_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_front
 	return 0;
 }
 
-static int vp702x_fe_set_frontend(struct dvb_frontend* fe,
-				  struct dvb_frontend_parameters *fep)
+static int vp702x_fe_set_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct vp702x_fe_state *st = fe->demodulator_priv;
 	struct vp702x_device_state *dst = st->d->priv;
 	u32 freq = fep->frequency/1000;
@@ -155,14 +155,14 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe,
 	cmd[1] =  freq       & 0xff;
 	cmd[2] = 1; /* divrate == 4 -> frequencyRef[1] -> 1 here */
 
-	sr = (u64) (fep->u.qpsk.symbol_rate/1000) << 20;
+	sr = (u64) (fep->symbol_rate/1000) << 20;
 	do_div(sr,88000);
 	cmd[3] = (sr >> 12) & 0xff;
 	cmd[4] = (sr >> 4)  & 0xff;
 	cmd[5] = (sr << 4)  & 0xf0;
 
 	deb_fe("setting frontend to: %u -> %u (%x) LNB-based GHz, symbolrate: %d -> %lu (%lx)\n",
-			fep->frequency,freq,freq, fep->u.qpsk.symbol_rate,
+			fep->frequency,freq,freq, fep->symbol_rate,
 			(unsigned long) sr, (unsigned long) sr);
 
 /*	if (fep->inversion == INVERSION_ON)
@@ -171,7 +171,7 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe,
 	if (st->voltage == SEC_VOLTAGE_18)
 		cmd[6] |= 0x40;
 
-/*	if (fep->u.qpsk.symbol_rate > 8000000)
+/*	if (fep->symbol_rate > 8000000)
 		cmd[6] |= 0x20;
 
 	if (fep->frequency < 1531000)
@@ -212,7 +212,7 @@ static int vp702x_fe_sleep(struct dvb_frontend *fe)
 }
 
 static int vp702x_fe_get_frontend(struct dvb_frontend* fe,
-				  struct dvb_frontend_parameters *fep)
+				  struct dtv_frontend_properties *fep)
 {
 	deb_fe("%s\n",__func__);
 	return 0;
@@ -350,6 +350,7 @@ error:
 
 
 static struct dvb_frontend_ops vp702x_fe_ops = {
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name           = "Twinhan DST-like frontend (VP7021/VP7020) DVB-S",
 		.type           = FE_QPSK,
@@ -370,8 +371,8 @@ static struct dvb_frontend_ops vp702x_fe_ops = {
 	.init  = vp702x_fe_init,
 	.sleep = vp702x_fe_sleep,
 
-	.set_frontend_legacy = vp702x_fe_set_frontend,
-	.get_frontend_legacy = vp702x_fe_get_frontend,
+	.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,
Signature · 1 line
1.7.8.352.g876a6
#4 lore raw

RFC PATCH 4/91 af9013: 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/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
1.7.8.352.g876a6
#12 lore raw

RFC PATCH 12/91 cx23123: remove an unused argument from cx24123_pll_writereg()

In reply to Mauro Carvalho Chehab

cx24123_pll_writereg doesn't use dvb_frontend_parameters. Just remove it.

---
 drivers/media/dvb/frontends/cx24123.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
drivers/media/dvb/frontends/cx24123.c +5 -6
index 96f99a8..4dfe786 100644
@@ -601,8 +601,7 @@ static int cx24123_pll_calculate(struct dvb_frontend *fe,
  * Tuner cx24109 is written through a dedicated 3wire interface
  * on the demod chip.
  */
-static int cx24123_pll_writereg(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p, u32 data)
+static int cx24123_pll_writereg(struct dvb_frontend *fe, u32 data)
 {
 	struct cx24123_state *state = fe->demodulator_priv;
 	unsigned long timeout;
@@ -673,12 +672,12 @@ static int cx24123_pll_tune(struct dvb_frontend *fe,
 	}
 
 	/* Write the new VCO/VGA */
-	cx24123_pll_writereg(fe, p, state->VCAarg);
-	cx24123_pll_writereg(fe, p, state->VGAarg);
+	cx24123_pll_writereg(fe, state->VCAarg);
+	cx24123_pll_writereg(fe, state->VGAarg);
 
 	/* Write the new bandselect and pll args */
-	cx24123_pll_writereg(fe, p, state->bandselectarg);
-	cx24123_pll_writereg(fe, p, state->pllarg);
+	cx24123_pll_writereg(fe, state->bandselectarg);
+	cx24123_pll_writereg(fe, state->pllarg);
 
 	/* set the FILTUNE voltage */
 	val = cx24123_readreg(state, 0x28) & ~0x3;
Signature · 1 line
1.7.8.352.g876a6
#13 lore raw

RFC PATCH 13/91 av7110: convert set_fontend to use DVBv5 parameters

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/ttpci/av7110.c |   13 ++++++-------
 drivers/media/dvb/ttpci/av7110.h |    3 +--
 2 files changed, 7 insertions(+), 9 deletions(-)
drivers/media/dvb/ttpci/av7110.c +6 -7
index c615ed7..e0df729 100644
@@ -1971,15 +1971,14 @@ static int av7110_fe_lock_fix(struct av7110* av7110, fe_status_t status)
 	return ret;
 }
 
-static int av7110_fe_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int av7110_fe_set_frontend(struct dvb_frontend *fe)
 {
 	struct av7110* av7110 = fe->dvb->priv;
 
 	int ret = av7110_fe_lock_fix(av7110, 0);
-	if (!ret) {
-		av7110->saved_fe_params = *params;
-		ret = av7110->fe_set_frontend(fe, params);
-	}
+	if (!ret)
+		ret = av7110->fe_set_frontend(fe);
+
 	return ret;
 }
 
@@ -2088,7 +2087,7 @@ static void dvb_s_recover(struct av7110* av7110)
 	msleep(20);
 	av7110_fe_set_tone(av7110->fe, av7110->saved_tone);
 
-	av7110_fe_set_frontend(av7110->fe, &av7110->saved_fe_params);
+	av7110_fe_set_frontend(av7110->fe);
 }
 
 static u8 read_pwm(struct av7110* av7110)
@@ -2283,7 +2282,7 @@ static int frontend_init(struct av7110 *av7110)
 		FE_FUNC_OVERRIDE(av7110->fe->ops.set_tone, av7110->fe_set_tone, av7110_fe_set_tone);
 		FE_FUNC_OVERRIDE(av7110->fe->ops.set_voltage, av7110->fe_set_voltage, av7110_fe_set_voltage);
 		FE_FUNC_OVERRIDE(av7110->fe->ops.dishnetwork_send_legacy_command, av7110->fe_dishnetwork_send_legacy_command, av7110_fe_dishnetwork_send_legacy_command);
-		FE_FUNC_OVERRIDE(av7110->fe->ops.set_frontend_legacy, av7110->fe_set_frontend, av7110_fe_set_frontend);
+		FE_FUNC_OVERRIDE(av7110->fe->ops.set_frontend, av7110->fe_set_frontend, av7110_fe_set_frontend);
 
 		ret = dvb_register_frontend(&av7110->dvb_adapter, av7110->fe);
 		if (ret < 0) {
drivers/media/dvb/ttpci/av7110.h +1 -2
index d85b851..16f0e0e 100644
@@ -272,7 +272,6 @@ struct av7110 {
 
 	/* crash recovery */
 	void				(*recover)(struct av7110* av7110);
-	struct dvb_frontend_parameters	saved_fe_params;
 	fe_sec_voltage_t		saved_voltage;
 	fe_sec_tone_mode_t		saved_tone;
 	struct dvb_diseqc_master_cmd	saved_master_cmd;
@@ -286,7 +285,7 @@ struct av7110 {
 	int (*fe_set_tone)(struct dvb_frontend* fe, fe_sec_tone_mode_t tone);
 	int (*fe_set_voltage)(struct dvb_frontend* fe, fe_sec_voltage_t voltage);
 	int (*fe_dishnetwork_send_legacy_command)(struct dvb_frontend* fe, unsigned long cmd);
-	int (*fe_set_frontend)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
+	int (*fe_set_frontend)(struct dvb_frontend* fe);
 };
 
 
Signature · 1 line
1.7.8.352.g876a6
#33 lore raw

RFC PATCH 33/91 lgdt330x: 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/dvb/frontends/lgdt330x.c |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)
drivers/media/dvb/frontends/lgdt330x.c +16 -14
index 21bffc0..f117eeb 100644
@@ -307,9 +307,9 @@ static int lgdt330x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int lgdt330x_set_parameters(struct dvb_frontend* fe,
-				   struct dvb_frontend_parameters *param)
+static int lgdt330x_set_parameters(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	/*
 	 * Array of byte pairs <address, value>
 	 * to initialize 8VSB for lgdt3303 chip 50 MHz IF
@@ -345,8 +345,8 @@ static int lgdt330x_set_parameters(struct dvb_frontend* fe,
 
 	int err;
 	/* Change only if we are actually changing the modulation */
-	if (state->current_modulation != param->u.vsb.modulation) {
-		switch(param->u.vsb.modulation) {
+	if (state->current_modulation != p->modulation) {
+		switch(p->modulation) {
 		case VSB_8:
 			dprintk("%s: VSB_8 MODE\n", __func__);
 
@@ -395,7 +395,7 @@ static int lgdt330x_set_parameters(struct dvb_frontend* fe,
 			}
 			break;
 		default:
-			printk(KERN_WARNING "lgdt330x: %s: Modulation type(%d) UNSUPPORTED\n", __func__, param->u.vsb.modulation);
+			printk(KERN_WARNING "lgdt330x: %s: Modulation type(%d) UNSUPPORTED\n", __func__, p->modulation);
 			return -1;
 		}
 		/*
@@ -410,7 +410,7 @@ static int lgdt330x_set_parameters(struct dvb_frontend* fe,
 				      sizeof(top_ctrl_cfg));
 		if (state->config->set_ts_params)
 			state->config->set_ts_params(fe, 0);
-		state->current_modulation = param->u.vsb.modulation;
+		state->current_modulation = p->modulation;
 	}
 
 	/* Tune to the specified frequency */
@@ -422,17 +422,17 @@ static int lgdt330x_set_parameters(struct dvb_frontend* fe,
 	/* Keep track of the new frequency */
 	/* FIXME this is the wrong way to do this...           */
 	/* The tuner is shared with the video4linux analog API */
-	state->current_frequency = param->frequency;
+	state->current_frequency = p->frequency;
 
 	lgdt330x_SwReset(state);
 	return 0;
 }
 
-static int lgdt330x_get_frontend(struct dvb_frontend* fe,
-				 struct dvb_frontend_parameters* param)
+static int lgdt330x_get_frontend(struct dvb_frontend *fe,
+				 struct dtv_frontend_properties *p)
 {
 	struct lgdt330x_state *state = fe->demodulator_priv;
-	param->frequency = state->current_frequency;
+	p->frequency = state->current_frequency;
 	return 0;
 }
 
@@ -762,6 +762,7 @@ error:
 }
 
 static struct dvb_frontend_ops lgdt3302_ops = {
+	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name= "LG Electronics LGDT3302 VSB/QAM Frontend",
 		.type = FE_ATSC,
@@ -773,8 +774,8 @@ static struct dvb_frontend_ops lgdt3302_ops = {
 		.caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
 	},
 	.init                 = lgdt330x_init,
-	.set_frontend_legacy         = lgdt330x_set_parameters,
-	.get_frontend_legacy = lgdt330x_get_frontend,
+	.set_frontend         = lgdt330x_set_parameters,
+	.get_frontend         = lgdt330x_get_frontend,
 	.get_tune_settings    = lgdt330x_get_tune_settings,
 	.read_status          = lgdt3302_read_status,
 	.read_ber             = lgdt330x_read_ber,
@@ -785,6 +786,7 @@ static struct dvb_frontend_ops lgdt3302_ops = {
 };
 
 static struct dvb_frontend_ops lgdt3303_ops = {
+	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name= "LG Electronics LGDT3303 VSB/QAM Frontend",
 		.type = FE_ATSC,
@@ -796,8 +798,8 @@ static struct dvb_frontend_ops lgdt3303_ops = {
 		.caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
 	},
 	.init                 = lgdt330x_init,
-	.set_frontend_legacy         = lgdt330x_set_parameters,
-	.get_frontend_legacy = lgdt330x_get_frontend,
+	.set_frontend         = lgdt330x_set_parameters,
+	.get_frontend         = lgdt330x_get_frontend,
 	.get_tune_settings    = lgdt330x_get_tune_settings,
 	.read_status          = lgdt3303_read_status,
 	.read_ber             = lgdt330x_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#43 lore raw

RFC PATCH 43/91 sp887x: 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/dvb/frontends/sp887x.c |   49 +++++++++++++++++++++------------
 1 files changed, 31 insertions(+), 18 deletions(-)
drivers/media/dvb/frontends/sp887x.c +31 -18
index 33ec08a..4b28d6a 100644
@@ -209,13 +209,13 @@ static int sp887x_initial_setup (struct dvb_frontend* fe, const struct firmware
 	return 0;
 };
 
-static int configure_reg0xc05 (struct dvb_frontend_parameters *p, u16 *reg0xc05)
+static int configure_reg0xc05 (struct dtv_frontend_properties *p, u16 *reg0xc05)
 {
 	int known_parameters = 1;
 
 	*reg0xc05 = 0x000;
 
-	switch (p->u.ofdm.constellation) {
+	switch (p->modulation) {
 	case QPSK:
 		break;
 	case QAM_16:
@@ -231,7 +231,7 @@ static int configure_reg0xc05 (struct dvb_frontend_parameters *p, u16 *reg0xc05)
 		return -EINVAL;
 	};
 
-	switch (p->u.ofdm.hierarchy_information) {
+	switch (p->hierarchy) {
 	case HIERARCHY_NONE:
 		break;
 	case HIERARCHY_1:
@@ -250,7 +250,7 @@ static int configure_reg0xc05 (struct dvb_frontend_parameters *p, u16 *reg0xc05)
 		return -EINVAL;
 	};
 
-	switch (p->u.ofdm.code_rate_HP) {
+	switch (p->code_rate_HP) {
 	case FEC_1_2:
 		break;
 	case FEC_2_3:
@@ -303,17 +303,30 @@ static void divide (int n, int d, int *quotient_i, int *quotient_f)
 }
 
 static void sp887x_correct_offsets (struct sp887x_state* state,
-				    struct dvb_frontend_parameters *p,
+				    struct dtv_frontend_properties *p,
 				    int actual_freq)
 {
 	static const u32 srate_correction [] = { 1879617, 4544878, 8098561 };
-	int bw_index = p->u.ofdm.bandwidth - BANDWIDTH_8_MHZ;
+	int bw_index;
 	int freq_offset = actual_freq - p->frequency;
 	int sysclock = 61003; //[kHz]
 	int ifreq = 36000000;
 	int freq;
 	int frequency_shift;
 
+	switch (p->bandwidth_hz) {
+	default:
+	case 8000000:
+		bw_index = 0;
+		break;
+	case 7000000:
+		bw_index = 1;
+		break;
+	case 6000000:
+		bw_index = 2;
+		break;
+	}
+
 	if (p->inversion == INVERSION_ON)
 		freq = ifreq - freq_offset;
 	else
@@ -333,17 +346,17 @@ static void sp887x_correct_offsets (struct sp887x_state* state,
 	sp887x_writereg(state, 0x30a, frequency_shift & 0xfff);
 }
 
-static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe,
-					     struct dvb_frontend_parameters *p)
+static int sp887x_setup_frontend_parameters (struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct sp887x_state* state = fe->demodulator_priv;
 	unsigned actual_freq;
 	int err;
 	u16 val, reg0xc05;
 
-	if (p->u.ofdm.bandwidth != BANDWIDTH_8_MHZ &&
-	    p->u.ofdm.bandwidth != BANDWIDTH_7_MHZ &&
-	    p->u.ofdm.bandwidth != BANDWIDTH_6_MHZ)
+	if (p->bandwidth_hz != 8000000 &&
+	    p->bandwidth_hz != 7000000 &&
+	    p->bandwidth_hz != 6000000)
 		return -EINVAL;
 
 	if ((err = configure_reg0xc05(p, &reg0xc05)))
@@ -369,9 +382,9 @@ static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe,
 	sp887x_correct_offsets(state, p, actual_freq);
 
 	/* filter for 6/7/8 Mhz channel */
-	if (p->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
+	if (p->bandwidth_hz == 6000000)
 		val = 2;
-	else if (p->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)
+	else if (p->bandwidth_hz == 7000000)
 		val = 1;
 	else
 		val = 0;
@@ -379,16 +392,16 @@ static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe,
 	sp887x_writereg(state, 0x311, val);
 
 	/* scan order: 2k first = 0, 8k first = 1 */
-	if (p->u.ofdm.transmission_mode == TRANSMISSION_MODE_2K)
+	if (p->transmission_mode == TRANSMISSION_MODE_2K)
 		sp887x_writereg(state, 0x338, 0x000);
 	else
 		sp887x_writereg(state, 0x338, 0x001);
 
 	sp887x_writereg(state, 0xc05, reg0xc05);
 
-	if (p->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
+	if (p->bandwidth_hz == 6000000)
 		val = 2 << 3;
-	else if (p->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)
+	else if (p->bandwidth_hz == 7000000)
 		val = 3 << 3;
 	else
 		val = 0 << 3;
@@ -579,7 +592,7 @@ error:
 }
 
 static struct dvb_frontend_ops sp887x_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "Spase SP887x DVB-T",
 		.type = FE_OFDM,
@@ -598,7 +611,7 @@ static struct dvb_frontend_ops sp887x_ops = {
 	.sleep = sp887x_sleep,
 	.i2c_gate_ctrl = sp887x_i2c_gate_ctrl,
 
-	.set_frontend_legacy = sp887x_setup_frontend_parameters,
+	.set_frontend = sp887x_setup_frontend_parameters,
 	.get_tune_settings = sp887x_get_tune_settings,
 
 	.read_status = sp887x_read_status,
Signature · 1 line
1.7.8.352.g876a6
#44 lore raw

RFC PATCH 44/91 stv0367: convert set_fontend to use DVBv5 parameters

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/stv0367.c |  154 ++++++++++++++++-----------------
 1 files changed, 75 insertions(+), 79 deletions(-)
drivers/media/dvb/frontends/stv0367.c +75 -79
index e0a2438..7c8964f6 100644
@@ -1577,9 +1577,9 @@ int stv0367ter_init(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int stv0367ter_algo(struct dvb_frontend *fe,
-				struct dvb_frontend_parameters *param)
+static int stv0367ter_algo(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;
 	int offset = 0, tempo = 0;
@@ -1591,7 +1591,7 @@ static int stv0367ter_algo(struct dvb_frontend *fe,
 
 	dprintk("%s:\n", __func__);
 
-	ter_state->frequency = param->frequency;
+	ter_state->frequency = p->frequency;
 	ter_state->force = FE_TER_FORCENONE
 			+ stv0367_readbits(state, F367TER_FORCE) * 2;
 	ter_state->if_iq_mode = state->config->if_iq_mode;
@@ -1620,7 +1620,7 @@ static int stv0367ter_algo(struct dvb_frontend *fe,
 
 	usleep_range(5000, 7000);
 
-	switch (param->inversion) {
+	switch (p->inversion) {
 	case INVERSION_AUTO:
 	default:
 		dprintk("%s: inversion AUTO\n", __func__);
@@ -1636,10 +1636,10 @@ static int stv0367ter_algo(struct dvb_frontend *fe,
 	case INVERSION_OFF:
 		if (ter_state->if_iq_mode == FE_TER_IQ_TUNER)
 			stv0367_writebits(state, F367TER_IQ_INVERT,
-						param->inversion);
+						p->inversion);
 		else
 			stv0367_writebits(state, F367TER_INV_SPECTR,
-						param->inversion);
+						p->inversion);
 
 		break;
 	}
@@ -1806,10 +1806,9 @@ static int stv0367ter_algo(struct dvb_frontend *fe,
 	return 0;
 }
 
-static int stv0367ter_set_frontend(struct dvb_frontend *fe,
-				struct dvb_frontend_parameters *param)
+static int stv0367ter_set_frontend(struct dvb_frontend *fe)
 {
-	struct dvb_ofdm_parameters *op = &param->u.ofdm;
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct stv0367_state *state = fe->demodulator_priv;
 	struct stv0367ter_state *ter_state = state->ter_state;
 
@@ -1827,7 +1826,7 @@ static int stv0367ter_set_frontend(struct dvb_frontend *fe,
 			fe->ops.i2c_gate_ctrl(fe, 0);
 	}
 
-	switch (op->transmission_mode) {
+	switch (p->transmission_mode) {
 	default:
 	case TRANSMISSION_MODE_AUTO:
 	case TRANSMISSION_MODE_2K:
@@ -1841,34 +1840,34 @@ static int stv0367ter_set_frontend(struct dvb_frontend *fe,
 		break;
 	}
 
-	switch (op->guard_interval) {
+	switch (p->guard_interval) {
 	default:
 	case GUARD_INTERVAL_1_32:
 	case GUARD_INTERVAL_1_16:
 	case GUARD_INTERVAL_1_8:
 	case GUARD_INTERVAL_1_4:
-		ter_state->guard = op->guard_interval;
+		ter_state->guard = p->guard_interval;
 		break;
 	case GUARD_INTERVAL_AUTO:
 		ter_state->guard = GUARD_INTERVAL_1_32;
 		break;
 	}
 
-	switch (op->bandwidth) {
-	case BANDWIDTH_6_MHZ:
+	switch (p->bandwidth_hz) {
+	case 6000000:
 		ter_state->bw = FE_TER_CHAN_BW_6M;
 		break;
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		ter_state->bw = FE_TER_CHAN_BW_7M;
 		break;
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
 	default:
 		ter_state->bw = FE_TER_CHAN_BW_8M;
 	}
 
 	ter_state->hierarchy = FE_TER_HIER_NONE;
 
-	switch (param->inversion) {
+	switch (p->inversion) {
 	case INVERSION_OFF:
 	case INVERSION_ON:
 		num_trials = 1;
@@ -1885,14 +1884,14 @@ static int stv0367ter_set_frontend(struct dvb_frontend *fe,
 
 	while (((index) < num_trials) && (ter_state->state != FE_TER_LOCKOK)) {
 		if (!ter_state->first_lock) {
-			if (param->inversion == INVERSION_AUTO)
+			if (p->inversion == INVERSION_AUTO)
 				ter_state->sense = SenseTrials[index];
 
 		}
-		stv0367ter_algo(fe,/* &pLook, result,*/ param);
+		stv0367ter_algo(fe);
 
 		if ((ter_state->state == FE_TER_LOCKOK) &&
-				(param->inversion == INVERSION_AUTO) &&
+				(p->inversion == INVERSION_AUTO) &&
 								(index == 1)) {
 			/* invert spectrum sense */
 			SenseTrials[index] = SenseTrials[0];
@@ -1928,49 +1927,47 @@ static int stv0367ter_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
 }
 
 static int stv0367ter_get_frontend(struct dvb_frontend *fe,
-				  struct dvb_frontend_parameters *param)
+				   struct dtv_frontend_properties *p)
 {
 	struct stv0367_state *state = fe->demodulator_priv;
 	struct stv0367ter_state *ter_state = state->ter_state;
-	struct dvb_ofdm_parameters *op = &param->u.ofdm;
-	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 
 	int error = 0;
 	enum stv0367_ter_mode mode;
 	int constell = 0,/* snr = 0,*/ Data = 0;
 
-	param->frequency = stv0367_get_tuner_freq(fe);
-	if ((int)param->frequency < 0)
-		param->frequency = c->frequency;
+	p->frequency = stv0367_get_tuner_freq(fe);
+	if ((int)p->frequency < 0)
+		p->frequency = -p->frequency;
 
 	constell = stv0367_readbits(state, F367TER_TPS_CONST);
 	if (constell == 0)
-		op->constellation = QPSK;
+		p->modulation = QPSK;
 	else if (constell == 1)
-		op->constellation = QAM_16;
+		p->modulation = QAM_16;
 	else
-		op->constellation = QAM_64;
+		p->modulation = QAM_64;
 
-	param->inversion = stv0367_readbits(state, F367TER_INV_SPECTR);
+	p->inversion = stv0367_readbits(state, F367TER_INV_SPECTR);
 
 	/* Get the Hierarchical mode */
 	Data = stv0367_readbits(state, F367TER_TPS_HIERMODE);
 
 	switch (Data) {
 	case 0:
-		op->hierarchy_information = HIERARCHY_NONE;
+		p->hierarchy = HIERARCHY_NONE;
 		break;
 	case 1:
-		op->hierarchy_information = HIERARCHY_1;
+		p->hierarchy = HIERARCHY_1;
 		break;
 	case 2:
-		op->hierarchy_information = HIERARCHY_2;
+		p->hierarchy = HIERARCHY_2;
 		break;
 	case 3:
-		op->hierarchy_information = HIERARCHY_4;
+		p->hierarchy = HIERARCHY_4;
 		break;
 	default:
-		op->hierarchy_information = HIERARCHY_AUTO;
+		p->hierarchy = HIERARCHY_AUTO;
 		break; /* error */
 	}
 
@@ -1982,22 +1979,22 @@ static int stv0367ter_get_frontend(struct dvb_frontend *fe,
 
 	switch (Data) {
 	case 0:
-		op->code_rate_HP = FEC_1_2;
+		p->code_rate_HP = FEC_1_2;
 		break;
 	case 1:
-		op->code_rate_HP = FEC_2_3;
+		p->code_rate_HP = FEC_2_3;
 		break;
 	case 2:
-		op->code_rate_HP = FEC_3_4;
+		p->code_rate_HP = FEC_3_4;
 		break;
 	case 3:
-		op->code_rate_HP = FEC_5_6;
+		p->code_rate_HP = FEC_5_6;
 		break;
 	case 4:
-		op->code_rate_HP = FEC_7_8;
+		p->code_rate_HP = FEC_7_8;
 		break;
 	default:
-		op->code_rate_HP = FEC_AUTO;
+		p->code_rate_HP = FEC_AUTO;
 		break; /* error */
 	}
 
@@ -2005,19 +2002,19 @@ static int stv0367ter_get_frontend(struct dvb_frontend *fe,
 
 	switch (mode) {
 	case FE_TER_MODE_2K:
-		op->transmission_mode = TRANSMISSION_MODE_2K;
+		p->transmission_mode = TRANSMISSION_MODE_2K;
 		break;
 /*	case FE_TER_MODE_4K:
-		op->transmission_mode = TRANSMISSION_MODE_4K;
+		p->transmission_mode = TRANSMISSION_MODE_4K;
 		break;*/
 	case FE_TER_MODE_8K:
-		op->transmission_mode = TRANSMISSION_MODE_8K;
+		p->transmission_mode = TRANSMISSION_MODE_8K;
 		break;
 	default:
-		op->transmission_mode = TRANSMISSION_MODE_AUTO;
+		p->transmission_mode = TRANSMISSION_MODE_AUTO;
 	}
 
-	op->guard_interval = stv0367_readbits(state, F367TER_SYR_GUARD);
+	p->guard_interval = stv0367_readbits(state, F367TER_SYR_GUARD);
 
 	return error;
 }
@@ -2265,6 +2262,7 @@ static void stv0367_release(struct dvb_frontend *fe)
 }
 
 static struct dvb_frontend_ops stv0367ter_ops = {
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "ST STV0367 DVB-T",
 		.type			= FE_OFDM,
@@ -2285,8 +2283,8 @@ static struct dvb_frontend_ops stv0367ter_ops = {
 	.init = stv0367ter_init,
 	.sleep = stv0367ter_sleep,
 	.i2c_gate_ctrl = stv0367ter_gate_ctrl,
-	.set_frontend_legacy = stv0367ter_set_frontend,
-	.get_frontend_legacy = stv0367ter_get_frontend,
+	.set_frontend = stv0367ter_set_frontend,
+	.get_frontend = stv0367ter_get_frontend,
 	.get_tune_settings = stv0367_get_tune_settings,
 	.read_status = stv0367ter_read_status,
 	.read_ber = stv0367ter_read_ber,/* too slow */
@@ -2822,9 +2820,8 @@ int stv0367cab_init(struct dvb_frontend *fe)
 }
 static
 enum stv0367_cab_signal_type stv0367cab_algo(struct stv0367_state *state,
-				struct dvb_frontend_parameters *param)
+					     struct dtv_frontend_properties *p)
 {
-	struct dvb_qam_parameters *op = &param->u.qam;
 	struct stv0367cab_state *cab_state = state->cab_state;
 	enum stv0367_cab_signal_type signalType = FE_CAB_NOAGC;
 	u32	QAMFEC_Lock, QAM_Lock, u32_tmp,
@@ -2839,7 +2836,7 @@ enum stv0367_cab_signal_type stv0367cab_algo(struct stv0367_state *state,
 	/* A max lock time of 25 ms is allowed for delayed AGC */
 	AGCTimeOut = 25;
 	/* 100000 symbols needed by the TRL as a maximum value */
-	TRLTimeOut = 100000000 / op->symbol_rate;
+	TRLTimeOut = 100000000 / p->symbol_rate;
 	/* CRLSymbols is the needed number of symbols to achieve a lock
 	   within [-4%, +4%] of the symbol rate.
 	   CRL timeout is calculated
@@ -2849,7 +2846,7 @@ enum stv0367_cab_signal_type stv0367cab_algo(struct stv0367_state *state,
 	   A characterization must be performed
 	   with these echoes to get new timeout values.
 	*/
-	switch (op->modulation) {
+	switch (p->modulation) {
 	case QAM_16:
 		CRLSymbols = 150000;
 		EQLTimeOut = 100;
@@ -2883,9 +2880,9 @@ enum stv0367_cab_signal_type stv0367cab_algo(struct stv0367_state *state,
 	} else
 #endif
 	CRLTimeOut = (25 * CRLSymbols * (cab_state->search_range / 1000)) /
-					(op->symbol_rate / 1000);
+					(p->symbol_rate / 1000);
 
-	CRLTimeOut = (1000 * CRLTimeOut) / op->symbol_rate;
+	CRLTimeOut = (1000 * CRLTimeOut) / p->symbol_rate;
 	/* Timeouts below 50ms are coerced */
 	if (CRLTimeOut < 50)
 		CRLTimeOut = 50;
@@ -2915,7 +2912,7 @@ enum stv0367_cab_signal_type stv0367cab_algo(struct stv0367_state *state,
 	stv0367cab_set_derot_freq(state, cab_state->adc_clk,
 		(1000 * (s32)state->config->if_khz + cab_state->derot_offset));
 	/* Disable the Allpass Filter when the symbol rate is out of range */
-	if ((op->symbol_rate > 10800000) | (op->symbol_rate < 1800000)) {
+	if ((p->symbol_rate > 10800000) | (p->symbol_rate < 1800000)) {
 		stv0367_writebits(state, F367CAB_ADJ_EN, 0);
 		stv0367_writebits(state, F367CAB_ALLPASSFILT_EN, 0);
 	}
@@ -2999,7 +2996,7 @@ enum stv0367_cab_signal_type stv0367cab_algo(struct stv0367_state *state,
 
 	if (QAMFEC_Lock) {
 		signalType = FE_CAB_DATAOK;
-		cab_state->modulation = op->modulation;
+		cab_state->modulation = p->modulation;
 		cab_state->spect_inv = stv0367_readbits(state,
 							F367CAB_QUAD_INV);
 #if 0
@@ -3081,20 +3078,19 @@ enum stv0367_cab_signal_type stv0367cab_algo(struct stv0367_state *state,
 	return signalType;
 }
 
-static int stv0367cab_set_frontend(struct dvb_frontend *fe,
-				struct dvb_frontend_parameters *param)
+static int stv0367cab_set_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;
-	struct dvb_qam_parameters *op = &param->u.qam;
 	enum stv0367cab_mod QAMSize = 0;
 
 	dprintk("%s: freq = %d, srate = %d\n", __func__,
-					param->frequency, op->symbol_rate);
+					p->frequency, p->symbol_rate);
 
 	cab_state->derot_offset = 0;
 
-	switch (op->modulation) {
+	switch (p->modulation) {
 	case QAM_16:
 		QAMSize = FE_CAB_MOD_QAM16;
 		break;
@@ -3127,70 +3123,69 @@ static int stv0367cab_set_frontend(struct dvb_frontend *fe,
 
 	stv0367cab_SetQamSize(
 			state,
-			op->symbol_rate,
+			p->symbol_rate,
 			QAMSize);
 
 	stv0367cab_set_srate(state,
 			cab_state->adc_clk,
 			cab_state->mclk,
-			op->symbol_rate,
+			p->symbol_rate,
 			QAMSize);
 	/* Search algorithm launch, [-1.1*RangeOffset, +1.1*RangeOffset] scan */
-	cab_state->state = stv0367cab_algo(state, param);
+	cab_state->state = stv0367cab_algo(state, p);
 	return 0;
 }
 
 static int stv0367cab_get_frontend(struct dvb_frontend *fe,
-				  struct dvb_frontend_parameters *param)
+				   struct dtv_frontend_properties *p)
 {
 	struct stv0367_state *state = fe->demodulator_priv;
 	struct stv0367cab_state *cab_state = state->cab_state;
-	struct dvb_qam_parameters *op = &param->u.qam;
 
 	enum stv0367cab_mod QAMSize;
 
 	dprintk("%s:\n", __func__);
 
-	op->symbol_rate = stv0367cab_GetSymbolRate(state, cab_state->mclk);
+	p->symbol_rate = stv0367cab_GetSymbolRate(state, cab_state->mclk);
 
 	QAMSize = stv0367_readbits(state, F367CAB_QAM_MODE);
 	switch (QAMSize) {
 	case FE_CAB_MOD_QAM16:
-		op->modulation = QAM_16;
+		p->modulation = QAM_16;
 		break;
 	case FE_CAB_MOD_QAM32:
-		op->modulation = QAM_32;
+		p->modulation = QAM_32;
 		break;
 	case FE_CAB_MOD_QAM64:
-		op->modulation = QAM_64;
+		p->modulation = QAM_64;
 		break;
 	case FE_CAB_MOD_QAM128:
-		op->modulation = QAM_128;
+		p->modulation = QAM_128;
 		break;
 	case QAM_256:
-		op->modulation = QAM_256;
+		p->modulation = QAM_256;
 		break;
 	default:
 		break;
 	}
 
-	param->frequency = stv0367_get_tuner_freq(fe);
+	p->frequency = stv0367_get_tuner_freq(fe);
 
-	dprintk("%s: tuner frequency = %d\n", __func__, param->frequency);
+	dprintk("%s: tuner frequency = %d\n", __func__, p->frequency);
 
 	if (state->config->if_khz == 0) {
-		param->frequency +=
+		p->frequency +=
 			(stv0367cab_get_derot_freq(state, cab_state->adc_clk) -
 			cab_state->adc_clk / 4000);
 		return 0;
 	}
 
 	if (state->config->if_khz > cab_state->adc_clk / 1000)
-		param->frequency += (state->config->if_khz
+		p->frequency += (state->config->if_khz
 			- stv0367cab_get_derot_freq(state, cab_state->adc_clk)
 			- cab_state->adc_clk / 1000);
 	else
-		param->frequency += (state->config->if_khz
+		p->frequency += (state->config->if_khz
 			- stv0367cab_get_derot_freq(state, cab_state->adc_clk));
 
 	return 0;
@@ -3386,6 +3381,7 @@ static int stv0367cab_read_ucblcks(struct dvb_frontend *fe, u32 *ucblocks)
 };
 
 static struct dvb_frontend_ops stv0367cab_ops = {
+	.delsys = { SYS_DVBC_ANNEX_A },
 	.info = {
 		.name = "ST STV0367 DVB-C",
 		.type = FE_QAM,
@@ -3403,8 +3399,8 @@ static struct dvb_frontend_ops stv0367cab_ops = {
 	.init					= stv0367cab_init,
 	.sleep					= stv0367cab_sleep,
 	.i2c_gate_ctrl				= stv0367cab_gate_ctrl,
-	.set_frontend_legacy				= stv0367cab_set_frontend,
-	.get_frontend_legacy = stv0367cab_get_frontend,
+	.set_frontend				= stv0367cab_set_frontend,
+	.get_frontend				= stv0367cab_get_frontend,
 	.read_status				= stv0367cab_read_status,
 /*	.read_ber				= stv0367cab_read_ber, */
 	.read_signal_strength			= stv0367cab_read_strength,
Signature · 1 line
1.7.8.352.g876a6
#48 lore raw

RFC PATCH 48/91 mt312: 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/dvb/frontends/mt312.c |   36 +++++++++++++++++-----------------
 1 files changed, 18 insertions(+), 18 deletions(-)
drivers/media/dvb/frontends/mt312.c +18 -18
index 8f5d2d2..3e4512a 100644
@@ -531,9 +531,9 @@ static int mt312_read_ucblocks(struct dvb_frontend *fe, u32 *ubc)
 	return 0;
 }
 
-static int mt312_set_frontend(struct dvb_frontend *fe,
-			      struct dvb_frontend_parameters *p)
+static int mt312_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct mt312_state *state = fe->demodulator_priv;
 	int ret;
 	u8 buf[5], config_val;
@@ -553,16 +553,16 @@ static int mt312_set_frontend(struct dvb_frontend *fe,
 	    || (p->inversion > INVERSION_ON))
 		return -EINVAL;
 
-	if ((p->u.qpsk.symbol_rate < fe->ops.info.symbol_rate_min)
-	    || (p->u.qpsk.symbol_rate > fe->ops.info.symbol_rate_max))
+	if ((p->symbol_rate < fe->ops.info.symbol_rate_min)
+	    || (p->symbol_rate > fe->ops.info.symbol_rate_max))
 		return -EINVAL;
 
-	if ((p->u.qpsk.fec_inner < FEC_NONE)
-	    || (p->u.qpsk.fec_inner > FEC_AUTO))
+	if ((p->fec_inner < FEC_NONE)
+	    || (p->fec_inner > FEC_AUTO))
 		return -EINVAL;
 
-	if ((p->u.qpsk.fec_inner == FEC_4_5)
-	    || (p->u.qpsk.fec_inner == FEC_8_9))
+	if ((p->fec_inner == FEC_4_5)
+	    || (p->fec_inner == FEC_8_9))
 		return -EINVAL;
 
 	switch (state->id) {
@@ -574,7 +574,7 @@ static int mt312_set_frontend(struct dvb_frontend *fe,
 		ret = mt312_readreg(state, CONFIG, &config_val);
 		if (ret < 0)
 			return ret;
-		if (p->u.qpsk.symbol_rate >= 30000000) {
+		if (p->symbol_rate >= 30000000) {
 			/* Note that 30MS/s should use 90MHz */
 			if (state->freq_mult == 6) {
 				/* We are running 60MHz */
@@ -609,19 +609,19 @@ static int mt312_set_frontend(struct dvb_frontend *fe,
 	}
 
 	/* sr = (u16)(sr * 256.0 / 1000000.0) */
-	sr = mt312_div(p->u.qpsk.symbol_rate * 4, 15625);
+	sr = mt312_div(p->symbol_rate * 4, 15625);
 
 	/* SYM_RATE */
 	buf[0] = (sr >> 8) & 0x3f;
 	buf[1] = (sr >> 0) & 0xff;
 
 	/* VIT_MODE */
-	buf[2] = inv_tab[p->inversion] | fec_tab[p->u.qpsk.fec_inner];
+	buf[2] = inv_tab[p->inversion] | fec_tab[p->fec_inner];
 
 	/* QPSK_CTRL */
 	buf[3] = 0x40;		/* swap I and Q before QPSK demodulation */
 
-	if (p->u.qpsk.symbol_rate < 10000000)
+	if (p->symbol_rate < 10000000)
 		buf[3] |= 0x04;	/* use afc mode */
 
 	/* GO */
@@ -637,7 +637,7 @@ static int mt312_set_frontend(struct dvb_frontend *fe,
 }
 
 static int mt312_get_frontend(struct dvb_frontend *fe,
-			      struct dvb_frontend_parameters *p)
+			      struct dtv_frontend_properties *p)
 {
 	struct mt312_state *state = fe->demodulator_priv;
 	int ret;
@@ -646,11 +646,11 @@ static int mt312_get_frontend(struct dvb_frontend *fe,
 	if (ret < 0)
 		return ret;
 
-	ret = mt312_get_symbol_rate(state, &p->u.qpsk.symbol_rate);
+	ret = mt312_get_symbol_rate(state, &p->symbol_rate);
 	if (ret < 0)
 		return ret;
 
-	ret = mt312_get_code_rate(state, &p->u.qpsk.fec_inner);
+	ret = mt312_get_code_rate(state, &p->fec_inner);
 	if (ret < 0)
 		return ret;
 
@@ -738,7 +738,7 @@ static void mt312_release(struct dvb_frontend *fe)
 
 #define MT312_SYS_CLK		90000000UL	/* 90 MHz */
 static struct dvb_frontend_ops mt312_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name = "Zarlink ???? DVB-S",
 		.type = FE_QPSK,
@@ -761,8 +761,8 @@ static struct dvb_frontend_ops mt312_ops = {
 	.sleep = mt312_sleep,
 	.i2c_gate_ctrl = mt312_i2c_gate_ctrl,
 
-	.set_frontend_legacy = mt312_set_frontend,
-	.get_frontend_legacy = mt312_get_frontend,
+	.set_frontend = mt312_set_frontend,
+	.get_frontend = mt312_get_frontend,
 	.get_tune_settings = mt312_get_tune_settings,
 
 	.read_status = mt312_read_status,
Signature · 1 line
1.7.8.352.g876a6
#54 lore raw

RFC PATCH 54/91 stv0297: 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/dvb/frontends/stv0297.c |   35 +++++++++++++++++----------------
 1 files changed, 18 insertions(+), 17 deletions(-)
drivers/media/dvb/frontends/stv0297.c +18 -17
index 5d7c288..88e8e52 100644
@@ -404,8 +404,9 @@ static int stv0297_read_ucblocks(struct dvb_frontend *fe, u32 * ucblocks)
 	return 0;
 }
 
-static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
+static int stv0297_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct stv0297_state *state = fe->demodulator_priv;
 	int u_threshold;
 	int initial_u;
@@ -417,7 +418,7 @@ static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 	unsigned long timeout;
 	fe_spectral_inversion_t inversion;
 
-	switch (p->u.qam.modulation) {
+	switch (p->modulation) {
 	case QAM_16:
 	case QAM_32:
 	case QAM_64:
@@ -519,16 +520,16 @@ static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 	stv0297_writereg_mask(state, 0x69, 0x0f, 0x00);
 
 	/* set parameters */
-	stv0297_set_qam(state, p->u.qam.modulation);
-	stv0297_set_symbolrate(state, p->u.qam.symbol_rate / 1000);
-	stv0297_set_sweeprate(state, sweeprate, p->u.qam.symbol_rate / 1000);
+	stv0297_set_qam(state, p->modulation);
+	stv0297_set_symbolrate(state, p->symbol_rate / 1000);
+	stv0297_set_sweeprate(state, sweeprate, p->symbol_rate / 1000);
 	stv0297_set_carrieroffset(state, carrieroffset);
 	stv0297_set_inversion(state, inversion);
 
 	/* kick off lock */
 	/* Disable corner detection for higher QAMs */
-	if (p->u.qam.modulation == QAM_128 ||
-		p->u.qam.modulation == QAM_256)
+	if (p->modulation == QAM_128 ||
+		p->modulation == QAM_256)
 		stv0297_writereg_mask(state, 0x88, 0x08, 0x00);
 	else
 		stv0297_writereg_mask(state, 0x88, 0x08, 0x08);
@@ -613,7 +614,7 @@ timeout:
 	return 0;
 }
 
-static int stv0297_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
+static int stv0297_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
 {
 	struct stv0297_state *state = fe->demodulator_priv;
 	int reg_00, reg_83;
@@ -625,24 +626,24 @@ static int stv0297_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 	p->inversion = (reg_83 & 0x08) ? INVERSION_ON : INVERSION_OFF;
 	if (state->config->invert)
 		p->inversion = (p->inversion == INVERSION_ON) ? INVERSION_OFF : INVERSION_ON;
-	p->u.qam.symbol_rate = stv0297_get_symbolrate(state) * 1000;
-	p->u.qam.fec_inner = FEC_NONE;
+	p->symbol_rate = stv0297_get_symbolrate(state) * 1000;
+	p->fec_inner = FEC_NONE;
 
 	switch ((reg_00 >> 4) & 0x7) {
 	case 0:
-		p->u.qam.modulation = QAM_16;
+		p->modulation = QAM_16;
 		break;
 	case 1:
-		p->u.qam.modulation = QAM_32;
+		p->modulation = QAM_32;
 		break;
 	case 2:
-		p->u.qam.modulation = QAM_128;
+		p->modulation = QAM_128;
 		break;
 	case 3:
-		p->u.qam.modulation = QAM_256;
+		p->modulation = QAM_256;
 		break;
 	case 4:
-		p->u.qam.modulation = QAM_64;
+		p->modulation = QAM_64;
 		break;
 	}
 
@@ -706,8 +707,8 @@ static struct dvb_frontend_ops stv0297_ops = {
 	.sleep = stv0297_sleep,
 	.i2c_gate_ctrl = stv0297_i2c_gate_ctrl,
 
-	.set_frontend_legacy = stv0297_set_frontend,
-	.get_frontend_legacy = stv0297_get_frontend,
+	.set_frontend = stv0297_set_frontend,
+	.get_frontend = stv0297_get_frontend,
 
 	.read_status = stv0297_read_status,
 	.read_ber = stv0297_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#69 lore raw

RFC PATCH 69/91 staging/as102: 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/staging/media/as102/as102_fe.c    |   78 ++++++++++++++--------------
 drivers/staging/media/as102/as10x_cmd.c   |    4 +-
 drivers/staging/media/as102/as10x_types.h |    4 +-
 3 files changed, 43 insertions(+), 43 deletions(-)
drivers/staging/media/as102/as102_fe.c +39 -39
index b0c5128..d6472ea 100644
@@ -23,15 +23,15 @@
 #include "as10x_types.h"
 #include "as10x_cmd.h"
 
-static void as10x_fe_copy_tps_parameters(struct dvb_frontend_parameters *dst,
+static void as10x_fe_copy_tps_parameters(struct dtv_frontend_properties *dst,
 					 struct as10x_tps *src);
 
 static void as102_fe_copy_tune_parameters(struct as10x_tune_args *dst,
-					  struct dvb_frontend_parameters *src);
+					  struct dtv_frontend_properties *src);
 
-static int as102_fe_set_frontend(struct dvb_frontend *fe,
-				 struct dvb_frontend_parameters *params)
+static int as102_fe_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	int ret = 0;
 	struct as102_dev_t *dev;
 	struct as10x_tune_args tune_args = { 0 };
@@ -45,7 +45,7 @@ static int as102_fe_set_frontend(struct dvb_frontend *fe,
 	if (mutex_lock_interruptible(&dev->bus_adap.lock))
 		return -EBUSY;
 
-	as102_fe_copy_tune_parameters(&tune_args, params);
+	as102_fe_copy_tune_parameters(&tune_args, p);
 
 	/* send abilis command: SET_TUNE */
 	ret =  as10x_cmd_set_tune(&dev->bus_adap, &tune_args);
@@ -59,7 +59,8 @@ static int as102_fe_set_frontend(struct dvb_frontend *fe,
 }
 
 static int as102_fe_get_frontend(struct dvb_frontend *fe,
-				 struct dvb_frontend_parameters *p) {
+				 struct dtv_frontend_properties *p)
+{
 	int ret = 0;
 	struct as102_dev_t *dev;
 	struct as10x_tps tps = { 0 };
@@ -278,6 +279,7 @@ static int as102_fe_ts_bus_ctrl(struct dvb_frontend *fe, int acquire)
 }
 
 static struct dvb_frontend_ops as102_fe_ops = {
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Unknown AS102 device",
 		.type			= FE_OFDM,
@@ -296,8 +298,8 @@ static struct dvb_frontend_ops as102_fe_ops = {
 			| FE_CAN_MUTE_TS
 	},
 
-	.set_frontend_legacy	= as102_fe_set_frontend,
-	.get_frontend_legacy	= as102_fe_get_frontend,
+	.set_frontend		= as102_fe_set_frontend,
+	.get_frontend		= as102_fe_get_frontend,
 	.get_tune_settings	= as102_fe_get_tune_settings,
 
 	.read_status		= as102_fe_read_status,
@@ -344,38 +346,36 @@ int as102_dvb_register_fe(struct as102_dev_t *as102_dev,
 	return errno;
 }
 
-static void as10x_fe_copy_tps_parameters(struct dvb_frontend_parameters *dst,
+static void as10x_fe_copy_tps_parameters(struct dtv_frontend_properties *fe_tps,
 					 struct as10x_tps *as10x_tps)
 {
 
-	struct dvb_ofdm_parameters *fe_tps = &dst->u.ofdm;
-
 	/* extract consteallation */
-	switch (as10x_tps->constellation) {
+	switch (as10x_tps->modulation) {
 	case CONST_QPSK:
-		fe_tps->constellation = QPSK;
+		fe_tps->modulation = QPSK;
 		break;
 	case CONST_QAM16:
-		fe_tps->constellation = QAM_16;
+		fe_tps->modulation = QAM_16;
 		break;
 	case CONST_QAM64:
-		fe_tps->constellation = QAM_64;
+		fe_tps->modulation = QAM_64;
 		break;
 	}
 
 	/* extract hierarchy */
 	switch (as10x_tps->hierarchy) {
 	case HIER_NONE:
-		fe_tps->hierarchy_information = HIERARCHY_NONE;
+		fe_tps->hierarchy = HIERARCHY_NONE;
 		break;
 	case HIER_ALPHA_1:
-		fe_tps->hierarchy_information = HIERARCHY_1;
+		fe_tps->hierarchy = HIERARCHY_1;
 		break;
 	case HIER_ALPHA_2:
-		fe_tps->hierarchy_information = HIERARCHY_2;
+		fe_tps->hierarchy = HIERARCHY_2;
 		break;
 	case HIER_ALPHA_4:
-		fe_tps->hierarchy_information = HIERARCHY_4;
+		fe_tps->hierarchy = HIERARCHY_4;
 		break;
 	}
 
@@ -473,7 +473,7 @@ static uint8_t as102_fe_get_code_rate(fe_code_rate_t arg)
 }
 
 static void as102_fe_copy_tune_parameters(struct as10x_tune_args *tune_args,
-			  struct dvb_frontend_parameters *params)
+			  struct dtv_frontend_properties *params)
 {
 
 	/* set frequency */
@@ -482,21 +482,21 @@ static void as102_fe_copy_tune_parameters(struct as10x_tune_args *tune_args,
 	/* fix interleaving_mode */
 	tune_args->interleaving_mode = INTLV_NATIVE;
 
-	switch (params->u.ofdm.bandwidth) {
-	case BANDWIDTH_8_MHZ:
+	switch (params->bandwidth_hz) {
+	case 8000000:
 		tune_args->bandwidth = BW_8_MHZ;
 		break;
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		tune_args->bandwidth = BW_7_MHZ;
 		break;
-	case BANDWIDTH_6_MHZ:
+	case 6000000:
 		tune_args->bandwidth = BW_6_MHZ;
 		break;
 	default:
 		tune_args->bandwidth = BW_8_MHZ;
 	}
 
-	switch (params->u.ofdm.guard_interval) {
+	switch (params->guard_interval) {
 	case GUARD_INTERVAL_1_32:
 		tune_args->guard_interval = GUARD_INT_1_32;
 		break;
@@ -515,22 +515,22 @@ static void as102_fe_copy_tune_parameters(struct as10x_tune_args *tune_args,
 		break;
 	}
 
-	switch (params->u.ofdm.constellation) {
+	switch (params->modulation) {
 	case QPSK:
-		tune_args->constellation = CONST_QPSK;
+		tune_args->modulation = CONST_QPSK;
 		break;
 	case QAM_16:
-		tune_args->constellation = CONST_QAM16;
+		tune_args->modulation = CONST_QAM16;
 		break;
 	case QAM_64:
-		tune_args->constellation = CONST_QAM64;
+		tune_args->modulation = CONST_QAM64;
 		break;
 	default:
-		tune_args->constellation = CONST_UNKNOWN;
+		tune_args->modulation = CONST_UNKNOWN;
 		break;
 	}
 
-	switch (params->u.ofdm.transmission_mode) {
+	switch (params->transmission_mode) {
 	case TRANSMISSION_MODE_2K:
 		tune_args->transmission_mode = TRANS_MODE_2K;
 		break;
@@ -541,7 +541,7 @@ static void as102_fe_copy_tune_parameters(struct as10x_tune_args *tune_args,
 		tune_args->transmission_mode = TRANS_MODE_UNKNOWN;
 	}
 
-	switch (params->u.ofdm.hierarchy_information) {
+	switch (params->hierarchy) {
 	case HIERARCHY_NONE:
 		tune_args->hierarchy = HIER_NONE;
 		break;
@@ -569,19 +569,19 @@ static void as102_fe_copy_tune_parameters(struct as10x_tune_args *tune_args,
 	 * if HP/LP are both set to FEC_NONE, HP will be selected.
 	 */
 	if ((tune_args->hierarchy != HIER_NONE) &&
-		       ((params->u.ofdm.code_rate_LP == FEC_NONE) ||
-			(params->u.ofdm.code_rate_HP == FEC_NONE))) {
+		       ((params->code_rate_LP == FEC_NONE) ||
+			(params->code_rate_HP == FEC_NONE))) {
 
-		if (params->u.ofdm.code_rate_LP == FEC_NONE) {
+		if (params->code_rate_LP == FEC_NONE) {
 			tune_args->hier_select = HIER_HIGH_PRIORITY;
 			tune_args->code_rate =
-			   as102_fe_get_code_rate(params->u.ofdm.code_rate_HP);
+			   as102_fe_get_code_rate(params->code_rate_HP);
 		}
 
-		if (params->u.ofdm.code_rate_HP == FEC_NONE) {
+		if (params->code_rate_HP == FEC_NONE) {
 			tune_args->hier_select = HIER_LOW_PRIORITY;
 			tune_args->code_rate =
-			   as102_fe_get_code_rate(params->u.ofdm.code_rate_LP);
+			   as102_fe_get_code_rate(params->code_rate_LP);
 		}
 
 		dprintk(debug, "\thierarchy: 0x%02x  "
@@ -594,6 +594,6 @@ static void as102_fe_copy_tune_parameters(struct as10x_tune_args *tune_args,
 			tune_args->code_rate);
 	} else {
 		tune_args->code_rate =
-			as102_fe_get_code_rate(params->u.ofdm.code_rate_HP);
+			as102_fe_get_code_rate(params->code_rate_HP);
 	}
 }
drivers/staging/media/as102/as10x_cmd.c +2 -2
index 0387bb8..262bb94 100644
@@ -141,7 +141,7 @@ int as10x_cmd_set_tune(struct as10x_bus_adapter_t *adap,
 	preq->body.set_tune.req.args.freq = cpu_to_le32(ptune->freq);
 	preq->body.set_tune.req.args.bandwidth = ptune->bandwidth;
 	preq->body.set_tune.req.args.hier_select = ptune->hier_select;
-	preq->body.set_tune.req.args.constellation = ptune->constellation;
+	preq->body.set_tune.req.args.modulation = ptune->modulation;
 	preq->body.set_tune.req.args.hierarchy = ptune->hierarchy;
 	preq->body.set_tune.req.args.interleaving_mode  =
 		ptune->interleaving_mode;
@@ -279,7 +279,7 @@ int as10x_cmd_get_tps(struct as10x_bus_adapter_t *adap, struct as10x_tps *ptps)
 		goto out;
 
 	/* Response OK -> get response data */
-	ptps->constellation = prsp->body.get_tps.rsp.tps.constellation;
+	ptps->modulation = prsp->body.get_tps.rsp.tps.modulation;
 	ptps->hierarchy = prsp->body.get_tps.rsp.tps.hierarchy;
 	ptps->interleaving_mode = prsp->body.get_tps.rsp.tps.interleaving_mode;
 	ptps->code_rate_HP = prsp->body.get_tps.rsp.tps.code_rate_HP;
drivers/staging/media/as102/as10x_types.h +2 -2
index c40c812..fde8140 100644
@@ -112,7 +112,7 @@
 #define CFG_MODE_AUTO	2
 
 struct as10x_tps {
-	uint8_t constellation;
+	uint8_t modulation;
 	uint8_t hierarchy;
 	uint8_t interleaving_mode;
 	uint8_t code_rate_HP;
@@ -132,7 +132,7 @@ struct as10x_tune_args {
 	/* hierarchy selection */
 	uint8_t hier_select;
 	/* constellation */
-	uint8_t constellation;
+	uint8_t modulation;
 	/* hierarchy */
 	uint8_t hierarchy;
 	/* interleaving mode */
Signature · 1 line
1.7.8.352.g876a6
#76 lore raw

RFC PATCH 76/91 mxl111sf-demod: 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/dvb/dvb-usb/mxl111sf-demod.c |   41 +++++++++++++--------------
 1 files changed, 20 insertions(+), 21 deletions(-)
drivers/media/dvb/dvb-usb/mxl111sf-demod.c +20 -21
index b798cc8..c61f246 100644
@@ -102,8 +102,8 @@ fail:
 }
 
 static
-int mxl1x1sf_demod_get_tps_constellation(struct mxl111sf_demod_state *state,
-					 fe_modulation_t *constellation)
+int mxl1x1sf_demod_get_tps_modulation(struct mxl111sf_demod_state *state,
+					 fe_modulation_t *modulation)
 {
 	u8 val;
 	int ret = mxl111sf_demod_read_reg(state, V6_MODORDER_TPS_REG, &val);
@@ -113,13 +113,13 @@ int mxl1x1sf_demod_get_tps_constellation(struct mxl111sf_demod_state *state,
 
 	switch ((val & V6_PARAM_CONSTELLATION_MASK) >> 4) {
 	case 0:
-		*constellation = QPSK;
+		*modulation = QPSK;
 		break;
 	case 1:
-		*constellation = QAM_16;
+		*modulation = QAM_16;
 		break;
 	case 2:
-		*constellation = QAM_64;
+		*modulation = QAM_64;
 		break;
 	}
 fail:
@@ -284,8 +284,7 @@ static int mxl1x1sf_demod_reset_irq_status(struct mxl111sf_demod_state *state)
 
 /* ------------------------------------------------------------------------ */
 
-static int mxl111sf_demod_set_frontend(struct dvb_frontend *fe,
-				       struct dvb_frontend_parameters *param)
+static int mxl111sf_demod_set_frontend(struct dvb_frontend *fe)
 {
 	struct mxl111sf_demod_state *state = fe->demodulator_priv;
 	int ret = 0;
@@ -481,13 +480,13 @@ static int mxl111sf_demod_read_signal_strength(struct dvb_frontend *fe,
 					       u16 *signal_strength)
 {
 	struct mxl111sf_demod_state *state = fe->demodulator_priv;
-	fe_modulation_t constellation;
+	fe_modulation_t modulation;
 	u16 snr;
 
 	mxl111sf_demod_calc_snr(state, &snr);
-	mxl1x1sf_demod_get_tps_constellation(state, &constellation);
+	mxl1x1sf_demod_get_tps_modulation(state, &modulation);
 
-	switch (constellation) {
+	switch (modulation) {
 	case QPSK:
 		*signal_strength = (snr >= 1300) ?
 			min(65535, snr * 44) : snr * 38;
@@ -509,7 +508,7 @@ static int mxl111sf_demod_read_signal_strength(struct dvb_frontend *fe,
 }
 
 static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe,
-				       struct dvb_frontend_parameters *p)
+				       struct dtv_frontend_properties *p)
 {
 	struct mxl111sf_demod_state *state = fe->demodulator_priv;
 
@@ -518,18 +517,18 @@ static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe,
 	p->inversion = /* FIXME */ ? INVERSION_ON : INVERSION_OFF;
 #endif
 	if (fe->ops.tuner_ops.get_bandwidth)
-		fe->ops.tuner_ops.get_bandwidth(fe, &p->u.ofdm.bandwidth);
+		fe->ops.tuner_ops.get_bandwidth(fe, &p->bandwidth_hz);
 	if (fe->ops.tuner_ops.get_frequency)
 		fe->ops.tuner_ops.get_frequency(fe, &p->frequency);
-	mxl1x1sf_demod_get_tps_code_rate(state, &p->u.ofdm.code_rate_HP);
-	mxl1x1sf_demod_get_tps_code_rate(state, &p->u.ofdm.code_rate_LP);
-	mxl1x1sf_demod_get_tps_constellation(state, &p->u.ofdm.constellation);
+	mxl1x1sf_demod_get_tps_code_rate(state, &p->code_rate_HP);
+	mxl1x1sf_demod_get_tps_code_rate(state, &p->code_rate_LP);
+	mxl1x1sf_demod_get_tps_modulation(state, &p->modulation);
 	mxl1x1sf_demod_get_tps_guard_fft_mode(state,
-					      &p->u.ofdm.transmission_mode);
+					      &p->transmission_mode);
 	mxl1x1sf_demod_get_tps_guard_interval(state,
-					      &p->u.ofdm.guard_interval);
+					      &p->guard_interval);
 	mxl1x1sf_demod_get_tps_hierarchy(state,
-					 &p->u.ofdm.hierarchy_information);
+					 &p->hierarchy);
 
 	return 0;
 }
@@ -551,7 +550,7 @@ static void mxl111sf_demod_release(struct dvb_frontend *fe)
 }
 
 static struct dvb_frontend_ops mxl111sf_demod_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name               = "MaxLinear MxL111SF DVB-T demodulator",
 		.type               = FE_OFDM,
@@ -570,8 +569,8 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = {
 	.init                 = mxl111sf_init,
 	.i2c_gate_ctrl        = mxl111sf_i2c_gate_ctrl,
 #endif
-	.set_frontend_legacy         = mxl111sf_demod_set_frontend,
-	.get_frontend_legacy = mxl111sf_demod_get_frontend,
+	.set_frontend         = mxl111sf_demod_set_frontend,
+	.get_frontend         = 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,
Signature · 1 line
1.7.8.352.g876a6
#31 lore raw

RFC PATCH 31/91 l64781: 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/dvb/frontends/l64781.c |  116 ++++++++++++++++++----------------
 1 files changed, 62 insertions(+), 54 deletions(-)
drivers/media/dvb/frontends/l64781.c +62 -54
index 1f1c598..1784e34 100644
@@ -117,18 +117,17 @@ static int reset_and_configure (struct l64781_state* state)
 	return (i2c_transfer(state->i2c, &msg, 1) == 1) ? 0 : -ENODEV;
 }
 
-static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_parameters *param)
+static int apply_frontend_param (struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct l64781_state* state = fe->demodulator_priv;
 	/* The coderates for FEC_NONE, FEC_4_5 and FEC_FEC_6_7 are arbitrary */
 	static const u8 fec_tab[] = { 7, 0, 1, 2, 9, 3, 10, 4 };
 	/* QPSK, QAM_16, QAM_64 */
 	static const u8 qam_tab [] = { 2, 4, 0, 6 };
-	static const u8 bw_tab [] = { 8, 7, 6 };  /* 8Mhz, 7MHz, 6MHz */
 	static const u8 guard_tab [] = { 1, 2, 4, 8 };
 	/* The Grundig 29504-401.04 Tuner comes with 18.432MHz crystal. */
 	static const u32 ppm = 8000;
-	struct dvb_ofdm_parameters *p = &param->u.ofdm;
 	u32 ddfs_offset_fixed;
 /*	u32 ddfs_offset_variable = 0x6000-((1000000UL+ppm)/ */
 /*			bw_tab[p->bandWidth]<<10)/15625; */
@@ -137,18 +136,29 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa
 	u8 val0x04;
 	u8 val0x05;
 	u8 val0x06;
-	int bw = p->bandwidth - BANDWIDTH_8_MHZ;
+	int bw;
+
+	switch (p->bandwidth_hz) {
+	case 8000000:
+		bw = 8;
+		break;
+	case 7000000:
+		bw = 7;
+		break;
+	case 6000000:
+		bw = 6;
+		break;
+	default:
+		return -EINVAL;
+	}
 
 	if (fe->ops.tuner_ops.set_params) {
 		fe->ops.tuner_ops.set_params(fe);
 		if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
 	}
 
-	if (param->inversion != INVERSION_ON &&
-	    param->inversion != INVERSION_OFF)
-		return -EINVAL;
-
-	if (bw < 0 || bw > 2)
+	if (p->inversion != INVERSION_ON &&
+	    p->inversion != INVERSION_OFF)
 		return -EINVAL;
 
 	if (p->code_rate_HP != FEC_1_2 && p->code_rate_HP != FEC_2_3 &&
@@ -156,14 +166,14 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa
 	    p->code_rate_HP != FEC_7_8)
 		return -EINVAL;
 
-	if (p->hierarchy_information != HIERARCHY_NONE &&
+	if (p->hierarchy != HIERARCHY_NONE &&
 	    (p->code_rate_LP != FEC_1_2 && p->code_rate_LP != FEC_2_3 &&
 	     p->code_rate_LP != FEC_3_4 && p->code_rate_LP != FEC_5_6 &&
 	     p->code_rate_LP != FEC_7_8))
 		return -EINVAL;
 
-	if (p->constellation != QPSK && p->constellation != QAM_16 &&
-	    p->constellation != QAM_64)
+	if (p->modulation != QPSK && p->modulation != QAM_16 &&
+	    p->modulation != QAM_64)
 		return -EINVAL;
 
 	if (p->transmission_mode != TRANSMISSION_MODE_2K &&
@@ -174,22 +184,22 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa
 	    p->guard_interval > GUARD_INTERVAL_1_4)
 		return -EINVAL;
 
-	if (p->hierarchy_information < HIERARCHY_NONE ||
-	    p->hierarchy_information > HIERARCHY_4)
+	if (p->hierarchy < HIERARCHY_NONE ||
+	    p->hierarchy > HIERARCHY_4)
 		return -EINVAL;
 
-	ddfs_offset_fixed = 0x4000-(ppm<<16)/bw_tab[p->bandwidth]/1000000;
+	ddfs_offset_fixed = 0x4000-(ppm<<16)/bw/1000000;
 
 	/* This works up to 20000 ppm, it overflows if too large ppm! */
 	init_freq = (((8UL<<25) + (8UL<<19) / 25*ppm / (15625/25)) /
-			bw_tab[p->bandwidth] & 0xFFFFFF);
+			bw & 0xFFFFFF);
 
 	/* SPI bias calculation is slightly modified to fit in 32bit */
 	/* will work for high ppm only... */
 	spi_bias = 378 * (1 << 10);
 	spi_bias *= 16;
-	spi_bias *= bw_tab[p->bandwidth];
-	spi_bias *= qam_tab[p->constellation];
+	spi_bias *= bw;
+	spi_bias *= qam_tab[p->modulation];
 	spi_bias /= p->code_rate_HP + 1;
 	spi_bias /= (guard_tab[p->guard_interval] + 32);
 	spi_bias *= 1000;
@@ -199,10 +209,10 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa
 	val0x04 = (p->transmission_mode << 2) | p->guard_interval;
 	val0x05 = fec_tab[p->code_rate_HP];
 
-	if (p->hierarchy_information != HIERARCHY_NONE)
+	if (p->hierarchy != HIERARCHY_NONE)
 		val0x05 |= (p->code_rate_LP - FEC_1_2) << 3;
 
-	val0x06 = (p->hierarchy_information << 2) | p->constellation;
+	val0x06 = (p->hierarchy << 2) | p->modulation;
 
 	l64781_writereg (state, 0x04, val0x04);
 	l64781_writereg (state, 0x05, val0x05);
@@ -220,7 +230,7 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa
 	l64781_writereg (state, 0x1b, spi_bias & 0xff);
 	l64781_writereg (state, 0x1c, (spi_bias >> 8) & 0xff);
 	l64781_writereg (state, 0x1d, ((spi_bias >> 16) & 0x7f) |
-		(param->inversion == INVERSION_ON ? 0x80 : 0x00));
+		(p->inversion == INVERSION_ON ? 0x80 : 0x00));
 
 	l64781_writereg (state, 0x22, ddfs_offset_fixed & 0xff);
 	l64781_writereg (state, 0x23, (ddfs_offset_fixed >> 8) & 0x3f);
@@ -233,7 +243,8 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa
 	return 0;
 }
 
-static int get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters* param)
+static int get_frontend(struct dvb_frontend* fe,
+			struct dtv_frontend_properties *p)
 {
 	struct l64781_state* state = fe->demodulator_priv;
 	int tmp;
@@ -242,98 +253,95 @@ static int get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters*
 	tmp = l64781_readreg(state, 0x04);
 	switch(tmp & 3) {
 	case 0:
-		param->u.ofdm.guard_interval = GUARD_INTERVAL_1_32;
+		p->guard_interval = GUARD_INTERVAL_1_32;
 		break;
 	case 1:
-		param->u.ofdm.guard_interval = GUARD_INTERVAL_1_16;
+		p->guard_interval = GUARD_INTERVAL_1_16;
 		break;
 	case 2:
-		param->u.ofdm.guard_interval = GUARD_INTERVAL_1_8;
+		p->guard_interval = GUARD_INTERVAL_1_8;
 		break;
 	case 3:
-		param->u.ofdm.guard_interval = GUARD_INTERVAL_1_4;
+		p->guard_interval = GUARD_INTERVAL_1_4;
 		break;
 	}
 	switch((tmp >> 2) & 3) {
 	case 0:
-		param->u.ofdm.transmission_mode = TRANSMISSION_MODE_2K;
+		p->transmission_mode = TRANSMISSION_MODE_2K;
 		break;
 	case 1:
-		param->u.ofdm.transmission_mode = TRANSMISSION_MODE_8K;
+		p->transmission_mode = TRANSMISSION_MODE_8K;
 		break;
 	default:
 		printk("Unexpected value for transmission_mode\n");
 	}
 
-
-
 	tmp = l64781_readreg(state, 0x05);
 	switch(tmp & 7) {
 	case 0:
-		param->u.ofdm.code_rate_HP = FEC_1_2;
+		p->code_rate_HP = FEC_1_2;
 		break;
 	case 1:
-		param->u.ofdm.code_rate_HP = FEC_2_3;
+		p->code_rate_HP = FEC_2_3;
 		break;
 	case 2:
-		param->u.ofdm.code_rate_HP = FEC_3_4;
+		p->code_rate_HP = FEC_3_4;
 		break;
 	case 3:
-		param->u.ofdm.code_rate_HP = FEC_5_6;
+		p->code_rate_HP = FEC_5_6;
 		break;
 	case 4:
-		param->u.ofdm.code_rate_HP = FEC_7_8;
+		p->code_rate_HP = FEC_7_8;
 		break;
 	default:
 		printk("Unexpected value for code_rate_HP\n");
 	}
 	switch((tmp >> 3) & 7) {
 	case 0:
-		param->u.ofdm.code_rate_LP = FEC_1_2;
+		p->code_rate_LP = FEC_1_2;
 		break;
 	case 1:
-		param->u.ofdm.code_rate_LP = FEC_2_3;
+		p->code_rate_LP = FEC_2_3;
 		break;
 	case 2:
-		param->u.ofdm.code_rate_LP = FEC_3_4;
+		p->code_rate_LP = FEC_3_4;
 		break;
 	case 3:
-		param->u.ofdm.code_rate_LP = FEC_5_6;
+		p->code_rate_LP = FEC_5_6;
 		break;
 	case 4:
-		param->u.ofdm.code_rate_LP = FEC_7_8;
+		p->code_rate_LP = FEC_7_8;
 		break;
 	default:
 		printk("Unexpected value for code_rate_LP\n");
 	}
 
-
 	tmp = l64781_readreg(state, 0x06);
 	switch(tmp & 3) {
 	case 0:
-		param->u.ofdm.constellation = QPSK;
+		p->modulation = QPSK;
 		break;
 	case 1:
-		param->u.ofdm.constellation = QAM_16;
+		p->modulation = QAM_16;
 		break;
 	case 2:
-		param->u.ofdm.constellation = QAM_64;
+		p->modulation = QAM_64;
 		break;
 	default:
-		printk("Unexpected value for constellation\n");
+		printk("Unexpected value for modulation\n");
 	}
 	switch((tmp >> 2) & 7) {
 	case 0:
-		param->u.ofdm.hierarchy_information = HIERARCHY_NONE;
+		p->hierarchy = HIERARCHY_NONE;
 		break;
 	case 1:
-		param->u.ofdm.hierarchy_information = HIERARCHY_1;
+		p->hierarchy = HIERARCHY_1;
 		break;
 	case 2:
-		param->u.ofdm.hierarchy_information = HIERARCHY_2;
+		p->hierarchy = HIERARCHY_2;
 		break;
 	case 3:
-		param->u.ofdm.hierarchy_information = HIERARCHY_4;
+		p->hierarchy = HIERARCHY_4;
 		break;
 	default:
 		printk("Unexpected value for hierarchy\n");
@@ -341,12 +349,12 @@ static int get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters*
 
 
 	tmp = l64781_readreg (state, 0x1d);
-	param->inversion = (tmp & 0x80) ? INVERSION_ON : INVERSION_OFF;
+	p->inversion = (tmp & 0x80) ? INVERSION_ON : INVERSION_OFF;
 
 	tmp = (int) (l64781_readreg (state, 0x08) |
 		     (l64781_readreg (state, 0x09) << 8) |
 		     (l64781_readreg (state, 0x0a) << 16));
-	param->frequency += tmp;
+	p->frequency += tmp;
 
 	return 0;
 }
@@ -564,7 +572,7 @@ error:
 }
 
 static struct dvb_frontend_ops l64781_ops = {
-
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "LSI L64781 DVB-T",
 		.type = FE_OFDM,
@@ -584,8 +592,8 @@ static struct dvb_frontend_ops l64781_ops = {
 	.init = l64781_init,
 	.sleep = l64781_sleep,
 
-	.set_frontend_legacy = apply_frontend_param,
-	.get_frontend_legacy = get_frontend,
+	.set_frontend = apply_frontend_param,
+	.get_frontend = get_frontend,
 	.get_tune_settings = l64781_get_tune_settings,
 
 	.read_status = l64781_read_status,
Signature · 1 line
1.7.8.352.g876a6
#55 lore raw

RFC PATCH 55/91 stv0299: 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/dvb/frontends/stv0299.c |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)
drivers/media/dvb/frontends/stv0299.c +12 -11
index 6aeabaf..abf4bff 100644
@@ -559,8 +559,9 @@ static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p)
+static int stv0299_set_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct stv0299_state* state = fe->demodulator_priv;
 	int invval = 0;
 
@@ -583,19 +584,19 @@ static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 		if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
 	}
 
-	stv0299_set_FEC (state, p->u.qpsk.fec_inner);
-	stv0299_set_symbolrate (fe, p->u.qpsk.symbol_rate);
+	stv0299_set_FEC (state, p->fec_inner);
+	stv0299_set_symbolrate (fe, p->symbol_rate);
 	stv0299_writeregI(state, 0x22, 0x00);
 	stv0299_writeregI(state, 0x23, 0x00);
 
 	state->tuner_frequency = p->frequency;
-	state->fec_inner = p->u.qpsk.fec_inner;
-	state->symbol_rate = p->u.qpsk.symbol_rate;
+	state->fec_inner = p->fec_inner;
+	state->symbol_rate = p->symbol_rate;
 
 	return 0;
 }
 
-static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p)
+static int stv0299_get_frontend(struct dvb_frontend* fe, struct dtv_frontend_properties * p)
 {
 	struct stv0299_state* state = fe->demodulator_priv;
 	s32 derot_freq;
@@ -614,8 +615,8 @@ static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 	if (state->config->invert) invval = (~invval) & 1;
 	p->inversion = invval ? INVERSION_ON : INVERSION_OFF;
 
-	p->u.qpsk.fec_inner = stv0299_get_fec (state);
-	p->u.qpsk.symbol_rate = stv0299_get_symbolrate (state);
+	p->fec_inner = stv0299_get_fec (state);
+	p->symbol_rate = stv0299_get_symbolrate (state);
 
 	return 0;
 }
@@ -705,7 +706,7 @@ error:
 }
 
 static struct dvb_frontend_ops stv0299_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "ST STV0299 DVB-S",
 		.type			= FE_QPSK,
@@ -729,8 +730,8 @@ static struct dvb_frontend_ops stv0299_ops = {
 	.write = stv0299_write,
 	.i2c_gate_ctrl = stv0299_i2c_gate_ctrl,
 
-	.set_frontend_legacy = stv0299_set_frontend,
-	.get_frontend_legacy = stv0299_get_frontend,
+	.set_frontend = stv0299_set_frontend,
+	.get_frontend = stv0299_get_frontend,
 	.get_tune_settings = stv0299_get_tune_settings,
 
 	.read_status = stv0299_read_status,
Signature · 1 line
1.7.8.352.g876a6
#0 lore raw

cover Only use DVBv5 internally on frontend drivers

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(-)
Signature · 1 line
1.7.8.352.g876a6
#34 lore raw

RFC PATCH 34/91 lgdt3305: 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/dvb/frontends/lgdt3305.c |   97 ++++++++++++++++----------------
 1 files changed, 49 insertions(+), 48 deletions(-)
drivers/media/dvb/frontends/lgdt3305.c +49 -48
index e1a9c92..58eb7bc 100644
@@ -266,7 +266,7 @@ fail:
 }
 
 static int lgdt3305_set_modulation(struct lgdt3305_state *state,
-				   struct dvb_frontend_parameters *param)
+				   struct dtv_frontend_properties *p)
 {
 	u8 opermode;
 	int ret;
@@ -279,7 +279,7 @@ static int lgdt3305_set_modulation(struct lgdt3305_state *state,
 
 	opermode &= ~0x03;
 
-	switch (param->u.vsb.modulation) {
+	switch (p->modulation) {
 	case VSB_8:
 		opermode |= 0x03;
 		break;
@@ -298,11 +298,11 @@ fail:
 }
 
 static int lgdt3305_set_filter_extension(struct lgdt3305_state *state,
-					 struct dvb_frontend_parameters *param)
+					 struct dtv_frontend_properties *p)
 {
 	int val;
 
-	switch (param->u.vsb.modulation) {
+	switch (p->modulation) {
 	case VSB_8:
 		val = 0;
 		break;
@@ -321,11 +321,11 @@ static int lgdt3305_set_filter_extension(struct lgdt3305_state *state,
 /* ------------------------------------------------------------------------ */
 
 static int lgdt3305_passband_digital_agc(struct lgdt3305_state *state,
-					 struct dvb_frontend_parameters *param)
+					 struct dtv_frontend_properties *p)
 {
 	u16 agc_ref;
 
-	switch (param->u.vsb.modulation) {
+	switch (p->modulation) {
 	case VSB_8:
 		agc_ref = 0x32c4;
 		break;
@@ -348,11 +348,11 @@ static int lgdt3305_passband_digital_agc(struct lgdt3305_state *state,
 }
 
 static int lgdt3305_rfagc_loop(struct lgdt3305_state *state,
-			       struct dvb_frontend_parameters *param)
+			       struct dtv_frontend_properties *p)
 {
 	u16 ifbw, rfbw, agcdelay;
 
-	switch (param->u.vsb.modulation) {
+	switch (p->modulation) {
 	case VSB_8:
 		agcdelay = 0x04c0;
 		rfbw     = 0x8000;
@@ -398,11 +398,11 @@ static int lgdt3305_rfagc_loop(struct lgdt3305_state *state,
 }
 
 static int lgdt3305_agc_setup(struct lgdt3305_state *state,
-			      struct dvb_frontend_parameters *param)
+			      struct dtv_frontend_properties *p)
 {
 	int lockdten, acqen;
 
-	switch (param->u.vsb.modulation) {
+	switch (p->modulation) {
 	case VSB_8:
 		lockdten = 0;
 		acqen = 0;
@@ -432,15 +432,15 @@ static int lgdt3305_agc_setup(struct lgdt3305_state *state,
 		return -EINVAL;
 	}
 
-	return lgdt3305_rfagc_loop(state, param);
+	return lgdt3305_rfagc_loop(state, p);
 }
 
 static int lgdt3305_set_agc_power_ref(struct lgdt3305_state *state,
-				      struct dvb_frontend_parameters *param)
+				      struct dtv_frontend_properties *p)
 {
 	u16 usref = 0;
 
-	switch (param->u.vsb.modulation) {
+	switch (p->modulation) {
 	case VSB_8:
 		if (state->cfg->usref_8vsb)
 			usref = state->cfg->usref_8vsb;
@@ -473,14 +473,14 @@ static int lgdt3305_set_agc_power_ref(struct lgdt3305_state *state,
 /* ------------------------------------------------------------------------ */
 
 static int lgdt3305_spectral_inversion(struct lgdt3305_state *state,
-				       struct dvb_frontend_parameters *param,
+				       struct dtv_frontend_properties *p,
 				       int inversion)
 {
 	int ret;
 
 	lg_dbg("(%d)\n", inversion);
 
-	switch (param->u.vsb.modulation) {
+	switch (p->modulation) {
 	case VSB_8:
 		ret = lgdt3305_write_reg(state, LGDT3305_CR_CTRL_7,
 					 inversion ? 0xf9 : 0x79);
@@ -497,13 +497,13 @@ static int lgdt3305_spectral_inversion(struct lgdt3305_state *state,
 }
 
 static int lgdt3305_set_if(struct lgdt3305_state *state,
-			   struct dvb_frontend_parameters *param)
+			   struct dtv_frontend_properties *p)
 {
 	u16 if_freq_khz;
 	u8 nco1, nco2, nco3, nco4;
 	u64 nco;
 
-	switch (param->u.vsb.modulation) {
+	switch (p->modulation) {
 	case VSB_8:
 		if_freq_khz = state->cfg->vsb_if_khz;
 		break;
@@ -517,7 +517,7 @@ static int lgdt3305_set_if(struct lgdt3305_state *state,
 
 	nco = if_freq_khz / 10;
 
-	switch (param->u.vsb.modulation) {
+	switch (p->modulation) {
 	case VSB_8:
 		nco <<= 24;
 		do_div(nco, 625);
@@ -677,13 +677,13 @@ fail:
 	return ret;
 }
 
-static int lgdt3304_set_parameters(struct dvb_frontend *fe,
-				   struct dvb_frontend_parameters *param)
+static int lgdt3304_set_parameters(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct lgdt3305_state *state = fe->demodulator_priv;
 	int ret;
 
-	lg_dbg("(%d, %d)\n", param->frequency, param->u.vsb.modulation);
+	lg_dbg("(%d, %d)\n", p->frequency, p->modulation);
 
 	if (fe->ops.tuner_ops.set_params) {
 		ret = fe->ops.tuner_ops.set_params(fe);
@@ -691,23 +691,23 @@ static int lgdt3304_set_parameters(struct dvb_frontend *fe,
 			fe->ops.i2c_gate_ctrl(fe, 0);
 		if (lg_fail(ret))
 			goto fail;
-		state->current_frequency = param->frequency;
+		state->current_frequency = p->frequency;
 	}
 
-	ret = lgdt3305_set_modulation(state, param);
+	ret = lgdt3305_set_modulation(state, p);
 	if (lg_fail(ret))
 		goto fail;
 
-	ret = lgdt3305_passband_digital_agc(state, param);
+	ret = lgdt3305_passband_digital_agc(state, p);
 	if (lg_fail(ret))
 		goto fail;
 
-	ret = lgdt3305_agc_setup(state, param);
+	ret = lgdt3305_agc_setup(state, p);
 	if (lg_fail(ret))
 		goto fail;
 
 	/* reg 0x030d is 3304-only... seen in vsb and qam usbsnoops... */
-	switch (param->u.vsb.modulation) {
+	switch (p->modulation) {
 	case VSB_8:
 		lgdt3305_write_reg(state, 0x030d, 0x00);
 		lgdt3305_write_reg(state, LGDT3305_CR_CTR_FREQ_1, 0x4f);
@@ -718,7 +718,7 @@ static int lgdt3304_set_parameters(struct dvb_frontend *fe,
 	case QAM_64:
 	case QAM_256:
 		lgdt3305_write_reg(state, 0x030d, 0x14);
-		ret = lgdt3305_set_if(state, param);
+		ret = lgdt3305_set_if(state, p);
 		if (lg_fail(ret))
 			goto fail;
 		break;
@@ -727,13 +727,13 @@ static int lgdt3304_set_parameters(struct dvb_frontend *fe,
 	}
 
 
-	ret = lgdt3305_spectral_inversion(state, param,
+	ret = lgdt3305_spectral_inversion(state, p,
 					  state->cfg->spectral_inversion
 					  ? 1 : 0);
 	if (lg_fail(ret))
 		goto fail;
 
-	state->current_modulation = param->u.vsb.modulation;
+	state->current_modulation = p->modulation;
 
 	ret = lgdt3305_mpeg_mode(state, state->cfg->mpeg_mode);
 	if (lg_fail(ret))
@@ -747,13 +747,13 @@ fail:
 	return ret;
 }
 
-static int lgdt3305_set_parameters(struct dvb_frontend *fe,
-				   struct dvb_frontend_parameters *param)
+static int lgdt3305_set_parameters(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct lgdt3305_state *state = fe->demodulator_priv;
 	int ret;
 
-	lg_dbg("(%d, %d)\n", param->frequency, param->u.vsb.modulation);
+	lg_dbg("(%d, %d)\n", p->frequency, p->modulation);
 
 	if (fe->ops.tuner_ops.set_params) {
 		ret = fe->ops.tuner_ops.set_params(fe);
@@ -761,20 +761,20 @@ static int lgdt3305_set_parameters(struct dvb_frontend *fe,
 			fe->ops.i2c_gate_ctrl(fe, 0);
 		if (lg_fail(ret))
 			goto fail;
-		state->current_frequency = param->frequency;
+		state->current_frequency = p->frequency;
 	}
 
-	ret = lgdt3305_set_modulation(state, param);
+	ret = lgdt3305_set_modulation(state, p);
 	if (lg_fail(ret))
 		goto fail;
 
-	ret = lgdt3305_passband_digital_agc(state, param);
+	ret = lgdt3305_passband_digital_agc(state, p);
 	if (lg_fail(ret))
 		goto fail;
-	ret = lgdt3305_set_agc_power_ref(state, param);
+	ret = lgdt3305_set_agc_power_ref(state, p);
 	if (lg_fail(ret))
 		goto fail;
-	ret = lgdt3305_agc_setup(state, param);
+	ret = lgdt3305_agc_setup(state, p);
 	if (lg_fail(ret))
 		goto fail;
 
@@ -786,20 +786,20 @@ static int lgdt3305_set_parameters(struct dvb_frontend *fe,
 	if (lg_fail(ret))
 		goto fail;
 
-	ret = lgdt3305_set_if(state, param);
+	ret = lgdt3305_set_if(state, p);
 	if (lg_fail(ret))
 		goto fail;
-	ret = lgdt3305_spectral_inversion(state, param,
+	ret = lgdt3305_spectral_inversion(state, p,
 					  state->cfg->spectral_inversion
 					  ? 1 : 0);
 	if (lg_fail(ret))
 		goto fail;
 
-	ret = lgdt3305_set_filter_extension(state, param);
+	ret = lgdt3305_set_filter_extension(state, p);
 	if (lg_fail(ret))
 		goto fail;
 
-	state->current_modulation = param->u.vsb.modulation;
+	state->current_modulation = p->modulation;
 
 	ret = lgdt3305_mpeg_mode(state, state->cfg->mpeg_mode);
 	if (lg_fail(ret))
@@ -814,14 +814,14 @@ fail:
 }
 
 static int lgdt3305_get_frontend(struct dvb_frontend *fe,
-				 struct dvb_frontend_parameters *param)
+				 struct dtv_frontend_properties *p)
 {
 	struct lgdt3305_state *state = fe->demodulator_priv;
 
 	lg_dbg("\n");
 
-	param->u.vsb.modulation = state->current_modulation;
-	param->frequency = state->current_frequency;
+	p->modulation = state->current_modulation;
+	p->frequency = state->current_frequency;
 	return 0;
 }
 
@@ -1176,8 +1176,8 @@ 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_legacy = lgdt3305_get_frontend,
+	.set_frontend         = lgdt3304_set_parameters,
+	.get_frontend         = lgdt3305_get_frontend,
 	.get_tune_settings    = lgdt3305_get_tune_settings,
 	.read_status          = lgdt3305_read_status,
 	.read_ber             = lgdt3305_read_ber,
@@ -1188,6 +1188,7 @@ static struct dvb_frontend_ops lgdt3304_ops = {
 };
 
 static struct dvb_frontend_ops lgdt3305_ops = {
+	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name = "LG Electronics LGDT3305 VSB/QAM Frontend",
 		.type               = FE_ATSC,
@@ -1199,8 +1200,8 @@ static struct dvb_frontend_ops lgdt3305_ops = {
 	.i2c_gate_ctrl        = lgdt3305_i2c_gate_ctrl,
 	.init                 = lgdt3305_init,
 	.sleep                = lgdt3305_sleep,
-	.set_frontend_legacy         = lgdt3305_set_parameters,
-	.get_frontend_legacy = lgdt3305_get_frontend,
+	.set_frontend         = lgdt3305_set_parameters,
+	.get_frontend         = lgdt3305_get_frontend,
 	.get_tune_settings    = lgdt3305_get_tune_settings,
 	.read_status          = lgdt3305_read_status,
 	.read_ber             = lgdt3305_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#46 lore raw

RFC PATCH 46/91 tda1004x: 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/dvb/frontends/tda1004x.c |  114 ++++++++++++++++----------------
 1 files changed, 58 insertions(+), 56 deletions(-)
drivers/media/dvb/frontends/tda1004x.c +58 -56
index 2dbb070..d5e68af 100644
@@ -224,22 +224,22 @@ static int tda1004x_disable_tuner_i2c(struct tda1004x_state *state)
 }
 
 static int tda10045h_set_bandwidth(struct tda1004x_state *state,
-				   fe_bandwidth_t bandwidth)
+				   u32 bandwidth)
 {
 	static u8 bandwidth_6mhz[] = { 0x02, 0x00, 0x3d, 0x00, 0x60, 0x1e, 0xa7, 0x45, 0x4f };
 	static u8 bandwidth_7mhz[] = { 0x02, 0x00, 0x37, 0x00, 0x4a, 0x2f, 0x6d, 0x76, 0xdb };
 	static u8 bandwidth_8mhz[] = { 0x02, 0x00, 0x3d, 0x00, 0x48, 0x17, 0x89, 0xc7, 0x14 };
 
 	switch (bandwidth) {
-	case BANDWIDTH_6_MHZ:
+	case 6000000:
 		tda1004x_write_buf(state, TDA10045H_CONFPLL_P, bandwidth_6mhz, sizeof(bandwidth_6mhz));
 		break;
 
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		tda1004x_write_buf(state, TDA10045H_CONFPLL_P, bandwidth_7mhz, sizeof(bandwidth_7mhz));
 		break;
 
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
 		tda1004x_write_buf(state, TDA10045H_CONFPLL_P, bandwidth_8mhz, sizeof(bandwidth_8mhz));
 		break;
 
@@ -253,7 +253,7 @@ static int tda10045h_set_bandwidth(struct tda1004x_state *state,
 }
 
 static int tda10046h_set_bandwidth(struct tda1004x_state *state,
-				   fe_bandwidth_t bandwidth)
+				   u32 bandwidth)
 {
 	static u8 bandwidth_6mhz_53M[] = { 0x7b, 0x2e, 0x11, 0xf0, 0xd2 };
 	static u8 bandwidth_7mhz_53M[] = { 0x6a, 0x02, 0x6a, 0x43, 0x9f };
@@ -270,7 +270,7 @@ static int tda10046h_set_bandwidth(struct tda1004x_state *state,
 	else
 		tda10046_clk53m = 1;
 	switch (bandwidth) {
-	case BANDWIDTH_6_MHZ:
+	case 6000000:
 		if (tda10046_clk53m)
 			tda1004x_write_buf(state, TDA10046H_TIME_WREF1, bandwidth_6mhz_53M,
 						  sizeof(bandwidth_6mhz_53M));
@@ -283,7 +283,7 @@ static int tda10046h_set_bandwidth(struct tda1004x_state *state,
 		}
 		break;
 
-	case BANDWIDTH_7_MHZ:
+	case 7000000:
 		if (tda10046_clk53m)
 			tda1004x_write_buf(state, TDA10046H_TIME_WREF1, bandwidth_7mhz_53M,
 						  sizeof(bandwidth_7mhz_53M));
@@ -296,7 +296,7 @@ static int tda10046h_set_bandwidth(struct tda1004x_state *state,
 		}
 		break;
 
-	case BANDWIDTH_8_MHZ:
+	case 8000000:
 		if (tda10046_clk53m)
 			tda1004x_write_buf(state, TDA10046H_TIME_WREF1, bandwidth_8mhz_53M,
 						  sizeof(bandwidth_8mhz_53M));
@@ -409,7 +409,7 @@ static int tda10045_fwupload(struct dvb_frontend* fe)
 	msleep(10);
 
 	/* set parameters */
-	tda10045h_set_bandwidth(state, BANDWIDTH_8_MHZ);
+	tda10045h_set_bandwidth(state, 8000000);
 
 	ret = tda1004x_do_upload(state, fw->data, fw->size, TDA10045H_FWPAGE, TDA10045H_CODE_IN);
 	release_firmware(fw);
@@ -473,7 +473,7 @@ static void tda10046_init_plls(struct dvb_frontend* fe)
 		tda1004x_write_byteI(state, TDA10046H_FREQ_PHY2_LSB, 0x3f);
 		break;
 	}
-	tda10046h_set_bandwidth(state, BANDWIDTH_8_MHZ); // default bandwidth 8 MHz
+	tda10046h_set_bandwidth(state, 8000000); // default bandwidth 8 MHz
 	/* let the PLLs settle */
 	msleep(120);
 }
@@ -697,9 +697,9 @@ static int tda10046_init(struct dvb_frontend* fe)
 	return 0;
 }
 
-static int tda1004x_set_fe(struct dvb_frontend* fe,
-			   struct dvb_frontend_parameters *fe_params)
+static int tda1004x_set_fe(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache;
 	struct tda1004x_state* state = fe->demodulator_priv;
 	int tmp;
 	int inversion;
@@ -726,37 +726,37 @@ static int tda1004x_set_fe(struct dvb_frontend* fe,
 	// Hardcoded to use auto as much as possible on the TDA10045 as it
 	// is very unreliable if AUTO mode is _not_ used.
 	if (state->demod_type == TDA1004X_DEMOD_TDA10045) {
-		fe_params->u.ofdm.code_rate_HP = FEC_AUTO;
-		fe_params->u.ofdm.guard_interval = GUARD_INTERVAL_AUTO;
-		fe_params->u.ofdm.transmission_mode = TRANSMISSION_MODE_AUTO;
+		fe_params->code_rate_HP = FEC_AUTO;
+		fe_params->guard_interval = GUARD_INTERVAL_AUTO;
+		fe_params->transmission_mode = TRANSMISSION_MODE_AUTO;
 	}
 
 	// Set standard params.. or put them to auto
-	if ((fe_params->u.ofdm.code_rate_HP == FEC_AUTO) ||
-		(fe_params->u.ofdm.code_rate_LP == FEC_AUTO) ||
-		(fe_params->u.ofdm.constellation == QAM_AUTO) ||
-		(fe_params->u.ofdm.hierarchy_information == HIERARCHY_AUTO)) {
+	if ((fe_params->code_rate_HP == FEC_AUTO) ||
+		(fe_params->code_rate_LP == FEC_AUTO) ||
+		(fe_params->modulation == QAM_AUTO) ||
+		(fe_params->hierarchy == HIERARCHY_AUTO)) {
 		tda1004x_write_mask(state, TDA1004X_AUTO, 1, 1);	// enable auto
-		tda1004x_write_mask(state, TDA1004X_IN_CONF1, 0x03, 0);	// turn off constellation bits
+		tda1004x_write_mask(state, TDA1004X_IN_CONF1, 0x03, 0);	// turn off modulation bits
 		tda1004x_write_mask(state, TDA1004X_IN_CONF1, 0x60, 0);	// turn off hierarchy bits
 		tda1004x_write_mask(state, TDA1004X_IN_CONF2, 0x3f, 0);	// turn off FEC bits
 	} else {
 		tda1004x_write_mask(state, TDA1004X_AUTO, 1, 0);	// disable auto
 
 		// set HP FEC
-		tmp = tda1004x_encode_fec(fe_params->u.ofdm.code_rate_HP);
+		tmp = tda1004x_encode_fec(fe_params->code_rate_HP);
 		if (tmp < 0)
 			return tmp;
 		tda1004x_write_mask(state, TDA1004X_IN_CONF2, 7, tmp);
 
 		// set LP FEC
-		tmp = tda1004x_encode_fec(fe_params->u.ofdm.code_rate_LP);
+		tmp = tda1004x_encode_fec(fe_params->code_rate_LP);
 		if (tmp < 0)
 			return tmp;
 		tda1004x_write_mask(state, TDA1004X_IN_CONF2, 0x38, tmp << 3);
 
-		// set constellation
-		switch (fe_params->u.ofdm.constellation) {
+		// set modulation
+		switch (fe_params->modulation) {
 		case QPSK:
 			tda1004x_write_mask(state, TDA1004X_IN_CONF1, 3, 0);
 			break;
@@ -774,7 +774,7 @@ static int tda1004x_set_fe(struct dvb_frontend* fe,
 		}
 
 		// set hierarchy
-		switch (fe_params->u.ofdm.hierarchy_information) {
+		switch (fe_params->hierarchy) {
 		case HIERARCHY_NONE:
 			tda1004x_write_mask(state, TDA1004X_IN_CONF1, 0x60, 0 << 5);
 			break;
@@ -799,11 +799,11 @@ static int tda1004x_set_fe(struct dvb_frontend* fe,
 	// set bandwidth
 	switch (state->demod_type) {
 	case TDA1004X_DEMOD_TDA10045:
-		tda10045h_set_bandwidth(state, fe_params->u.ofdm.bandwidth);
+		tda10045h_set_bandwidth(state, fe_params->bandwidth_hz);
 		break;
 
 	case TDA1004X_DEMOD_TDA10046:
-		tda10046h_set_bandwidth(state, fe_params->u.ofdm.bandwidth);
+		tda10046h_set_bandwidth(state, fe_params->bandwidth_hz);
 		break;
 	}
 
@@ -825,7 +825,7 @@ static int tda1004x_set_fe(struct dvb_frontend* fe,
 	}
 
 	// set guard interval
-	switch (fe_params->u.ofdm.guard_interval) {
+	switch (fe_params->guard_interval) {
 	case GUARD_INTERVAL_1_32:
 		tda1004x_write_mask(state, TDA1004X_AUTO, 2, 0);
 		tda1004x_write_mask(state, TDA1004X_IN_CONF1, 0x0c, 0 << 2);
@@ -856,7 +856,7 @@ static int tda1004x_set_fe(struct dvb_frontend* fe,
 	}
 
 	// set transmission mode
-	switch (fe_params->u.ofdm.transmission_mode) {
+	switch (fe_params->transmission_mode) {
 	case TRANSMISSION_MODE_2K:
 		tda1004x_write_mask(state, TDA1004X_AUTO, 4, 0);
 		tda1004x_write_mask(state, TDA1004X_IN_CONF1, 0x10, 0 << 4);
@@ -895,7 +895,7 @@ static int tda1004x_set_fe(struct dvb_frontend* fe,
 	return 0;
 }
 
-static int tda1004x_get_fe(struct dvb_frontend* fe, struct dvb_frontend_parameters *fe_params)
+static int tda1004x_get_fe(struct dvb_frontend* fe, struct dtv_frontend_properties *fe_params)
 {
 	struct tda1004x_state* state = fe->demodulator_priv;
 
@@ -913,13 +913,13 @@ static int tda1004x_get_fe(struct dvb_frontend* fe, struct dvb_frontend_paramete
 	case TDA1004X_DEMOD_TDA10045:
 		switch (tda1004x_read_byte(state, TDA10045H_WREF_LSB)) {
 		case 0x14:
-			fe_params->u.ofdm.bandwidth = BANDWIDTH_8_MHZ;
+			fe_params->bandwidth_hz = 8000000;
 			break;
 		case 0xdb:
-			fe_params->u.ofdm.bandwidth = BANDWIDTH_7_MHZ;
+			fe_params->bandwidth_hz = 7000000;
 			break;
 		case 0x4f:
-			fe_params->u.ofdm.bandwidth = BANDWIDTH_6_MHZ;
+			fe_params->bandwidth_hz = 6000000;
 			break;
 		}
 		break;
@@ -927,73 +927,73 @@ static int tda1004x_get_fe(struct dvb_frontend* fe, struct dvb_frontend_paramete
 		switch (tda1004x_read_byte(state, TDA10046H_TIME_WREF1)) {
 		case 0x5c:
 		case 0x54:
-			fe_params->u.ofdm.bandwidth = BANDWIDTH_8_MHZ;
+			fe_params->bandwidth_hz = 8000000;
 			break;
 		case 0x6a:
 		case 0x60:
-			fe_params->u.ofdm.bandwidth = BANDWIDTH_7_MHZ;
+			fe_params->bandwidth_hz = 7000000;
 			break;
 		case 0x7b:
 		case 0x70:
-			fe_params->u.ofdm.bandwidth = BANDWIDTH_6_MHZ;
+			fe_params->bandwidth_hz = 6000000;
 			break;
 		}
 		break;
 	}
 
 	// FEC
-	fe_params->u.ofdm.code_rate_HP =
+	fe_params->code_rate_HP =
 	    tda1004x_decode_fec(tda1004x_read_byte(state, TDA1004X_OUT_CONF2) & 7);
-	fe_params->u.ofdm.code_rate_LP =
+	fe_params->code_rate_LP =
 	    tda1004x_decode_fec((tda1004x_read_byte(state, TDA1004X_OUT_CONF2) >> 3) & 7);
 
-	// constellation
+	// modulation
 	switch (tda1004x_read_byte(state, TDA1004X_OUT_CONF1) & 3) {
 	case 0:
-		fe_params->u.ofdm.constellation = QPSK;
+		fe_params->modulation = QPSK;
 		break;
 	case 1:
-		fe_params->u.ofdm.constellation = QAM_16;
+		fe_params->modulation = QAM_16;
 		break;
 	case 2:
-		fe_params->u.ofdm.constellation = QAM_64;
+		fe_params->modulation = QAM_64;
 		break;
 	}
 
 	// transmission mode
-	fe_params->u.ofdm.transmission_mode = TRANSMISSION_MODE_2K;
+	fe_params->transmission_mode = TRANSMISSION_MODE_2K;
 	if (tda1004x_read_byte(state, TDA1004X_OUT_CONF1) & 0x10)
-		fe_params->u.ofdm.transmission_mode = TRANSMISSION_MODE_8K;
+		fe_params->transmission_mode = TRANSMISSION_MODE_8K;
 
 	// guard interval
 	switch ((tda1004x_read_byte(state, TDA1004X_OUT_CONF1) & 0x0c) >> 2) {
 	case 0:
-		fe_params->u.ofdm.guard_interval = GUARD_INTERVAL_1_32;
+		fe_params->guard_interval = GUARD_INTERVAL_1_32;
 		break;
 	case 1:
-		fe_params->u.ofdm.guard_interval = GUARD_INTERVAL_1_16;
+		fe_params->guard_interval = GUARD_INTERVAL_1_16;
 		break;
 	case 2:
-		fe_params->u.ofdm.guard_interval = GUARD_INTERVAL_1_8;
+		fe_params->guard_interval = GUARD_INTERVAL_1_8;
 		break;
 	case 3:
-		fe_params->u.ofdm.guard_interval = GUARD_INTERVAL_1_4;
+		fe_params->guard_interval = GUARD_INTERVAL_1_4;
 		break;
 	}
 
 	// hierarchy
 	switch ((tda1004x_read_byte(state, TDA1004X_OUT_CONF1) & 0x60) >> 5) {
 	case 0:
-		fe_params->u.ofdm.hierarchy_information = HIERARCHY_NONE;
+		fe_params->hierarchy = HIERARCHY_NONE;
 		break;
 	case 1:
-		fe_params->u.ofdm.hierarchy_information = HIERARCHY_1;
+		fe_params->hierarchy = HIERARCHY_1;
 		break;
 	case 2:
-		fe_params->u.ofdm.hierarchy_information = HIERARCHY_2;
+		fe_params->hierarchy = HIERARCHY_2;
 		break;
 	case 3:
-		fe_params->u.ofdm.hierarchy_information = HIERARCHY_4;
+		fe_params->hierarchy = HIERARCHY_4;
 		break;
 	}
 
@@ -1231,6 +1231,7 @@ static void tda1004x_release(struct dvb_frontend* fe)
 }
 
 static struct dvb_frontend_ops tda10045_ops = {
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "Philips TDA10045H DVB-T",
 		.type = FE_OFDM,
@@ -1251,8 +1252,8 @@ static struct dvb_frontend_ops tda10045_ops = {
 	.write = tda1004x_write,
 	.i2c_gate_ctrl = tda1004x_i2c_gate_ctrl,
 
-	.set_frontend_legacy = tda1004x_set_fe,
-	.get_frontend_legacy = tda1004x_get_fe,
+	.set_frontend = tda1004x_set_fe,
+	.get_frontend = tda1004x_get_fe,
 	.get_tune_settings = tda1004x_get_tune_settings,
 
 	.read_status = tda1004x_read_status,
@@ -1301,6 +1302,7 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config,
 }
 
 static struct dvb_frontend_ops tda10046_ops = {
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "Philips TDA10046H DVB-T",
 		.type = FE_OFDM,
@@ -1321,8 +1323,8 @@ static struct dvb_frontend_ops tda10046_ops = {
 	.write = tda1004x_write,
 	.i2c_gate_ctrl = tda1004x_i2c_gate_ctrl,
 
-	.set_frontend_legacy = tda1004x_set_fe,
-	.get_frontend_legacy = tda1004x_get_fe,
+	.set_frontend = tda1004x_set_fe,
+	.get_frontend= tda1004x_get_fe,
 	.get_tune_settings = tda1004x_get_tune_settings,
 
 	.read_status = tda1004x_read_status,
Signature · 1 line
1.7.8.352.g876a6
#57 lore raw

RFC PATCH 57/91 stv090x: use .delsys property, instead of get_property()

In reply to Mauro Carvalho Chehab

Now that the DVB ops struct contains the supported delivery systems, use it, instead of adding a get_property() callback just due to that.

---
 drivers/media/dvb/frontends/stv090x.c |   19 +------------------
 1 files changed, 1 insertions(+), 18 deletions(-)
drivers/media/dvb/frontends/stv090x.c +1 -18
index 8a2637c..574ef67 100644
@@ -4711,23 +4711,8 @@ int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio, u8 dir, u8 value,
 }
 EXPORT_SYMBOL(stv090x_set_gpio);
 
-static int stv090x_get_property(struct dvb_frontend *fe, struct dtv_property *p)
-{
-	switch (p->cmd) {
-	case DTV_ENUM_DELSYS:
-		p->u.buffer.data[0] = SYS_DSS;
-		p->u.buffer.data[1] = SYS_DVBS;
-		p->u.buffer.data[2] = SYS_DVBS2;
-		p->u.buffer.len = 3;
-		break;
-	default:
-		break;
-	}
-	return 0;
-}
-
 static struct dvb_frontend_ops stv090x_ops = {
-
+	.delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS },
 	.info = {
 		.name			= "STV090x Multistandard",
 		.type			= FE_QPSK,
@@ -4759,8 +4744,6 @@ static struct dvb_frontend_ops stv090x_ops = {
 	.read_ber			= stv090x_read_per,
 	.read_signal_strength		= stv090x_read_signal_strength,
 	.read_snr			= stv090x_read_cnr,
-
-	.get_property			= stv090x_get_property,
 };
 
 
Signature · 1 line
1.7.8.352.g876a6
#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
#21 lore raw

RFC PATCH 21/91 dib8000: Remove the old DVBv3 struct from it and add delsys

In reply to Mauro Carvalho Chehab

This driver only uses the DVBv5 struct. All it needs is to remove the non-used params var, and to add the ISDB-T to the delivery systems.

---
 drivers/media/dvb/frontends/dib8000.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
drivers/media/dvb/frontends/dib8000.c +7 -6
index 9860062..115c099 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 dvb_frontend_parameters *fep)
+static int dib8000_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *c)
 {
 	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 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_legacy(state->fe[index_frontend], fep);
+			state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], c);
 			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;
@@ -2956,7 +2956,7 @@ static int dib8000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 	return 0;
 }
 
-static int dib8000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
+static int dib8000_set_frontend(struct dvb_frontend *fe)
 {
 	struct dib8000_state *state = fe->demodulator_priv;
 	u8 nbr_pending, exit_condition, index_frontend;
@@ -3088,7 +3088,7 @@ static int dib8000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
 
 		dprintk("tune success on frontend%i", index_frontend_success);
 
-		dib8000_get_frontend(fe, fep);
+		dib8000_get_frontend(fe, &state->fe[0]->dtv_property_cache);
 	}
 
 	for (index_frontend = 0, ret = 0; (ret >= 0) && (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++)
@@ -3461,6 +3461,7 @@ int dib8000_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff)
 EXPORT_SYMBOL(dib8000_pid_filter);
 
 static const struct dvb_frontend_ops dib8000_ops = {
+	.delsys = { SYS_ISDBT },
 	.info = {
 		 .name = "DiBcom 8000 ISDB-T",
 		 .type = FE_OFDM,
@@ -3479,9 +3480,9 @@ static const struct dvb_frontend_ops dib8000_ops = {
 	.init = dib8000_wakeup,
 	.sleep = dib8000_sleep,
 
-	.set_frontend_legacy = dib8000_set_frontend,
+	.set_frontend = dib8000_set_frontend,
 	.get_tune_settings = dib8000_fe_get_tune_settings,
-	.get_frontend_legacy = dib8000_get_frontend,
+	.get_frontend = dib8000_get_frontend,
 
 	.read_status = dib8000_read_status,
 	.read_ber = dib8000_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#36 lore raw

RFC PATCH 36/91 vez1x93: 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/dvb/frontends/ves1x93.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
drivers/media/dvb/frontends/ves1x93.c +14 -10
index a95619e..15929c2 100644
@@ -46,6 +46,7 @@ struct ves1x93_state {
 	u8 *init_1x93_wtab;
 	u8 tab_size;
 	u8 demod_type;
+	u32 frequency;
 };
 
 static int debug;
@@ -384,8 +385,9 @@ static int ves1x93_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int ves1x93_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int ves1x93_set_frontend(struct dvb_frontend* fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct ves1x93_state* state = fe->demodulator_priv;
 
 	if (fe->ops.tuner_ops.set_params) {
@@ -393,22 +395,24 @@ static int ves1x93_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 		if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
 	}
 	ves1x93_set_inversion (state, p->inversion);
-	ves1x93_set_fec (state, p->u.qpsk.fec_inner);
-	ves1x93_set_symbolrate (state, p->u.qpsk.symbol_rate);
+	ves1x93_set_fec (state, p->fec_inner);
+	ves1x93_set_symbolrate (state, p->symbol_rate);
 	state->inversion = p->inversion;
+	state->frequency = p->frequency;
 
 	return 0;
 }
 
-static int ves1x93_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int ves1x93_get_frontend(struct dvb_frontend* fe,
+				struct dtv_frontend_properties *p)
 {
 	struct ves1x93_state* state = fe->demodulator_priv;
 	int afc;
 
 	afc = ((int)((char)(ves1x93_readreg (state, 0x0a) << 1)))/2;
-	afc = (afc * (int)(p->u.qpsk.symbol_rate/1000/8))/16;
+	afc = (afc * (int)(p->symbol_rate/1000/8))/16;
 
-	p->frequency -= afc;
+	p->frequency = state->frequency - afc;
 
 	/*
 	 * inversion indicator is only valid
@@ -417,7 +421,7 @@ static int ves1x93_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 	if (state->inversion == INVERSION_AUTO)
 		p->inversion = (ves1x93_readreg (state, 0x0f) & 2) ?
 				INVERSION_OFF : INVERSION_ON;
-	p->u.qpsk.fec_inner = ves1x93_get_fec (state);
+	p->fec_inner = ves1x93_get_fec (state);
 	/*  XXX FIXME: timing offset !! */
 
 	return 0;
@@ -506,7 +510,7 @@ error:
 }
 
 static struct dvb_frontend_ops ves1x93_ops = {
-
+	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "VLSI VES1x93 DVB-S",
 		.type			= FE_QPSK,
@@ -529,8 +533,8 @@ static struct dvb_frontend_ops ves1x93_ops = {
 	.sleep = ves1x93_sleep,
 	.i2c_gate_ctrl = ves1x93_i2c_gate_ctrl,
 
-	.set_frontend_legacy = ves1x93_set_frontend,
-	.get_frontend_legacy = ves1x93_get_frontend,
+	.set_frontend = ves1x93_set_frontend,
+	.get_frontend = ves1x93_get_frontend,
 
 	.read_status = ves1x93_read_status,
 	.read_ber = ves1x93_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#59 lore raw

RFC PATCH 59/91 tda10023: 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/dvb/frontends/tda10023.c |   35 ++++++++-----------------------
 1 files changed, 9 insertions(+), 26 deletions(-)
drivers/media/dvb/frontends/tda10023.c +9 -26
index de535a4..8f451dc 100644
@@ -302,8 +302,7 @@ struct qam_params {
 	u8 qam, lockthr, mseth, aref, agcrefnyq, eragnyq_thd;
 };
 
-static int tda10023_set_parameters (struct dvb_frontend *fe,
-			    struct dvb_frontend_parameters *p)
+static int tda10023_set_parameters (struct dvb_frontend *fe)
 {
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	u32 delsys  = c->delivery_system;
@@ -377,21 +376,6 @@ static int tda10023_set_parameters (struct dvb_frontend *fe,
 	return 0;
 }
 
-static int tda10023_get_property(struct dvb_frontend *fe,
-				 struct dtv_property *p)
-{
-	switch (p->cmd) {
-	case DTV_ENUM_DELSYS:
-		p->u.buffer.data[0] = SYS_DVBC_ANNEX_A;
-		p->u.buffer.data[1] = SYS_DVBC_ANNEX_C;
-		p->u.buffer.len = 2;
-		break;
-	default:
-		break;
-	}
-	return 0;
-}
-
 static int tda10023_read_status(struct dvb_frontend* fe, fe_status_t* status)
 {
 	struct tda10023_state* state = fe->demodulator_priv;
@@ -472,7 +456,7 @@ static int tda10023_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
 	return 0;
 }
 
-static int tda10023_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
+static int tda10023_get_frontend(struct dvb_frontend* fe, struct dtv_frontend_properties *p)
 {
 	struct tda10023_state* state = fe->demodulator_priv;
 	int sync,inv;
@@ -487,17 +471,17 @@ static int tda10023_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
 		printk(sync & 2 ? "DVB: TDA10023(%d): AFC (%d) %dHz\n" :
 				  "DVB: TDA10023(%d): [AFC (%d) %dHz]\n",
 			state->frontend.dvb->num, afc,
-		       -((s32)p->u.qam.symbol_rate * afc) >> 10);
+		       -((s32)p->symbol_rate * afc) >> 10);
 	}
 
 	p->inversion = (inv&0x20?0:1);
-	p->u.qam.modulation = ((state->reg0 >> 2) & 7) + QAM_16;
+	p->modulation = ((state->reg0 >> 2) & 7) + QAM_16;
 
-	p->u.qam.fec_inner = FEC_NONE;
+	p->fec_inner = FEC_NONE;
 	p->frequency = ((p->frequency + 31250) / 62500) * 62500;
 
 	if (sync & 2)
-		p->frequency -= ((s32)p->u.qam.symbol_rate * afc) >> 10;
+		p->frequency -= ((s32)p->symbol_rate * afc) >> 10;
 
 	return 0;
 }
@@ -588,7 +572,7 @@ error:
 }
 
 static struct dvb_frontend_ops tda10023_ops = {
-
+	.delsys = { SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_C },
 	.info = {
 		.name = "Philips TDA10023 DVB-C",
 		.type = FE_QAM,
@@ -609,9 +593,8 @@ static struct dvb_frontend_ops tda10023_ops = {
 	.sleep = tda10023_sleep,
 	.i2c_gate_ctrl = tda10023_i2c_gate_ctrl,
 
-	.set_frontend_legacy = tda10023_set_parameters,
-	.get_frontend_legacy = tda10023_get_frontend,
-	.get_property = tda10023_get_property,
+	.set_frontend = tda10023_set_parameters,
+	.get_frontend = tda10023_get_frontend,
 	.read_status = tda10023_read_status,
 	.read_ber = tda10023_read_ber,
 	.read_signal_strength = tda10023_read_signal_strength,
Signature · 1 line
1.7.8.352.g876a6
#60 lore raw

RFC PATCH 60/91 tda10071: convert set_fontend to use DVBv5 parameters

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/tda10071.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/media/dvb/frontends/tda10071.c +5 -5
index e9e00ea..68dcce6 100644
@@ -636,8 +636,7 @@ error:
 	return ret;
 }
 
-static int tda10071_set_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *params)
+static int tda10071_set_frontend(struct dvb_frontend *fe)
 {
 	struct tda10071_priv *priv = fe->demodulator_priv;
 	struct tda10071_cmd cmd;
@@ -778,7 +777,7 @@ error:
 }
 
 static int tda10071_get_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+	struct dtv_frontend_properties *p)
 {
 	struct tda10071_priv *priv = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -1217,6 +1216,7 @@ error:
 EXPORT_SYMBOL(tda10071_attach);
 
 static struct dvb_frontend_ops tda10071_ops = {
+	.delsys = { SYS_DVBT, SYS_DVBT2 },
 	.info = {
 		.name = "NXP TDA10071",
 		.type = FE_QPSK,
@@ -1247,8 +1247,8 @@ static struct dvb_frontend_ops tda10071_ops = {
 	.init = tda10071_init,
 	.sleep = tda10071_sleep,
 
-	.set_frontend_legacy = tda10071_set_frontend,
-	.get_frontend_legacy = tda10071_get_frontend,
+	.set_frontend = tda10071_set_frontend,
+	.get_frontend = tda10071_get_frontend,
 
 	.read_status = tda10071_read_status,
 	.read_snr = tda10071_read_snr,
Signature · 1 line
1.7.8.352.g876a6
#66 lore raw

RFC PATCH 66/91 s55h1411: 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/dvb/frontends/s5h1411.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
drivers/media/dvb/frontends/s5h1411.c +8 -8
index cb221aa..08f568c 100644
@@ -585,9 +585,9 @@ static int s5h1411_register_reset(struct dvb_frontend *fe)
 }
 
 /* Talk to the demod, set the FEC, GUARD, QAM settings etc */
-static int s5h1411_set_frontend(struct dvb_frontend *fe,
-	struct dvb_frontend_parameters *p)
+static int s5h1411_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 	struct s5h1411_state *state = fe->demodulator_priv;
 
 	dprintk("%s(frequency=%d)\n", __func__, p->frequency);
@@ -596,7 +596,7 @@ static int s5h1411_set_frontend(struct dvb_frontend *fe,
 
 	state->current_frequency = p->frequency;
 
-	s5h1411_enable_modulation(fe, p->u.vsb.modulation);
+	s5h1411_enable_modulation(fe, p->modulation);
 
 	if (fe->ops.tuner_ops.set_params) {
 		if (fe->ops.i2c_gate_ctrl)
@@ -841,12 +841,12 @@ static int s5h1411_read_ber(struct dvb_frontend *fe, u32 *ber)
 }
 
 static int s5h1411_get_frontend(struct dvb_frontend *fe,
-				struct dvb_frontend_parameters *p)
+				struct dtv_frontend_properties *p)
 {
 	struct s5h1411_state *state = fe->demodulator_priv;
 
 	p->frequency = state->current_frequency;
-	p->u.vsb.modulation = state->current_modulation;
+	p->modulation = state->current_modulation;
 
 	return 0;
 }
@@ -915,7 +915,7 @@ error:
 EXPORT_SYMBOL(s5h1411_attach);
 
 static struct dvb_frontend_ops s5h1411_ops = {
-
+	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name			= "Samsung S5H1411 QAM/8VSB Frontend",
 		.type			= FE_ATSC,
@@ -928,8 +928,8 @@ static struct dvb_frontend_ops s5h1411_ops = {
 	.init                 = s5h1411_init,
 	.sleep                = s5h1411_sleep,
 	.i2c_gate_ctrl        = s5h1411_i2c_gate_ctrl,
-	.set_frontend_legacy         = s5h1411_set_frontend,
-	.get_frontend_legacy = s5h1411_get_frontend,
+	.set_frontend         = s5h1411_set_frontend,
+	.get_frontend         = s5h1411_get_frontend,
 	.get_tune_settings    = s5h1411_get_tune_settings,
 	.read_status          = s5h1411_read_status,
 	.read_ber             = s5h1411_read_ber,
Signature · 1 line
1.7.8.352.g876a6
#72 lore raw

RFC PATCH 72/91 cinergyT2-fe: 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/dvb/dvb-usb/cinergyT2-fe.c |   31 ++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 10 deletions(-)
drivers/media/dvb/dvb-usb/cinergyT2-fe.c +21 -10
index 40d50f7..0b49d44 100644
@@ -40,9 +40,8 @@
  *  We replace errornous fields by default TPS fields (the ones with value 0).
  */
 
-static uint16_t compute_tps(struct dvb_frontend_parameters *p)
+static uint16_t compute_tps(struct dtv_frontend_properties *op)
 {
-	struct dvb_ofdm_parameters *op = &p->u.ofdm;
 	uint16_t tps = 0;
 
 	switch (op->code_rate_HP) {
@@ -83,7 +82,7 @@ static uint16_t compute_tps(struct dvb_frontend_parameters *p)
 		/* tps |= (0 << 4) */;
 	}
 
-	switch (op->constellation) {
+	switch (op->modulation) {
 	case QAM_16:
 		tps |= (1 << 13);
 		break;
@@ -119,7 +118,7 @@ static uint16_t compute_tps(struct dvb_frontend_parameters *p)
 		/* tps |= (0 << 2) */;
 	}
 
-	switch (op->hierarchy_information) {
+	switch (op->hierarchy) {
 	case HIERARCHY_1:
 		tps |= (1 << 10);
 		break;
@@ -263,9 +262,9 @@ static int cinergyt2_fe_get_tune_settings(struct dvb_frontend *fe,
 	return 0;
 }
 
-static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe,
-				  struct dvb_frontend_parameters *fep)
+static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
 	struct cinergyt2_fe_state *state = fe->demodulator_priv;
 	struct dvbt_set_parameters_msg param;
 	char result[2];
@@ -274,9 +273,20 @@ static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe,
 	param.cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS;
 	param.tps = cpu_to_le16(compute_tps(fep));
 	param.freq = cpu_to_le32(fep->frequency / 1000);
-	param.bandwidth = 8 - fep->u.ofdm.bandwidth - BANDWIDTH_8_MHZ;
 	param.flags = 0;
 
+	switch (fep->bandwidth_hz) {
+		case 8000000:
+			param.bandwidth = 0;
+			break;
+		case 7000000:
+			param.bandwidth = 1;
+			break;
+		case 6000000:
+			param.bandwidth = 2;
+			break;
+	}
+
 	err = dvb_usb_generic_rw(state->d,
 			(char *)&param, sizeof(param),
 			result, sizeof(result), 0);
@@ -287,7 +297,7 @@ static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe,
 }
 
 static int cinergyt2_fe_get_frontend(struct dvb_frontend *fe,
-				  struct dvb_frontend_parameters *fep)
+				  struct dtv_frontend_properties *fep)
 {
 	return 0;
 }
@@ -316,6 +326,7 @@ struct dvb_frontend *cinergyt2_fe_attach(struct dvb_usb_device *d)
 
 
 static struct dvb_frontend_ops cinergyt2_fe_ops = {
+	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= DRIVER_NAME,
 		.type			= FE_OFDM,
@@ -340,8 +351,8 @@ static struct dvb_frontend_ops cinergyt2_fe_ops = {
 	.init			= cinergyt2_fe_init,
 	.sleep			= cinergyt2_fe_sleep,
 
-	.set_frontend_legacy		= cinergyt2_fe_set_frontend,
-	.get_frontend_legacy = cinergyt2_fe_get_frontend,
+	.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,
Signature · 1 line
1.7.8.352.g876a6