linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type
@ 2012-01-01 20:11 Mauro Carvalho Chehab
  2012-01-01 20:11 ` [PATCH 1/9] [media] dvb: Initialize all cache values Mauro Carvalho Chehab
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-01 20:11 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

This is likely the last patch series from my series of DVB cleanups.
I still intend to work on DRX-K frontend merge patch, but this will
need to wait until my return to my home town. Of course, if you're
hurry with this, patches are welcome.

This series changes dvb_frontend to use ops->delsys instead of ops->info.type,
as the source for the frontend support. With this series:

1) the first delivery system is reported as info.type for DVBv3 apps;
2) all subsequent checks are made against the current delivery system
   (c->delivery_system);
3) An attempt to use an un-suported delivery system will either return
   an error, or enter into the emulation mode, if the frontend is
   using a newer delivery system.
4) Lots of cleanup at the cache sync logic. Now, a pure DVBv5 call
   shouldn't fill the DVBv3 structs. Still, as events are generated,
   the event will dynamically generate a DVBv3 compat struct.

The emulation logic is not perfect (but it were not perfect before this
patch series). The emulation will work worse for devices that have
support for different "ops->info.type", as there's no way for a DVBv3
application to work properly with those devices.

TODO:

There are a few things left to do, with regards to DVB frontend cleanup.
They're more related to the DVBv5 API, so they were out of the scope
of this series. Maybe some work for this upcoming year!

They are:

	1) Fix the capabilities flags. There are several capabilities
not reported, like several modulations, etc. There are not enough flags
for them. It was suggested that the delivery system (DTV_ENUM_DELSYS)
would be enough, but it doesn't seem so. For example, there are several
SYS_ATSC devices that only support VSB_8. So, we'll end by needing to
either extend the current way (but we lack bits) or to implement a DVBv5
way for that;

	2) The DVBv3 events call (FE_GET_EVENT) is not ok for
newer delivery system. We'll likely need to replace it by a DVBv5 way;

	3) The stats API needs to be extended. Delivery systems like
ISDB can report a per-layer set of statistics. This is currently not
supported. Also, it is desirable to get the stats together with a
set of other properties.

I think that both (2) and (3) could be solved by adding some new DVBv5
properties. So, we need a proposal for that. I did one for stats in the
past. Maybe it is time to return with that proposal.

So, application developers are warned to migrate to DVBv5. As a reference,
I've ported an existing zap application to use DVBv5, on my experimental
test tree:

	http://git.linuxtv.org/mchehab/experimental-v4l-utils.git/shortlog/refs/heads/dvb-utils

Anyway, this patch series is short ;)

Please test.

Happy New Year!
Mauro

Mauro Carvalho Chehab (9):
  [media] dvb: Initialize all cache values
  [media] dvb_frontend: Handle all possible DVBv3 values for bandwidth
  [media] dvb: move dvb_set_frontend logic into a separate routine
  [media] dvb_frontend: Don't use ops->info.type anymore
  [media] dvb_frontend: Fix DVBv3 emulation
  [media] dvb-core: Fix ISDB-T defaults
  [media] dvb: get rid of fepriv->parameters_in
  [media] dvb: deprecate the usage of ops->info.type
  [media] dvb: Remove ops->info.type from frontends

 Documentation/DocBook/media/dvb/frontend.xml |    4 +
 drivers/media/dvb/bt8xx/dst.c                |    5 +-
 drivers/media/dvb/dvb-core/dvb_frontend.c    |  853 +++++++++++++++-----------
 drivers/media/dvb/dvb-usb/af9005-fe.c        |    1 -
 drivers/media/dvb/dvb-usb/cinergyT2-fe.c     |    1 -
 drivers/media/dvb/dvb-usb/dtt200u-fe.c       |    1 -
 drivers/media/dvb/dvb-usb/friio-fe.c         |    1 -
 drivers/media/dvb/dvb-usb/gp8psk-fe.c        |    1 -
 drivers/media/dvb/dvb-usb/mxl111sf-demod.c   |    1 -
 drivers/media/dvb/dvb-usb/vp702x-fe.c        |    1 -
 drivers/media/dvb/dvb-usb/vp7045-fe.c        |    1 -
 drivers/media/dvb/frontends/af9013.c         |    1 -
 drivers/media/dvb/frontends/atbm8830.c       |    1 -
 drivers/media/dvb/frontends/au8522_dig.c     |    1 -
 drivers/media/dvb/frontends/bcm3510.c        |    1 -
 drivers/media/dvb/frontends/cx22700.c        |    1 -
 drivers/media/dvb/frontends/cx22702.c        |    1 -
 drivers/media/dvb/frontends/cx24110.c        |    1 -
 drivers/media/dvb/frontends/cx24116.c        |    1 -
 drivers/media/dvb/frontends/cx24123.c        |    1 -
 drivers/media/dvb/frontends/cxd2820r_core.c  |    2 -
 drivers/media/dvb/frontends/dib3000mb.c      |    1 -
 drivers/media/dvb/frontends/dib3000mc.c      |    1 -
 drivers/media/dvb/frontends/dib7000m.c       |    1 -
 drivers/media/dvb/frontends/dib7000p.c       |    1 -
 drivers/media/dvb/frontends/dib8000.c        |    1 -
 drivers/media/dvb/frontends/dib9000.c        |    1 -
 drivers/media/dvb/frontends/drxd_hard.c      |    1 -
 drivers/media/dvb/frontends/drxk_hard.c      |    2 -
 drivers/media/dvb/frontends/ds3000.c         |    1 -
 drivers/media/dvb/frontends/dvb_dummy_fe.c   |    3 -
 drivers/media/dvb/frontends/ec100.c          |    1 -
 drivers/media/dvb/frontends/it913x-fe.c      |    1 -
 drivers/media/dvb/frontends/l64781.c         |    1 -
 drivers/media/dvb/frontends/lgdt3305.c       |    3 +-
 drivers/media/dvb/frontends/lgdt330x.c       |    2 -
 drivers/media/dvb/frontends/lgs8gl5.c        |    1 -
 drivers/media/dvb/frontends/lgs8gxx.c        |    1 -
 drivers/media/dvb/frontends/mb86a16.c        |    1 -
 drivers/media/dvb/frontends/mb86a20s.c       |    1 -
 drivers/media/dvb/frontends/mt312.c          |    1 -
 drivers/media/dvb/frontends/mt352.c          |    1 -
 drivers/media/dvb/frontends/nxt200x.c        |    1 -
 drivers/media/dvb/frontends/nxt6000.c        |    1 -
 drivers/media/dvb/frontends/or51132.c        |    1 -
 drivers/media/dvb/frontends/or51211.c        |    1 -
 drivers/media/dvb/frontends/s5h1409.c        |    1 -
 drivers/media/dvb/frontends/s5h1411.c        |    1 -
 drivers/media/dvb/frontends/s5h1420.c        |    1 -
 drivers/media/dvb/frontends/s5h1432.c        |    1 -
 drivers/media/dvb/frontends/s921.c           |    1 -
 drivers/media/dvb/frontends/si21xx.c         |    1 -
 drivers/media/dvb/frontends/sp8870.c         |    1 -
 drivers/media/dvb/frontends/sp887x.c         |    1 -
 drivers/media/dvb/frontends/stb0899_drv.c    |   20 +-
 drivers/media/dvb/frontends/stv0288.c        |    8 -
 drivers/media/dvb/frontends/stv0297.c        |    1 -
 drivers/media/dvb/frontends/stv0299.c        |    1 -
 drivers/media/dvb/frontends/stv0367.c        |    2 -
 drivers/media/dvb/frontends/stv0900_core.c   |    1 -
 drivers/media/dvb/frontends/stv090x.c        |    1 -
 drivers/media/dvb/frontends/tda10021.c       |    1 -
 drivers/media/dvb/frontends/tda10023.c       |    1 -
 drivers/media/dvb/frontends/tda10048.c       |    1 -
 drivers/media/dvb/frontends/tda1004x.c       |    2 -
 drivers/media/dvb/frontends/tda10071.c       |    1 -
 drivers/media/dvb/frontends/tda10086.c       |    1 -
 drivers/media/dvb/frontends/tda8083.c        |    1 -
 drivers/media/dvb/frontends/ves1820.c        |    1 -
 drivers/media/dvb/frontends/ves1x93.c        |    1 -
 drivers/media/dvb/frontends/zl10353.c        |    1 -
 drivers/media/dvb/pt1/va1j5jf8007s.c         |    1 -
 drivers/media/dvb/pt1/va1j5jf8007t.c         |    1 -
 drivers/media/dvb/siano/smsdvb.c             |    1 -
 drivers/media/dvb/ttusb-dec/ttusbdecfe.c     |    2 -
 drivers/media/video/tlg2300/pd-dvb.c         |    1 -
 include/linux/dvb/frontend.h                 |    2 +-
 77 files changed, 508 insertions(+), 465 deletions(-)

-- 
1.7.8.352.g876a6


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 1/9] [media] dvb: Initialize all cache values
  2012-01-01 20:11 [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Mauro Carvalho Chehab
@ 2012-01-01 20:11 ` Mauro Carvalho Chehab
  2012-01-01 20:11 ` [PATCH 2/9] [media] dvb_frontend: Handle all possible DVBv3 values for bandwidth Mauro Carvalho Chehab
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-01 20:11 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

By default, initialize the frontend current delivery system with
the first one. This warrants that a DVBv3 application will be able
to tune to it, after the removal of ops->init.type filling at
the drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index d030cd3..b72b87e 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -873,17 +873,22 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
 	memset(c, 0, sizeof(struct dtv_frontend_properties));
 
 	c->state = DTV_CLEAR;
-	c->delivery_system = SYS_UNDEFINED;
-	c->inversion = INVERSION_AUTO;
-	c->fec_inner = FEC_AUTO;
+
+	c->delivery_system = fe->ops.delsys[0];
+
 	c->transmission_mode = TRANSMISSION_MODE_AUTO;
-	c->bandwidth_hz = BANDWIDTH_AUTO;
+	c->bandwidth_hz = 0;	/* AUTO */
 	c->guard_interval = GUARD_INTERVAL_AUTO;
 	c->hierarchy = HIERARCHY_AUTO;
-	c->symbol_rate = QAM_AUTO;
+	c->symbol_rate = 0;
 	c->code_rate_HP = FEC_AUTO;
 	c->code_rate_LP = FEC_AUTO;
+	c->fec_inner = FEC_AUTO;
 	c->rolloff = ROLLOFF_AUTO;
+	c->voltage = SEC_VOLTAGE_OFF;
+	c->modulation = QAM_AUTO;
+	c->sectone = SEC_TONE_OFF;
+	c->pilot = PILOT_AUTO;
 
 	c->isdbt_partial_reception = -1;
 	c->isdbt_sb_mode = -1;
@@ -898,6 +903,9 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
 		c->layer[i].segment_count = -1;
 	}
 
+	c->isdbs_ts_id = 0;
+	c->dvbt2_plp_id = 0;
+
 	return 0;
 }
 
-- 
1.7.8.352.g876a6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/9] [media] dvb_frontend: Handle all possible DVBv3 values for bandwidth
  2012-01-01 20:11 [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Mauro Carvalho Chehab
  2012-01-01 20:11 ` [PATCH 1/9] [media] dvb: Initialize all cache values Mauro Carvalho Chehab
@ 2012-01-01 20:11 ` Mauro Carvalho Chehab
  2012-01-01 20:11 ` [PATCH 3/9] [media] dvb: move dvb_set_frontend logic into a separate routine Mauro Carvalho Chehab
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-01 20:11 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

Due to DVB-T2, several new possible values for bandwidth were added.
As the DVBv3 struct were updated to handle them, the core needs to
handle all of them, as a DVBv3 application might try to use it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   55 ++++++++++++++++++++++-------
 1 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index b72b87e..33ce309 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1079,15 +1079,29 @@ static void dtv_property_cache_sync(struct dvb_frontend *fe,
 		c->modulation = p->u.qam.modulation;
 		break;
 	case FE_OFDM:
-		if (p->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
-			c->bandwidth_hz = 6000000;
-		else if (p->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)
-			c->bandwidth_hz = 7000000;
-		else if (p->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
+		switch (p->u.ofdm.bandwidth) {
+		case BANDWIDTH_10_MHZ:
+			c->bandwidth_hz = 10000000;
+			break;
+		case BANDWIDTH_8_MHZ:
 			c->bandwidth_hz = 8000000;
-		else
-			/* Including BANDWIDTH_AUTO */
+			break;
+		case BANDWIDTH_7_MHZ:
+			c->bandwidth_hz = 7000000;
+			break;
+		case BANDWIDTH_6_MHZ:
+			c->bandwidth_hz = 6000000;
+			break;
+		case BANDWIDTH_5_MHZ:
+			c->bandwidth_hz = 5000000;
+			break;
+		case BANDWIDTH_1_712_MHZ:
+			c->bandwidth_hz = 1712000;
+			break;
+		case BANDWIDTH_AUTO:
 			c->bandwidth_hz = 0;
+		}
+
 		c->code_rate_HP = p->u.ofdm.code_rate_HP;
 		c->code_rate_LP = p->u.ofdm.code_rate_LP;
 		c->modulation = p->u.ofdm.constellation;
@@ -1130,14 +1144,29 @@ static void dtv_property_legacy_params_sync(struct dvb_frontend *fe,
 		break;
 	case FE_OFDM:
 		dprintk("%s() Preparing OFDM req\n", __func__);
-		if (c->bandwidth_hz == 6000000)
-			p->u.ofdm.bandwidth = BANDWIDTH_6_MHZ;
-		else if (c->bandwidth_hz == 7000000)
-			p->u.ofdm.bandwidth = BANDWIDTH_7_MHZ;
-		else if (c->bandwidth_hz == 8000000)
+		switch (c->bandwidth_hz) {
+		case 10000000:
+			p->u.ofdm.bandwidth = BANDWIDTH_10_MHZ;
+			break;
+		case 8000000:
 			p->u.ofdm.bandwidth = BANDWIDTH_8_MHZ;
-		else
+			break;
+		case 7000000:
+			p->u.ofdm.bandwidth = BANDWIDTH_7_MHZ;
+			break;
+		case 6000000:
+			p->u.ofdm.bandwidth = BANDWIDTH_6_MHZ;
+			break;
+		case 5000000:
+			p->u.ofdm.bandwidth = BANDWIDTH_5_MHZ;
+			break;
+		case 1712000:
+			p->u.ofdm.bandwidth = BANDWIDTH_1_712_MHZ;
+			break;
+		case 0:
+		default:
 			p->u.ofdm.bandwidth = BANDWIDTH_AUTO;
+		}
 		p->u.ofdm.code_rate_HP = c->code_rate_HP;
 		p->u.ofdm.code_rate_LP = c->code_rate_LP;
 		p->u.ofdm.constellation = c->modulation;
-- 
1.7.8.352.g876a6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/9] [media] dvb: move dvb_set_frontend logic into a separate routine
  2012-01-01 20:11 [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Mauro Carvalho Chehab
  2012-01-01 20:11 ` [PATCH 1/9] [media] dvb: Initialize all cache values Mauro Carvalho Chehab
  2012-01-01 20:11 ` [PATCH 2/9] [media] dvb_frontend: Handle all possible DVBv3 values for bandwidth Mauro Carvalho Chehab
@ 2012-01-01 20:11 ` Mauro Carvalho Chehab
  2012-01-01 20:11 ` [PATCH 4/9] [media] dvb_frontend: Don't use ops->info.type anymore Mauro Carvalho Chehab
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-01 20:11 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

This change is there in order to prepare the code to avoid calling
 dvb_frontend_ioctl_legacy() from FE_SET_PROPERTY.

A call to dvb_frontend_ioctl_legacy() would require to update the
DVBv3 cache without need, mangling calls for newer delivery system
without any reason.

No functional changes here.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |  182 +++++++++++++++--------------
 1 files changed, 93 insertions(+), 89 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 33ce309..eefcb7f 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1786,6 +1786,97 @@ out:
 	return err;
 }
 
+static int dtv_set_frontend(struct file *file, unsigned int cmd, void *parg)
+{
+	struct dvb_device *dvbdev = file->private_data;
+	struct dvb_frontend *fe = dvbdev->priv;
+	struct dvb_frontend_private *fepriv = fe->frontend_priv;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+	struct dvb_frontend_tune_settings fetunesettings;
+
+	if (c->state == DTV_TUNE) {
+		if (dvb_frontend_check_parameters(fe, &fepriv->parameters_in) < 0)
+			return -EINVAL;
+	} else {
+		if (dvb_frontend_check_parameters(fe, parg) < 0)
+			return -EINVAL;
+
+		memcpy (&fepriv->parameters_in, parg,
+			sizeof (struct dvb_frontend_parameters));
+		dtv_property_cache_init(fe, c);
+		dtv_property_cache_sync(fe, c, &fepriv->parameters_in);
+	}
+
+	/*
+		* Initialize output parameters to match the values given by
+		* the user. FE_SET_FRONTEND triggers an initial frontend event
+		* with status = 0, which copies output parameters to userspace.
+		*/
+	fepriv->parameters_out = fepriv->parameters_in;
+
+	memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings));
+
+	/* force auto frequency inversion if requested */
+	if (dvb_force_auto_inversion) {
+		c->inversion = INVERSION_AUTO;
+	}
+	if (fe->ops.info.type == FE_OFDM) {
+		/* without hierarchical coding code_rate_LP is irrelevant,
+			* so we tolerate the otherwise invalid FEC_NONE setting */
+		if (c->hierarchy == HIERARCHY_NONE &&
+			c->code_rate_LP == FEC_NONE)
+			c->code_rate_LP = FEC_AUTO;
+	}
+
+	/* get frontend-specific tuning settings */
+	if (fe->ops.get_tune_settings && (fe->ops.get_tune_settings(fe, &fetunesettings) == 0)) {
+		fepriv->min_delay = (fetunesettings.min_delay_ms * HZ) / 1000;
+		fepriv->max_drift = fetunesettings.max_drift;
+		fepriv->step_size = fetunesettings.step_size;
+	} else {
+		/* default values */
+		switch(fe->ops.info.type) {
+		case FE_QPSK:
+			fepriv->min_delay = HZ/20;
+			fepriv->step_size = c->symbol_rate / 16000;
+			fepriv->max_drift = c->symbol_rate / 2000;
+			break;
+
+		case FE_QAM:
+			fepriv->min_delay = HZ/20;
+			fepriv->step_size = 0; /* no zigzag */
+			fepriv->max_drift = 0;
+			break;
+
+		case FE_OFDM:
+			fepriv->min_delay = HZ/20;
+			fepriv->step_size = fe->ops.info.frequency_stepsize * 2;
+			fepriv->max_drift = (fe->ops.info.frequency_stepsize * 2) + 1;
+			break;
+		case FE_ATSC:
+			fepriv->min_delay = HZ/20;
+			fepriv->step_size = 0;
+			fepriv->max_drift = 0;
+			break;
+		}
+	}
+	if (dvb_override_tune_delay > 0)
+		fepriv->min_delay = (dvb_override_tune_delay * HZ) / 1000;
+
+	fepriv->state = FESTATE_RETUNE;
+
+	/* Request the search algorithm to search */
+	fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
+
+	dvb_frontend_clear_events(fe);
+	dvb_frontend_add_event(fe, 0);
+	dvb_frontend_wakeup(fe);
+	fepriv->status = 0;
+
+	return 0;
+}
+
+
 static int dvb_frontend_ioctl_legacy(struct file *file,
 			unsigned int cmd, void *parg)
 {
@@ -1969,96 +2060,9 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 			err = fe->ops.enable_high_lnb_voltage(fe, (long) parg);
 		break;
 
-	case FE_SET_FRONTEND: {
-		struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-		struct dvb_frontend_tune_settings fetunesettings;
-
-		if (c->state == DTV_TUNE) {
-			if (dvb_frontend_check_parameters(fe, &fepriv->parameters_in) < 0) {
-				err = -EINVAL;
-				break;
-			}
-		} else {
-			if (dvb_frontend_check_parameters(fe, parg) < 0) {
-				err = -EINVAL;
-				break;
-			}
-
-			memcpy (&fepriv->parameters_in, parg,
-				sizeof (struct dvb_frontend_parameters));
-			dtv_property_cache_init(fe, c);
-			dtv_property_cache_sync(fe, c, &fepriv->parameters_in);
-		}
-
-		/*
-		 * Initialize output parameters to match the values given by
-		 * the user. FE_SET_FRONTEND triggers an initial frontend event
-		 * with status = 0, which copies output parameters to userspace.
-		 */
-		fepriv->parameters_out = fepriv->parameters_in;
-
-		memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings));
-
-		/* force auto frequency inversion if requested */
-		if (dvb_force_auto_inversion) {
-			c->inversion = INVERSION_AUTO;
-		}
-		if (fe->ops.info.type == FE_OFDM) {
-			/* without hierarchical coding code_rate_LP is irrelevant,
-			 * so we tolerate the otherwise invalid FEC_NONE setting */
-			if (c->hierarchy == HIERARCHY_NONE &&
-			    c->code_rate_LP == FEC_NONE)
-				c->code_rate_LP = FEC_AUTO;
-		}
-
-		/* get frontend-specific tuning settings */
-		if (fe->ops.get_tune_settings && (fe->ops.get_tune_settings(fe, &fetunesettings) == 0)) {
-			fepriv->min_delay = (fetunesettings.min_delay_ms * HZ) / 1000;
-			fepriv->max_drift = fetunesettings.max_drift;
-			fepriv->step_size = fetunesettings.step_size;
-		} else {
-			/* default values */
-			switch(fe->ops.info.type) {
-			case FE_QPSK:
-				fepriv->min_delay = HZ/20;
-				fepriv->step_size = c->symbol_rate / 16000;
-				fepriv->max_drift = c->symbol_rate / 2000;
-				break;
-
-			case FE_QAM:
-				fepriv->min_delay = HZ/20;
-				fepriv->step_size = 0; /* no zigzag */
-				fepriv->max_drift = 0;
-				break;
-
-			case FE_OFDM:
-				fepriv->min_delay = HZ/20;
-				fepriv->step_size = fe->ops.info.frequency_stepsize * 2;
-				fepriv->max_drift = (fe->ops.info.frequency_stepsize * 2) + 1;
-				break;
-			case FE_ATSC:
-				fepriv->min_delay = HZ/20;
-				fepriv->step_size = 0;
-				fepriv->max_drift = 0;
-				break;
-			}
-		}
-		if (dvb_override_tune_delay > 0)
-			fepriv->min_delay = (dvb_override_tune_delay * HZ) / 1000;
-
-		fepriv->state = FESTATE_RETUNE;
-
-		/* Request the search algorithm to search */
-		fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
-
-		dvb_frontend_clear_events(fe);
-		dvb_frontend_add_event(fe, 0);
-		dvb_frontend_wakeup(fe);
-		fepriv->status = 0;
-		err = 0;
+	case FE_SET_FRONTEND:
+		err = dtv_set_frontend(file, cmd, parg);
 		break;
-	}
-
 	case FE_GET_EVENT:
 		err = dvb_frontend_get_event (fe, parg, file->f_flags);
 		break;
-- 
1.7.8.352.g876a6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/9] [media] dvb_frontend: Don't use ops->info.type anymore
  2012-01-01 20:11 [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Mauro Carvalho Chehab
                   ` (2 preceding siblings ...)
  2012-01-01 20:11 ` [PATCH 3/9] [media] dvb: move dvb_set_frontend logic into a separate routine Mauro Carvalho Chehab
@ 2012-01-01 20:11 ` Mauro Carvalho Chehab
  2012-01-05 16:19   ` e9hack
  2012-01-01 20:11 ` [PATCH 5/9] [media] dvb_frontend: Fix DVBv3 emulation Mauro Carvalho Chehab
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-01 20:11 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

Get rid of using ops->info.type defined on DVB drivers,
as it doesn't apply anymore.

Currently, one driver (cxd2820) supports more than one different
info.type, as it can be used for DVB-T/T2 and DVB-C. There are more
drivers like that to come. So, the same frontend will have
different DVBv3 types, depending on the current delivery system.

This breaks the existing logic at dvb_frontend, that assumes that
just one delivery system DVBv3 type is supported by all delsys.

In order to easy the DVBv3->DVBv5 conversion, an ancillary function
that maps DVBv3 delivery systems into DVBv5 were added.

Also, on all places, except for the event logic, the DVBv5 cache
will be used to check parameters, instead of the DVBv5 copy.

This patch simplifies the cache sync logic, and warrants that the
cache will be in a clear state at DVB frontend register. This way,
ops->info.type will be filled to reflect the first delivery system,
providing backward compatibility support for it.

For example, in the cases like cxd2820, where the delivery systems
are defined as:
        .delsys = { SYS_DVBT, SYS_DVBT2, SYS_DVBC_ANNEX_A },

A pure DVBv3 will be able to use both DVB-T and DVB-T2, as, at
DVB cache clear, the ops->info.type will be equal to FE_OFDM.

However, DVB-C won't be visible. A quick workaround would be to
do a DVBv5 call to set the delivery system to SYS_DVBC_ANNEX_A.

After such call, ops->info.type will be equal to FE_QAM, and a
DVBv3 application will see the frontend as a DVB-C one.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |  541 ++++++++++++++---------------
 1 files changed, 266 insertions(+), 275 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index eefcb7f..7f6ce06 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -150,6 +150,55 @@ static bool has_get_frontend(struct dvb_frontend *fe)
 	return fe->ops.get_frontend;
 }
 
+/*
+ * Due to DVBv3 API calls, a delivery system should be mapped into one of
+ * the 4 DVBv3 delivery systems (FE_QPSK, FE_QAM, FE_OFDM or FE_ATSC),
+ * otherwise, a DVBv3 call will fail.
+ */
+enum dvbv3_emulation_type {
+	DVBV3_UNKNOWN,
+	DVBV3_QPSK,
+	DVBV3_QAM,
+	DVBV3_OFDM,
+	DVBV3_ATSC,
+};
+
+static enum dvbv3_emulation_type dvbv3_type(u32 delivery_system)
+{
+	switch (delivery_system) {
+	case SYS_DVBC_ANNEX_A:
+	case SYS_DVBC_ANNEX_C:
+		return DVBV3_QAM;
+	case SYS_DVBS:
+	case SYS_DVBS2:
+	case SYS_TURBO:
+	case SYS_ISDBS:
+	case SYS_DSS:
+		return DVBV3_QPSK;
+	case SYS_DVBT:
+	case SYS_DVBT2:
+	case SYS_ISDBT:
+	case SYS_DMBTH:
+		return DVBV3_OFDM;
+	case SYS_ATSC:
+	case SYS_DVBC_ANNEX_B:
+		return DVBV3_ATSC;
+	case SYS_UNDEFINED:
+	case SYS_ISDBC:
+	case SYS_DVBH:
+	case SYS_DAB:
+	case SYS_ATSCMH:
+	default:
+		/*
+		 * Doesn't know how to emulate those types and/or
+		 * there's no frontend driver from this type yet
+		 * with some emulation code, so, we're not sure yet how
+		 * to handle them, or they're not compatible with a DVBv3 call.
+		 */
+		return DVBV3_UNKNOWN;
+	}
+}
+
 static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 {
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
@@ -814,52 +863,63 @@ static void dvb_frontend_get_frequency_limits(struct dvb_frontend *fe,
 		       fe->dvb->num,fe->id);
 }
 
-static int dvb_frontend_check_parameters(struct dvb_frontend *fe,
-				struct dvb_frontend_parameters *parms)
+static int dvb_frontend_check_parameters(struct dvb_frontend *fe)
 {
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	u32 freq_min;
 	u32 freq_max;
 
 	/* range check: frequency */
 	dvb_frontend_get_frequency_limits(fe, &freq_min, &freq_max);
-	if ((freq_min && parms->frequency < freq_min) ||
-	    (freq_max && parms->frequency > freq_max)) {
+	if ((freq_min && c->frequency < freq_min) ||
+	    (freq_max && c->frequency > freq_max)) {
 		printk(KERN_WARNING "DVB: adapter %i frontend %i frequency %u out of range (%u..%u)\n",
-		       fe->dvb->num, fe->id, parms->frequency, freq_min, freq_max);
+		       fe->dvb->num, fe->id, c->frequency, freq_min, freq_max);
 		return -EINVAL;
 	}
 
 	/* range check: symbol rate */
-	if (fe->ops.info.type == FE_QPSK) {
-		if ((fe->ops.info.symbol_rate_min &&
-		     parms->u.qpsk.symbol_rate < fe->ops.info.symbol_rate_min) ||
-		    (fe->ops.info.symbol_rate_max &&
-		     parms->u.qpsk.symbol_rate > fe->ops.info.symbol_rate_max)) {
-			printk(KERN_WARNING "DVB: adapter %i frontend %i symbol rate %u out of range (%u..%u)\n",
-			       fe->dvb->num, fe->id, parms->u.qpsk.symbol_rate,
-			       fe->ops.info.symbol_rate_min, fe->ops.info.symbol_rate_max);
-			return -EINVAL;
-		}
-
-	} else if (fe->ops.info.type == FE_QAM) {
+	switch (c->delivery_system) {
+	case SYS_DVBS:
+	case SYS_DVBS2:
+	case SYS_TURBO:
+	case SYS_DVBC_ANNEX_A:
+	case SYS_DVBC_ANNEX_C:
 		if ((fe->ops.info.symbol_rate_min &&
-		     parms->u.qam.symbol_rate < fe->ops.info.symbol_rate_min) ||
+		     c->symbol_rate < fe->ops.info.symbol_rate_min) ||
 		    (fe->ops.info.symbol_rate_max &&
-		     parms->u.qam.symbol_rate > fe->ops.info.symbol_rate_max)) {
+		     c->symbol_rate > fe->ops.info.symbol_rate_max)) {
 			printk(KERN_WARNING "DVB: adapter %i frontend %i symbol rate %u out of range (%u..%u)\n",
-			       fe->dvb->num, fe->id, parms->u.qam.symbol_rate,
-			       fe->ops.info.symbol_rate_min, fe->ops.info.symbol_rate_max);
+			       fe->dvb->num, fe->id, c->symbol_rate,
+			       fe->ops.info.symbol_rate_min,
+			       fe->ops.info.symbol_rate_max);
 			return -EINVAL;
 		}
+	default:
+		break;
 	}
 
-	/* check for supported modulation */
-	if (fe->ops.info.type == FE_QAM &&
-	    (parms->u.qam.modulation > QAM_AUTO ||
-	     !((1 << (parms->u.qam.modulation + 10)) & fe->ops.info.caps))) {
-		printk(KERN_WARNING "DVB: adapter %i frontend %i modulation %u not supported\n",
-		       fe->dvb->num, fe->id, parms->u.qam.modulation);
+	/*
+	 * check for supported modulation
+	 *
+	 * This is currently hacky. Also, it only works for DVB-S & friends,
+	 * and not all modulations has FE_CAN flags
+	 */
+	switch (c->delivery_system) {
+	case SYS_DVBS:
+	case SYS_DVBS2:
+	case SYS_TURBO:
+		if ((c->modulation > QAM_AUTO ||
+		    !((1 << (c->modulation + 10)) & fe->ops.info.caps))) {
+			printk(KERN_WARNING
+			       "DVB: adapter %i frontend %i modulation %u not supported\n",
+			       fe->dvb->num, fe->id, c->modulation);
 			return -EINVAL;
+		}
+		break;
+	default:
+		/* FIXME: it makes sense to validate othere delsys here */
+		break;
 	}
 
 	return 0;
@@ -875,6 +935,8 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
 	c->state = DTV_CLEAR;
 
 	c->delivery_system = fe->ops.delsys[0];
+	dprintk("%s() Clearing cache for delivery system %d\n", __func__,
+		c->delivery_system);
 
 	c->transmission_mode = TRANSMISSION_MODE_AUTO;
 	c->bandwidth_hz = 0;	/* AUTO */
@@ -886,7 +948,6 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
 	c->fec_inner = FEC_AUTO;
 	c->rolloff = ROLLOFF_AUTO;
 	c->voltage = SEC_VOLTAGE_OFF;
-	c->modulation = QAM_AUTO;
 	c->sectone = SEC_TONE_OFF;
 	c->pilot = PILOT_AUTO;
 
@@ -906,6 +967,21 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
 	c->isdbs_ts_id = 0;
 	c->dvbt2_plp_id = 0;
 
+	switch (c->delivery_system) {
+	case SYS_DVBS:
+	case SYS_DVBS2:
+	case SYS_TURBO:
+		c->modulation = QPSK;   /* implied for DVB-S in legacy API */
+		c->rolloff = ROLLOFF_35;/* implied for DVB-S */
+		break;
+	case SYS_ATSC:
+		c->modulation = VSB_8;
+		break;
+	default:
+		c->modulation = QAM_AUTO;
+		break;
+	}
+
 	return 0;
 }
 
@@ -1024,61 +1100,31 @@ static void dtv_property_dump(struct dtv_property *tvp)
 		dprintk("%s() tvp.u.data = 0x%08x\n", __func__, tvp->u.data);
 }
 
-static int is_legacy_delivery_system(fe_delivery_system_t s)
-{
-	if((s == SYS_UNDEFINED) || (s == SYS_DVBC_ANNEX_A) ||
-	   (s == SYS_DVBC_ANNEX_B) || (s == SYS_DVBT) || (s == SYS_DVBS) ||
-	   (s == SYS_ATSC))
-		return 1;
-
-	return 0;
-}
-
-/* Initialize the cache with some default values derived from the
- * legacy frontend_info structure.
- */
-static void dtv_property_cache_init(struct dvb_frontend *fe,
-				    struct dtv_frontend_properties *c)
-{
-	switch (fe->ops.info.type) {
-	case FE_QPSK:
-		c->modulation = QPSK;   /* implied for DVB-S in legacy API */
-		c->rolloff = ROLLOFF_35;/* implied for DVB-S */
-		c->delivery_system = SYS_DVBS;
-		break;
-	case FE_QAM:
-		c->delivery_system = SYS_DVBC_ANNEX_A;
-		break;
-	case FE_OFDM:
-		c->delivery_system = SYS_DVBT;
-		break;
-	case FE_ATSC:
-		break;
-	}
-}
-
 /* Synchronise the legacy tuning parameters into the cache, so that demodulator
  * drivers can use a single set_frontend tuning function, regardless of whether
  * it's being used for the legacy or new API, reducing code and complexity.
  */
-static void dtv_property_cache_sync(struct dvb_frontend *fe,
-				    struct dtv_frontend_properties *c,
-				    const struct dvb_frontend_parameters *p)
+static int dtv_property_cache_sync(struct dvb_frontend *fe,
+				   struct dtv_frontend_properties *c,
+				   const struct dvb_frontend_parameters *p)
 {
 	c->frequency = p->frequency;
 	c->inversion = p->inversion;
 
-	switch (fe->ops.info.type) {
-	case FE_QPSK:
+	switch (dvbv3_type(c->delivery_system)) {
+	case DVBV3_QPSK:
+		dprintk("%s() Preparing QPSK req\n", __func__);
 		c->symbol_rate = p->u.qpsk.symbol_rate;
 		c->fec_inner = p->u.qpsk.fec_inner;
 		break;
-	case FE_QAM:
+	case DVBV3_QAM:
+		dprintk("%s() Preparing QAM req\n", __func__);
 		c->symbol_rate = p->u.qam.symbol_rate;
 		c->fec_inner = p->u.qam.fec_inner;
 		c->modulation = p->u.qam.modulation;
 		break;
-	case FE_OFDM:
+	case DVBV3_OFDM:
+		dprintk("%s() Preparing OFDM req\n", __func__);
 		switch (p->u.ofdm.bandwidth) {
 		case BANDWIDTH_10_MHZ:
 			c->bandwidth_hz = 10000000;
@@ -1109,20 +1155,28 @@ static void dtv_property_cache_sync(struct dvb_frontend *fe,
 		c->guard_interval = p->u.ofdm.guard_interval;
 		c->hierarchy = p->u.ofdm.hierarchy_information;
 		break;
-	case FE_ATSC:
+	case DVBV3_ATSC:
+		dprintk("%s() Preparing ATSC req\n", __func__);
 		c->modulation = p->u.vsb.modulation;
 		if ((c->modulation == VSB_8) || (c->modulation == VSB_16))
 			c->delivery_system = SYS_ATSC;
 		else
 			c->delivery_system = SYS_DVBC_ANNEX_B;
 		break;
+	case DVBV3_UNKNOWN:
+		printk(KERN_ERR
+		       "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n",
+		       __func__, c->delivery_system);
+		return -EINVAL;
 	}
+
+	return 0;
 }
 
 /* Ensure the cached values are set correctly in the frontend
  * legacy tuning structures, for the advanced tuning API.
  */
-static void dtv_property_legacy_params_sync(struct dvb_frontend *fe,
+static int dtv_property_legacy_params_sync(struct dvb_frontend *fe,
 					    struct dvb_frontend_parameters *p)
 {
 	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -1130,20 +1184,26 @@ static void dtv_property_legacy_params_sync(struct dvb_frontend *fe,
 	p->frequency = c->frequency;
 	p->inversion = c->inversion;
 
-	switch (fe->ops.info.type) {
-	case FE_QPSK:
+	switch (dvbv3_type(c->delivery_system)) {
+	case DVBV3_UNKNOWN:
+		printk(KERN_ERR
+		       "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n",
+		       __func__, c->delivery_system);
+		return -EINVAL;
+	case DVBV3_QPSK:
 		dprintk("%s() Preparing QPSK req\n", __func__);
 		p->u.qpsk.symbol_rate = c->symbol_rate;
 		p->u.qpsk.fec_inner = c->fec_inner;
 		break;
-	case FE_QAM:
+	case DVBV3_QAM:
 		dprintk("%s() Preparing QAM req\n", __func__);
 		p->u.qam.symbol_rate = c->symbol_rate;
 		p->u.qam.fec_inner = c->fec_inner;
 		p->u.qam.modulation = c->modulation;
 		break;
-	case FE_OFDM:
+	case DVBV3_OFDM:
 		dprintk("%s() Preparing OFDM req\n", __func__);
+
 		switch (c->bandwidth_hz) {
 		case 10000000:
 			p->u.ofdm.bandwidth = BANDWIDTH_10_MHZ;
@@ -1174,116 +1234,12 @@ static void dtv_property_legacy_params_sync(struct dvb_frontend *fe,
 		p->u.ofdm.guard_interval = c->guard_interval;
 		p->u.ofdm.hierarchy_information = c->hierarchy;
 		break;
-	case FE_ATSC:
+	case DVBV3_ATSC:
 		dprintk("%s() Preparing VSB req\n", __func__);
 		p->u.vsb.modulation = c->modulation;
 		break;
 	}
-}
-
-/* Ensure the cached values are set correctly in the frontend
- * legacy tuning structures, for the legacy tuning API.
- */
-static void dtv_property_adv_params_sync(struct dvb_frontend *fe)
-{
-	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	struct dvb_frontend_parameters *p = &fepriv->parameters_in;
-	u32 rolloff = 0;
-
-	p->frequency = c->frequency;
-	p->inversion = c->inversion;
-
-	if (c->delivery_system == SYS_DSS ||
-	    c->delivery_system == SYS_DVBS ||
-	    c->delivery_system == SYS_DVBS2 ||
-	    c->delivery_system == SYS_ISDBS ||
-	    c->delivery_system == SYS_TURBO) {
-		p->u.qpsk.symbol_rate = c->symbol_rate;
-		p->u.qpsk.fec_inner = c->fec_inner;
-	}
-
-	/* Fake out a generic DVB-T request so we pass validation in the ioctl */
-	if ((c->delivery_system == SYS_ISDBT) ||
-	    (c->delivery_system == SYS_DVBT2)) {
-		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.transmission_mode = TRANSMISSION_MODE_AUTO;
-		p->u.ofdm.guard_interval = GUARD_INTERVAL_AUTO;
-		p->u.ofdm.hierarchy_information = HIERARCHY_AUTO;
-		if (c->bandwidth_hz == 8000000)
-			p->u.ofdm.bandwidth = BANDWIDTH_8_MHZ;
-		else if (c->bandwidth_hz == 7000000)
-			p->u.ofdm.bandwidth = BANDWIDTH_7_MHZ;
-		else if (c->bandwidth_hz == 6000000)
-			p->u.ofdm.bandwidth = BANDWIDTH_6_MHZ;
-		else
-			p->u.ofdm.bandwidth = BANDWIDTH_AUTO;
-	}
-
-	/*
-	 * Be sure that the bandwidth will be filled for all
-	 * non-satellite systems, as tuners need to know what
-	 * low pass/Nyquist half filter should be applied, in
-	 * order to avoid inter-channel noise.
-	 *
-	 * ISDB-T and DVB-T/T2 already sets bandwidth.
-	 * ATSC and DVB-C don't set, so, the core should fill it.
-	 *
-	 * On DVB-C Annex A and C, the bandwidth is a function of
-	 * the roll-off and symbol rate. Annex B defines different
-	 * roll-off factors depending on the modulation. Fortunately,
-	 * Annex B is only used with 6MHz, so there's no need to
-	 * calculate it.
-	 *
-	 * While not officially supported, a side effect of handling it at
-	 * the cache level is that a program could retrieve the bandwidth
-	 * via DTV_BANDWIDTH_HZ, which may be useful for test programs.
-	 */
-	switch (c->delivery_system) {
-	case SYS_ATSC:
-	case SYS_DVBC_ANNEX_B:
-		c->bandwidth_hz = 6000000;
-		break;
-	case SYS_DVBC_ANNEX_A:
-		rolloff = 115;
-		break;
-	case SYS_DVBC_ANNEX_C:
-		rolloff = 113;
-		break;
-	default:
-		break;
-	}
-	if (rolloff)
-		c->bandwidth_hz = (c->symbol_rate * rolloff) / 100;
-}
-
-static void dtv_property_cache_submit(struct dvb_frontend *fe)
-{
-	const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-
-	/* For legacy delivery systems we don't need the delivery_system to
-	 * be specified, but we populate the older structures from the cache
-	 * so we can call set_frontend on older drivers.
-	 */
-	if(is_legacy_delivery_system(c->delivery_system)) {
-
-		dprintk("%s() legacy, modulation = %d\n", __func__, c->modulation);
-		dtv_property_legacy_params_sync(fe, &fepriv->parameters_in);
-
-	} else {
-		dprintk("%s() adv, modulation = %d\n", __func__, c->modulation);
-
-		/* For advanced delivery systems / modulation types ...
-		 * we seed the lecacy dvb_frontend_parameters structure
-		 * so that the sanity checking code later in the IOCTL processing
-		 * can validate our basic frequency ranges, symbolrates, modulation
-		 * etc.
-		 */
-		dtv_property_adv_params_sync(fe);
-	}
+	return 0;
 }
 
 /**
@@ -1319,59 +1275,21 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 static int dvb_frontend_ioctl_properties(struct file *file,
 			unsigned int cmd, void *parg);
 
-static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct dtv_property *p)
-{
-	const struct dvb_frontend_info *info = &fe->ops.info;
-	u32 ncaps = 0;
-
-	/*
-	 * If the frontend explicitly sets a list, use it, instead of
-	 * filling based on the info->type
-	 */
-	if (fe->ops.delsys[ncaps]) {
-		while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
-			p->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
-			ncaps++;
-		}
-		p->u.buffer.len = ncaps;
-		return;
-	}
-	switch (info->type) {
-	case FE_QPSK:
-		p->u.buffer.data[ncaps++] = SYS_DVBS;
-		if (info->caps & FE_CAN_2G_MODULATION)
-			p->u.buffer.data[ncaps++] = SYS_DVBS2;
-		if (info->caps & FE_CAN_TURBO_FEC)
-			p->u.buffer.data[ncaps++] = SYS_TURBO;
-		break;
-	case FE_QAM:
-		p->u.buffer.data[ncaps++] = SYS_DVBC_ANNEX_A;
-		break;
-	case FE_OFDM:
-		p->u.buffer.data[ncaps++] = SYS_DVBT;
-		if (info->caps & FE_CAN_2G_MODULATION)
-			p->u.buffer.data[ncaps++] = SYS_DVBT2;
-		break;
-	case FE_ATSC:
-		if (info->caps & (FE_CAN_8VSB | FE_CAN_16VSB))
-			p->u.buffer.data[ncaps++] = SYS_ATSC;
-		if (info->caps & (FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_128 | FE_CAN_QAM_256))
-			p->u.buffer.data[ncaps++] = SYS_DVBC_ANNEX_B;
-		break;
-	}
-	p->u.buffer.len = ncaps;
-}
-
 static int dtv_property_process_get(struct dvb_frontend *fe,
 				    const struct dtv_frontend_properties *c,
 				    struct dtv_property *tvp,
 				    struct file *file)
 {
-	int r;
+	int r, ncaps;
 
 	switch(tvp->cmd) {
 	case DTV_ENUM_DELSYS:
-		dtv_set_default_delivery_caps(fe, tvp);
+		ncaps = 0;
+		while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
+			tvp->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
+			ncaps++;
+		}
+		tvp->u.buffer.len = ncaps;
 		break;
 	case DTV_FREQUENCY:
 		tvp->u.data = c->frequency;
@@ -1502,6 +1420,8 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
 	return 0;
 }
 
+static int dtv_set_frontend(struct dvb_frontend *fe);
+
 static int dtv_property_process_set(struct dvb_frontend *fe,
 				    struct dtv_property *tvp,
 				    struct file *file)
@@ -1520,11 +1440,11 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
 
 	switch(tvp->cmd) {
 	case DTV_CLEAR:
-		/* Reset a cache of data specific to the frontend here. This does
+		/*
+		 * Reset a cache of data specific to the frontend here. This does
 		 * not effect hardware.
 		 */
 		dvb_frontend_clear_cache(fe);
-		dprintk("%s() Flushing property cache\n", __func__);
 		break;
 	case DTV_TUNE:
 		/* interpret the cache of data, build either a traditional frontend
@@ -1533,10 +1453,11 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
 		 */
 		c->state = tvp->cmd;
 		dprintk("%s() Finalised property cache\n", __func__);
-		dtv_property_cache_submit(fe);
 
-		r = dvb_frontend_ioctl_legacy(file, FE_SET_FRONTEND,
-			&fepriv->parameters_in);
+		/* Needed, due to status update */
+		dtv_property_legacy_params_sync(fe, &fepriv->parameters_in);
+
+		r = dtv_set_frontend(fe);
 		break;
 	case DTV_FREQUENCY:
 		c->frequency = tvp->u.data;
@@ -1786,76 +1707,102 @@ out:
 	return err;
 }
 
-static int dtv_set_frontend(struct file *file, unsigned int cmd, void *parg)
+static int dtv_set_frontend(struct dvb_frontend *fe)
 {
-	struct dvb_device *dvbdev = file->private_data;
-	struct dvb_frontend *fe = dvbdev->priv;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	struct dvb_frontend_tune_settings fetunesettings;
+	u32 rolloff = 0;
 
-	if (c->state == DTV_TUNE) {
-		if (dvb_frontend_check_parameters(fe, &fepriv->parameters_in) < 0)
-			return -EINVAL;
-	} else {
-		if (dvb_frontend_check_parameters(fe, parg) < 0)
-			return -EINVAL;
-
-		memcpy (&fepriv->parameters_in, parg,
-			sizeof (struct dvb_frontend_parameters));
-		dtv_property_cache_init(fe, c);
-		dtv_property_cache_sync(fe, c, &fepriv->parameters_in);
-	}
+	if (dvb_frontend_check_parameters(fe) < 0)
+		return -EINVAL;
 
 	/*
-		* Initialize output parameters to match the values given by
-		* the user. FE_SET_FRONTEND triggers an initial frontend event
-		* with status = 0, which copies output parameters to userspace.
-		*/
+	 * Initialize output parameters to match the values given by
+	 * the user. FE_SET_FRONTEND triggers an initial frontend event
+	 * with status = 0, which copies output parameters to userspace.
+	 *
+	 * This is still needed for DVBv5 calls, due to event state update.
+	 */
 	fepriv->parameters_out = fepriv->parameters_in;
 
-	memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings));
+	/*
+	 * Be sure that the bandwidth will be filled for all
+	 * non-satellite systems, as tuners need to know what
+	 * low pass/Nyquist half filter should be applied, in
+	 * order to avoid inter-channel noise.
+	 *
+	 * ISDB-T and DVB-T/T2 already sets bandwidth.
+	 * ATSC and DVB-C don't set, so, the core should fill it.
+	 *
+	 * On DVB-C Annex A and C, the bandwidth is a function of
+	 * the roll-off and symbol rate. Annex B defines different
+	 * roll-off factors depending on the modulation. Fortunately,
+	 * Annex B is only used with 6MHz, so there's no need to
+	 * calculate it.
+	 *
+	 * While not officially supported, a side effect of handling it at
+	 * the cache level is that a program could retrieve the bandwidth
+	 * via DTV_BANDWIDTH_HZ, which may be useful for test programs.
+	 */
+	switch (c->delivery_system) {
+	case SYS_ATSC:
+	case SYS_DVBC_ANNEX_B:
+		c->bandwidth_hz = 6000000;
+		break;
+	case SYS_DVBC_ANNEX_A:
+		rolloff = 115;
+		break;
+	case SYS_DVBC_ANNEX_C:
+		rolloff = 113;
+		break;
+	default:
+		break;
+	}
+	if (rolloff)
+		c->bandwidth_hz = (c->symbol_rate * rolloff) / 100;
 
 	/* force auto frequency inversion if requested */
-	if (dvb_force_auto_inversion) {
+	if (dvb_force_auto_inversion)
 		c->inversion = INVERSION_AUTO;
-	}
-	if (fe->ops.info.type == FE_OFDM) {
-		/* without hierarchical coding code_rate_LP is irrelevant,
-			* so we tolerate the otherwise invalid FEC_NONE setting */
-		if (c->hierarchy == HIERARCHY_NONE &&
-			c->code_rate_LP == FEC_NONE)
-			c->code_rate_LP = FEC_AUTO;
-	}
+
+	/*
+	 * without hierarchical coding code_rate_LP is irrelevant,
+	 * so we tolerate the otherwise invalid FEC_NONE setting
+	 */
+	if (c->hierarchy == HIERARCHY_NONE && c->code_rate_LP == FEC_NONE)
+		c->code_rate_LP = FEC_AUTO;
 
 	/* get frontend-specific tuning settings */
+	memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings));
 	if (fe->ops.get_tune_settings && (fe->ops.get_tune_settings(fe, &fetunesettings) == 0)) {
 		fepriv->min_delay = (fetunesettings.min_delay_ms * HZ) / 1000;
 		fepriv->max_drift = fetunesettings.max_drift;
 		fepriv->step_size = fetunesettings.step_size;
 	} else {
 		/* default values */
-		switch(fe->ops.info.type) {
-		case FE_QPSK:
-			fepriv->min_delay = HZ/20;
+		switch (c->delivery_system) {
+		case SYS_DVBC_ANNEX_A:
+		case SYS_DVBC_ANNEX_C:
+			fepriv->min_delay = HZ / 20;
 			fepriv->step_size = c->symbol_rate / 16000;
 			fepriv->max_drift = c->symbol_rate / 2000;
 			break;
-
-		case FE_QAM:
-			fepriv->min_delay = HZ/20;
-			fepriv->step_size = 0; /* no zigzag */
-			fepriv->max_drift = 0;
-			break;
-
-		case FE_OFDM:
-			fepriv->min_delay = HZ/20;
+		case SYS_DVBT:
+		case SYS_DVBT2:
+		case SYS_ISDBT:
+		case SYS_DMBTH:
+			fepriv->min_delay = HZ / 20;
 			fepriv->step_size = fe->ops.info.frequency_stepsize * 2;
 			fepriv->max_drift = (fe->ops.info.frequency_stepsize * 2) + 1;
 			break;
-		case FE_ATSC:
-			fepriv->min_delay = HZ/20;
-			fepriv->step_size = 0;
+		default:
+			/*
+			 * FIXME: This sounds wrong! if freqency_stepsize is
+			 * defined by the frontend, why not use it???
+			 */
+			fepriv->min_delay = HZ / 20;
+			fepriv->step_size = 0; /* no zigzag */
 			fepriv->max_drift = 0;
 			break;
 		}
@@ -1883,6 +1830,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 	struct dvb_device *dvbdev = file->private_data;
 	struct dvb_frontend *fe = dvbdev->priv;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
 	int cb_err, err = -EOPNOTSUPP;
 
 	if (fe->dvb->fe_ioctl_override) {
@@ -1902,6 +1850,37 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 		memcpy(info, &fe->ops.info, sizeof(struct dvb_frontend_info));
 		dvb_frontend_get_frequency_limits(fe, &info->frequency_min, &info->frequency_max);
 
+		/*
+		 * Associate the 4 delivery systems supported by DVBv3
+		 * API with their DVBv5 counterpart. For the other standards,
+		 * use the closest type, assuming that it would hopefully
+		 * work with a DVBv3 application.
+		 * It should be noticed that, on multi-frontend devices with
+		 * different types (terrestrial and cable, for example),
+		 * a pure DVBv3 application won't be able to use all delivery
+		 * systems. Yet, changing the DVBv5 cache to the other delivery
+		 * system should be enough for making it work.
+		 */
+		switch (dvbv3_type(c->delivery_system)) {
+		case DVBV3_QPSK:
+			fe->ops.info.type = FE_QPSK;
+			break;
+		case DVBV3_ATSC:
+			fe->ops.info.type = FE_ATSC;
+			break;
+		case DVBV3_QAM:
+			fe->ops.info.type = FE_QAM;
+			break;
+		case DVBV3_OFDM:
+			fe->ops.info.type = FE_OFDM;
+			break;
+		default:
+			printk(KERN_ERR
+			       "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n",
+			       __func__, c->delivery_system);
+			fe->ops.info.type = FE_OFDM;
+		}
+
 		/* Force the CAN_INVERSION_AUTO bit on. If the frontend doesn't
 		 * do it, it is done for it. */
 		info->caps |= FE_CAN_INVERSION_AUTO;
@@ -2061,7 +2040,13 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 		break;
 
 	case FE_SET_FRONTEND:
-		err = dtv_set_frontend(file, cmd, parg);
+		/* Synchronise DVBv5 parameters from DVBv3 */
+		memcpy (&fepriv->parameters_in, parg,
+			sizeof (struct dvb_frontend_parameters));
+		err = dtv_property_cache_sync(fe, c, &fepriv->parameters_in);
+		if (err)
+			break;
+		err = dtv_set_frontend(fe);
 		break;
 	case FE_GET_EVENT:
 		err = dvb_frontend_get_event (fe, parg, file->f_flags);
@@ -2281,6 +2266,12 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
 	dvb_register_device (fe->dvb, &fepriv->dvbdev, &dvbdev_template,
 			     fe, DVB_DEVICE_FRONTEND);
 
+	/*
+	 * Initialize the cache to the proper values according with the
+	 * first supported delivery system (ops->delsys[0])
+	 */
+	dvb_frontend_clear_cache(fe);
+
 	mutex_unlock(&frontend_mutex);
 	return 0;
 }
-- 
1.7.8.352.g876a6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 5/9] [media] dvb_frontend: Fix DVBv3 emulation
  2012-01-01 20:11 [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Mauro Carvalho Chehab
                   ` (3 preceding siblings ...)
  2012-01-01 20:11 ` [PATCH 4/9] [media] dvb_frontend: Don't use ops->info.type anymore Mauro Carvalho Chehab
@ 2012-01-01 20:11 ` Mauro Carvalho Chehab
  2012-01-01 20:11 ` [PATCH 6/9] [media] dvb-core: Fix ISDB-T defaults Mauro Carvalho Chehab
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-01 20:11 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

For frontends with ISDB-T, DVB-T2, CMDBTH, etc, some code is
needed, in order to provide emulation. Add such code, and check
if the desired delivery system is supported by the frontend.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |  140 ++++++++++++++++++++++++++++-
 1 files changed, 139 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 7f6ce06..c1b3b30 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1422,6 +1422,139 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
 
 static int dtv_set_frontend(struct dvb_frontend *fe);
 
+static bool is_dvbv3_delsys(u32 delsys)
+{
+	bool status;
+
+	status = (delsys == SYS_DVBT) || (delsys == SYS_DVBC_ANNEX_A) ||
+		 (delsys == SYS_DVBS) || (delsys == SYS_ATSC);
+
+	return status;
+}
+
+static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
+{
+	int ncaps, i;
+	u32 delsys = SYS_UNDEFINED;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+	enum dvbv3_emulation_type type;
+
+	if (desired_system == SYS_UNDEFINED) {
+		/*
+		 * A DVBv3 call doesn't know what's the desired system.
+		 * So, don't change the current delivery system. Instead,
+		 * find the closest DVBv3 system that matches the delivery
+		 * system.
+		 */
+		if (is_dvbv3_delsys(c->delivery_system)) {
+			dprintk("%s() Using delivery system to %d\n",
+				__func__, c->delivery_system);
+			return 0;
+		}
+		type = dvbv3_type(c->delivery_system);
+		switch (type) {
+		case DVBV3_QPSK:
+			desired_system = FE_QPSK;
+			break;
+		case DVBV3_QAM:
+			desired_system = FE_QAM;
+			break;
+		case DVBV3_ATSC:
+			desired_system = FE_ATSC;
+			break;
+		case DVBV3_OFDM:
+			desired_system = FE_OFDM;
+			break;
+		default:
+			dprintk("%s(): This frontend doesn't support DVBv3 calls\n",
+				__func__);
+			return -EINVAL;
+		}
+		delsys = c->delivery_system;
+	} else {
+		/*
+		 * Check if the desired delivery system is supported
+		 */
+		ncaps = 0;
+		while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
+			if (fe->ops.delsys[ncaps] == desired_system) {
+				c->delivery_system = desired_system;
+				dprintk("%s() Changing delivery system to %d\n",
+					__func__, desired_system);
+				return 0;
+			}
+		}
+		type = dvbv3_type(desired_system);
+
+		/*
+		 * The delivery system is not supported. See if it can be
+		 * emulated.
+		 * The emulation only works if the desired system is one of the
+		 * DVBv3 delivery systems
+		 */
+		if (!is_dvbv3_delsys(desired_system)) {
+			dprintk("%s() can't use a DVBv3 FE_SET_FRONTEND call on this frontend\n",
+				__func__);
+			return -EINVAL;
+		}
+
+		/*
+		 * Get the last non-DVBv3 delivery system that has the same type
+		 * of the desired system
+		 */
+		ncaps = 0;
+		while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
+			if ((dvbv3_type(fe->ops.delsys[ncaps]) == type) &&
+			    !is_dvbv3_delsys(fe->ops.delsys[ncaps]))
+				delsys = fe->ops.delsys[ncaps];
+			ncaps++;
+		}
+		/* There's nothing compatible with the desired delivery system */
+		if (delsys == SYS_UNDEFINED) {
+			dprintk("%s() Incompatible DVBv3 FE_SET_FRONTEND call for this frontend\n",
+				__func__);
+			return -EINVAL;
+		}
+		c->delivery_system = delsys;
+	}
+
+	/*
+	 * Emulate newer delivery systems like ISDBT, DVBT and DMBTH
+	 * for older DVBv5 applications. The emulation will try to use
+	 * the auto mode for most things, and will assume that the desired
+	 * delivery system is the last one at the ops.delsys[] array
+	 */
+	dprintk("%s() Using delivery system %d emulated as if it were a %d\n",
+		__func__, delsys, desired_system);
+
+	/*
+	 * For now, uses it for ISDB-T, DMBTH and DVB-T2
+	 * For DVB-S2 and DVB-TURBO, assumes that the DVB-S parameters are enough.
+	 */
+	if (type == DVBV3_OFDM) {
+		c->modulation = QAM_AUTO;
+		c->code_rate_HP = FEC_AUTO;
+		c->code_rate_LP = FEC_AUTO;
+		c->transmission_mode = TRANSMISSION_MODE_AUTO;
+		c->guard_interval = GUARD_INTERVAL_AUTO;
+		c->hierarchy = HIERARCHY_AUTO;
+
+		c->isdbt_partial_reception = -1;
+		c->isdbt_sb_mode = -1;
+		c->isdbt_sb_subchannel = -1;
+		c->isdbt_sb_segment_idx = -1;
+		c->isdbt_sb_segment_count = -1;
+		c->isdbt_layer_enabled = 0x7;
+		for (i = 0; i < 3; i++) {
+			c->layer[i].fec = FEC_AUTO;
+			c->layer[i].modulation = QAM_AUTO;
+			c->layer[i].interleaving = -1;
+			c->layer[i].segment_count = -1;
+		}
+	}
+	return 0;
+}
+
 static int dtv_property_process_set(struct dvb_frontend *fe,
 				    struct dtv_property *tvp,
 				    struct file *file)
@@ -1484,7 +1617,7 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
 		c->rolloff = tvp->u.data;
 		break;
 	case DTV_DELIVERY_SYSTEM:
-		c->delivery_system = tvp->u.data;
+		r = set_delivery_system(fe, tvp->u.data);
 		break;
 	case DTV_VOLTAGE:
 		c->voltage = tvp->u.data;
@@ -2043,6 +2176,11 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 		/* Synchronise DVBv5 parameters from DVBv3 */
 		memcpy (&fepriv->parameters_in, parg,
 			sizeof (struct dvb_frontend_parameters));
+
+		err = set_delivery_system(fe, SYS_UNDEFINED);
+		if (err)
+			break;
+
 		err = dtv_property_cache_sync(fe, c, &fepriv->parameters_in);
 		if (err)
 			break;
-- 
1.7.8.352.g876a6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 6/9] [media] dvb-core: Fix ISDB-T defaults
  2012-01-01 20:11 [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Mauro Carvalho Chehab
                   ` (4 preceding siblings ...)
  2012-01-01 20:11 ` [PATCH 5/9] [media] dvb_frontend: Fix DVBv3 emulation Mauro Carvalho Chehab
@ 2012-01-01 20:11 ` Mauro Carvalho Chehab
  2012-01-01 20:11 ` [PATCH 7/9] [media] dvb: get rid of fepriv->parameters_in Mauro Carvalho Chehab
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-01 20:11 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

using -1 for ISDB-T parameters do the wrong thing. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   56 ++++++++++++++--------------
 1 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index c1b3b30..ea3d0a3 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -951,17 +951,17 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
 	c->sectone = SEC_TONE_OFF;
 	c->pilot = PILOT_AUTO;
 
-	c->isdbt_partial_reception = -1;
-	c->isdbt_sb_mode = -1;
-	c->isdbt_sb_subchannel = -1;
-	c->isdbt_sb_segment_idx = -1;
-	c->isdbt_sb_segment_count = -1;
-	c->isdbt_layer_enabled = 0x7;
+	c->isdbt_partial_reception = 0;
+	c->isdbt_sb_mode = 0;
+	c->isdbt_sb_subchannel = 0;
+	c->isdbt_sb_segment_idx = 0;
+	c->isdbt_sb_segment_count = 0;
+	c->isdbt_layer_enabled = 0;
 	for (i = 0; i < 3; i++) {
 		c->layer[i].fec = FEC_AUTO;
 		c->layer[i].modulation = QAM_AUTO;
-		c->layer[i].interleaving = -1;
-		c->layer[i].segment_count = -1;
+		c->layer[i].interleaving = 0;
+		c->layer[i].segment_count = 0;
 	}
 
 	c->isdbs_ts_id = 0;
@@ -1528,28 +1528,28 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
 		__func__, delsys, desired_system);
 
 	/*
-	 * For now, uses it for ISDB-T, DMBTH and DVB-T2
-	 * For DVB-S2 and DVB-TURBO, assumes that the DVB-S parameters are enough.
+	 * For now, handles ISDB-T calls. More code may be needed here for the
+	 * other emulated stuff
 	 */
 	if (type == DVBV3_OFDM) {
-		c->modulation = QAM_AUTO;
-		c->code_rate_HP = FEC_AUTO;
-		c->code_rate_LP = FEC_AUTO;
-		c->transmission_mode = TRANSMISSION_MODE_AUTO;
-		c->guard_interval = GUARD_INTERVAL_AUTO;
-		c->hierarchy = HIERARCHY_AUTO;
-
-		c->isdbt_partial_reception = -1;
-		c->isdbt_sb_mode = -1;
-		c->isdbt_sb_subchannel = -1;
-		c->isdbt_sb_segment_idx = -1;
-		c->isdbt_sb_segment_count = -1;
-		c->isdbt_layer_enabled = 0x7;
-		for (i = 0; i < 3; i++) {
-			c->layer[i].fec = FEC_AUTO;
-			c->layer[i].modulation = QAM_AUTO;
-			c->layer[i].interleaving = -1;
-			c->layer[i].segment_count = -1;
+		if (c->delivery_system == SYS_ISDBT) {
+			dprintk("%s() Using defaults for SYS_ISDBT\n",
+				__func__);
+			if (!c->bandwidth_hz)
+				c->bandwidth_hz = 6000000;
+
+			c->isdbt_partial_reception = 0;
+			c->isdbt_sb_mode = 0;
+			c->isdbt_sb_subchannel = 0;
+			c->isdbt_sb_segment_idx = 0;
+			c->isdbt_sb_segment_count = 0;
+			c->isdbt_layer_enabled = 0;
+			for (i = 0; i < 3; i++) {
+				c->layer[i].fec = FEC_AUTO;
+				c->layer[i].modulation = QAM_AUTO;
+				c->layer[i].interleaving = 0;
+				c->layer[i].segment_count = 0;
+			}
 		}
 	}
 	return 0;
-- 
1.7.8.352.g876a6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 7/9] [media] dvb: get rid of fepriv->parameters_in
  2012-01-01 20:11 [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Mauro Carvalho Chehab
                   ` (5 preceding siblings ...)
  2012-01-01 20:11 ` [PATCH 6/9] [media] dvb-core: Fix ISDB-T defaults Mauro Carvalho Chehab
@ 2012-01-01 20:11 ` Mauro Carvalho Chehab
  2012-01-01 20:11 ` [PATCH 8/9] [media] dvb: deprecate the usage of ops->info.type Mauro Carvalho Chehab
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-01 20:11 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

This var were used during DVBv3 times, in order to keep a copy
of the parameters used by the events. This is not needed anymore,
as the parameters are now dynamically generated from the DVBv5
structure.

So, just get rid of it. That means that a DVBv5 pure call won't
use anymore any DVBv3 parameters.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   27 ++-------------------------
 1 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index ea3d0a3..678e329 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -108,7 +108,6 @@ struct dvb_frontend_private {
 
 	/* thread/frontend values */
 	struct dvb_device *dvbdev;
-	struct dvb_frontend_parameters parameters_in;
 	struct dvb_frontend_parameters parameters_out;
 	struct dvb_fe_events events;
 	struct semaphore sem;
@@ -696,7 +695,6 @@ restart:
 					fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
 					fepriv->delay = HZ / 2;
 				}
-				fepriv->parameters_out = fepriv->parameters_in;
 				fe->ops.read_status(fe, &s);
 				if (s != fepriv->status) {
 					dvb_frontend_add_event(fe, s); /* update event list */
@@ -1561,8 +1559,6 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
 {
 	int r = 0;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	dtv_property_dump(tvp);
 
 	/* Allow the frontend to validate incoming properties */
 	if (fe->ops.set_property) {
@@ -1587,9 +1583,6 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
 		c->state = tvp->cmd;
 		dprintk("%s() Finalised property cache\n", __func__);
 
-		/* Needed, due to status update */
-		dtv_property_legacy_params_sync(fe, &fepriv->parameters_in);
-
 		r = dtv_set_frontend(fe);
 		break;
 	case DTV_FREQUENCY:
@@ -1851,15 +1844,6 @@ static int dtv_set_frontend(struct dvb_frontend *fe)
 		return -EINVAL;
 
 	/*
-	 * Initialize output parameters to match the values given by
-	 * the user. FE_SET_FRONTEND triggers an initial frontend event
-	 * with status = 0, which copies output parameters to userspace.
-	 *
-	 * This is still needed for DVBv5 calls, due to event state update.
-	 */
-	fepriv->parameters_out = fepriv->parameters_in;
-
-	/*
 	 * Be sure that the bandwidth will be filled for all
 	 * non-satellite systems, as tuners need to know what
 	 * low pass/Nyquist half filter should be applied, in
@@ -2173,15 +2157,11 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 		break;
 
 	case FE_SET_FRONTEND:
-		/* Synchronise DVBv5 parameters from DVBv3 */
-		memcpy (&fepriv->parameters_in, parg,
-			sizeof (struct dvb_frontend_parameters));
-
 		err = set_delivery_system(fe, SYS_UNDEFINED);
 		if (err)
 			break;
 
-		err = dtv_property_cache_sync(fe, c, &fepriv->parameters_in);
+		err = dtv_property_cache_sync(fe, c, parg);
 		if (err)
 			break;
 		err = dtv_set_frontend(fe);
@@ -2191,10 +2171,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 		break;
 
 	case FE_GET_FRONTEND:
-		err = dtv_get_frontend(fe, &fepriv->parameters_out);
-		if (err >= 0)
-			memcpy(parg, &fepriv->parameters_out,
-			       sizeof(struct dvb_frontend_parameters));
+		err = dtv_get_frontend(fe, parg);
 		break;
 
 	case FE_SET_FRONTEND_TUNE_MODE:
-- 
1.7.8.352.g876a6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 8/9] [media] dvb: deprecate the usage of ops->info.type
  2012-01-01 20:11 [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Mauro Carvalho Chehab
                   ` (6 preceding siblings ...)
  2012-01-01 20:11 ` [PATCH 7/9] [media] dvb: get rid of fepriv->parameters_in Mauro Carvalho Chehab
@ 2012-01-01 20:11 ` Mauro Carvalho Chehab
  2012-01-01 20:11 ` [PATCH 9/9] [media] dvb: Remove ops->info.type from frontends Mauro Carvalho Chehab
  2012-01-02  7:31 ` [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Manu Abraham
  9 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-01 20:11 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

Mark info.type as deprecated inside the header, recommending
the usage of DTV_ENUM_DELSYS DVBv5 command instead.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 Documentation/DocBook/media/dvb/frontend.xml |    4 ++++
 include/linux/dvb/frontend.h                 |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Documentation/DocBook/media/dvb/frontend.xml b/Documentation/DocBook/media/dvb/frontend.xml
index 28d7ea5..aeaed59 100644
--- a/Documentation/DocBook/media/dvb/frontend.xml
+++ b/Documentation/DocBook/media/dvb/frontend.xml
@@ -63,6 +63,10 @@ transmission. The fontend types are given by fe_type_t type, defined as:</para>
 <para>Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described at the above, as they're
 supported via the new <link linkend="FE_GET_SET_PROPERTY">FE_GET_PROPERTY/FE_GET_SET_PROPERTY</link> ioctl's, using the <link linkend="DTV-DELIVERY-SYSTEM">DTV_DELIVERY_SYSTEM</link> parameter.
 </para>
+
+<para>The usage of this field is deprecated, as it doesn't report all supported standards, and
+will provide an incomplete information for frontends that support multiple delivery systems.
+Please use <link linkend="DTV_ENUM_DELSYS">DTV_ENUM_DELSYS</link> instead.</para>
 </section>
 
 <section id="fe-caps-t">
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h
index 7e7cb64..cb4428a 100644
--- a/include/linux/dvb/frontend.h
+++ b/include/linux/dvb/frontend.h
@@ -72,7 +72,7 @@ typedef enum fe_caps {
 
 struct dvb_frontend_info {
 	char       name[128];
-	fe_type_t  type;
+	fe_type_t  type;			/* DEPRECATED. Use DTV_ENUM_DELSYS instead */
 	__u32      frequency_min;
 	__u32      frequency_max;
 	__u32      frequency_stepsize;
-- 
1.7.8.352.g876a6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 9/9] [media] dvb: Remove ops->info.type from frontends
  2012-01-01 20:11 [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Mauro Carvalho Chehab
                   ` (7 preceding siblings ...)
  2012-01-01 20:11 ` [PATCH 8/9] [media] dvb: deprecate the usage of ops->info.type Mauro Carvalho Chehab
@ 2012-01-01 20:11 ` Mauro Carvalho Chehab
  2012-01-02  7:31 ` [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Manu Abraham
  9 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-01 20:11 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

Now that this field is deprecated, and core generates it for
DVBv3 calls, remove it from the drivers.

It also adds .delsys on the few drivers where this were missed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/dvb/bt8xx/dst.c               |    5 +----
 drivers/media/dvb/dvb-usb/af9005-fe.c       |    1 -
 drivers/media/dvb/dvb-usb/cinergyT2-fe.c    |    1 -
 drivers/media/dvb/dvb-usb/dtt200u-fe.c      |    1 -
 drivers/media/dvb/dvb-usb/friio-fe.c        |    1 -
 drivers/media/dvb/dvb-usb/gp8psk-fe.c       |    1 -
 drivers/media/dvb/dvb-usb/mxl111sf-demod.c  |    1 -
 drivers/media/dvb/dvb-usb/vp702x-fe.c       |    1 -
 drivers/media/dvb/dvb-usb/vp7045-fe.c       |    1 -
 drivers/media/dvb/frontends/af9013.c        |    1 -
 drivers/media/dvb/frontends/atbm8830.c      |    1 -
 drivers/media/dvb/frontends/au8522_dig.c    |    1 -
 drivers/media/dvb/frontends/bcm3510.c       |    1 -
 drivers/media/dvb/frontends/cx22700.c       |    1 -
 drivers/media/dvb/frontends/cx22702.c       |    1 -
 drivers/media/dvb/frontends/cx24110.c       |    1 -
 drivers/media/dvb/frontends/cx24116.c       |    1 -
 drivers/media/dvb/frontends/cx24123.c       |    1 -
 drivers/media/dvb/frontends/cxd2820r_core.c |    2 --
 drivers/media/dvb/frontends/dib3000mb.c     |    1 -
 drivers/media/dvb/frontends/dib3000mc.c     |    1 -
 drivers/media/dvb/frontends/dib7000m.c      |    1 -
 drivers/media/dvb/frontends/dib7000p.c      |    1 -
 drivers/media/dvb/frontends/dib8000.c       |    1 -
 drivers/media/dvb/frontends/dib9000.c       |    1 -
 drivers/media/dvb/frontends/drxd_hard.c     |    1 -
 drivers/media/dvb/frontends/drxk_hard.c     |    2 --
 drivers/media/dvb/frontends/ds3000.c        |    1 -
 drivers/media/dvb/frontends/dvb_dummy_fe.c  |    3 ---
 drivers/media/dvb/frontends/ec100.c         |    1 -
 drivers/media/dvb/frontends/it913x-fe.c     |    1 -
 drivers/media/dvb/frontends/l64781.c        |    1 -
 drivers/media/dvb/frontends/lgdt3305.c      |    3 +--
 drivers/media/dvb/frontends/lgdt330x.c      |    2 --
 drivers/media/dvb/frontends/lgs8gl5.c       |    1 -
 drivers/media/dvb/frontends/lgs8gxx.c       |    1 -
 drivers/media/dvb/frontends/mb86a16.c       |    1 -
 drivers/media/dvb/frontends/mb86a20s.c      |    1 -
 drivers/media/dvb/frontends/mt312.c         |    1 -
 drivers/media/dvb/frontends/mt352.c         |    1 -
 drivers/media/dvb/frontends/nxt200x.c       |    1 -
 drivers/media/dvb/frontends/nxt6000.c       |    1 -
 drivers/media/dvb/frontends/or51132.c       |    1 -
 drivers/media/dvb/frontends/or51211.c       |    1 -
 drivers/media/dvb/frontends/s5h1409.c       |    1 -
 drivers/media/dvb/frontends/s5h1411.c       |    1 -
 drivers/media/dvb/frontends/s5h1420.c       |    1 -
 drivers/media/dvb/frontends/s5h1432.c       |    1 -
 drivers/media/dvb/frontends/s921.c          |    1 -
 drivers/media/dvb/frontends/si21xx.c        |    1 -
 drivers/media/dvb/frontends/sp8870.c        |    1 -
 drivers/media/dvb/frontends/sp887x.c        |    1 -
 drivers/media/dvb/frontends/stb0899_drv.c   |   20 +-------------------
 drivers/media/dvb/frontends/stv0288.c       |    8 --------
 drivers/media/dvb/frontends/stv0297.c       |    1 -
 drivers/media/dvb/frontends/stv0299.c       |    1 -
 drivers/media/dvb/frontends/stv0367.c       |    2 --
 drivers/media/dvb/frontends/stv0900_core.c  |    1 -
 drivers/media/dvb/frontends/stv090x.c       |    1 -
 drivers/media/dvb/frontends/tda10021.c      |    1 -
 drivers/media/dvb/frontends/tda10023.c      |    1 -
 drivers/media/dvb/frontends/tda10048.c      |    1 -
 drivers/media/dvb/frontends/tda1004x.c      |    2 --
 drivers/media/dvb/frontends/tda10071.c      |    1 -
 drivers/media/dvb/frontends/tda10086.c      |    1 -
 drivers/media/dvb/frontends/tda8083.c       |    1 -
 drivers/media/dvb/frontends/ves1820.c       |    1 -
 drivers/media/dvb/frontends/ves1x93.c       |    1 -
 drivers/media/dvb/frontends/zl10353.c       |    1 -
 drivers/media/dvb/pt1/va1j5jf8007s.c        |    1 -
 drivers/media/dvb/pt1/va1j5jf8007t.c        |    1 -
 drivers/media/dvb/siano/smsdvb.c            |    1 -
 drivers/media/dvb/ttusb-dec/ttusbdecfe.c    |    2 --
 drivers/media/video/tlg2300/pd-dvb.c        |    1 -
 74 files changed, 3 insertions(+), 111 deletions(-)

diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c
index 9c5cbf1..430b3eb 100644
--- a/drivers/media/dvb/bt8xx/dst.c
+++ b/drivers/media/dvb/bt8xx/dst.c
@@ -1762,7 +1762,6 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "DST DVB-T",
-		.type = FE_OFDM,
 		.frequency_min = 137000000,
 		.frequency_max = 858000000,
 		.frequency_stepsize = 166667,
@@ -1792,7 +1791,6 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name = "DST DVB-S",
-		.type = FE_QPSK,
 		.frequency_min = 950000,
 		.frequency_max = 2150000,
 		.frequency_stepsize = 1000,	/* kHz for QPSK frontends */
@@ -1822,7 +1820,6 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
 	.delsys = { SYS_DVBC_ANNEX_A },
 	.info = {
 		.name = "DST DVB-C",
-		.type = FE_QAM,
 		.frequency_stepsize = 62500,
 		.frequency_min = 51000000,
 		.frequency_max = 858000000,
@@ -1849,9 +1846,9 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
 };
 
 static struct dvb_frontend_ops dst_atsc_ops = {
+	.delsys = { SYS_ATSC },
 	.info = {
 		.name = "DST ATSC",
-		.type = FE_ATSC,
 		.frequency_stepsize = 62500,
 		.frequency_min = 510000000,
 		.frequency_max = 858000000,
diff --git a/drivers/media/dvb/dvb-usb/af9005-fe.c b/drivers/media/dvb/dvb-usb/af9005-fe.c
index 0e1b04f..740f3f4 100644
--- a/drivers/media/dvb/dvb-usb/af9005-fe.c
+++ b/drivers/media/dvb/dvb-usb/af9005-fe.c
@@ -1458,7 +1458,6 @@ static struct dvb_frontend_ops af9005_fe_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		 .name = "AF9005 USB DVB-T",
-		 .type = FE_OFDM,
 		 .frequency_min = 44250000,
 		 .frequency_max = 867250000,
 		 .frequency_stepsize = 250000,
diff --git a/drivers/media/dvb/dvb-usb/cinergyT2-fe.c b/drivers/media/dvb/dvb-usb/cinergyT2-fe.c
index 0315db8..8a57ed8 100644
--- a/drivers/media/dvb/dvb-usb/cinergyT2-fe.c
+++ b/drivers/media/dvb/dvb-usb/cinergyT2-fe.c
@@ -323,7 +323,6 @@ static struct dvb_frontend_ops cinergyt2_fe_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= DRIVER_NAME,
-		.type			= FE_OFDM,
 		.frequency_min		= 174000000,
 		.frequency_max		= 862000000,
 		.frequency_stepsize	= 166667,
diff --git a/drivers/media/dvb/dvb-usb/dtt200u-fe.c b/drivers/media/dvb/dvb-usb/dtt200u-fe.c
index c94da3c..3d81daa 100644
--- a/drivers/media/dvb/dvb-usb/dtt200u-fe.c
+++ b/drivers/media/dvb/dvb-usb/dtt200u-fe.c
@@ -180,7 +180,6 @@ static struct dvb_frontend_ops dtt200u_fe_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "WideView USB DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 44250000,
 		.frequency_max		= 867250000,
 		.frequency_stepsize	= 250000,
diff --git a/drivers/media/dvb/dvb-usb/friio-fe.c b/drivers/media/dvb/dvb-usb/friio-fe.c
index 0660a87..90a70c6 100644
--- a/drivers/media/dvb/dvb-usb/friio-fe.c
+++ b/drivers/media/dvb/dvb-usb/friio-fe.c
@@ -442,7 +442,6 @@ 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,
diff --git a/drivers/media/dvb/dvb-usb/gp8psk-fe.c b/drivers/media/dvb/dvb-usb/gp8psk-fe.c
index 79db9d6..67957dd 100644
--- a/drivers/media/dvb/dvb-usb/gp8psk-fe.c
+++ b/drivers/media/dvb/dvb-usb/gp8psk-fe.c
@@ -329,7 +329,6 @@ static struct dvb_frontend_ops gp8psk_fe_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "Genpix DVB-S",
-		.type			= FE_QPSK,
 		.frequency_min		= 800000,
 		.frequency_max		= 2250000,
 		.frequency_stepsize	= 100,
diff --git a/drivers/media/dvb/dvb-usb/mxl111sf-demod.c b/drivers/media/dvb/dvb-usb/mxl111sf-demod.c
index 694e207..d83df4b 100644
--- a/drivers/media/dvb/dvb-usb/mxl111sf-demod.c
+++ b/drivers/media/dvb/dvb-usb/mxl111sf-demod.c
@@ -553,7 +553,6 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name               = "MaxLinear MxL111SF DVB-T demodulator",
-		.type               = FE_OFDM,
 		.frequency_min      = 177000000,
 		.frequency_max      = 858000000,
 		.frequency_stepsize = 166666,
diff --git a/drivers/media/dvb/dvb-usb/vp702x-fe.c b/drivers/media/dvb/dvb-usb/vp702x-fe.c
index 8d8c6ad..5eab468 100644
--- a/drivers/media/dvb/dvb-usb/vp702x-fe.c
+++ b/drivers/media/dvb/dvb-usb/vp702x-fe.c
@@ -346,7 +346,6 @@ static struct dvb_frontend_ops vp702x_fe_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name           = "Twinhan DST-like frontend (VP7021/VP7020) DVB-S",
-		.type           = FE_QPSK,
 		.frequency_min       = 950000,
 		.frequency_max       = 2150000,
 		.frequency_stepsize  = 1000,   /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/dvb-usb/vp7045-fe.c b/drivers/media/dvb/dvb-usb/vp7045-fe.c
index ecbd623..b8825b1 100644
--- a/drivers/media/dvb/dvb-usb/vp7045-fe.c
+++ b/drivers/media/dvb/dvb-usb/vp7045-fe.c
@@ -161,7 +161,6 @@ static struct dvb_frontend_ops vp7045_fe_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Twinhan VP7045/46 USB DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 44250000,
 		.frequency_max		= 867250000,
 		.frequency_stepsize	= 1000,
diff --git a/drivers/media/dvb/frontends/af9013.c b/drivers/media/dvb/frontends/af9013.c
index e6ba3e0..d4227c6 100644
--- a/drivers/media/dvb/frontends/af9013.c
+++ b/drivers/media/dvb/frontends/af9013.c
@@ -1483,7 +1483,6 @@ static struct dvb_frontend_ops af9013_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "Afatech AF9013",
-		.type = FE_OFDM,
 		.frequency_min = 174000000,
 		.frequency_max = 862000000,
 		.frequency_stepsize = 250000,
diff --git a/drivers/media/dvb/frontends/atbm8830.c b/drivers/media/dvb/frontends/atbm8830.c
index ff86074..a2261ea 100644
--- a/drivers/media/dvb/frontends/atbm8830.c
+++ b/drivers/media/dvb/frontends/atbm8830.c
@@ -431,7 +431,6 @@ static struct dvb_frontend_ops atbm8830_ops = {
 	.delsys = { SYS_DMBTH },
 	.info = {
 		.name = "AltoBeam ATBM8830/8831 DMB-TH",
-		.type = FE_OFDM,
 		.frequency_min = 474000000,
 		.frequency_max = 858000000,
 		.frequency_stepsize = 10000,
diff --git a/drivers/media/dvb/frontends/au8522_dig.c b/drivers/media/dvb/frontends/au8522_dig.c
index 762cd5e..c688b95 100644
--- a/drivers/media/dvb/frontends/au8522_dig.c
+++ b/drivers/media/dvb/frontends/au8522_dig.c
@@ -1013,7 +1013,6 @@ static struct dvb_frontend_ops au8522_ops = {
 	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name			= "Auvitek AU8522 QAM/8VSB Frontend",
-		.type			= FE_ATSC,
 		.frequency_min		= 54000000,
 		.frequency_max		= 858000000,
 		.frequency_stepsize	= 62500,
diff --git a/drivers/media/dvb/frontends/bcm3510.c b/drivers/media/dvb/frontends/bcm3510.c
index a53f83a..033cd7a 100644
--- a/drivers/media/dvb/frontends/bcm3510.c
+++ b/drivers/media/dvb/frontends/bcm3510.c
@@ -825,7 +825,6 @@ static struct dvb_frontend_ops bcm3510_ops = {
 	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name = "Broadcom BCM3510 VSB/QAM frontend",
-		.type = FE_ATSC,
 		.frequency_min =  54000000,
 		.frequency_max = 803000000,
 		/* stepsize is just a guess */
diff --git a/drivers/media/dvb/frontends/cx22700.c b/drivers/media/dvb/frontends/cx22700.c
index a5b1521..f2a90f9 100644
--- a/drivers/media/dvb/frontends/cx22700.c
+++ b/drivers/media/dvb/frontends/cx22700.c
@@ -408,7 +408,6 @@ static struct dvb_frontend_ops cx22700_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Conexant CX22700 DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 470000000,
 		.frequency_max		= 860000000,
 		.frequency_stepsize	= 166667,
diff --git a/drivers/media/dvb/frontends/cx22702.c b/drivers/media/dvb/frontends/cx22702.c
index a0dcbd6..faba824 100644
--- a/drivers/media/dvb/frontends/cx22702.c
+++ b/drivers/media/dvb/frontends/cx22702.c
@@ -606,7 +606,6 @@ static const struct dvb_frontend_ops cx22702_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Conexant CX22702 DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 177000000,
 		.frequency_max		= 858000000,
 		.frequency_stepsize	= 166666,
diff --git a/drivers/media/dvb/frontends/cx24110.c b/drivers/media/dvb/frontends/cx24110.c
index 2f07c49..5101f10 100644
--- a/drivers/media/dvb/frontends/cx24110.c
+++ b/drivers/media/dvb/frontends/cx24110.c
@@ -627,7 +627,6 @@ static struct dvb_frontend_ops cx24110_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name = "Conexant CX24110 DVB-S",
-		.type = FE_QPSK,
 		.frequency_min = 950000,
 		.frequency_max = 2150000,
 		.frequency_stepsize = 1011,  /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/frontends/cx24116.c b/drivers/media/dvb/frontends/cx24116.c
index e29de1c..b488791 100644
--- a/drivers/media/dvb/frontends/cx24116.c
+++ b/drivers/media/dvb/frontends/cx24116.c
@@ -1469,7 +1469,6 @@ static struct dvb_frontend_ops cx24116_ops = {
 	.delsys = { SYS_DVBS, SYS_DVBS2 },
 	.info = {
 		.name = "Conexant CX24116/CX24118",
-		.type = FE_QPSK,
 		.frequency_min = 950000,
 		.frequency_max = 2150000,
 		.frequency_stepsize = 1011, /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c
index ad5d1a4..7e28b4e 100644
--- a/drivers/media/dvb/frontends/cx24123.c
+++ b/drivers/media/dvb/frontends/cx24123.c
@@ -1128,7 +1128,6 @@ static struct dvb_frontend_ops cx24123_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name = "Conexant CX24123/CX24109",
-		.type = FE_QPSK,
 		.frequency_min = 950000,
 		.frequency_max = 2150000,
 		.frequency_stepsize = 1011, /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/frontends/cxd2820r_core.c b/drivers/media/dvb/frontends/cxd2820r_core.c
index 07c1a95..93e1b12 100644
--- a/drivers/media/dvb/frontends/cxd2820r_core.c
+++ b/drivers/media/dvb/frontends/cxd2820r_core.c
@@ -554,11 +554,9 @@ static int cxd2820r_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
 
 static const struct dvb_frontend_ops cxd2820r_ops = {
 	.delsys = { SYS_DVBT, SYS_DVBT2, SYS_DVBC_ANNEX_A },
-
 	/* default: DVB-T/T2 */
 	.info = {
 		.name = "Sony CXD2820R (DVB-T/T2)",
-		.type = FE_OFDM,
 
 		.caps =	FE_CAN_FEC_1_2			|
 			FE_CAN_FEC_2_3			|
diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c
index a1c5bdb..af91e0c 100644
--- a/drivers/media/dvb/frontends/dib3000mb.c
+++ b/drivers/media/dvb/frontends/dib3000mb.c
@@ -793,7 +793,6 @@ static struct dvb_frontend_ops dib3000mb_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "DiBcom 3000M-B DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 44250000,
 		.frequency_max		= 867250000,
 		.frequency_stepsize	= 62500,
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c
index e500b89..ffad181 100644
--- a/drivers/media/dvb/frontends/dib3000mc.c
+++ b/drivers/media/dvb/frontends/dib3000mc.c
@@ -906,7 +906,6 @@ static struct dvb_frontend_ops dib3000mc_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "DiBcom 3000MC/P",
-		.type = FE_OFDM,
 		.frequency_min      = 44250000,
 		.frequency_max      = 867250000,
 		.frequency_stepsize = 62500,
diff --git a/drivers/media/dvb/frontends/dib7000m.c b/drivers/media/dvb/frontends/dib7000m.c
index 2a2d646..148bf79 100644
--- a/drivers/media/dvb/frontends/dib7000m.c
+++ b/drivers/media/dvb/frontends/dib7000m.c
@@ -1439,7 +1439,6 @@ static struct dvb_frontend_ops dib7000m_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "DiBcom 7000MA/MB/PA/PB/MC",
-		.type = FE_OFDM,
 		.frequency_min      = 44250000,
 		.frequency_max      = 867250000,
 		.frequency_stepsize = 62500,
diff --git a/drivers/media/dvb/frontends/dib7000p.c b/drivers/media/dvb/frontends/dib7000p.c
index 361bdb1..5ceadc2 100644
--- a/drivers/media/dvb/frontends/dib7000p.c
+++ b/drivers/media/dvb/frontends/dib7000p.c
@@ -2430,7 +2430,6 @@ static struct dvb_frontend_ops dib7000p_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		 .name = "DiBcom 7000PC",
-		 .type = FE_OFDM,
 		 .frequency_min = 44250000,
 		 .frequency_max = 867250000,
 		 .frequency_stepsize = 62500,
diff --git a/drivers/media/dvb/frontends/dib8000.c b/drivers/media/dvb/frontends/dib8000.c
index fe07d74..9ca34f4 100644
--- a/drivers/media/dvb/frontends/dib8000.c
+++ b/drivers/media/dvb/frontends/dib8000.c
@@ -3464,7 +3464,6 @@ static const struct dvb_frontend_ops dib8000_ops = {
 	.delsys = { SYS_ISDBT },
 	.info = {
 		 .name = "DiBcom 8000 ISDB-T",
-		 .type = FE_OFDM,
 		 .frequency_min = 44250000,
 		 .frequency_max = 867250000,
 		 .frequency_stepsize = 62500,
diff --git a/drivers/media/dvb/frontends/dib9000.c b/drivers/media/dvb/frontends/dib9000.c
index 2312b4d..863ef3c 100644
--- a/drivers/media/dvb/frontends/dib9000.c
+++ b/drivers/media/dvb/frontends/dib9000.c
@@ -2500,7 +2500,6 @@ static struct dvb_frontend_ops dib9000_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		 .name = "DiBcom 9000",
-		 .type = FE_OFDM,
 		 .frequency_min = 44250000,
 		 .frequency_max = 867250000,
 		 .frequency_stepsize = 62500,
diff --git a/drivers/media/dvb/frontends/drxd_hard.c b/drivers/media/dvb/frontends/drxd_hard.c
index 2520620..7bf39cd 100644
--- a/drivers/media/dvb/frontends/drxd_hard.c
+++ b/drivers/media/dvb/frontends/drxd_hard.c
@@ -2924,7 +2924,6 @@ static struct dvb_frontend_ops drxd_ops = {
 	.delsys = { SYS_DVBT},
 	.info = {
 		 .name = "Micronas DRXD DVB-T",
-		 .type = FE_OFDM,
 		 .frequency_min = 47125000,
 		 .frequency_max = 855250000,
 		 .frequency_stepsize = 166667,
diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c
index 36e1c82..67a1e39 100644
--- a/drivers/media/dvb/frontends/drxk_hard.c
+++ b/drivers/media/dvb/frontends/drxk_hard.c
@@ -6355,7 +6355,6 @@ 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,
 		 .frequency_stepsize = 62500,
 		 .frequency_min = 47000000,
 		 .frequency_max = 862000000,
@@ -6382,7 +6381,6 @@ static struct dvb_frontend_ops drxk_t_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		 .name = "DRXK DVB-T",
-		 .type = FE_OFDM,
 		 .frequency_min = 47125000,
 		 .frequency_max = 865000000,
 		 .frequency_stepsize = 166667,
diff --git a/drivers/media/dvb/frontends/ds3000.c b/drivers/media/dvb/frontends/ds3000.c
index c6a43c4..9387770 100644
--- a/drivers/media/dvb/frontends/ds3000.c
+++ b/drivers/media/dvb/frontends/ds3000.c
@@ -1267,7 +1267,6 @@ static struct dvb_frontend_ops ds3000_ops = {
 	.delsys = { SYS_DVBS, SYS_DVBS2},
 	.info = {
 		.name = "Montage Technology DS3000/TS2020",
-		.type = FE_QPSK,
 		.frequency_min = 950000,
 		.frequency_max = 2150000,
 		.frequency_stepsize = 1011, /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/frontends/dvb_dummy_fe.c b/drivers/media/dvb/frontends/dvb_dummy_fe.c
index ac4c8d2..dcfc902 100644
--- a/drivers/media/dvb/frontends/dvb_dummy_fe.c
+++ b/drivers/media/dvb/frontends/dvb_dummy_fe.c
@@ -177,7 +177,6 @@ static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Dummy DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 0,
 		.frequency_max		= 863250000,
 		.frequency_stepsize	= 62500,
@@ -209,7 +208,6 @@ static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
 	.delsys = { SYS_DVBC_ANNEX_A },
 	.info = {
 		.name			= "Dummy DVB-C",
-		.type			= FE_QAM,
 		.frequency_stepsize	= 62500,
 		.frequency_min		= 51000000,
 		.frequency_max		= 858000000,
@@ -239,7 +237,6 @@ static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "Dummy DVB-S",
-		.type			= FE_QPSK,
 		.frequency_min		= 950000,
 		.frequency_max		= 2150000,
 		.frequency_stepsize	= 250,           /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/frontends/ec100.c b/drivers/media/dvb/frontends/ec100.c
index 39e0811..c56fddb 100644
--- a/drivers/media/dvb/frontends/ec100.c
+++ b/drivers/media/dvb/frontends/ec100.c
@@ -309,7 +309,6 @@ static struct dvb_frontend_ops ec100_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "E3C EC100 DVB-T",
-		.type = FE_OFDM,
 		.caps =
 			FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
 			FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
diff --git a/drivers/media/dvb/frontends/it913x-fe.c b/drivers/media/dvb/frontends/it913x-fe.c
index 754d0f5..29cb47e 100644
--- a/drivers/media/dvb/frontends/it913x-fe.c
+++ b/drivers/media/dvb/frontends/it913x-fe.c
@@ -930,7 +930,6 @@ static struct dvb_frontend_ops it913x_fe_ofdm_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "it913x-fe DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 51000000,
 		.frequency_max		= 1680000000,
 		.frequency_stepsize	= 62500,
diff --git a/drivers/media/dvb/frontends/l64781.c b/drivers/media/dvb/frontends/l64781.c
index dc3e42c..36fcf55 100644
--- a/drivers/media/dvb/frontends/l64781.c
+++ b/drivers/media/dvb/frontends/l64781.c
@@ -575,7 +575,6 @@ static struct dvb_frontend_ops l64781_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "LSI L64781 DVB-T",
-		.type = FE_OFDM,
 	/*	.frequency_min = ???,*/
 	/*	.frequency_max = ???,*/
 		.frequency_stepsize = 166666,
diff --git a/drivers/media/dvb/frontends/lgdt3305.c b/drivers/media/dvb/frontends/lgdt3305.c
index 0b289b2..1d2c473 100644
--- a/drivers/media/dvb/frontends/lgdt3305.c
+++ b/drivers/media/dvb/frontends/lgdt3305.c
@@ -1166,9 +1166,9 @@ fail:
 EXPORT_SYMBOL(lgdt3305_attach);
 
 static struct dvb_frontend_ops lgdt3304_ops = {
+	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name = "LG Electronics LGDT3304 VSB/QAM Frontend",
-		.type               = FE_ATSC,
 		.frequency_min      = 54000000,
 		.frequency_max      = 858000000,
 		.frequency_stepsize = 62500,
@@ -1191,7 +1191,6 @@ 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,
 		.frequency_min      = 54000000,
 		.frequency_max      = 858000000,
 		.frequency_stepsize = 62500,
diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c
index 0e6f41b..c990d35 100644
--- a/drivers/media/dvb/frontends/lgdt330x.c
+++ b/drivers/media/dvb/frontends/lgdt330x.c
@@ -774,7 +774,6 @@ 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,
 		.frequency_min= 54000000,
 		.frequency_max= 858000000,
 		.frequency_stepsize= 62500,
@@ -798,7 +797,6 @@ 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,
 		.frequency_min= 54000000,
 		.frequency_max= 858000000,
 		.frequency_stepsize= 62500,
diff --git a/drivers/media/dvb/frontends/lgs8gl5.c b/drivers/media/dvb/frontends/lgs8gl5.c
index 8f2f43b..2cec804 100644
--- a/drivers/media/dvb/frontends/lgs8gl5.c
+++ b/drivers/media/dvb/frontends/lgs8gl5.c
@@ -415,7 +415,6 @@ static struct dvb_frontend_ops lgs8gl5_ops = {
 	.delsys = { SYS_DMBTH },
 	.info = {
 		.name			= "Legend Silicon LGS-8GL5 DMB-TH",
-		.type			= FE_OFDM,
 		.frequency_min		= 474000000,
 		.frequency_max		= 858000000,
 		.frequency_stepsize	= 10000,
diff --git a/drivers/media/dvb/frontends/lgs8gxx.c b/drivers/media/dvb/frontends/lgs8gxx.c
index a47add2..4de1d35 100644
--- a/drivers/media/dvb/frontends/lgs8gxx.c
+++ b/drivers/media/dvb/frontends/lgs8gxx.c
@@ -997,7 +997,6 @@ static struct dvb_frontend_ops lgs8gxx_ops = {
 	.delsys = { SYS_DMBTH },
 	.info = {
 		.name = "Legend Silicon LGS8913/LGS8GXX DMB-TH",
-		.type = FE_OFDM,
 		.frequency_min = 474000000,
 		.frequency_max = 858000000,
 		.frequency_stepsize = 10000,
diff --git a/drivers/media/dvb/frontends/mb86a16.c b/drivers/media/dvb/frontends/mb86a16.c
index 45844f4..9ae40ab 100644
--- a/drivers/media/dvb/frontends/mb86a16.c
+++ b/drivers/media/dvb/frontends/mb86a16.c
@@ -1817,7 +1817,6 @@ static struct dvb_frontend_ops mb86a16_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "Fujitsu MB86A16 DVB-S",
-		.type			= FE_QPSK,
 		.frequency_min		= 950000,
 		.frequency_max		= 2150000,
 		.frequency_stepsize	= 3000,
diff --git a/drivers/media/dvb/frontends/mb86a20s.c b/drivers/media/dvb/frontends/mb86a20s.c
index 4267e51..82d3301 100644
--- a/drivers/media/dvb/frontends/mb86a20s.c
+++ b/drivers/media/dvb/frontends/mb86a20s.c
@@ -617,7 +617,6 @@ static struct dvb_frontend_ops mb86a20s_ops = {
 	/* Use dib8000 values per default */
 	.info = {
 		.name = "Fujitsu mb86A20s",
-		.type = FE_OFDM,
 		.caps = FE_CAN_INVERSION_AUTO | FE_CAN_RECOVER |
 			FE_CAN_FEC_1_2  | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
 			FE_CAN_FEC_5_6  | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
diff --git a/drivers/media/dvb/frontends/mt312.c b/drivers/media/dvb/frontends/mt312.c
index 90aac0d..e20bf13 100644
--- a/drivers/media/dvb/frontends/mt312.c
+++ b/drivers/media/dvb/frontends/mt312.c
@@ -741,7 +741,6 @@ static struct dvb_frontend_ops mt312_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name = "Zarlink ???? DVB-S",
-		.type = FE_QPSK,
 		.frequency_min = 950000,
 		.frequency_max = 2150000,
 		/* FIXME: adjust freq to real used xtal */
diff --git a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c
index 0321eec..2c3b50e 100644
--- a/drivers/media/dvb/frontends/mt352.c
+++ b/drivers/media/dvb/frontends/mt352.c
@@ -570,7 +570,6 @@ static struct dvb_frontend_ops mt352_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Zarlink MT352 DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 174000000,
 		.frequency_max		= 862000000,
 		.frequency_stepsize	= 166667,
diff --git a/drivers/media/dvb/frontends/nxt200x.c b/drivers/media/dvb/frontends/nxt200x.c
index b541614..49ca78d 100644
--- a/drivers/media/dvb/frontends/nxt200x.c
+++ b/drivers/media/dvb/frontends/nxt200x.c
@@ -1206,7 +1206,6 @@ static struct dvb_frontend_ops nxt200x_ops = {
 	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name = "Nextwave NXT200X VSB/QAM frontend",
-		.type = FE_ATSC,
 		.frequency_min =  54000000,
 		.frequency_max = 860000000,
 		.frequency_stepsize = 166666,	/* stepsize is just a guess */
diff --git a/drivers/media/dvb/frontends/nxt6000.c b/drivers/media/dvb/frontends/nxt6000.c
index 89021bd..90ae6c7 100644
--- a/drivers/media/dvb/frontends/nxt6000.c
+++ b/drivers/media/dvb/frontends/nxt6000.c
@@ -576,7 +576,6 @@ static struct dvb_frontend_ops nxt6000_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "NxtWave NXT6000 DVB-T",
-		.type = FE_OFDM,
 		.frequency_min = 0,
 		.frequency_max = 863250000,
 		.frequency_stepsize = 62500,
diff --git a/drivers/media/dvb/frontends/or51132.c b/drivers/media/dvb/frontends/or51132.c
index 82ee2959..5ef9218 100644
--- a/drivers/media/dvb/frontends/or51132.c
+++ b/drivers/media/dvb/frontends/or51132.c
@@ -589,7 +589,6 @@ static struct dvb_frontend_ops or51132_ops = {
 	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name			= "Oren OR51132 VSB/QAM Frontend",
-		.type			= FE_ATSC,
 		.frequency_min		= 44000000,
 		.frequency_max		= 958000000,
 		.frequency_stepsize	= 166666,
diff --git a/drivers/media/dvb/frontends/or51211.c b/drivers/media/dvb/frontends/or51211.c
index d2b52e5..c625b57 100644
--- a/drivers/media/dvb/frontends/or51211.c
+++ b/drivers/media/dvb/frontends/or51211.c
@@ -547,7 +547,6 @@ static struct dvb_frontend_ops or51211_ops = {
 	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name               = "Oren OR51211 VSB Frontend",
-		.type               = FE_ATSC,
 		.frequency_min      = 44000000,
 		.frequency_max      = 958000000,
 		.frequency_stepsize = 166666,
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c
index 21baea8..f71b062 100644
--- a/drivers/media/dvb/frontends/s5h1409.c
+++ b/drivers/media/dvb/frontends/s5h1409.c
@@ -999,7 +999,6 @@ static struct dvb_frontend_ops s5h1409_ops = {
 	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name			= "Samsung S5H1409 QAM/8VSB Frontend",
-		.type			= FE_ATSC,
 		.frequency_min		= 54000000,
 		.frequency_max		= 858000000,
 		.frequency_stepsize	= 62500,
diff --git a/drivers/media/dvb/frontends/s5h1411.c b/drivers/media/dvb/frontends/s5h1411.c
index b8c7feb..6cc4b7a 100644
--- a/drivers/media/dvb/frontends/s5h1411.c
+++ b/drivers/media/dvb/frontends/s5h1411.c
@@ -918,7 +918,6 @@ static struct dvb_frontend_ops s5h1411_ops = {
 	.delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
 	.info = {
 		.name			= "Samsung S5H1411 QAM/8VSB Frontend",
-		.type			= FE_ATSC,
 		.frequency_min		= 54000000,
 		.frequency_max		= 858000000,
 		.frequency_stepsize	= 62500,
diff --git a/drivers/media/dvb/frontends/s5h1420.c b/drivers/media/dvb/frontends/s5h1420.c
index d83d20a..2322257 100644
--- a/drivers/media/dvb/frontends/s5h1420.c
+++ b/drivers/media/dvb/frontends/s5h1420.c
@@ -940,7 +940,6 @@ static struct dvb_frontend_ops s5h1420_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name     = "Samsung S5H1420/PnpNetwork PN1010 DVB-S",
-		.type     = FE_QPSK,
 		.frequency_min    = 950000,
 		.frequency_max    = 2150000,
 		.frequency_stepsize = 125,     /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/frontends/s5h1432.c b/drivers/media/dvb/frontends/s5h1432.c
index baa3aae..8352ce1 100644
--- a/drivers/media/dvb/frontends/s5h1432.c
+++ b/drivers/media/dvb/frontends/s5h1432.c
@@ -378,7 +378,6 @@ static struct dvb_frontend_ops s5h1432_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		 .name = "Samsung s5h1432 DVB-T Frontend",
-		 .type = FE_OFDM,
 		 .frequency_min = 177000000,
 		 .frequency_max = 858000000,
 		 .frequency_stepsize = 166666,
diff --git a/drivers/media/dvb/frontends/s921.c b/drivers/media/dvb/frontends/s921.c
index 6012e10..cd2288c 100644
--- a/drivers/media/dvb/frontends/s921.c
+++ b/drivers/media/dvb/frontends/s921.c
@@ -515,7 +515,6 @@ static struct dvb_frontend_ops s921_ops = {
 	/* Use dib8000 values per default */
 	.info = {
 		.name = "Sharp S921",
-		.type = FE_OFDM,
 		.frequency_min = 470000000,
 		/*
 		 * Max should be 770MHz instead, according with Sharp docs,
diff --git a/drivers/media/dvb/frontends/si21xx.c b/drivers/media/dvb/frontends/si21xx.c
index e223f35..a68a648 100644
--- a/drivers/media/dvb/frontends/si21xx.c
+++ b/drivers/media/dvb/frontends/si21xx.c
@@ -867,7 +867,6 @@ static struct dvb_frontend_ops si21xx_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "SL SI21XX DVB-S",
-		.type			= FE_QPSK,
 		.frequency_min		= 950000,
 		.frequency_max		= 2150000,
 		.frequency_stepsize	= 125,	 /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/frontends/sp8870.c b/drivers/media/dvb/frontends/sp8870.c
index 58e4792..e37274c 100644
--- a/drivers/media/dvb/frontends/sp8870.c
+++ b/drivers/media/dvb/frontends/sp8870.c
@@ -584,7 +584,6 @@ static struct dvb_frontend_ops sp8870_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Spase SP8870 DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 470000000,
 		.frequency_max		= 860000000,
 		.frequency_stepsize	= 166666,
diff --git a/drivers/media/dvb/frontends/sp887x.c b/drivers/media/dvb/frontends/sp887x.c
index 6fd8513..f4096cc 100644
--- a/drivers/media/dvb/frontends/sp887x.c
+++ b/drivers/media/dvb/frontends/sp887x.c
@@ -595,7 +595,6 @@ static struct dvb_frontend_ops sp887x_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "Spase SP887x DVB-T",
-		.type = FE_OFDM,
 		.frequency_min =  50500000,
 		.frequency_max = 858000000,
 		.frequency_stepsize = 166666,
diff --git a/drivers/media/dvb/frontends/stb0899_drv.c b/drivers/media/dvb/frontends/stb0899_drv.c
index c9e1785..38565be 100644
--- a/drivers/media/dvb/frontends/stb0899_drv.c
+++ b/drivers/media/dvb/frontends/stb0899_drv.c
@@ -1586,26 +1586,10 @@ static enum dvbfe_algo stb0899_frontend_algo(struct dvb_frontend *fe)
 	return DVBFE_ALGO_CUSTOM;
 }
 
-static int stb0899_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 stb0899_ops = {
-
+	.delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS },
 	.info = {
 		.name 			= "STB0899 Multistandard",
-		.type 			= FE_QPSK,
 		.frequency_min		= 950000,
 		.frequency_max 		= 2150000,
 		.frequency_stepsize	= 0,
@@ -1642,8 +1626,6 @@ static struct dvb_frontend_ops stb0899_ops = {
 	.diseqc_send_master_cmd		= stb0899_send_diseqc_msg,
 	.diseqc_recv_slave_reply	= stb0899_recv_slave_reply,
 	.diseqc_send_burst		= stb0899_send_diseqc_burst,
-
-	.get_property			= stb0899_get_property,
 };
 
 struct dvb_frontend *stb0899_attach(struct stb0899_config *config, struct i2c_adapter *i2c)
diff --git a/drivers/media/dvb/frontends/stv0288.c b/drivers/media/dvb/frontends/stv0288.c
index b0ddebc..fb5548a 100644
--- a/drivers/media/dvb/frontends/stv0288.c
+++ b/drivers/media/dvb/frontends/stv0288.c
@@ -452,12 +452,6 @@ static int stv0288_set_property(struct dvb_frontend *fe, struct dtv_property *p)
 	return 0;
 }
 
-static int stv0288_get_property(struct dvb_frontend *fe, struct dtv_property *p)
-{
-	dprintk("%s(..)\n", __func__);
-	return 0;
-}
-
 static int stv0288_set_frontend(struct dvb_frontend *fe)
 {
 	struct stv0288_state *state = fe->demodulator_priv;
@@ -545,7 +539,6 @@ static struct dvb_frontend_ops stv0288_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "ST STV0288 DVB-S",
-		.type			= FE_QPSK,
 		.frequency_min		= 950000,
 		.frequency_max		= 2150000,
 		.frequency_stepsize	= 1000,	 /* kHz for QPSK frontends */
@@ -575,7 +568,6 @@ static struct dvb_frontend_ops stv0288_ops = {
 	.set_voltage = stv0288_set_voltage,
 
 	.set_property = stv0288_set_property,
-	.get_property = stv0288_get_property,
 	.set_frontend = stv0288_set_frontend,
 };
 
diff --git a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c
index 8e5bd69..85c157a 100644
--- a/drivers/media/dvb/frontends/stv0297.c
+++ b/drivers/media/dvb/frontends/stv0297.c
@@ -693,7 +693,6 @@ static struct dvb_frontend_ops stv0297_ops = {
 	.delsys = { SYS_DVBC_ANNEX_A },
 	.info = {
 		 .name = "ST STV0297 DVB-C",
-		 .type = FE_QAM,
 		 .frequency_min = 47000000,
 		 .frequency_max = 862000000,
 		 .frequency_stepsize = 62500,
diff --git a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c
index a7abc82..057b5f8 100644
--- a/drivers/media/dvb/frontends/stv0299.c
+++ b/drivers/media/dvb/frontends/stv0299.c
@@ -711,7 +711,6 @@ static struct dvb_frontend_ops stv0299_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "ST STV0299 DVB-S",
-		.type			= FE_QPSK,
 		.frequency_min		= 950000,
 		.frequency_max		= 2150000,
 		.frequency_stepsize	= 125,	 /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/frontends/stv0367.c b/drivers/media/dvb/frontends/stv0367.c
index 6786b9e..fdd20c7 100644
--- a/drivers/media/dvb/frontends/stv0367.c
+++ b/drivers/media/dvb/frontends/stv0367.c
@@ -2265,7 +2265,6 @@ static struct dvb_frontend_ops stv0367ter_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "ST STV0367 DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 47000000,
 		.frequency_max		= 862000000,
 		.frequency_stepsize	= 15625,
@@ -3384,7 +3383,6 @@ static struct dvb_frontend_ops stv0367cab_ops = {
 	.delsys = { SYS_DVBC_ANNEX_A },
 	.info = {
 		.name = "ST STV0367 DVB-C",
-		.type = FE_QAM,
 		.frequency_min = 47000000,
 		.frequency_max = 862000000,
 		.frequency_stepsize = 62500,
diff --git a/drivers/media/dvb/frontends/stv0900_core.c b/drivers/media/dvb/frontends/stv0900_core.c
index 33325ae..7f1bada 100644
--- a/drivers/media/dvb/frontends/stv0900_core.c
+++ b/drivers/media/dvb/frontends/stv0900_core.c
@@ -1860,7 +1860,6 @@ static struct dvb_frontend_ops stv0900_ops = {
 	.delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS },
 	.info = {
 		.name			= "STV0900 frontend",
-		.type			= FE_QPSK,
 		.frequency_min		= 950000,
 		.frequency_max		= 2150000,
 		.frequency_stepsize	= 125,
diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c
index dd8ded5..4aef187 100644
--- a/drivers/media/dvb/frontends/stv090x.c
+++ b/drivers/media/dvb/frontends/stv090x.c
@@ -4715,7 +4715,6 @@ static struct dvb_frontend_ops stv090x_ops = {
 	.delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS },
 	.info = {
 		.name			= "STV090x Multistandard",
-		.type			= FE_QPSK,
 		.frequency_min		= 950000,
 		.frequency_max 		= 2150000,
 		.frequency_stepsize	= 0,
diff --git a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c
index a330831..1bff7f4 100644
--- a/drivers/media/dvb/frontends/tda10021.c
+++ b/drivers/media/dvb/frontends/tda10021.c
@@ -487,7 +487,6 @@ static struct dvb_frontend_ops tda10021_ops = {
 	.delsys = { SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_C },
 	.info = {
 		.name = "Philips TDA10021 DVB-C",
-		.type = FE_QAM,
 		.frequency_stepsize = 62500,
 		.frequency_min = 47000000,
 		.frequency_max = 862000000,
diff --git a/drivers/media/dvb/frontends/tda10023.c b/drivers/media/dvb/frontends/tda10023.c
index d0b8e86..ca1e0d5 100644
--- a/drivers/media/dvb/frontends/tda10023.c
+++ b/drivers/media/dvb/frontends/tda10023.c
@@ -576,7 +576,6 @@ 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,
 		.frequency_stepsize = 62500,
 		.frequency_min =  47000000,
 		.frequency_max = 862000000,
diff --git a/drivers/media/dvb/frontends/tda10048.c b/drivers/media/dvb/frontends/tda10048.c
index 57711cb..71fb632 100644
--- a/drivers/media/dvb/frontends/tda10048.c
+++ b/drivers/media/dvb/frontends/tda10048.c
@@ -1160,7 +1160,6 @@ static struct dvb_frontend_ops tda10048_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "NXP TDA10048HN DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 177000000,
 		.frequency_max		= 858000000,
 		.frequency_stepsize	= 166666,
diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c
index bbab4a1..ae6f22a 100644
--- a/drivers/media/dvb/frontends/tda1004x.c
+++ b/drivers/media/dvb/frontends/tda1004x.c
@@ -1235,7 +1235,6 @@ static struct dvb_frontend_ops tda10045_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "Philips TDA10045H DVB-T",
-		.type = FE_OFDM,
 		.frequency_min = 51000000,
 		.frequency_max = 858000000,
 		.frequency_stepsize = 166667,
@@ -1306,7 +1305,6 @@ static struct dvb_frontend_ops tda10046_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name = "Philips TDA10046H DVB-T",
-		.type = FE_OFDM,
 		.frequency_min = 51000000,
 		.frequency_max = 858000000,
 		.frequency_stepsize = 166667,
diff --git a/drivers/media/dvb/frontends/tda10071.c b/drivers/media/dvb/frontends/tda10071.c
index 54e2aa0..a992050 100644
--- a/drivers/media/dvb/frontends/tda10071.c
+++ b/drivers/media/dvb/frontends/tda10071.c
@@ -1218,7 +1218,6 @@ static struct dvb_frontend_ops tda10071_ops = {
 	.delsys = { SYS_DVBT, SYS_DVBT2 },
 	.info = {
 		.name = "NXP TDA10071",
-		.type = FE_QPSK,
 		.frequency_min = 950000,
 		.frequency_max = 2150000,
 		.frequency_tolerance = 5000,
diff --git a/drivers/media/dvb/frontends/tda10086.c b/drivers/media/dvb/frontends/tda10086.c
index e0d2fc1..fcfe2e0 100644
--- a/drivers/media/dvb/frontends/tda10086.c
+++ b/drivers/media/dvb/frontends/tda10086.c
@@ -707,7 +707,6 @@ static struct dvb_frontend_ops tda10086_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name     = "Philips TDA10086 DVB-S",
-		.type     = FE_QPSK,
 		.frequency_min    = 950000,
 		.frequency_max    = 2150000,
 		.frequency_stepsize = 125,     /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/frontends/tda8083.c b/drivers/media/dvb/frontends/tda8083.c
index b613dfc..15912c9 100644
--- a/drivers/media/dvb/frontends/tda8083.c
+++ b/drivers/media/dvb/frontends/tda8083.c
@@ -443,7 +443,6 @@ static struct dvb_frontend_ops tda8083_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "Philips TDA8083 DVB-S",
-		.type			= FE_QPSK,
 		.frequency_min		= 920000,     /* TDA8060 */
 		.frequency_max		= 2200000,    /* TDA8060 */
 		.frequency_stepsize	= 125,   /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c
index e85a823..bb42b56 100644
--- a/drivers/media/dvb/frontends/ves1820.c
+++ b/drivers/media/dvb/frontends/ves1820.c
@@ -410,7 +410,6 @@ static struct dvb_frontend_ops ves1820_ops = {
 	.delsys = { SYS_DVBC_ANNEX_A },
 	.info = {
 		.name = "VLSI VES1820 DVB-C",
-		.type = FE_QAM,
 		.frequency_stepsize = 62500,
 		.frequency_min = 47000000,
 		.frequency_max = 862000000,
diff --git a/drivers/media/dvb/frontends/ves1x93.c b/drivers/media/dvb/frontends/ves1x93.c
index 0ccd851..9c17eac 100644
--- a/drivers/media/dvb/frontends/ves1x93.c
+++ b/drivers/media/dvb/frontends/ves1x93.c
@@ -513,7 +513,6 @@ static struct dvb_frontend_ops ves1x93_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "VLSI VES1x93 DVB-S",
-		.type			= FE_QPSK,
 		.frequency_min		= 950000,
 		.frequency_max		= 2150000,
 		.frequency_stepsize	= 125,		 /* kHz for QPSK frontends */
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c
index 816fa86..ac72378 100644
--- a/drivers/media/dvb/frontends/zl10353.c
+++ b/drivers/media/dvb/frontends/zl10353.c
@@ -641,7 +641,6 @@ static struct dvb_frontend_ops zl10353_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "Zarlink ZL10353 DVB-T",
-		.type			= FE_OFDM,
 		.frequency_min		= 174000000,
 		.frequency_max		= 862000000,
 		.frequency_stepsize	= 166667,
diff --git a/drivers/media/dvb/pt1/va1j5jf8007s.c b/drivers/media/dvb/pt1/va1j5jf8007s.c
index ef74440..d980dfb 100644
--- a/drivers/media/dvb/pt1/va1j5jf8007s.c
+++ b/drivers/media/dvb/pt1/va1j5jf8007s.c
@@ -582,7 +582,6 @@ static struct dvb_frontend_ops va1j5jf8007s_ops = {
 	.delsys = { SYS_ISDBS },
 	.info = {
 		.name = "VA1J5JF8007/VA1J5JF8011 ISDB-S",
-		.type = FE_QPSK,
 		.frequency_min = 950000,
 		.frequency_max = 2150000,
 		.frequency_stepsize = 1000,
diff --git a/drivers/media/dvb/pt1/va1j5jf8007t.c b/drivers/media/dvb/pt1/va1j5jf8007t.c
index 6eeabc8..2db15159 100644
--- a/drivers/media/dvb/pt1/va1j5jf8007t.c
+++ b/drivers/media/dvb/pt1/va1j5jf8007t.c
@@ -431,7 +431,6 @@ static struct dvb_frontend_ops va1j5jf8007t_ops = {
 	.delsys = { SYS_ISDBT },
 	.info = {
 		.name = "VA1J5JF8007/VA1J5JF8011 ISDB-T",
-		.type = FE_OFDM,
 		.frequency_min = 90000000,
 		.frequency_max = 770000000,
 		.frequency_stepsize = 142857,
diff --git a/drivers/media/dvb/siano/smsdvb.c b/drivers/media/dvb/siano/smsdvb.c
index 198cc0e..654685c 100644
--- a/drivers/media/dvb/siano/smsdvb.c
+++ b/drivers/media/dvb/siano/smsdvb.c
@@ -786,7 +786,6 @@ static void smsdvb_release(struct dvb_frontend *fe)
 static struct dvb_frontend_ops smsdvb_fe_ops = {
 	.info = {
 		.name			= "Siano Mobile Digital MDTV Receiver",
-		.type			= FE_OFDM,
 		.frequency_min		= 44250000,
 		.frequency_max		= 867250000,
 		.frequency_stepsize	= 250000,
diff --git a/drivers/media/dvb/ttusb-dec/ttusbdecfe.c b/drivers/media/dvb/ttusb-dec/ttusbdecfe.c
index a498f5a..5c45c9d 100644
--- a/drivers/media/dvb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/dvb/ttusb-dec/ttusbdecfe.c
@@ -246,7 +246,6 @@ static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name			= "TechnoTrend/Hauppauge DEC2000-t Frontend",
-		.type			= FE_OFDM,
 		.frequency_min		= 51000000,
 		.frequency_max		= 858000000,
 		.frequency_stepsize	= 62500,
@@ -270,7 +269,6 @@ static struct dvb_frontend_ops ttusbdecfe_dvbs_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
 		.name			= "TechnoTrend/Hauppauge DEC3000-s Frontend",
-		.type			= FE_QPSK,
 		.frequency_min		= 950000,
 		.frequency_max		= 2150000,
 		.frequency_stepsize	= 125,
diff --git a/drivers/media/video/tlg2300/pd-dvb.c b/drivers/media/video/tlg2300/pd-dvb.c
index d7aac42..30fcb11 100644
--- a/drivers/media/video/tlg2300/pd-dvb.c
+++ b/drivers/media/video/tlg2300/pd-dvb.c
@@ -335,7 +335,6 @@ static struct dvb_frontend_ops poseidon_frontend_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
 		.name		= "Poseidon DVB-T",
-		.type		= FE_OFDM,
 		.frequency_min	= 174000000,
 		.frequency_max  = 862000000,
 		.frequency_stepsize	  = 62500,/* FIXME */
-- 
1.7.8.352.g876a6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type
  2012-01-01 20:11 [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Mauro Carvalho Chehab
                   ` (8 preceding siblings ...)
  2012-01-01 20:11 ` [PATCH 9/9] [media] dvb: Remove ops->info.type from frontends Mauro Carvalho Chehab
@ 2012-01-02  7:31 ` Manu Abraham
  2012-01-02 10:55   ` Mauro Carvalho Chehab
  9 siblings, 1 reply; 19+ messages in thread
From: Manu Abraham @ 2012-01-02  7:31 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On Mon, Jan 2, 2012 at 1:41 AM, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:
> This is likely the last patch series from my series of DVB cleanups.
> I still intend to work on DRX-K frontend merge patch, but this will
> need to wait until my return to my home town. Of course, if you're
> hurry with this, patches are welcome.
>
> This series changes dvb_frontend to use ops->delsys instead of ops->info.type,
> as the source for the frontend support. With this series:
>
> 1) the first delivery system is reported as info.type for DVBv3 apps;
> 2) all subsequent checks are made against the current delivery system
>   (c->delivery_system);
> 3) An attempt to use an un-suported delivery system will either return
>   an error, or enter into the emulation mode, if the frontend is
>   using a newer delivery system.
> 4) Lots of cleanup at the cache sync logic. Now, a pure DVBv5 call
>   shouldn't fill the DVBv3 structs. Still, as events are generated,
>   the event will dynamically generate a DVBv3 compat struct.
>
> The emulation logic is not perfect (but it were not perfect before this
> patch series). The emulation will work worse for devices that have
> support for different "ops->info.type", as there's no way for a DVBv3
> application to work properly with those devices.
>
> TODO:
>
> There are a few things left to do, with regards to DVB frontend cleanup.
> They're more related to the DVBv5 API, so they were out of the scope
> of this series. Maybe some work for this upcoming year!
>
> They are:
>
>        1) Fix the capabilities flags. There are several capabilities
> not reported, like several modulations, etc. There are not enough flags
> for them. It was suggested that the delivery system (DTV_ENUM_DELSYS)
> would be enough, but it doesn't seem so. For example, there are several
> SYS_ATSC devices that only support VSB_8. So, we'll end by needing to
> either extend the current way (but we lack bits) or to implement a DVBv5
> way for that;
>

If an ATSC device supports fewer modulations, things should be
even simpler. Just return INVALID Frontend setup if it is trying to
setup something invalid, that which is not supported. Advertising
the available modulations doesn't help in any sense.
A53 spec talks about devices supporting 2 modes, Terrestrial
mode and High data rate mode. It is unlikely and yet maybe
some devices don't adhere to specifications supporting only
8VSB, but even in those cases, just returning -EINVAL would be
sufficient for 16VSB.

What you suggest, just adds confusion alone to applications as
to what to do with all the exported fields/flags.


>        2) The DVBv3 events call (FE_GET_EVENT) is not ok for
> newer delivery system. We'll likely need to replace it by a DVBv5 way;
>


It should be noted that there is no "DVBv5 way", If you are implying
to replace ioctl calls with a get/set interface, it doesn't make sense
at all.


>        3) The stats API needs to be extended. Delivery systems like
> ISDB can report a per-layer set of statistics. This is currently not
> supported. Also, it is desirable to get the stats together with a
> set of other properties.


The per layer statistics is a myth and can be ignored. Each of the
layers are much higher above and simply RF/demodulation
parameters don't exist/layer; Even if you argue that they do exist,
it would be exactly sufficient to read stats after setting up the
relevant layer for filtering (since you cannot read demodulation
statistics, without setting up proper demodulation parameters).

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type
  2012-01-02  7:31 ` [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Manu Abraham
@ 2012-01-02 10:55   ` Mauro Carvalho Chehab
  2012-01-02 11:40     ` Mauro Carvalho Chehab
  2012-01-02 11:48     ` Manu Abraham
  0 siblings, 2 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-02 10:55 UTC (permalink / raw)
  To: Manu Abraham; +Cc: Linux Media Mailing List

On 02-01-2012 05:31, Manu Abraham wrote:
> On Mon, Jan 2, 2012 at 1:41 AM, Mauro Carvalho Chehab
> <mchehab@redhat.com> wrote:
>> This is likely the last patch series from my series of DVB cleanups.
>> I still intend to work on DRX-K frontend merge patch, but this will
>> need to wait until my return to my home town. Of course, if you're
>> hurry with this, patches are welcome.
>>
>> This series changes dvb_frontend to use ops->delsys instead of ops->info.type,
>> as the source for the frontend support. With this series:
>>
>> 1) the first delivery system is reported as info.type for DVBv3 apps;
>> 2) all subsequent checks are made against the current delivery system
>>   (c->delivery_system);
>> 3) An attempt to use an un-suported delivery system will either return
>>   an error, or enter into the emulation mode, if the frontend is
>>   using a newer delivery system.
>> 4) Lots of cleanup at the cache sync logic. Now, a pure DVBv5 call
>>   shouldn't fill the DVBv3 structs. Still, as events are generated,
>>   the event will dynamically generate a DVBv3 compat struct.
>>
>> The emulation logic is not perfect (but it were not perfect before this
>> patch series). The emulation will work worse for devices that have
>> support for different "ops->info.type", as there's no way for a DVBv3
>> application to work properly with those devices.
>>
>> TODO:
>>
>> There are a few things left to do, with regards to DVB frontend cleanup.
>> They're more related to the DVBv5 API, so they were out of the scope
>> of this series. Maybe some work for this upcoming year!
>>
>> They are:
>>
>>        1) Fix the capabilities flags. There are several capabilities
>> not reported, like several modulations, etc. There are not enough flags
>> for them. It was suggested that the delivery system (DTV_ENUM_DELSYS)
>> would be enough, but it doesn't seem so. For example, there are several
>> SYS_ATSC devices that only support VSB_8. So, we'll end by needing to
>> either extend the current way (but we lack bits) or to implement a DVBv5
>> way for that;
>>
> 
> If an ATSC device supports fewer modulations, things should be
> even simpler. Just return INVALID Frontend setup if it is trying to
> setup something invalid, that which is not supported. Advertising
> the available modulations doesn't help in any sense.
> A53 spec talks about devices supporting 2 modes, Terrestrial
> mode and High data rate mode. It is unlikely and yet maybe
> some devices don't adhere to specifications supporting only
> 8VSB, but even in those cases, just returning -EINVAL would be
> sufficient for 16VSB.
> 
> What you suggest, just adds confusion alone to applications as
> to what to do with all the exported fields/flags.

Returning -EINVAL works from kernel POV, but at least one userpsace
application developer sent me an email those days complaining that
applications need to know what are the supported capabilities, in order
to provide a proper userspace gui.

>>        2) The DVBv3 events call (FE_GET_EVENT) is not ok for
>> newer delivery system. We'll likely need to replace it by a DVBv5 way;
>>
> 
> 
> It should be noted that there is no "DVBv5 way", If you are implying
> to replace ioctl calls with a get/set interface, it doesn't make sense
> at all.

By DVBv5 way, I'm meaning to say that it should be replaced by some way
that allow reporting events not only for the 4 delivery systems supported
by DVBv3 API.

This could be as easy as adding a DTV_GET_EVENT command for FE_GET_PROPERTY.

Alternatively, events could be reported via a poll() ops at the frontend
node.

>>        3) The stats API needs to be extended. Delivery systems like
>> ISDB can report a per-layer set of statistics. This is currently not
>> supported. Also, it is desirable to get the stats together with a
>> set of other properties.
> 
> The per layer statistics is a myth and can be ignored. Each of the
> layers are much higher above and simply RF/demodulation
> parameters don't exist/layer; Even if you argue that they do exist,
> it would be exactly sufficient to read stats after setting up the
> relevant layer for filtering (since you cannot read demodulation
> statistics, without setting up proper demodulation parameters).

Take a look at:
	http://linuxtv.org/downloads/v4l-dvb-apis/FE_GET_SET_PROPERTY.html#isdb-hierq-layers

Each layer has a group of OFDM carriers, each group have its own modulation,
viterbi and red-salomon decoders. And all of them can be decoded 
simultaneously. So, the statistics for each layer will be different.

That's said, I haven't seen any broadcaster using more than one layer yet,
so, there's no pressure for adding such feature yet.

Regards,
Mauro

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type
  2012-01-02 10:55   ` Mauro Carvalho Chehab
@ 2012-01-02 11:40     ` Mauro Carvalho Chehab
  2012-01-02 11:48     ` Manu Abraham
  1 sibling, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-02 11:40 UTC (permalink / raw)
  To: Manu Abraham; +Cc: Linux Media Mailing List

On 02-01-2012 08:55, Mauro Carvalho Chehab wrote:
> On 02-01-2012 05:31, Manu Abraham wrote:
>> On Mon, Jan 2, 2012 at 1:41 AM, Mauro Carvalho Chehab
>> <mchehab@redhat.com> wrote:
>>> This is likely the last patch series from my series of DVB cleanups.
>>> I still intend to work on DRX-K frontend merge patch, but this will
>>> need to wait until my return to my home town. Of course, if you're
>>> hurry with this, patches are welcome.
>>>
>>> This series changes dvb_frontend to use ops->delsys instead of ops->info.type,
>>> as the source for the frontend support. With this series:
>>>
>>> 1) the first delivery system is reported as info.type for DVBv3 apps;
>>> 2) all subsequent checks are made against the current delivery system
>>>   (c->delivery_system);
>>> 3) An attempt to use an un-suported delivery system will either return
>>>   an error, or enter into the emulation mode, if the frontend is
>>>   using a newer delivery system.
>>> 4) Lots of cleanup at the cache sync logic. Now, a pure DVBv5 call
>>>   shouldn't fill the DVBv3 structs. Still, as events are generated,
>>>   the event will dynamically generate a DVBv3 compat struct.
>>>
>>> The emulation logic is not perfect (but it were not perfect before this
>>> patch series). The emulation will work worse for devices that have
>>> support for different "ops->info.type", as there's no way for a DVBv3
>>> application to work properly with those devices.
>>>
>>> TODO:
>>>
>>> There are a few things left to do, with regards to DVB frontend cleanup.
>>> They're more related to the DVBv5 API, so they were out of the scope
>>> of this series. Maybe some work for this upcoming year!
>>>
>>> They are:
>>>
>>>        1) Fix the capabilities flags. There are several capabilities
>>> not reported, like several modulations, etc. There are not enough flags
>>> for them. It was suggested that the delivery system (DTV_ENUM_DELSYS)
>>> would be enough, but it doesn't seem so. For example, there are several
>>> SYS_ATSC devices that only support VSB_8. So, we'll end by needing to
>>> either extend the current way (but we lack bits) or to implement a DVBv5
>>> way for that;
>>>
>>
>> If an ATSC device supports fewer modulations, things should be
>> even simpler. Just return INVALID Frontend setup if it is trying to
>> setup something invalid, that which is not supported. Advertising
>> the available modulations doesn't help in any sense.
>> A53 spec talks about devices supporting 2 modes, Terrestrial
>> mode and High data rate mode. It is unlikely and yet maybe
>> some devices don't adhere to specifications supporting only
>> 8VSB, but even in those cases, just returning -EINVAL would be
>> sufficient for 16VSB.
>>
>> What you suggest, just adds confusion alone to applications as
>> to what to do with all the exported fields/flags.
> 
> Returning -EINVAL works from kernel POV, but at least one userpsace
> application developer sent me an email those days complaining that
> applications need to know what are the supported capabilities, in order
> to provide a proper userspace gui.
> 
>>>        2) The DVBv3 events call (FE_GET_EVENT) is not ok for
>>> newer delivery system. We'll likely need to replace it by a DVBv5 way;
>>>
>>
>>
>> It should be noted that there is no "DVBv5 way", If you are implying
>> to replace ioctl calls with a get/set interface, it doesn't make sense
>> at all.
> 
> By DVBv5 way, I'm meaning to say that it should be replaced by some way
> that allow reporting events not only for the 4 delivery systems supported
> by DVBv3 API.
> 
> This could be as easy as adding a DTV_GET_EVENT command for FE_GET_PROPERTY.
> 
> Alternatively, events could be reported via a poll() ops at the frontend
> node.
> 
>>>        3) The stats API needs to be extended. Delivery systems like
>>> ISDB can report a per-layer set of statistics. This is currently not
>>> supported. Also, it is desirable to get the stats together with a
>>> set of other properties.
>>
>> The per layer statistics is a myth and can be ignored. Each of the
>> layers are much higher above and simply RF/demodulation
>> parameters don't exist/layer; Even if you argue that they do exist,
>> it would be exactly sufficient to read stats after setting up the
>> relevant layer for filtering (since you cannot read demodulation
>> statistics, without setting up proper demodulation parameters).
> 
> Take a look at:
> 	http://linuxtv.org/downloads/v4l-dvb-apis/FE_GET_SET_PROPERTY.html#isdb-hierq-layers
> 
> Each layer has a group of OFDM carriers, each group have its own modulation,
> viterbi and red-salomon decoders. And all of them can be decoded 
> simultaneously. So, the statistics for each layer will be different.
> 
> That's said, I haven't seen any broadcaster using more than one layer yet,
> so, there's no pressure for adding such feature yet.

I spoke too early. I modified my dvbv5-zap tool[1] to show what's beeing
detected by a dibcom 8000 frontend.

[1] http://git.linuxtv.org/mchehab/experimental-v4l-utils.git/shortlog/refs/heads/dvb-utils

Tuning into two different frequencies:

$ ./dvbv5-zap globo\ hd
using demug '/dev/dvb/adapter0/demux0'
reading channels from file '/home/v4l/.tzap/channels.conf'
Device DiBcom 8000 ISDB-T (/dev/dvb/adapter0/frontend0) capabilities:
        CAN_FEC_1_2 CAN_FEC_2_3 CAN_FEC_3_4 CAN_FEC_5_6 CAN_FEC_7_8 CAN_FEC_AUTO CAN_GUARD_INTERVAL_AUTO CAN_HIERARCHY_AUTO CAN_INVERSION_AUTO CAN_QAM_16 CAN_QAM_64 CAN_QAM_AUTO CAN_QPSK CAN_RECOVER CAN_TRANSMISSION_MODE_AUTO 
DVB API Version 5.5, Current v5 delivery system: ISDBT
Supported delivery system: [ISDBT] 
tuning to 515142857 Hz
video pid 0x0111, audio pid 0x0112
status 03 | signal 99bd | snr 00cd | ber 00000000 | unc 000000cd | 
status 1f | signal 994d | snr 00e3 | ber 00000000 | unc 000000e3 | FE_HAS_LOCK
Got parameters for ISDBT:
FREQUENCY = 515142857
MODULATION = QAM/AUTO
BANDWIDTH_HZ = 6000000
INVERSION = OFF
CODE_RATE_HP = AUTO
CODE_RATE_LP = AUTO
GUARD_INTERVAL = 1/16
TRANSMISSION_MODE = 8K
HIERARCHY = NONE
ISDBT_LAYER_ENABLED = 7
ISDBT_PARTIAL_RECEPTION = 1
ISDBT_SOUND_BROADCASTING = 0
ISDBT_SB_SUBCHANNEL_ID = 0
ISDBT_SB_SEGMENT_IDX = 0
ISDBT_SB_SEGMENT_COUNT = 0
ISDBT_LAYERA_FEC = 1/2
ISDBT_LAYERA_MODULATION = QPSK
ISDBT_LAYERA_SEGMENT_COUNT = 1
ISDBT_LAYERA_TIME_INTERLEAVING = 3
ISDBT_LAYERB_FEC = 3/4
ISDBT_LAYERB_MODULATION = QAM/64
ISDBT_LAYERB_SEGMENT_COUNT = 12
ISDBT_LAYERB_TIME_INTERLEAVING = 2
ISDBT_LAYERC_FEC = 1/2
ISDBT_LAYERC_MODULATION = QAM/64
ISDBT_LAYERC_SEGMENT_COUNT = 0
ISDBT_LAYERC_TIME_INTERLEAVING = 0
DELIVERY_SYSTEM = ISDBT

$ ./dvbv5-zap band\ 1seg
using demug '/dev/dvb/adapter0/demux0'
reading channels from file '/home/v4l/.tzap/channels.conf'
Device DiBcom 8000 ISDB-T (/dev/dvb/adapter0/frontend0) capabilities:
        CAN_FEC_1_2 CAN_FEC_2_3 CAN_FEC_3_4 CAN_FEC_5_6 CAN_FEC_7_8 CAN_FEC_AUTO CAN_GUARD_INTERVAL_AUTO CAN_HIERARCHY_AUTO CAN_INVERSION_AUTO CAN_QAM_16 CAN_QAM_64 CAN_QAM_AUTO CAN_QPSK CAN_RECOVER CAN_TRANSMISSION_MODE_AUTO 
DVB API Version 5.5, Current v5 delivery system: ISDBT
Supported delivery system: [ISDBT] 
tuning to 545142857 Hz
video pid 0x0211, audio pid 0x0212
status 03 | signal 9b2c | snr 00d9 | ber 00000000 | unc 000000d9 | 
status 1f | signal 9b3d | snr 00cf | ber 00000000 | unc 000000cf | FE_HAS_LOCK
Got parameters for ISDBT:
FREQUENCY = 545142857
MODULATION = QAM/AUTO
BANDWIDTH_HZ = 6000000
INVERSION = OFF
CODE_RATE_HP = AUTO
CODE_RATE_LP = AUTO
GUARD_INTERVAL = 1/16
TRANSMISSION_MODE = 8K
HIERARCHY = NONE
ISDBT_LAYER_ENABLED = 7
ISDBT_PARTIAL_RECEPTION = 1
ISDBT_SOUND_BROADCASTING = 0
ISDBT_SB_SUBCHANNEL_ID = 0
ISDBT_SB_SEGMENT_IDX = 0
ISDBT_SB_SEGMENT_COUNT = 0
ISDBT_LAYERA_FEC = 2/3
ISDBT_LAYERA_MODULATION = QPSK
ISDBT_LAYERA_SEGMENT_COUNT = 1
ISDBT_LAYERA_TIME_INTERLEAVING = 3
ISDBT_LAYERB_FEC = 3/4
ISDBT_LAYERB_MODULATION = QAM/64
ISDBT_LAYERB_SEGMENT_COUNT = 12
ISDBT_LAYERB_TIME_INTERLEAVING = 2
ISDBT_LAYERC_FEC = 1/2
ISDBT_LAYERC_MODULATION = QAM/64
ISDBT_LAYERC_SEGMENT_COUNT = 0
ISDBT_LAYERC_TIME_INTERLEAVING = 0
DELIVERY_SYSTEM = ISDBT

Clearly, for both frequencies, the 1-seg channels are being
broadcasted with QPSK, 1 segment. "Band" broadcaster uses
FEC_1_2 red-salomon code, while "Globo" uses FEC_2_3.

The HD channel uses 64-QAM with 12 segments and FEC_3_4, for both
Globo and Band.

I tested it with some other channels and the result is consistent:
on all broadcasted channels here, the 1-seg transmissions are using
QPSK, and the SD and HD channels are using the 12 remaining segments.

This makes sense, as 1-seg transmissions are low-res and used
on mobile devices, so, broadcasters are using a di-bit constellation
and are opting by using more redundancy at the Red-Salomon encoder.

Regards,
Mauro

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type
  2012-01-02 10:55   ` Mauro Carvalho Chehab
  2012-01-02 11:40     ` Mauro Carvalho Chehab
@ 2012-01-02 11:48     ` Manu Abraham
  2012-01-02 14:33       ` Mauro Carvalho Chehab
  1 sibling, 1 reply; 19+ messages in thread
From: Manu Abraham @ 2012-01-02 11:48 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On Mon, Jan 2, 2012 at 4:25 PM, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:
> On 02-01-2012 05:31, Manu Abraham wrote:
>> On Mon, Jan 2, 2012 at 1:41 AM, Mauro Carvalho Chehab
>> <mchehab@redhat.com> wrote:
>>> This is likely the last patch series from my series of DVB cleanups.
>>> I still intend to work on DRX-K frontend merge patch, but this will
>>> need to wait until my return to my home town. Of course, if you're
>>> hurry with this, patches are welcome.
>>>
>>> This series changes dvb_frontend to use ops->delsys instead of ops->info.type,
>>> as the source for the frontend support. With this series:
>>>
>>> 1) the first delivery system is reported as info.type for DVBv3 apps;
>>> 2) all subsequent checks are made against the current delivery system
>>>   (c->delivery_system);
>>> 3) An attempt to use an un-suported delivery system will either return
>>>   an error, or enter into the emulation mode, if the frontend is
>>>   using a newer delivery system.
>>> 4) Lots of cleanup at the cache sync logic. Now, a pure DVBv5 call
>>>   shouldn't fill the DVBv3 structs. Still, as events are generated,
>>>   the event will dynamically generate a DVBv3 compat struct.
>>>
>>> The emulation logic is not perfect (but it were not perfect before this
>>> patch series). The emulation will work worse for devices that have
>>> support for different "ops->info.type", as there's no way for a DVBv3
>>> application to work properly with those devices.
>>>
>>> TODO:
>>>
>>> There are a few things left to do, with regards to DVB frontend cleanup.
>>> They're more related to the DVBv5 API, so they were out of the scope
>>> of this series. Maybe some work for this upcoming year!
>>>
>>> They are:
>>>
>>>        1) Fix the capabilities flags. There are several capabilities
>>> not reported, like several modulations, etc. There are not enough flags
>>> for them. It was suggested that the delivery system (DTV_ENUM_DELSYS)
>>> would be enough, but it doesn't seem so. For example, there are several
>>> SYS_ATSC devices that only support VSB_8. So, we'll end by needing to
>>> either extend the current way (but we lack bits) or to implement a DVBv5
>>> way for that;
>>>
>>
>> If an ATSC device supports fewer modulations, things should be
>> even simpler. Just return INVALID Frontend setup if it is trying to
>> setup something invalid, that which is not supported. Advertising
>> the available modulations doesn't help in any sense.
>> A53 spec talks about devices supporting 2 modes, Terrestrial
>> mode and High data rate mode. It is unlikely and yet maybe
>> some devices don't adhere to specifications supporting only
>> 8VSB, but even in those cases, just returning -EINVAL would be
>> sufficient for 16VSB.
>>
>> What you suggest, just adds confusion alone to applications as
>> to what to do with all the exported fields/flags.
>
> Returning -EINVAL works from kernel POV, but at least one userpsace
> application developer sent me an email those days complaining that
> applications need to know what are the supported capabilities, in order
> to provide a proper userspace gui.


FWIW, userapps shouldn't really bother about all the
hardware details. If user application were to really
bother about all the tiny intricacies (I can point out
a large amount of tiny intricacies that which might
sound pretty, as you are stating) then there wouldn't
be the need for a driver API -- the application itself
can contain the driver code. In short, providing too
much information to application is also not nice.

The user application should simply set the parameters
and try to demodulate, return error if it cannot.
Having unnecessary fields just causes confusion alone.
I don't see how providing all the modulations under a
delivery system can improve a GUI application
especially when it is according to the specifications.


>>>        2) The DVBv3 events call (FE_GET_EVENT) is not ok for
>>> newer delivery system. We'll likely need to replace it by a DVBv5 way;
>>>
>>
>>
>> It should be noted that there is no "DVBv5 way", If you are implying
>> to replace ioctl calls with a get/set interface, it doesn't make sense
>> at all.
>
> By DVBv5 way, I'm meaning to say that it should be replaced by some way
> that allow reporting events not only for the 4 delivery systems supported
> by DVBv3 API.
>
> This could be as easy as adding a DTV_GET_EVENT command for FE_GET_PROPERTY.
>
> Alternatively, events could be reported via a poll() ops at the frontend
> node.


I am unable to see the advantage in adding a
new DTV_GET_EVENT call instead of FE_GET_PROPERTY
improve anything at all.


>
>>>        3) The stats API needs to be extended. Delivery systems like
>>> ISDB can report a per-layer set of statistics. This is currently not
>>> supported. Also, it is desirable to get the stats together with a
>>> set of other properties.
>>
>> The per layer statistics is a myth and can be ignored. Each of the
>> layers are much higher above and simply RF/demodulation
>> parameters don't exist/layer; Even if you argue that they do exist,
>> it would be exactly sufficient to read stats after setting up the
>> relevant layer for filtering (since you cannot read demodulation
>> statistics, without setting up proper demodulation parameters).
>
> Take a look at:
>        http://linuxtv.org/downloads/v4l-dvb-apis/FE_GET_SET_PROPERTY.html#isdb-hierq-layers
>
> Each layer has a group of OFDM carriers, each group have its own modulation,
> viterbi and red-salomon decoders. And all of them can be decoded
> simultaneously. So, the statistics for each layer will be different.
>


Hierarchial modulation is not new as with ISDB,
DVB has been using hieararchial modulation with
DVB-T, T2, and S2 with no issues.

After a tune, an application can simply retrieve the
stats for that particular layer. The application knowing
which layer the frontend was setup/tuned for.

http://www.dvb.org/technology/fact_sheets/WP01_DVB-T%20Hierarchical.pdf

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type
  2012-01-02 11:48     ` Manu Abraham
@ 2012-01-02 14:33       ` Mauro Carvalho Chehab
  2012-01-02 16:48         ` Manu Abraham
  2012-01-02 17:43         ` Manu Abraham
  0 siblings, 2 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-02 14:33 UTC (permalink / raw)
  To: Manu Abraham; +Cc: Linux Media Mailing List

On 02-01-2012 09:48, Manu Abraham wrote:
> On Mon, Jan 2, 2012 at 4:25 PM, Mauro Carvalho Chehab
> <mchehab@redhat.com> wrote:
>> On 02-01-2012 05:31, Manu Abraham wrote:
>>> On Mon, Jan 2, 2012 at 1:41 AM, Mauro Carvalho Chehab
>>> <mchehab@redhat.com> wrote:
>>>> This is likely the last patch series from my series of DVB cleanups.
>>>> I still intend to work on DRX-K frontend merge patch, but this will
>>>> need to wait until my return to my home town. Of course, if you're
>>>> hurry with this, patches are welcome.
>>>>
>>>> This series changes dvb_frontend to use ops->delsys instead of ops->info.type,
>>>> as the source for the frontend support. With this series:
>>>>
>>>> 1) the first delivery system is reported as info.type for DVBv3 apps;
>>>> 2) all subsequent checks are made against the current delivery system
>>>>   (c->delivery_system);
>>>> 3) An attempt to use an un-suported delivery system will either return
>>>>   an error, or enter into the emulation mode, if the frontend is
>>>>   using a newer delivery system.
>>>> 4) Lots of cleanup at the cache sync logic. Now, a pure DVBv5 call
>>>>   shouldn't fill the DVBv3 structs. Still, as events are generated,
>>>>   the event will dynamically generate a DVBv3 compat struct.
>>>>
>>>> The emulation logic is not perfect (but it were not perfect before this
>>>> patch series). The emulation will work worse for devices that have
>>>> support for different "ops->info.type", as there's no way for a DVBv3
>>>> application to work properly with those devices.
>>>>
>>>> TODO:
>>>>
>>>> There are a few things left to do, with regards to DVB frontend cleanup.
>>>> They're more related to the DVBv5 API, so they were out of the scope
>>>> of this series. Maybe some work for this upcoming year!
>>>>
>>>> They are:
>>>>
>>>>        1) Fix the capabilities flags. There are several capabilities
>>>> not reported, like several modulations, etc. There are not enough flags
>>>> for them. It was suggested that the delivery system (DTV_ENUM_DELSYS)
>>>> would be enough, but it doesn't seem so. For example, there are several
>>>> SYS_ATSC devices that only support VSB_8. So, we'll end by needing to
>>>> either extend the current way (but we lack bits) or to implement a DVBv5
>>>> way for that;
>>>>
>>>
>>> If an ATSC device supports fewer modulations, things should be
>>> even simpler. Just return INVALID Frontend setup if it is trying to
>>> setup something invalid, that which is not supported. Advertising
>>> the available modulations doesn't help in any sense.
>>> A53 spec talks about devices supporting 2 modes, Terrestrial
>>> mode and High data rate mode. It is unlikely and yet maybe
>>> some devices don't adhere to specifications supporting only
>>> 8VSB, but even in those cases, just returning -EINVAL would be
>>> sufficient for 16VSB.
>>>
>>> What you suggest, just adds confusion alone to applications as
>>> to what to do with all the exported fields/flags.
>>
>> Returning -EINVAL works from kernel POV, but at least one userpsace
>> application developer sent me an email those days complaining that
>> applications need to know what are the supported capabilities, in order
>> to provide a proper userspace gui.
> 
> 
> FWIW, userapps shouldn't really bother about all the
> hardware details. If user application were to really
> bother about all the tiny intricacies (I can point out
> a large amount of tiny intricacies that which might
> sound pretty, as you are stating) then there wouldn't
> be the need for a driver API -- the application itself
> can contain the driver code. In short, providing too
> much information to application is also not nice.
> 
> The user application should simply set the parameters
> and try to demodulate, return error if it cannot.

-EINVAL could mean an error on any parameter, not just on
modulation.

> Having unnecessary fields just causes confusion alone.
> I don't see how providing all the modulations under a
> delivery system can improve a GUI application
> especially when it is according to the specifications.


> 
> 
>>>>        2) The DVBv3 events call (FE_GET_EVENT) is not ok for
>>>> newer delivery system. We'll likely need to replace it by a DVBv5 way;
>>>>
>>>
>>>
>>> It should be noted that there is no "DVBv5 way", If you are implying
>>> to replace ioctl calls with a get/set interface, it doesn't make sense
>>> at all.
>>
>> By DVBv5 way, I'm meaning to say that it should be replaced by some way
>> that allow reporting events not only for the 4 delivery systems supported
>> by DVBv3 API.
>>
>> This could be as easy as adding a DTV_GET_EVENT command for FE_GET_PROPERTY.
>>
>> Alternatively, events could be reported via a poll() ops at the frontend
>> node.
> 
> 
> I am unable to see the advantage in adding a
> new DTV_GET_EVENT call instead of FE_GET_PROPERTY
> improve anything at all.

Huh? DTV_foo is the name of the properties used by FE_GET_PROPERTY.

What I'm meaning is that:

	1) in order to have just one ioctl providing both FE status and
	   DTV properties, some new properties are needed there (status
	   and likely stats);

	2) It makes sense to have something that will only return to 
	   userspace after having a frontend lock, or after a timeout.

>>>>        3) The stats API needs to be extended. Delivery systems like
>>>> ISDB can report a per-layer set of statistics. This is currently not
>>>> supported. Also, it is desirable to get the stats together with a
>>>> set of other properties.
>>>
>>> The per layer statistics is a myth and can be ignored. Each of the
>>> layers are much higher above and simply RF/demodulation
>>> parameters don't exist/layer; Even if you argue that they do exist,
>>> it would be exactly sufficient to read stats after setting up the
>>> relevant layer for filtering (since you cannot read demodulation
>>> statistics, without setting up proper demodulation parameters).
>>
>> Take a look at:
>>        http://linuxtv.org/downloads/v4l-dvb-apis/FE_GET_SET_PROPERTY.html#isdb-hierq-layers
>>
>> Each layer has a group of OFDM carriers, each group have its own modulation,
>> viterbi and red-salomon decoders. And all of them can be decoded
>> simultaneously. So, the statistics for each layer will be different.
>>
> 
> 
> Hierarchial modulation is not new as with ISDB,
> DVB has been using hieararchial modulation with
> DVB-T, T2, and S2 with no issues.
> 
> After a tune, an application can simply retrieve the
> stats for that particular layer. The application knowing
> which layer the frontend was setup/tuned for.
> 
> http://www.dvb.org/technology/fact_sheets/WP01_DVB-T%20Hierarchical.pdf

If you want discuss anything about ISDB, please read ISDB documents (for
example [1]), and not DVB-T, as they're different standards. On DVB, the
hierarchical transmission use the same modulation for the transponder.

This is different than what is done on ISDB-T. On ISDB, the OFDM carriers are
divided into 13 segments. The segments can be grouped into 1 to 3 groups.
Each group is called "layer". Each layer has its own inner code and modulation.

There are devices capable of receiving only one segment (1-seg), others that
can also read up to 3 segments (3-seg), and full-seg devices (also called as 
wide-band ISDB-T receivers) can read all 13 segments. Up to 3 layers of 
modulators/Viterbi/Red-Salomon can be used independently, to be applied to 
3 different groups of segments. This is different from DVB-T hierarchical
transmission.

Btw, in order to allow support for both narrowband and wideband receivers,
all broadcasters here are using two layers: the first layer with 1 segment,
QPSK modulation, and the second layer with the remaining 12 segments.

There are several mobile phones, tablets and GPS's that have a narrowband
receiver, capable of handling only 1-seg. AFAIKT, in Japan, 1-seg and 3-seg
is used, not only for mobile reception but also for digital radio broadcast.

There's nothing similar to that on DVB-T. On DVB-T, in order to get the LP
data, the receiver needs to decode the HP bitstream first. On ISDB-T, they're
independent.

[1] see section 1.1 of: http://www.nhk.or.jp/strl/open99/de-2/shosai-e.html

Regards,
Mauro

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type
  2012-01-02 14:33       ` Mauro Carvalho Chehab
@ 2012-01-02 16:48         ` Manu Abraham
  2012-01-02 17:43         ` Manu Abraham
  1 sibling, 0 replies; 19+ messages in thread
From: Manu Abraham @ 2012-01-02 16:48 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On Mon, Jan 2, 2012 at 8:03 PM, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:
> On 02-01-2012 09:48, Manu Abraham wrote:
>> On Mon, Jan 2, 2012 at 4:25 PM, Mauro Carvalho Chehab
>> <mchehab@redhat.com> wrote:
>>> On 02-01-2012 05:31, Manu Abraham wrote:
>>>> On Mon, Jan 2, 2012 at 1:41 AM, Mauro Carvalho Chehab
>>>> <mchehab@redhat.com> wrote:
>>>>> This is likely the last patch series from my series of DVB cleanups.
>>>>> I still intend to work on DRX-K frontend merge patch, but this will
>>>>> need to wait until my return to my home town. Of course, if you're
>>>>> hurry with this, patches are welcome.
>>>>>
>>>>> This series changes dvb_frontend to use ops->delsys instead of ops->info.type,
>>>>> as the source for the frontend support. With this series:
>>>>>
>>>>> 1) the first delivery system is reported as info.type for DVBv3 apps;
>>>>> 2) all subsequent checks are made against the current delivery system
>>>>>   (c->delivery_system);
>>>>> 3) An attempt to use an un-suported delivery system will either return
>>>>>   an error, or enter into the emulation mode, if the frontend is
>>>>>   using a newer delivery system.
>>>>> 4) Lots of cleanup at the cache sync logic. Now, a pure DVBv5 call
>>>>>   shouldn't fill the DVBv3 structs. Still, as events are generated,
>>>>>   the event will dynamically generate a DVBv3 compat struct.
>>>>>
>>>>> The emulation logic is not perfect (but it were not perfect before this
>>>>> patch series). The emulation will work worse for devices that have
>>>>> support for different "ops->info.type", as there's no way for a DVBv3
>>>>> application to work properly with those devices.
>>>>>
>>>>> TODO:
>>>>>
>>>>> There are a few things left to do, with regards to DVB frontend cleanup.
>>>>> They're more related to the DVBv5 API, so they were out of the scope
>>>>> of this series. Maybe some work for this upcoming year!
>>>>>
>>>>> They are:
>>>>>
>>>>>        1) Fix the capabilities flags. There are several capabilities
>>>>> not reported, like several modulations, etc. There are not enough flags
>>>>> for them. It was suggested that the delivery system (DTV_ENUM_DELSYS)
>>>>> would be enough, but it doesn't seem so. For example, there are several
>>>>> SYS_ATSC devices that only support VSB_8. So, we'll end by needing to
>>>>> either extend the current way (but we lack bits) or to implement a DVBv5
>>>>> way for that;
>>>>>
>>>>
>>>> If an ATSC device supports fewer modulations, things should be
>>>> even simpler. Just return INVALID Frontend setup if it is trying to
>>>> setup something invalid, that which is not supported. Advertising
>>>> the available modulations doesn't help in any sense.
>>>> A53 spec talks about devices supporting 2 modes, Terrestrial
>>>> mode and High data rate mode. It is unlikely and yet maybe
>>>> some devices don't adhere to specifications supporting only
>>>> 8VSB, but even in those cases, just returning -EINVAL would be
>>>> sufficient for 16VSB.
>>>>
>>>> What you suggest, just adds confusion alone to applications as
>>>> to what to do with all the exported fields/flags.
>>>
>>> Returning -EINVAL works from kernel POV, but at least one userpsace
>>> application developer sent me an email those days complaining that
>>> applications need to know what are the supported capabilities, in order
>>> to provide a proper userspace gui.
>>
>>
>> FWIW, userapps shouldn't really bother about all the
>> hardware details. If user application were to really
>> bother about all the tiny intricacies (I can point out
>> a large amount of tiny intricacies that which might
>> sound pretty, as you are stating) then there wouldn't
>> be the need for a driver API -- the application itself
>> can contain the driver code. In short, providing too
>> much information to application is also not nice.
>>
>> The user application should simply set the parameters
>> and try to demodulate, return error if it cannot.
>
> -EINVAL could mean an error on any parameter, not just on
> modulation.

This suggestion of FE_CAN_MODULATION_X/Y/Z just follows
an earlier discussion about the FE_CAN_ bits where almost
everyone came to the conclusion and eventually agreed
that those are superfluous and such fine grained-ness is
not useful.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type
  2012-01-02 14:33       ` Mauro Carvalho Chehab
  2012-01-02 16:48         ` Manu Abraham
@ 2012-01-02 17:43         ` Manu Abraham
  1 sibling, 0 replies; 19+ messages in thread
From: Manu Abraham @ 2012-01-02 17:43 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On Mon, Jan 2, 2012 at 8:03 PM, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:
> On 02-01-2012 09:48, Manu Abraham wrote:
>> On Mon, Jan 2, 2012 at 4:25 PM, Mauro Carvalho Chehab
>> <mchehab@redhat.com> wrote:
>>> On 02-01-2012 05:31, Manu Abraham wrote:
>>>> On Mon, Jan 2, 2012 at 1:41 AM, Mauro Carvalho Chehab
>>>> <mchehab@redhat.com> wrote:
>>>>> This is likely the last patch series from my series of DVB cleanups.
>>>>> I still intend to work on DRX-K frontend merge patch, but this will
>>>>> need to wait until my return to my home town. Of course, if you're
>>>>> hurry with this, patches are welcome.
>>>>>
>>>>> This series changes dvb_frontend to use ops->delsys instead of ops->info.type,
>>>>> as the source for the frontend support. With this series:
>>>>>
>>>>> 1) the first delivery system is reported as info.type for DVBv3 apps;
>>>>> 2) all subsequent checks are made against the current delivery system
>>>>>   (c->delivery_system);
>>>>> 3) An attempt to use an un-suported delivery system will either return
>>>>>   an error, or enter into the emulation mode, if the frontend is
>>>>>   using a newer delivery system.
>>>>> 4) Lots of cleanup at the cache sync logic. Now, a pure DVBv5 call
>>>>>   shouldn't fill the DVBv3 structs. Still, as events are generated,
>>>>>   the event will dynamically generate a DVBv3 compat struct.
>>>>>
>>>>> The emulation logic is not perfect (but it were not perfect before this
>>>>> patch series). The emulation will work worse for devices that have
>>>>> support for different "ops->info.type", as there's no way for a DVBv3
>>>>> application to work properly with those devices.
>>>>>
>>>>> TODO:
>>>>>
>>>>> There are a few things left to do, with regards to DVB frontend cleanup.
>>>>> They're more related to the DVBv5 API, so they were out of the scope
>>>>> of this series. Maybe some work for this upcoming year!
>>>>>
>>>>> They are:
>>>>>
>>>>>        1) Fix the capabilities flags. There are several capabilities
>>>>> not reported, like several modulations, etc. There are not enough flags
>>>>> for them. It was suggested that the delivery system (DTV_ENUM_DELSYS)
>>>>> would be enough, but it doesn't seem so. For example, there are several
>>>>> SYS_ATSC devices that only support VSB_8. So, we'll end by needing to
>>>>> either extend the current way (but we lack bits) or to implement a DVBv5
>>>>> way for that;
>>>>>
>>>>
>>>> If an ATSC device supports fewer modulations, things should be
>>>> even simpler. Just return INVALID Frontend setup if it is trying to
>>>> setup something invalid, that which is not supported. Advertising
>>>> the available modulations doesn't help in any sense.
>>>> A53 spec talks about devices supporting 2 modes, Terrestrial
>>>> mode and High data rate mode. It is unlikely and yet maybe
>>>> some devices don't adhere to specifications supporting only
>>>> 8VSB, but even in those cases, just returning -EINVAL would be
>>>> sufficient for 16VSB.
>>>>
>>>> What you suggest, just adds confusion alone to applications as
>>>> to what to do with all the exported fields/flags.
>>>
>>> Returning -EINVAL works from kernel POV, but at least one userpsace
>>> application developer sent me an email those days complaining that
>>> applications need to know what are the supported capabilities, in order
>>> to provide a proper userspace gui.
>>
>>
>> FWIW, userapps shouldn't really bother about all the
>> hardware details. If user application were to really
>> bother about all the tiny intricacies (I can point out
>> a large amount of tiny intricacies that which might
>> sound pretty, as you are stating) then there wouldn't
>> be the need for a driver API -- the application itself
>> can contain the driver code. In short, providing too
>> much information to application is also not nice.
>>
>> The user application should simply set the parameters
>> and try to demodulate, return error if it cannot.
>
> -EINVAL could mean an error on any parameter, not just on
> modulation.
>
>> Having unnecessary fields just causes confusion alone.
>> I don't see how providing all the modulations under a
>> delivery system can improve a GUI application
>> especially when it is according to the specifications.
>
>
>>
>>
>>>>>        2) The DVBv3 events call (FE_GET_EVENT) is not ok for
>>>>> newer delivery system. We'll likely need to replace it by a DVBv5 way;
>>>>>
>>>>
>>>>
>>>> It should be noted that there is no "DVBv5 way", If you are implying
>>>> to replace ioctl calls with a get/set interface, it doesn't make sense
>>>> at all.
>>>
>>> By DVBv5 way, I'm meaning to say that it should be replaced by some way
>>> that allow reporting events not only for the 4 delivery systems supported
>>> by DVBv3 API.
>>>
>>> This could be as easy as adding a DTV_GET_EVENT command for FE_GET_PROPERTY.
>>>
>>> Alternatively, events could be reported via a poll() ops at the frontend
>>> node.
>>
>>
>> I am unable to see the advantage in adding a
>> new DTV_GET_EVENT call instead of FE_GET_PROPERTY
>> improve anything at all.
>
> Huh? DTV_foo is the name of the properties used by FE_GET_PROPERTY.
>
> What I'm meaning is that:
>
>        1) in order to have just one ioctl providing both FE status and
>           DTV properties, some new properties are needed there (status
>           and likely stats);
>
>        2) It makes sense to have something that will only return to
>           userspace after having a frontend lock, or after a timeout.
>
>>>>>        3) The stats API needs to be extended. Delivery systems like
>>>>> ISDB can report a per-layer set of statistics. This is currently not
>>>>> supported. Also, it is desirable to get the stats together with a
>>>>> set of other properties.
>>>>
>>>> The per layer statistics is a myth and can be ignored. Each of the
>>>> layers are much higher above and simply RF/demodulation
>>>> parameters don't exist/layer; Even if you argue that they do exist,
>>>> it would be exactly sufficient to read stats after setting up the
>>>> relevant layer for filtering (since you cannot read demodulation
>>>> statistics, without setting up proper demodulation parameters).
>>>
>>> Take a look at:
>>>        http://linuxtv.org/downloads/v4l-dvb-apis/FE_GET_SET_PROPERTY.html#isdb-hierq-layers
>>>
>>> Each layer has a group of OFDM carriers, each group have its own modulation,
>>> viterbi and red-salomon decoders. And all of them can be decoded
>>> simultaneously. So, the statistics for each layer will be different.
>>>
>>
>>
>> Hierarchial modulation is not new as with ISDB,
>> DVB has been using hieararchial modulation with
>> DVB-T, T2, and S2 with no issues.
>>
>> After a tune, an application can simply retrieve the
>> stats for that particular layer. The application knowing
>> which layer the frontend was setup/tuned for.
>>
>> http://www.dvb.org/technology/fact_sheets/WP01_DVB-T%20Hierarchical.pdf
>
> If you want discuss anything about ISDB, please read ISDB documents (for
> example [1]), and not DVB-T, as they're different standards. On DVB, the
> hierarchical transmission use the same modulation for the transponder.
>

Not exactly .. read on ..

> This is different than what is done on ISDB-T. On ISDB, the OFDM carriers are
> divided into 13 segments. The segments can be grouped into 1 to 3 groups.
> Each group is called "layer". Each layer has its own inner code and modulation.
>
> There are devices capable of receiving only one segment (1-seg), others that
> can also read up to 3 segments (3-seg), and full-seg devices (also called as
> wide-band ISDB-T receivers) can read all 13 segments. Up to 3 layers of
> modulators/Viterbi/Red-Salomon can be used independently, to be applied to
> 3 different groups of segments.
>

There aren't 3 layers of Reed-Solomon used with ISDB-T.
There are 3 different (CRL's) Clock Recovery Loops. A
single hierarchial bitstream is composed from these,
which is fed to an OFDM framing engine after interleaving
(for data protection) and symbol mapping.

See Section.2, Fig. 3 in the following URL.

.. snip ..

> [1] see section 1.1 of: http://www.nhk.or.jp/strl/open99/de-2/shosai-e.html
>

This just complements what I wrote earlier ..

An ISDB-T modulator is described in the above URL. A
demodulator is an exact reverse process described.

There is just one single Outer Code RS with a single OFDM
framing adaptation. Framing errors arising out of this will
also be single and not multiple types.

The splitter as shown is a TDM engine similarly as in the
case of DVB-S2. A pictorial representation of which can be
seen in Figure 2:
"Pictorial representation of the physical layer structure".

http://www.ebu.ch/en/technical/trev/trev_300-morello.pdf

Of course, the Error Correction and many other things are
different, but the basic concept of Multiple streams /
Multiple layers all remains the same.

With DVB V4 and ISDB-T we had this as ID's for each of the
individual available streams.

Similarity should be noted with DVB-T2 we have this as
Physical Layer Pipes (PLP's) and with DVB-S2 as (MIS)
Multiple Input streams. Just that we have different
nomenclature.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/9] [media] dvb_frontend: Don't use ops->info.type anymore
  2012-01-01 20:11 ` [PATCH 4/9] [media] dvb_frontend: Don't use ops->info.type anymore Mauro Carvalho Chehab
@ 2012-01-05 16:19   ` e9hack
  2012-01-05 20:39     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 19+ messages in thread
From: e9hack @ 2012-01-05 16:19 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

Am 01.01.2012 21:11, schrieb Mauro Carvalho Chehab:
> Get rid of using ops->info.type defined on DVB drivers,
> as it doesn't apply anymore.
....
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> ---
>  drivers/media/dvb/dvb-core/dvb_frontend.c |  541 ++++++++++++++---------------
>  1 files changed, 266 insertions(+), 275 deletions(-)
....
> diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
> index eefcb7f..7f6ce06 100644
> @@ -1902,6 +1850,37 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
>  		memcpy(info, &fe->ops.info, sizeof(struct dvb_frontend_info));
>  		dvb_frontend_get_frequency_limits(fe, &info->frequency_min, &info->frequency_max);
>  
> +		/*
> +		 * Associate the 4 delivery systems supported by DVBv3
> +		 * API with their DVBv5 counterpart. For the other standards,
> +		 * use the closest type, assuming that it would hopefully
> +		 * work with a DVBv3 application.
> +		 * It should be noticed that, on multi-frontend devices with
> +		 * different types (terrestrial and cable, for example),
> +		 * a pure DVBv3 application won't be able to use all delivery
> +		 * systems. Yet, changing the DVBv5 cache to the other delivery
> +		 * system should be enough for making it work.
> +		 */
> +		switch (dvbv3_type(c->delivery_system)) {
> +		case DVBV3_QPSK:
> +			fe->ops.info.type = FE_QPSK;
> +			break;
> +		case DVBV3_ATSC:
> +			fe->ops.info.type = FE_ATSC;
> +			break;
> +		case DVBV3_QAM:
> +			fe->ops.info.type = FE_QAM;
> +			break;
> +		case DVBV3_OFDM:
> +			fe->ops.info.type = FE_OFDM;
> +			break;
> +		default:
> +			printk(KERN_ERR
> +			       "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n",
> +			       __func__, c->delivery_system);
> +			fe->ops.info.type = FE_OFDM;
> +		}
> +

Hi,

I think this is partly wrong. The old delivery system values must be set in the given data
structure from caller:

fe->ops.info.type = FE_QAM;

must be replace by

info->type = FE_QAM;

Regards,
Hartmut

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/9] [media] dvb_frontend: Don't use ops->info.type anymore
  2012-01-05 16:19   ` e9hack
@ 2012-01-05 20:39     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-05 20:39 UTC (permalink / raw)
  To: e9hack; +Cc: Linux Media Mailing List

On 05-01-2012 14:19, e9hack wrote:
> Am 01.01.2012 21:11, schrieb Mauro Carvalho Chehab:
>> Get rid of using ops->info.type defined on DVB drivers,
>> as it doesn't apply anymore.
> ....
>>
>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>> ---
>>  drivers/media/dvb/dvb-core/dvb_frontend.c |  541 ++++++++++++++---------------
>>  1 files changed, 266 insertions(+), 275 deletions(-)
> ....
>> diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
>> index eefcb7f..7f6ce06 100644
>> @@ -1902,6 +1850,37 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
>>  		memcpy(info, &fe->ops.info, sizeof(struct dvb_frontend_info));
>>  		dvb_frontend_get_frequency_limits(fe, &info->frequency_min, &info->frequency_max);
>>  
>> +		/*
>> +		 * Associate the 4 delivery systems supported by DVBv3
>> +		 * API with their DVBv5 counterpart. For the other standards,
>> +		 * use the closest type, assuming that it would hopefully
>> +		 * work with a DVBv3 application.
>> +		 * It should be noticed that, on multi-frontend devices with
>> +		 * different types (terrestrial and cable, for example),
>> +		 * a pure DVBv3 application won't be able to use all delivery
>> +		 * systems. Yet, changing the DVBv5 cache to the other delivery
>> +		 * system should be enough for making it work.
>> +		 */
>> +		switch (dvbv3_type(c->delivery_system)) {
>> +		case DVBV3_QPSK:
>> +			fe->ops.info.type = FE_QPSK;
>> +			break;
>> +		case DVBV3_ATSC:
>> +			fe->ops.info.type = FE_ATSC;
>> +			break;
>> +		case DVBV3_QAM:
>> +			fe->ops.info.type = FE_QAM;
>> +			break;
>> +		case DVBV3_OFDM:
>> +			fe->ops.info.type = FE_OFDM;
>> +			break;
>> +		default:
>> +			printk(KERN_ERR
>> +			       "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n",
>> +			       __func__, c->delivery_system);
>> +			fe->ops.info.type = FE_OFDM;
>> +		}
>> +
> 
> Hi,
> 
> I think this is partly wrong. The old delivery system values must be set in the given data
> structure from caller:
> 
> fe->ops.info.type = FE_QAM;
> 
> must be replace by
> 
> info->type = FE_QAM;

Yeah, I noticed it today, when testing it with DRX-K. Patches fixing it
were sent to the ML earlier, but it ends that your solution is better
than mine ;) I've re-sent the patch to the ML, and added it upstream.

Thanks for noticing it!
Mauro

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-01-05 20:39 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-01 20:11 [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Mauro Carvalho Chehab
2012-01-01 20:11 ` [PATCH 1/9] [media] dvb: Initialize all cache values Mauro Carvalho Chehab
2012-01-01 20:11 ` [PATCH 2/9] [media] dvb_frontend: Handle all possible DVBv3 values for bandwidth Mauro Carvalho Chehab
2012-01-01 20:11 ` [PATCH 3/9] [media] dvb: move dvb_set_frontend logic into a separate routine Mauro Carvalho Chehab
2012-01-01 20:11 ` [PATCH 4/9] [media] dvb_frontend: Don't use ops->info.type anymore Mauro Carvalho Chehab
2012-01-05 16:19   ` e9hack
2012-01-05 20:39     ` Mauro Carvalho Chehab
2012-01-01 20:11 ` [PATCH 5/9] [media] dvb_frontend: Fix DVBv3 emulation Mauro Carvalho Chehab
2012-01-01 20:11 ` [PATCH 6/9] [media] dvb-core: Fix ISDB-T defaults Mauro Carvalho Chehab
2012-01-01 20:11 ` [PATCH 7/9] [media] dvb: get rid of fepriv->parameters_in Mauro Carvalho Chehab
2012-01-01 20:11 ` [PATCH 8/9] [media] dvb: deprecate the usage of ops->info.type Mauro Carvalho Chehab
2012-01-01 20:11 ` [PATCH 9/9] [media] dvb: Remove ops->info.type from frontends Mauro Carvalho Chehab
2012-01-02  7:31 ` [PATCH 0/9] dvb_frontend: Don't rely on drivers filling ops->info.type Manu Abraham
2012-01-02 10:55   ` Mauro Carvalho Chehab
2012-01-02 11:40     ` Mauro Carvalho Chehab
2012-01-02 11:48     ` Manu Abraham
2012-01-02 14:33       ` Mauro Carvalho Chehab
2012-01-02 16:48         ` Manu Abraham
2012-01-02 17:43         ` Manu Abraham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).