PATCH 15/44 multiproto + backward compatibility [DVB_DUMMY_FE]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- v4l-dvb/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c	2006-06-30 19:59:10.000000000 +0400
+++ mp-bc1/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c	2006-07-23 11:38:12.000000000 +0400
@@ -74,11 +74,30 @@ static int dvb_dummy_fe_get_frontend(str
 	return 0;
 }
 
+static int dvb_dummy_fe_get_frontend(struct dvb_frontend *fe,
+				     struct dvbfe_params *p)
+{
+	return 0;
+}
+
 static int dvb_dummy_fe_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
 {
+	if (fe->ops->tuner_ops->set_params_compat) {
+		fe->ops->tuner_ops->set_params_compat(fe, p);
+		if (fe->ops->i2c_gate_ctrl)
+			fe->ops->i2c_gate_ctrl(fe, 0);
+	}
+
+	return 0;
+}
+
+static int dvb_dummy_fe_set_params(struct dvb_frontend *fe,
+				   struct dvbfe_params *p)
+{
 	if (fe->ops->tuner_ops->set_params) {
 		fe->ops->tuner_ops->set_params(fe, p);
-		if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
+		if (fe->ops->i2c_gate_ctrl)
+			fe->ops->i2c_gate_ctrl(fe, 0);
 	}
 
 	return 0;
@@ -170,6 +189,81 @@ error:
 	return NULL;
 }
 
+static int dvb_dummy_get_info(struct dvb_frontend *fe,
+			      struct dvbfe_info *fe_info)
+{
+	switch(fe_info->delivery) {
+	case DVBFE_DELSYS_DVBS:
+		memcpy(fe_info, &dvbs_info, sizeof (dvbs_info));
+		return 0;
+	case DVBFE_DELSYS_DVBC:
+		memcpy(fe_info, &dvbc_info, sizeof (dvbc_info));
+		return 0;
+	case DVBFE_DELSYS_DVBT:
+		memcpy(fe_info, &dvbt_info, sizeof (dvbt_info));
+		return 0;
+	}
+	return 0;
+}
+
+static int dvb_dummy_get_delsys(struct dvb_frontend *fe,
+				enum dvbfe_delsys *fe_delsys)
+{
+	*fe_delsys = DVBFE_DELSYS_DVBS |
+		     DVBFE_DELSYS_DVBC |
+		     DVBFE_DELSYS_DVBT;
+
+	return 0;
+}
+
+static struct dvbfe_info dvbs_info	= {
+	.name				= "Dummy DVB-S",
+	.delivery			= DVBFE_DELSYS_DVBS,
+	.delsys				= {
+		.dvbs.modulation	= DVBFE_MOD_QPSK,
+		.dvbs.fec		= DVBFE_FEC_1_2 | DVBFE_FEC_2_3 |
+					  DVBFE_FEC_3_4 | DVBFE_FEC_5_6 |
+					  DVBFE_FEC_7_8 | DVBFE_FEC_AUTO
+	},
+
+	.frequency_min			= 950000,
+	.frequency_max			= 2150000,
+	.frequency_stepsize		= 250,           /* kHz for QPSK frontends */
+	.frequency_tolerance		= 29500,
+	.symbol_rate_min		= 1000000,
+	.symbol_rate_max		= 45000000,
+};
+
+static struct dvbfe_info dvbc_info	= {
+	.name				= "Dummy DVB-C",
+	.delivery			= DVBFE_DELSYS_DVBC,
+	.delsys				= {
+		.dvbc.modulation	= DVBFE_MOD_QAM16  | DVBFE_MOD_QAM32  |
+					  DVBFE_MOD_QAM64  | DVBFE_MOD_QAM128 |
+					  DVBFE_MOD_QAM256 | DVBFE_MOD_QAMAUTO
+	},
+
+	.frequency_step			= 62500,
+	.frequency_min			= 51000000,
+	.frequency_max			= 858000000,
+	.symbol_rate_min		= (57840000 / 2) / 64,     /* SACLK/64 == (XIN/2)/64 */
+	.symbol_rate_max		= (57840000 / 2) / 4,      /* SACLK/4 */
+};
+
+static struct dvbfe_info dvbt_info	= {
+	.name				= "Dummy DVB-T",
+	.delivery			= DVBFE_DELSYS_DVBT,
+	.delsys				= {
+		.dvbt.modulation	= DVBFE_MOD_OFDM,
+		.dvbt.stream_priority	= DVBFE_STREAM_PRIORITY_HP |
+					  DVBFE_STREAM_PRIORITY_LP
+	},
+	.frequency_min			= 0,
+	.frequency_max			= 863250000,
+	.frequency_stepsize		= 166667,
+
+};
+
 static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
 
 	.info = {
@@ -200,6 +294,11 @@ static struct dvb_frontend_ops dvb_dummy
 	.read_signal_strength = dvb_dummy_fe_read_signal_strength,
 	.read_snr = dvb_dummy_fe_read_snr,
 	.read_ucblocks = dvb_dummy_fe_read_ucblocks,
+
+	.set_params	= dvb_dummy_set_params,
+	.get_params	= dvb_dummy_get_params,
+	.get_info	= dvb_dummy_get_info,
+	.get_delsys	= dvb_dummy_get_delsys,
 };
 
 static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
@@ -230,8 +329,14 @@ static struct dvb_frontend_ops dvb_dummy
 	.read_signal_strength = dvb_dummy_fe_read_signal_strength,
 	.read_snr = dvb_dummy_fe_read_snr,
 	.read_ucblocks = dvb_dummy_fe_read_ucblocks,
+
+	.set_params	= dvb_dummy_set_params,
+	.get_params	= dvb_dummy_get_params,
+	.get_info	= dvb_dummy_get_info,
+	.get_delsys	= dvb_dummy_get_delsys,
 };
 
+
 static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
 
 	.info = {
@@ -265,6 +370,11 @@ static struct dvb_frontend_ops dvb_dummy
 
 	.set_voltage = dvb_dummy_fe_set_voltage,
 	.set_tone = dvb_dummy_fe_set_tone,
+
+	.set_params	= dvb_dummy_set_params,
+	.get_params	= dvb_dummy_get_params,
+	.get_info	= dvb_dummy_get_info,
+	.get_delsys	= dvb_dummy_get_delsys,
 };
 
 MODULE_DESCRIPTION("DVB DUMMY Frontend");
_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux