PATCH 3/44 multiproto + backward compatibility [AT76c651]

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

 



--- v4l-dvb/linux/drivers/media/dvb/frontends/at76c651.c	2006-06-30 19:59:10.000000000 +0400
+++ mp-bc1/linux/drivers/media/dvb/frontends/at76c651.c	2006-07-23 11:36:40.000000000 +0400
@@ -244,9 +244,10 @@ static int at76c651_set_parameters(struc
 	int ret;
 	struct at76c651_state* state = fe->demodulator_priv;
 
-	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.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);
 	}
 
 	if ((ret = at76c651_set_symbol_rate(state, p->u.qam.symbol_rate)))
@@ -394,6 +395,62 @@ error:
 	return NULL;
 }
 
+static struct dvbfe_info dvbc_info	= {
+	.name				= "Atmel AT76C651B DVB-C",
+	.delivery			= DVBFE_DELSYS_DVBC,
+	.delsys				= {
+		.dvbc.modulation	= DVBFE_MOD_QAM16  | DVBFE_MOD_QAM32  |
+					  DVBFE_MOD_QAM64  | DVBFE_MOD_QAM128 |
+					  DVBFE_MOD_QAM256
+	},
+
+	.frequency_min			= 48250000,
+	.frequency_max			= 863250000,
+	.frequency_step			= 62500,
+	.symbol_rate_min		= 0,
+	.symbol_rate_max		= 9360000,
+	.symbol_rate_tolerance		= 4000
+};
+
+static int at76c651_get_info(struct dvb_frontend *fe, struct dvbfe_info *fe_info)
+{
+	memcpy(fe_info, &dvbc_info, sizeof (dvbc_info));
+
+	return 0;
+}
+
+static int at76c651_get_delsys(struct dvb_frontend *fe, enum dvbfe_delsys *fe_delsys)
+{
+	*fe_delsys = DVBFE_DELSYS_DVBC,
+
+	return 0;
+}
+
+static int at76c651_set_params(struct dvb_frontend* fe, struct dvbfe_params *p)
+{
+	int ret;
+	struct at76c651_state* state = fe->demodulator_priv;
+
+	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 ((ret = at76c651_set_symbol_rate(state, p->delsys.dvbc.symbol_rate)))
+		return ret;
+
+	if ((ret = at76c651_set_inversion(state, p->inversion)))
+		return ret;
+
+	return at76c651_set_auto_config(state);
+}
+
+static enum dvbfe_algo at76c651_get_algo(struct dvb_frontend *fe)
+{
+	return DVBFE_ALGO_RECOVERY;
+}
+
 static struct dvb_frontend_ops at76c651_ops = {
 
 	.info = {
@@ -414,19 +471,21 @@ static struct dvb_frontend_ops at76c651_
 		    FE_CAN_MUTE_TS | FE_CAN_QAM_256 | FE_CAN_RECOVER
 	},
 
-	.release = at76c651_release,
-
-	.init = at76c651_set_defaults,
-	.i2c_gate_ctrl = at76c651_i2c_gate_ctrl,
-
-	.set_frontend = at76c651_set_parameters,
-	.get_tune_settings = at76c651_get_tune_settings,
-
-	.read_status = at76c651_read_status,
-	.read_ber = at76c651_read_ber,
-	.read_signal_strength = at76c651_read_signal_strength,
-	.read_snr = at76c651_read_snr,
-	.read_ucblocks = at76c651_read_ucblocks,
+	.release		= at76c651_release,
+	.init			= at76c651_set_defaults,
+	.i2c_gate_ctrl		= at76c651_i2c_gate_ctrl,
+	.set_frontend		= at76c651_set_parameters,
+	.get_tune_settings	= at76c651_get_tune_settings,
+	.read_status		= at76c651_read_status,
+	.read_ber		= at76c651_read_ber,
+	.read_signal_strength	= at76c651_read_signal_strength,
+	.read_snr		= at76c651_read_snr,
+	.read_ucblocks		= at76c651_read_ucblocks,
+
+	.set_params		= at76c651_set_params,
+	.get_info		= at76c651_get_info,
+	.get_delsys		= at76c651_get_delsys,
+	.get_frontend_algo	= at76c651_get_algo,
 };
 
 module_param(debug, int, 0644);
_______________________________________________

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