1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

Initial support for Max C2T2-8

This commit is contained in:
Ralph Metzler 2015-09-17 18:54:25 +02:00
parent 5932c6c52f
commit 29dc0f9e31
3 changed files with 79 additions and 27 deletions

View File

@ -1008,6 +1008,7 @@ static int demod_attach_cxd2843(struct ddb_input *input, int par)
struct ddb_dvb *dvb = &input->port->dvb[input->nr & 1]; struct ddb_dvb *dvb = &input->port->dvb[input->nr & 1];
struct dvb_frontend *fe; struct dvb_frontend *fe;
printk("attach cxd par = %d\n", par);
if (par) if (par)
fe = dvb->fe = dvb_attach(cxd2843_attach, i2c, fe = dvb->fe = dvb_attach(cxd2843_attach, i2c,
(input->nr & 1) ? (input->nr & 1) ?
@ -1855,6 +1856,7 @@ static int dvb_input_attach(struct ddb_input *input)
struct ddb_port *port = input->port; struct ddb_port *port = input->port;
struct dvb_adapter *adap = dvb->adap; struct dvb_adapter *adap = dvb->adap;
struct dvb_demux *dvbdemux = &dvb->demux; struct dvb_demux *dvbdemux = &dvb->demux;
int par = 0;
dvb->attached = 0x01; dvb->attached = 0x01;
@ -1928,18 +1930,15 @@ static int dvb_input_attach(struct ddb_input *input)
if (tuner_attach_tda18212dd(input) < 0) if (tuner_attach_tda18212dd(input) < 0)
return -ENODEV; return -ENODEV;
break; break;
case DDB_TUNER_DVBCT2_SONY:
case DDB_TUNER_DVBC2T2_SONY:
case DDB_TUNER_ISDBT_SONY:
if (demod_attach_cxd2843(input, 0) < 0)
return -ENODEV;
if (tuner_attach_tda18212dd(input) < 0)
return -ENODEV;
break;
case DDB_TUNER_DVBCT2_SONY_P: case DDB_TUNER_DVBCT2_SONY_P:
case DDB_TUNER_DVBC2T2_SONY_P: case DDB_TUNER_DVBC2T2_SONY_P:
case DDB_TUNER_ISDBT_SONY_P: case DDB_TUNER_ISDBT_SONY_P:
if (demod_attach_cxd2843(input, 1) < 0) if (!input->port->dev->link[input->port->lnr].info->serial)
par = 1;
case DDB_TUNER_DVBCT2_SONY:
case DDB_TUNER_DVBC2T2_SONY:
case DDB_TUNER_ISDBT_SONY:
if (demod_attach_cxd2843(input, par) < 0)
return -ENODEV; return -ENODEV;
if (tuner_attach_tda18212dd(input) < 0) if (tuner_attach_tda18212dd(input) < 0)
return -ENODEV; return -ENODEV;
@ -3040,6 +3039,7 @@ static void ddb_ports_init(struct ddb *dev)
ddb_output_init(port, i, i + 8); ddb_output_init(port, i, i + 8);
break; break;
case DDB_OCTOPUS_MAX: case DDB_OCTOPUS_MAX:
case DDB_OCTOPUS_MAX_CT:
ddb_input_init(port, 2 * i, 0, 2 * i, 2 * p); ddb_input_init(port, 2 * i, 0, 2 * i, 2 * p);
ddb_input_init(port, 2 * i + 1, 1, 2 * i + 1, 2 * p + 1); ddb_input_init(port, 2 * i + 1, 1, 2 * i + 1, 2 * p + 1);
break; break;
@ -4508,6 +4508,35 @@ static struct ddb_info octopus_max_gtl = {
}; };
static struct ddb_regset octopus_maxct_gtl_i2c = {
.base = 0x80,
.num = 0x04,
.size = 0x20,
};
static struct ddb_regset octopus_maxct_gtl_i2c_buf = {
.base = 0x1000,
.num = 0x04,
.size = 0x200,
};
static struct ddb_regmap octopus_maxct_gtl_map = {
.i2c = &octopus_maxct_gtl_i2c,
.i2c_buf = &octopus_maxct_gtl_i2c_buf,
};
static struct ddb_info octopus_ct_gtl = {
.type = DDB_OCTOPUS_MAX_CT,
.name = "Digital Devices Octopus MAX CT GTL",
.regmap = &octopus_maxct_gtl_map,
.port_num = 4,
.i2c_mask = 0x0f,
.board_control = 0xff,
.board_control_2 = 0xf00,
.serial = 1,
};
static int ddb_gtl_init_link(struct ddb *dev, u32 l) static int ddb_gtl_init_link(struct ddb *dev, u32 l)
{ {
struct ddb_link *link = &dev->link[l]; struct ddb_link *link = &dev->link[l];
@ -4541,9 +4570,14 @@ static int ddb_gtl_init_link(struct ddb *dev, u32 l)
link->regs = regs; link->regs = regs;
id = ddbreadl(dev, DDB_LINK_TAG(l) | 8); id = ddbreadl(dev, DDB_LINK_TAG(l) | 8);
if (id == 0x0007dd01) switch (id) {
case 0x0007dd01:
link->info = &octopus_max_gtl; link->info = &octopus_max_gtl;
else { break;
case 0x0008dd01:
link->info = &octopus_ct_gtl;
break;
default:
pr_info("DDBridge: Detected GT link but found invalid ID %08x. " pr_info("DDBridge: Detected GT link but found invalid ID %08x. "
"You might have to update (flash) the add-on card first.", "You might have to update (flash) the add-on card first.",
id); id);
@ -4565,7 +4599,7 @@ static int ddb_gtl_init_link(struct ddb *dev, u32 l)
tasklet_init(&link->tasklet, link_tasklet, (unsigned long) link); tasklet_init(&link->tasklet, link_tasklet, (unsigned long) link);
ddbwritel(dev, 0xffffffff, DDB_LINK_TAG(l) | INTERRUPT_ACK); ddbwritel(dev, 0xffffffff, DDB_LINK_TAG(l) | INTERRUPT_ACK);
ddbwritel(dev, 1, DDB_LINK_TAG(l) | INTERRUPT_ENABLE); ddbwritel(dev, 0xf, DDB_LINK_TAG(l) | INTERRUPT_ENABLE);
return 0; return 0;
} }
@ -4595,9 +4629,9 @@ static int ddb_init_boards(struct ddb *dev)
if (info->board_control) { if (info->board_control) {
ddbwritel(dev, 0, DDB_LINK_TAG(l) | BOARD_CONTROL); ddbwritel(dev, 0, DDB_LINK_TAG(l) | BOARD_CONTROL);
msleep(100); msleep(100);
ddbwritel(dev, 4, DDB_LINK_TAG(l) | BOARD_CONTROL); ddbwritel(dev, info->board_control_2, DDB_LINK_TAG(l) | BOARD_CONTROL);
usleep_range(2000, 3000); usleep_range(2000, 3000);
ddbwritel(dev, 4 | info->board_control, ddbwritel(dev, info->board_control_2 | info->board_control,
DDB_LINK_TAG(l) | BOARD_CONTROL); DDB_LINK_TAG(l) | BOARD_CONTROL);
usleep_range(2000, 3000); usleep_range(2000, 3000);
} }

View File

@ -358,6 +358,7 @@ static struct ddb_info ddb_v7 = {
.port_num = 4, .port_num = 4,
.i2c_mask = 0x0f, .i2c_mask = 0x0f,
.board_control = 2, .board_control = 2,
.board_control_2 = 4,
}; };
static struct ddb_info ddb_ctv7 = { static struct ddb_info ddb_ctv7 = {
@ -367,6 +368,7 @@ static struct ddb_info ddb_ctv7 = {
.port_num = 4, .port_num = 4,
.i2c_mask = 0x0f, .i2c_mask = 0x0f,
.board_control = 3, .board_control = 3,
.board_control_2 = 4,
}; };
static struct ddb_info ddb_satixS2v3 = { static struct ddb_info ddb_satixS2v3 = {
@ -399,7 +401,8 @@ static struct ddb_info ddb_ci_s2_pro = {
.regmap = &octopus_map, .regmap = &octopus_map,
.port_num = 4, .port_num = 4,
.i2c_mask = 0x01, .i2c_mask = 0x01,
.board_control = 3, .board_control = 2,
.board_control_2 = 4,
}; };
static struct ddb_info ddb_dvbct = { static struct ddb_info ddb_dvbct = {
@ -421,6 +424,17 @@ static struct ddb_info ddb_s2_48 = {
.board_control = 1, .board_control = 1,
}; };
static struct ddb_info ddb_ct_8 = {
.type = DDB_OCTOPUS_MAX_CT,
.name = "Digital Devices MAX CT8",
.regmap = &octopus_map,
.port_num = 4,
.i2c_mask = 0x0f,
.board_control = 0x0ff,
.board_control_2 = 0xf00,
.serial = 1,
};
static struct ddb_info ddb_mod = { static struct ddb_info ddb_mod = {
.type = DDB_MOD, .type = DDB_MOD,
.name = "Digital Devices DVB-C modulator", .name = "Digital Devices DVB-C modulator",
@ -467,6 +481,7 @@ static const struct pci_device_id ddb_id_tbl[] __devinitconst = {
DDB_ID(DDVID, 0x0006, DDVID, 0x0032, ddb_ctv7), DDB_ID(DDVID, 0x0006, DDVID, 0x0032, ddb_ctv7),
DDB_ID(DDVID, 0x0006, DDVID, 0x0033, ddb_ctv7), DDB_ID(DDVID, 0x0006, DDVID, 0x0033, ddb_ctv7),
DDB_ID(DDVID, 0x0007, DDVID, 0x0023, ddb_s2_48), DDB_ID(DDVID, 0x0007, DDVID, 0x0023, ddb_s2_48),
DDB_ID(DDVID, 0x0008, DDVID, 0x0034, ddb_ct_8),
DDB_ID(DDVID, 0x0011, DDVID, 0x0040, ddb_ci), DDB_ID(DDVID, 0x0011, DDVID, 0x0040, ddb_ci),
DDB_ID(DDVID, 0x0011, DDVID, 0x0041, ddb_cis), DDB_ID(DDVID, 0x0011, DDVID, 0x0041, ddb_cis),
DDB_ID(DDVID, 0x0012, DDVID, 0x0042, ddb_ci), DDB_ID(DDVID, 0x0012, DDVID, 0x0042, ddb_ci),

View File

@ -147,6 +147,7 @@ struct ddb_info {
#define DDB_MOD 3 #define DDB_MOD 3
#define DDB_OCTONET 4 #define DDB_OCTONET 4
#define DDB_OCTOPUS_MAX 5 #define DDB_OCTOPUS_MAX 5
#define DDB_OCTOPUS_MAX_CT 6
char *name; char *name;
u32 i2c_mask; u32 i2c_mask;
u8 port_num; u8 port_num;
@ -154,10 +155,12 @@ struct ddb_info {
u8 fan_num; u8 fan_num;
u8 temp_num; u8 temp_num;
u8 temp_bus; u8 temp_bus;
u8 board_control; u32 board_control;
u32 board_control_2;
u8 ns_num; u8 ns_num;
u8 mdio_num; u8 mdio_num;
u8 con_clock; u8 con_clock; /* use a continuous clock */
u8 serial; /* override to serial transfer */
struct ddb_regmap *regmap; struct ddb_regmap *regmap;
}; };
@ -287,13 +290,13 @@ struct ddb_port {
#define DDB_CI_EXTERNAL_XO2 12 #define DDB_CI_EXTERNAL_XO2 12
#define DDB_CI_EXTERNAL_XO2_B 13 #define DDB_CI_EXTERNAL_XO2_B 13
#define DDB_TUNER_XO2 16 #define DDB_TUNER_XO2 32
#define DDB_TUNER_DVBS_STV0910 16 #define DDB_TUNER_DVBS_STV0910 (DDB_TUNER_XO2 + 0)
#define DDB_TUNER_DVBCT2_SONY 17 #define DDB_TUNER_DVBCT2_SONY (DDB_TUNER_XO2 + 1)
#define DDB_TUNER_ISDBT_SONY 18 #define DDB_TUNER_ISDBT_SONY (DDB_TUNER_XO2 + 2)
#define DDB_TUNER_DVBC2T2_SONY 19 #define DDB_TUNER_DVBC2T2_SONY (DDB_TUNER_XO2 + 3)
#define DDB_TUNER_ATSC_ST 20 #define DDB_TUNER_ATSC_ST (DDB_TUNER_XO2 + 4)
#define DDB_TUNER_DVBC2T2_ST 21 #define DDB_TUNER_DVBC2T2_ST (DDB_TUNER_XO2 + 5)
struct ddb_input *input[2]; struct ddb_input *input[2];
struct ddb_output *output; struct ddb_output *output;