mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2023-10-10 13:37:43 +02:00
Merge branch 'internal'
This commit is contained in:
commit
c914fc9b13
@ -267,7 +267,11 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case 0x0220:
|
case 0x0220:
|
||||||
fname="SDRModulatorV1A_DD01_0220.fpga";
|
fname="SDRModulatorV1A_DD01_0220.fpga";
|
||||||
printf("SDRModulator\n");
|
printf("SDRModulator ATV\n");
|
||||||
|
break;
|
||||||
|
case 0x0221:
|
||||||
|
fname="SDRModulatorV1A_DD01_0221_IQ.fpga";
|
||||||
|
printf("SDRModulator IQ\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("UNKNOWN\n");
|
printf("UNKNOWN\n");
|
||||||
|
@ -517,10 +517,20 @@ static const struct ddb_info ddb_mod_fsm_4 = {
|
|||||||
.lostlock_irq = 9,
|
.lostlock_irq = 9,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ddb_info ddb_sdr = {
|
static const struct ddb_info ddb_sdr_atv = {
|
||||||
.type = DDB_MOD,
|
.type = DDB_MOD,
|
||||||
.name = "Digital Devices SDR",
|
.name = "Digital Devices SDR ATV",
|
||||||
.version = 3,
|
.version = 16,
|
||||||
|
.regmap = &octopus_sdr_map,
|
||||||
|
.port_num = 16,
|
||||||
|
.temp_num = 1,
|
||||||
|
.tempmon_irq = 8,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct ddb_info ddb_sdr_iq = {
|
||||||
|
.type = DDB_MOD,
|
||||||
|
.name = "Digital Devices SDR IQ",
|
||||||
|
.version = 17,
|
||||||
.regmap = &octopus_sdr_map,
|
.regmap = &octopus_sdr_map,
|
||||||
.port_num = 16,
|
.port_num = 16,
|
||||||
.temp_num = 1,
|
.temp_num = 1,
|
||||||
@ -777,7 +787,8 @@ static const struct ddb_device_id ddb_device_ids[] = {
|
|||||||
DDB_DEVID(0x0210, 0x0001, ddb_mod_fsm_24),
|
DDB_DEVID(0x0210, 0x0001, ddb_mod_fsm_24),
|
||||||
DDB_DEVID(0x0210, 0x0002, ddb_mod_fsm_16),
|
DDB_DEVID(0x0210, 0x0002, ddb_mod_fsm_16),
|
||||||
DDB_DEVID(0x0210, 0x0003, ddb_mod_fsm_8),
|
DDB_DEVID(0x0210, 0x0003, ddb_mod_fsm_8),
|
||||||
DDB_DEVID(0x0220, 0x0001, ddb_sdr),
|
DDB_DEVID(0x0220, 0x0001, ddb_sdr_atv),
|
||||||
|
DDB_DEVID(0x0221, 0x0001, ddb_sdr_iq),
|
||||||
|
|
||||||
/* testing on OctopusNet Pro */
|
/* testing on OctopusNet Pro */
|
||||||
DDB_DEVID(0x0320, 0xffff, ddb_octopro_hdin),
|
DDB_DEVID(0x0320, 0xffff, ddb_octopro_hdin),
|
||||||
|
@ -46,7 +46,6 @@ static int stop(struct dvb_frontend *fe)
|
|||||||
{
|
{
|
||||||
struct m4 *state = fe->demodulator_priv;
|
struct m4 *state = fe->demodulator_priv;
|
||||||
struct mci_command cmd;
|
struct mci_command cmd;
|
||||||
struct mci_base *mci_base = state->mci.base;
|
|
||||||
|
|
||||||
if (!state->started)
|
if (!state->started)
|
||||||
return -1;
|
return -1;
|
||||||
@ -62,8 +61,6 @@ static int stop(struct dvb_frontend *fe)
|
|||||||
static int search_s2(struct dvb_frontend *fe)
|
static int search_s2(struct dvb_frontend *fe)
|
||||||
{
|
{
|
||||||
struct m4 *state = fe->demodulator_priv;
|
struct m4 *state = fe->demodulator_priv;
|
||||||
struct mci_base *mci_base = state->mci.base;
|
|
||||||
struct m4_base *m4_base = (struct m4_base *) mci_base;
|
|
||||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
struct mci_command cmd;
|
struct mci_command cmd;
|
||||||
int stat;
|
int stat;
|
||||||
@ -72,10 +69,11 @@ static int search_s2(struct dvb_frontend *fe)
|
|||||||
cmd.command = MCI_CMD_SEARCH_DVBS;
|
cmd.command = MCI_CMD_SEARCH_DVBS;
|
||||||
cmd.dvbs2_search.flags = 3;
|
cmd.dvbs2_search.flags = 3;
|
||||||
cmd.dvbs2_search.s2_modulation_mask = 3;
|
cmd.dvbs2_search.s2_modulation_mask = 3;
|
||||||
cmd.dvbs2_search.retry = 2;
|
cmd.dvbs2_search.retry = 0;
|
||||||
cmd.dvbs2_search.frequency = p->frequency * 1000;
|
cmd.dvbs2_search.frequency = p->frequency * 1000;
|
||||||
cmd.dvbs2_search.symbol_rate = p->symbol_rate;
|
cmd.dvbs2_search.symbol_rate = p->symbol_rate;
|
||||||
cmd.dvbs2_search.scrambling_sequence_index = 0; //p->scrambling_sequence_index;
|
cmd.dvbs2_search.scrambling_sequence_index = 0; //p->scrambling_sequence_index;
|
||||||
|
if (p->stream_id != NO_STREAM_ID_FILTER)
|
||||||
cmd.dvbs2_search.input_stream_id = p->stream_id;
|
cmd.dvbs2_search.input_stream_id = p->stream_id;
|
||||||
cmd.tuner = state->mci.nr;
|
cmd.tuner = state->mci.nr;
|
||||||
cmd.demod = state->mci.tuner;
|
cmd.demod = state->mci.tuner;
|
||||||
@ -90,8 +88,6 @@ static int search_s2(struct dvb_frontend *fe)
|
|||||||
static int search_c(struct dvb_frontend *fe)
|
static int search_c(struct dvb_frontend *fe)
|
||||||
{
|
{
|
||||||
struct m4 *state = fe->demodulator_priv;
|
struct m4 *state = fe->demodulator_priv;
|
||||||
struct mci_base *mci_base = state->mci.base;
|
|
||||||
struct m4_base *m4_base = (struct m4_base *) mci_base;
|
|
||||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
struct mci_command cmd;
|
struct mci_command cmd;
|
||||||
int stat;
|
int stat;
|
||||||
@ -109,7 +105,7 @@ static int search_c(struct dvb_frontend *fe)
|
|||||||
cmd.dvbc_search.bandwidth = MCI_BANDWIDTH_8MHZ;
|
cmd.dvbc_search.bandwidth = MCI_BANDWIDTH_8MHZ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cmd.dvbc_search.retry = 2;
|
cmd.dvbc_search.retry = 0;
|
||||||
cmd.dvbc_search.frequency = p->frequency;
|
cmd.dvbc_search.frequency = p->frequency;
|
||||||
cmd.tuner = state->mci.tuner;
|
cmd.tuner = state->mci.tuner;
|
||||||
cmd.demod = state->mci.demod;
|
cmd.demod = state->mci.demod;
|
||||||
@ -124,8 +120,6 @@ static int search_c(struct dvb_frontend *fe)
|
|||||||
static int search_t(struct dvb_frontend *fe)
|
static int search_t(struct dvb_frontend *fe)
|
||||||
{
|
{
|
||||||
struct m4 *state = fe->demodulator_priv;
|
struct m4 *state = fe->demodulator_priv;
|
||||||
struct mci_base *mci_base = state->mci.base;
|
|
||||||
struct m4_base *m4_base = (struct m4_base *) mci_base;
|
|
||||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
struct mci_command cmd;
|
struct mci_command cmd;
|
||||||
int stat;
|
int stat;
|
||||||
@ -146,7 +140,7 @@ static int search_t(struct dvb_frontend *fe)
|
|||||||
cmd.dvbt_search.bandwidth = MCI_BANDWIDTH_8MHZ;
|
cmd.dvbt_search.bandwidth = MCI_BANDWIDTH_8MHZ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cmd.dvbt_search.retry = 2;
|
cmd.dvbt_search.retry = 0;
|
||||||
cmd.dvbt_search.frequency = p->frequency;
|
cmd.dvbt_search.frequency = p->frequency;
|
||||||
cmd.tuner = state->mci.tuner;
|
cmd.tuner = state->mci.tuner;
|
||||||
cmd.demod = state->mci.demod;
|
cmd.demod = state->mci.demod;
|
||||||
@ -158,15 +152,85 @@ static int search_t(struct dvb_frontend *fe)
|
|||||||
return stat;
|
return stat;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int search_t2(struct dvb_frontend *fe)
|
static int search_isdbs(struct dvb_frontend *fe)
|
||||||
|
{
|
||||||
|
struct m4 *state = fe->demodulator_priv;
|
||||||
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
|
struct mci_command cmd;
|
||||||
|
int stat;
|
||||||
|
|
||||||
|
memset(&cmd, 0, sizeof(cmd));
|
||||||
|
cmd.command = MCI_CMD_SEARCH_ISDBS;
|
||||||
|
cmd.isdbs_search.retry = 0;
|
||||||
|
if (p->stream_id != NO_STREAM_ID_FILTER) {
|
||||||
|
cmd.isdbs_search.flags = (p->stream_id & 0xffff0000) ? 0 : 1;
|
||||||
|
cmd.isdbs_search.tsid = p->stream_id;
|
||||||
|
}
|
||||||
|
cmd.isdbs_search.frequency = p->frequency * 1000;
|
||||||
|
cmd.tuner = state->mci.nr;
|
||||||
|
cmd.demod = state->mci.tuner;
|
||||||
|
cmd.output = state->mci.nr;
|
||||||
|
|
||||||
|
stat = ddb_mci_cmd(&state->mci, &cmd, NULL);
|
||||||
|
if (stat)
|
||||||
|
stop(fe);
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int search_isdbc(struct dvb_frontend *fe)
|
||||||
|
{
|
||||||
|
struct m4 *state = fe->demodulator_priv;
|
||||||
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
|
struct mci_command cmd;
|
||||||
|
int stat;
|
||||||
|
|
||||||
|
memset(&cmd, 0, sizeof(cmd));
|
||||||
|
cmd.command = MCI_CMD_SEARCH_ISDBC;
|
||||||
|
cmd.isdbc_search.retry = 0;
|
||||||
|
if (p->stream_id != NO_STREAM_ID_FILTER) {
|
||||||
|
cmd.isdbc_search.flags = (p->stream_id & 0xffff0000) ? 0 : 1;
|
||||||
|
cmd.isdbc_search.tsid = p->stream_id;
|
||||||
|
cmd.isdbc_search.onid = (p->stream_id & 0x10000) >> 16;
|
||||||
|
}
|
||||||
|
cmd.isdbc_search.bandwidth = MCI_BANDWIDTH_6MHZ;
|
||||||
|
cmd.isdbc_search.frequency = p->frequency;
|
||||||
|
cmd.demod = state->mci.tuner;
|
||||||
|
cmd.output = state->mci.nr;
|
||||||
|
|
||||||
|
stat = ddb_mci_cmd(&state->mci, &cmd, NULL);
|
||||||
|
if (stat)
|
||||||
|
stop(fe);
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int search_j83b(struct dvb_frontend *fe)
|
||||||
|
{
|
||||||
|
struct m4 *state = fe->demodulator_priv;
|
||||||
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
|
struct mci_command cmd;
|
||||||
|
int stat;
|
||||||
|
|
||||||
|
memset(&cmd, 0, sizeof(cmd));
|
||||||
|
cmd.command = MCI_CMD_SEARCH_J83B;
|
||||||
|
cmd.j83b_search.flags = 0;
|
||||||
|
cmd.j83b_search.retry = 0;
|
||||||
|
cmd.j83b_search.bandwidth = MCI_BANDWIDTH_6MHZ;
|
||||||
|
cmd.j83b_search.frequency = p->frequency;
|
||||||
|
cmd.demod = state->mci.tuner;
|
||||||
|
cmd.output = state->mci.nr;
|
||||||
|
|
||||||
|
stat = ddb_mci_cmd(&state->mci, &cmd, NULL);
|
||||||
|
if (stat)
|
||||||
|
stop(fe);
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int search_t2(struct dvb_frontend *fe)
|
||||||
{
|
{
|
||||||
struct m4 *state = fe->demodulator_priv;
|
struct m4 *state = fe->demodulator_priv;
|
||||||
struct mci_base *mci_base = state->mci.base;
|
|
||||||
struct m4_base *m4_base = (struct m4_base *) mci_base;
|
|
||||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
struct mci_command cmd;
|
struct mci_command cmd;
|
||||||
int stat;
|
int stat;
|
||||||
u32 flags = 0;
|
|
||||||
|
|
||||||
memset(&cmd, 0, sizeof(cmd));
|
memset(&cmd, 0, sizeof(cmd));
|
||||||
cmd.command = MCI_CMD_SEARCH_DVBT2;
|
cmd.command = MCI_CMD_SEARCH_DVBT2;
|
||||||
@ -187,7 +251,7 @@ static int search_t2(struct dvb_frontend *fe)
|
|||||||
cmd.dvbt_search.bandwidth = MCI_BANDWIDTH_8MHZ;
|
cmd.dvbt_search.bandwidth = MCI_BANDWIDTH_8MHZ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cmd.dvbt2_search.retry = 2;
|
cmd.dvbt2_search.retry = 0;
|
||||||
cmd.dvbt2_search.frequency = p->frequency;
|
cmd.dvbt2_search.frequency = p->frequency;
|
||||||
if (p->stream_id != NO_STREAM_ID_FILTER) {
|
if (p->stream_id != NO_STREAM_ID_FILTER) {
|
||||||
cmd.dvbt2_search.plp = p->stream_id & 0xff;
|
cmd.dvbt2_search.plp = p->stream_id & 0xff;
|
||||||
@ -207,12 +271,9 @@ static int search_t2(struct dvb_frontend *fe)
|
|||||||
static int search_c2(struct dvb_frontend *fe)
|
static int search_c2(struct dvb_frontend *fe)
|
||||||
{
|
{
|
||||||
struct m4 *state = fe->demodulator_priv;
|
struct m4 *state = fe->demodulator_priv;
|
||||||
struct mci_base *mci_base = state->mci.base;
|
|
||||||
struct m4_base *m4_base = (struct m4_base *) mci_base;
|
|
||||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
struct mci_command cmd;
|
struct mci_command cmd;
|
||||||
int stat;
|
int stat;
|
||||||
u32 flags = 0;
|
|
||||||
|
|
||||||
memset(&cmd, 0, sizeof(cmd));
|
memset(&cmd, 0, sizeof(cmd));
|
||||||
cmd.command = MCI_CMD_SEARCH_DVBC2;
|
cmd.command = MCI_CMD_SEARCH_DVBC2;
|
||||||
@ -224,7 +285,7 @@ static int search_c2(struct dvb_frontend *fe)
|
|||||||
cmd.dvbc2_search.bandwidth = MCI_BANDWIDTH_8MHZ;
|
cmd.dvbc2_search.bandwidth = MCI_BANDWIDTH_8MHZ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cmd.dvbc2_search.retry = 2;
|
cmd.dvbc2_search.retry = 0;
|
||||||
cmd.dvbc2_search.frequency = p->frequency;
|
cmd.dvbc2_search.frequency = p->frequency;
|
||||||
if (p->stream_id != NO_STREAM_ID_FILTER) {
|
if (p->stream_id != NO_STREAM_ID_FILTER) {
|
||||||
cmd.dvbc2_search.plp = p->stream_id & 0xff;
|
cmd.dvbc2_search.plp = p->stream_id & 0xff;
|
||||||
@ -243,12 +304,9 @@ static int search_c2(struct dvb_frontend *fe)
|
|||||||
static int search_isdbt(struct dvb_frontend *fe)
|
static int search_isdbt(struct dvb_frontend *fe)
|
||||||
{
|
{
|
||||||
struct m4 *state = fe->demodulator_priv;
|
struct m4 *state = fe->demodulator_priv;
|
||||||
struct mci_base *mci_base = state->mci.base;
|
|
||||||
struct m4_base *m4_base = (struct m4_base *) mci_base;
|
|
||||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
struct mci_command cmd;
|
struct mci_command cmd;
|
||||||
int stat;
|
int stat;
|
||||||
u32 flags = 0;
|
|
||||||
|
|
||||||
memset(&cmd, 0, sizeof(cmd));
|
memset(&cmd, 0, sizeof(cmd));
|
||||||
cmd.command = MCI_CMD_SEARCH_ISDBT;
|
cmd.command = MCI_CMD_SEARCH_ISDBT;
|
||||||
@ -263,7 +321,7 @@ static int search_isdbt(struct dvb_frontend *fe)
|
|||||||
cmd.isdbt_search.bandwidth = MCI_BANDWIDTH_6MHZ;
|
cmd.isdbt_search.bandwidth = MCI_BANDWIDTH_6MHZ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cmd.isdbt_search.retry = 2;
|
cmd.isdbt_search.retry = 0;
|
||||||
cmd.isdbt_search.frequency = p->frequency;
|
cmd.isdbt_search.frequency = p->frequency;
|
||||||
cmd.tuner = state->mci.tuner;
|
cmd.tuner = state->mci.tuner;
|
||||||
cmd.demod = state->mci.demod;
|
cmd.demod = state->mci.demod;
|
||||||
@ -296,6 +354,9 @@ static int set_parameters(struct dvb_frontend *fe)
|
|||||||
case SYS_DVBC_ANNEX_A:
|
case SYS_DVBC_ANNEX_A:
|
||||||
res = search_c(fe);
|
res = search_c(fe);
|
||||||
break;
|
break;
|
||||||
|
case SYS_DVBC_ANNEX_B:
|
||||||
|
res = search_j83b(fe);
|
||||||
|
break;
|
||||||
case SYS_DVBT:
|
case SYS_DVBT:
|
||||||
state->iq_constellation_tap = 5;
|
state->iq_constellation_tap = 5;
|
||||||
res = search_t(fe);
|
res = search_t(fe);
|
||||||
@ -309,6 +370,13 @@ static int set_parameters(struct dvb_frontend *fe)
|
|||||||
case SYS_ISDBT:
|
case SYS_ISDBT:
|
||||||
res = search_isdbt(fe);
|
res = search_isdbt(fe);
|
||||||
break;
|
break;
|
||||||
|
case SYS_ISDBS:
|
||||||
|
res = search_isdbs(fe);
|
||||||
|
break;
|
||||||
|
case SYS_DVBC_ANNEX_C:
|
||||||
|
case SYS_ISDBC:
|
||||||
|
res = search_isdbc(fe);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -329,7 +397,9 @@ static int read_status(struct dvb_frontend *fe, enum fe_status *status)
|
|||||||
if (stat)
|
if (stat)
|
||||||
return stat;
|
return stat;
|
||||||
*status = 0x00;
|
*status = 0x00;
|
||||||
ddb_mci_get_info(&state->mci);
|
stat = ddb_mci_get_info(&state->mci);
|
||||||
|
if (stat)
|
||||||
|
return stat;
|
||||||
ddb_mci_get_strength(fe);
|
ddb_mci_get_strength(fe);
|
||||||
if (res.status == MCI_DEMOD_WAIT_SIGNAL)
|
if (res.status == MCI_DEMOD_WAIT_SIGNAL)
|
||||||
*status = 0x01;
|
*status = 0x01;
|
||||||
@ -397,8 +467,10 @@ static int get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct dvb_frontend_ops m4_ops = {
|
static struct dvb_frontend_ops m4_ops = {
|
||||||
.delsys = { SYS_DVBC_ANNEX_A, SYS_DVBT, SYS_DVBT2, SYS_DVBC2, SYS_ISDBT,
|
.delsys = { SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_B, SYS_DVBC_ANNEX_C,
|
||||||
SYS_DVBS, SYS_DVBS2, },
|
SYS_ISDBC, SYS_DVBC2,
|
||||||
|
SYS_DVBT, SYS_DVBT2, SYS_ISDBT,
|
||||||
|
SYS_DVBS, SYS_DVBS2, SYS_ISDBS, },
|
||||||
.info = {
|
.info = {
|
||||||
.name = "M4",
|
.name = "M4",
|
||||||
.frequency_min = 950000, /* DVB-T: 47125000 */
|
.frequency_min = 950000, /* DVB-T: 47125000 */
|
||||||
|
@ -424,6 +424,7 @@ static const struct pci_device_id ddb_id_table[] __devinitconst = {
|
|||||||
DDB_DEVICE_ANY(0x0203),
|
DDB_DEVICE_ANY(0x0203),
|
||||||
DDB_DEVICE_ANY(0x0210),
|
DDB_DEVICE_ANY(0x0210),
|
||||||
DDB_DEVICE_ANY(0x0220),
|
DDB_DEVICE_ANY(0x0220),
|
||||||
|
DDB_DEVICE_ANY(0x0221),
|
||||||
DDB_DEVICE_ANY(0x0320),
|
DDB_DEVICE_ANY(0x0320),
|
||||||
DDB_DEVICE_ANY(0x0321),
|
DDB_DEVICE_ANY(0x0321),
|
||||||
DDB_DEVICE_ANY(0x0322),
|
DDB_DEVICE_ANY(0x0322),
|
||||||
|
@ -285,7 +285,7 @@ struct mci_command {
|
|||||||
u8 rsvd1;
|
u8 rsvd1;
|
||||||
u8 retry;
|
u8 retry;
|
||||||
u32 frequency;
|
u32 frequency;
|
||||||
} j83b_Search;
|
} j83b_search;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
u8 tap;
|
u8 tap;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ddbridge-modulator.c: Digital Devices modulator cards
|
* ddbridge-modulator.c: Digital Devices modulator cards
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010-2017 Digital Devices GmbH
|
* Copyright (C) 2010-2018 Digital Devices GmbH
|
||||||
* Marcus Metzler <mocm@metzlerbros.de>
|
* Marcus Metzler <mocm@metzlerbros.de>
|
||||||
* Ralph Metzler <rjkm@metzlerbros.de>
|
* Ralph Metzler <rjkm@metzlerbros.de>
|
||||||
*
|
*
|
||||||
@ -292,7 +292,7 @@ int ddbridge_mod_output_start(struct ddb_output *output)
|
|||||||
struct ddb_mod *mod = &dev->mod[output->nr];
|
struct ddb_mod *mod = &dev->mod[output->nr];
|
||||||
u32 Symbolrate = mod->symbolrate;
|
u32 Symbolrate = mod->symbolrate;
|
||||||
|
|
||||||
if (dev->link[0].info->version < 3)
|
if (dev->link[0].info->version < 16)
|
||||||
mod_calc_rateinc(mod);
|
mod_calc_rateinc(mod);
|
||||||
|
|
||||||
mod->LastInPacketCount = 0;
|
mod->LastInPacketCount = 0;
|
||||||
@ -311,7 +311,7 @@ int ddbridge_mod_output_start(struct ddb_output *output)
|
|||||||
mod->State = CM_STARTUP;
|
mod->State = CM_STARTUP;
|
||||||
mod->StateCounter = CM_STARTUP_DELAY;
|
mod->StateCounter = CM_STARTUP_DELAY;
|
||||||
|
|
||||||
if (dev->link[0].info->version == 3)
|
if (dev->link[0].info->version >= 16)
|
||||||
mod->Control = 0xfffffff0 &
|
mod->Control = 0xfffffff0 &
|
||||||
ddbreadl(dev, CHANNEL_CONTROL(output->nr));
|
ddbreadl(dev, CHANNEL_CONTROL(output->nr));
|
||||||
else
|
else
|
||||||
@ -363,11 +363,11 @@ int ddbridge_mod_output_start(struct ddb_output *output)
|
|||||||
CHANNEL_SETTINGS(output->nr));
|
CHANNEL_SETTINGS(output->nr));
|
||||||
mod->Control |= (CHANNEL_CONTROL_ENABLE_IQ |
|
mod->Control |= (CHANNEL_CONTROL_ENABLE_IQ |
|
||||||
CHANNEL_CONTROL_ENABLE_DVB);
|
CHANNEL_CONTROL_ENABLE_DVB);
|
||||||
} else if (dev->link[0].info->version == 3) {
|
} else if (dev->link[0].info->version >= 16) {
|
||||||
mod->Control |= (CHANNEL_CONTROL_ENABLE_IQ |
|
mod->Control |= (CHANNEL_CONTROL_ENABLE_IQ |
|
||||||
CHANNEL_CONTROL_ENABLE_DVB);
|
CHANNEL_CONTROL_ENABLE_DVB);
|
||||||
}
|
}
|
||||||
if (dev->link[0].info->version < 3) {
|
if (dev->link[0].info->version < 16) {
|
||||||
mod_set_rateinc(dev, output->nr);
|
mod_set_rateinc(dev, output->nr);
|
||||||
mod_set_incs(output);
|
mod_set_incs(output);
|
||||||
}
|
}
|
||||||
@ -1499,7 +1499,7 @@ static int mod3_prop_proc(struct ddb_mod *mod, struct dtv_property *tvp)
|
|||||||
|
|
||||||
static int mod_prop_proc(struct ddb_mod *mod, struct dtv_property *tvp)
|
static int mod_prop_proc(struct ddb_mod *mod, struct dtv_property *tvp)
|
||||||
{
|
{
|
||||||
if (mod->port->dev->link[0].info->version == 3)
|
if (mod->port->dev->link[0].info->version >= 16)
|
||||||
return mod3_prop_proc(mod, tvp);
|
return mod3_prop_proc(mod, tvp);
|
||||||
switch (tvp->cmd) {
|
switch (tvp->cmd) {
|
||||||
case MODULATOR_SYMBOL_RATE:
|
case MODULATOR_SYMBOL_RATE:
|
||||||
@ -1592,7 +1592,7 @@ int ddbridge_mod_do_ioctl(struct file *file, unsigned int cmd, void *parg)
|
|||||||
(struct dtv_properties __user *) parg;
|
(struct dtv_properties __user *) parg;
|
||||||
int i, ret = 0;
|
int i, ret = 0;
|
||||||
|
|
||||||
if (dev->link[0].info->version == 3 && cmd != FE_SET_PROPERTY)
|
if (dev->link[0].info->version >= 16 && cmd != FE_SET_PROPERTY)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
mutex_lock(&dev->ioctl_mutex);
|
mutex_lock(&dev->ioctl_mutex);
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
@ -1852,6 +1852,36 @@ static int mod_init_3(struct ddb *dev, u32 Frequency)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int mod_init_sdr_iq(struct ddb *dev)
|
||||||
|
{
|
||||||
|
int streams = dev->link[0].info->port_num;
|
||||||
|
int i, ret = 0;
|
||||||
|
|
||||||
|
ret = mod_setup_max2871(dev, max2871_sdr);
|
||||||
|
if (ret)
|
||||||
|
dev_err(dev->dev, "PLL setup failed\n");
|
||||||
|
ret = rfdac_init(dev);
|
||||||
|
if (ret)
|
||||||
|
ret = rfdac_init(dev);
|
||||||
|
if (ret)
|
||||||
|
dev_err(dev->dev, "RFDAC setup failed\n");
|
||||||
|
|
||||||
|
ddbwritel(dev, 0x01, 0x240);
|
||||||
|
|
||||||
|
//mod3_set_base_frequency(dev, 602000000);
|
||||||
|
for (i = 0; i < streams; i++) {
|
||||||
|
struct ddb_mod *mod = &dev->mod[i];
|
||||||
|
|
||||||
|
ddbwritel(dev, 0x00, SDR_CHANNEL_CONTROL(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
mod_set_attenuator(dev, 0);
|
||||||
|
udelay(10);
|
||||||
|
mod_set_vga(dev, 120);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int ddbridge_mod_init(struct ddb *dev)
|
int ddbridge_mod_init(struct ddb *dev)
|
||||||
{
|
{
|
||||||
switch (dev->link[0].info->version) {
|
switch (dev->link[0].info->version) {
|
||||||
@ -1860,8 +1890,10 @@ int ddbridge_mod_init(struct ddb *dev)
|
|||||||
return mod_init_1(dev, 722000000);
|
return mod_init_1(dev, 722000000);
|
||||||
case 2:
|
case 2:
|
||||||
return mod_init_2(dev, 114000000);
|
return mod_init_2(dev, 114000000);
|
||||||
case 3:
|
case 16:
|
||||||
return mod_init_3(dev, 503250000);
|
return mod_init_3(dev, 503250000);
|
||||||
|
case 17:
|
||||||
|
return mod_init_sdr_iq(dev);
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,6 @@ static int start(struct dvb_frontend *fe, u32 flags, u32 modmask, u32 ts_config)
|
|||||||
if (sx8_base->demod_in_use[i])
|
if (sx8_base->demod_in_use[i])
|
||||||
used_demods++;
|
used_demods++;
|
||||||
}
|
}
|
||||||
printk("used_ldpc_bitrate = %u\n", used_ldpc_bitrate);
|
|
||||||
if ((used_ldpc_bitrate >= MAX_LDPC_BITRATE) ||
|
if ((used_ldpc_bitrate >= MAX_LDPC_BITRATE) ||
|
||||||
((ts_config & SX8_TSCONFIG_MODE_MASK) >
|
((ts_config & SX8_TSCONFIG_MODE_MASK) >
|
||||||
SX8_TSCONFIG_MODE_NORMAL && used_demods > 0)) {
|
SX8_TSCONFIG_MODE_NORMAL && used_demods > 0)) {
|
||||||
@ -443,14 +442,12 @@ static int set_input(struct dvb_frontend *fe, int input)
|
|||||||
struct sx8 *state = fe->demodulator_priv;
|
struct sx8 *state = fe->demodulator_priv;
|
||||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
|
|
||||||
printk("fe %u, set input = %u\n", state->mci.nr, input);
|
|
||||||
if (input >= SX8_TUNER_NUM)
|
if (input >= SX8_TUNER_NUM)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (state->mci.tuner == input)
|
if (state->mci.tuner == input)
|
||||||
return 0;
|
return 0;
|
||||||
stop(fe);
|
stop(fe);
|
||||||
state->mci.tuner = p->input = input;
|
state->mci.tuner = p->input = input;
|
||||||
printk("fe %u, input = %u\n", state->mci.nr, input);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
* Maximum number of Delivery systems per frontend. It
|
* Maximum number of Delivery systems per frontend. It
|
||||||
* should be smaller or equal to 32
|
* should be smaller or equal to 32
|
||||||
*/
|
*/
|
||||||
#define MAX_DELSYS 8
|
#define MAX_DELSYS 16
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct dvb_frontend_tune_settings - parameters to adjust frontend tuning
|
* struct dvb_frontend_tune_settings - parameters to adjust frontend tuning
|
||||||
|
@ -114,7 +114,7 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dd = dddvb_init(config, 0xffff);
|
dd = dddvb_init(config, 0);//0xffff);
|
||||||
if (!dd) {
|
if (!dd) {
|
||||||
printf("dddvb_init failed\n");
|
printf("dddvb_init failed\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user