diff -Naurp v4l-dvb/linux/drivers/media/dvb/ttusb-dec/ttusbdecfe.c mp-bc1/linux/drivers/media/dvb/ttusb-dec/ttusbdecfe.c --- v4l-dvb/linux/drivers/media/dvb/ttusb-dec/ttusbdecfe.c 2006-06-30 19:59:11.000000000 +0400 +++ mp-bc1/linux/drivers/media/dvb/ttusb-dec/ttusbdecfe.c 2006-07-23 11:46:35.000000000 +0400 @@ -93,6 +93,24 @@ static int ttusbdecfe_dvbt_set_frontend( return 0; } +static int ttusbdecfe_dvbt_set_params(struct dvb_frontend* fe, + struct dvbfe_params *p) +{ + struct ttusbdecfe_state* state = fe->demodulator_priv; + u8 b[] = { 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xff + }; + + u32 freq = htonl(p->frequency / 1000); + memcpy(&b[4], &freq, sizeof (u32)); + state->config->send_command(fe, 0x71, sizeof (b), b, NULL, NULL); + + return 0; +} + static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) { @@ -137,6 +155,43 @@ static int ttusbdecfe_dvbs_set_frontend( return 0; } +static int ttusbdecfe_dvbs_set_params(struct dvb_frontend* fe, + struct dvbfe_params *p) +{ + struct ttusbdecfe_state* state = fe->demodulator_priv; + + u8 b[] = { 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 + }; + + u32 freq; + u32 sym_rate; + u32 band; + u32 lnb_voltage; + + freq = htonl(p->frequency + + (state->hi_band ? LOF_HI : LOF_LO)); + memcpy(&b[4], &freq, sizeof (u32)); + sym_rate = htonl(p->delsys.dvbc.symbol_rate); + memcpy(&b[12], &sym_rate, sizeof(u32)); + band = htonl(state->hi_band ? LOF_HI : LOF_LO); + memcpy(&b[24], &band, sizeof(u32)); + lnb_voltage = htonl(state->voltage); + memcpy(&b[28], &lnb_voltage, sizeof(u32)); + + state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL); + + return 0; +} + static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd) { struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv; @@ -230,6 +285,35 @@ struct dvb_frontend* ttusbdecfe_dvbs_att return &state->frontend; } +static struct dvbfe_info dvbt_info = { + .name = "Technotrend/Hauppauge DEC2000-T", + .delivery = DVBFE_DELSYS_DVBT, + .delsys = { + .dvbt.modulation = DVBFE_MOD_OFDM, + .dvbt.stream_priority = DVBFE_STREAM_PRIORITY_HP, + }, + + .frequency_min = 51000000, + .frequency_max = 858000000, + .frequency_step = 62500, +}; + +static int ttusbdecfe_dvbt_get_info(struct dvb_frontend *fe, + struct dvbfe_info *fe_info) +{ + memcpy(fe_info, &dvbt_info, sizeof (dvbt_info)); + + return 0; +} + +static int ttusbdecfe_dvbt_get_delsys(struct dvb_frontend *fe, + enum dvbfe_delsys *fe_delsys) +{ + *fe_delsys = DVBFE_DELSYS_DVBT; + + return 0; +} + static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = { .info = { @@ -252,8 +336,45 @@ static struct dvb_frontend_ops ttusbdecf .get_tune_settings = ttusbdecfe_dvbt_get_tune_settings, .read_status = ttusbdecfe_read_status, + + .set_params = ttusbdecfe_dvbt_set_params, + .get_info = ttusbdecfe_dvbt_get_info, + .get_delsys = ttusbdecfe_dvbt_get_delsys, +}; + +static struct dvbfe_info dvbs_info = { + .name = "TechnoTrend/Hauppauge DEC300-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_step = 125, + .symbol_rate_min = 1000000, + .symbol_rate_max = 45000000, }; +static int ttusbdecfe_dvbs_get_info(struct dvb_frontend *fe, + struct dvbfe_info *fe_info) +{ + memcpy(fe_info, &dvbs_info, sizeof (dvbs_info)); + + return 0; +} + +static int ttusbdecfe_dvbs_get_delsys(struct dvb_frontend *fe, + enum dvbfe_delsys *fe_delsys) +{ + *fe_delsys = DVBFE_DELSYS_DVBS; + + return 0; +} + static struct dvb_frontend_ops ttusbdecfe_dvbs_ops = { .info = { @@ -278,6 +399,10 @@ static struct dvb_frontend_ops ttusbdecf .diseqc_send_master_cmd = ttusbdecfe_dvbs_diseqc_send_master_cmd, .set_voltage = ttusbdecfe_dvbs_set_voltage, .set_tone = ttusbdecfe_dvbs_set_tone, + + .set_params = ttusbdecfe_dvbs_set_params, + .get_info = ttusbdecfe_dvbs_get_info, + .get_delsys = ttusbdecfe_dvbs_get_delsys, }; MODULE_DESCRIPTION("TTUSB DEC DVB-T/S Demodulator driver");
_______________________________________________ linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb