support for 24MHz crystals

This commit is contained in:
Ralph Metzler
2016-11-07 21:19:53 +01:00
parent 101289c77e
commit b6d5976e14
4 changed files with 341 additions and 136 deletions

View File

@@ -1341,42 +1341,21 @@ static int demod_attach_drxk(struct ddb_input *input)
}
#endif
struct cxd2843_cfg cxd2843_0 = {
.adr = 0x6c,
.ts_clock = 1,
};
struct cxd2843_cfg cxd2843_1 = {
.adr = 0x6d,
.ts_clock = 1,
};
struct cxd2843_cfg cxd2843p_0 = {
.adr = 0x6c,
.parallel = 1,
};
struct cxd2843_cfg cxd2843p_1 = {
.adr = 0x6d,
.parallel = 1,
};
static int demod_attach_cxd2843(struct ddb_input *input, int par)
static int demod_attach_cxd2843(struct ddb_input *input, int par, int osc24)
{
struct i2c_adapter *i2c = &input->port->i2c->adap;
struct ddb_dvb *dvb = &input->port->dvb[input->nr & 1];
struct dvb_frontend *fe;
struct cxd2843_cfg cfg;
cfg.adr = (input->nr & 1) ? 0x6d : 0x6c;
cfg.ts_clock = par ? 0 : 1;
cfg.parallel = par ? 1 : 0;
cfg.osc = osc24 ? 24000000 : 20500000;
fe = dvb->fe = dvb_attach(cxd2843_attach, i2c, &cfg);
if (par)
fe = dvb->fe = dvb_attach(cxd2843_attach, i2c,
(input->nr & 1) ?
&cxd2843p_1 : &cxd2843p_0);
else
fe = dvb->fe = dvb_attach(cxd2843_attach, i2c,
(input->nr & 1) ?
&cxd2843_1 : &cxd2843_0);
if (!dvb->fe) {
pr_err("DDBridge: No cxd2837/38/43 found!\n");
pr_err("DDBridge: No cxd2837/38/43/54 found!\n");
return -ENODEV;
}
fe->sec_priv = input;
@@ -2324,7 +2303,13 @@ static int dvb_input_attach(struct ddb_input *input)
case DDB_TUNER_DVBCT2_SONY:
case DDB_TUNER_DVBC2T2_SONY:
case DDB_TUNER_ISDBT_SONY:
if (demod_attach_cxd2843(input, par) < 0)
if (demod_attach_cxd2843(input, par, 0) < 0)
return -ENODEV;
if (tuner_attach_tda18212dd(input) < 0)
return -ENODEV;
break;
case DDB_TUNER_DVBC2T2I_SONY:
if (demod_attach_cxd2843(input, par, 1) < 0)
return -ENODEV;
if (tuner_attach_tda18212dd(input) < 0)
return -ENODEV;
@@ -2548,14 +2533,14 @@ static int port_has_cxd28xx(struct ddb_port *port, u8 *id)
static char *xo2names[] = {
"DUAL DVB-S2", "DUAL DVB-C/T/T2",
"DUAL DVB-ISDBT", "DUAL DVB-C/C2/T/T2",
"DUAL ATSC", "DUAL DVB-C/C2/T/T2",
"DUAL ATSC", "DUAL DVB-C/C2/T/T2,ISDB-T",
"", ""
};
static char *xo2types[] = {
"DVBS_ST", "DVBCT2_SONY",
"ISDBT_SONY", "DVBC2T2_SONY",
"ATSC_ST", "DVBC2T2_ST"
"ATSC_ST", "DVBC2T2I_SONY"
};
static void ddb_port_probe(struct ddb_port *port)
@@ -2636,7 +2621,7 @@ static void ddb_port_probe(struct ddb_port *port)
}
} else if (port_has_xo2(port, &type, &id)) {
ddbwritel(dev, I2C_SPEED_400, port->i2c->regs + I2C_TIMING);
/*pr_info("DDBridge: XO2 ID %02x\n", id);*/
pr_info("DDBridge: XO2 ID %02x\n", id);
if (type == 2) {
port->name = "DuoFlex CI";
port->class = DDB_PORT_CI;
@@ -4583,7 +4568,7 @@ static void ddb_set_led(struct ddb *dev, int num, int val)
i2c_write_reg16(&dev->i2c[num].adap,
0x1f, 0xf00f, val ? 1 : 0);
break;
case DDB_TUNER_XO2 ... DDB_TUNER_DVBC2T2_ST:
case DDB_TUNER_XO2 ... DDB_TUNER_DVBC2T2I_SONY:
{
u8 v;

View File

@@ -324,7 +324,7 @@ struct ddb_port {
#define DDB_TUNER_ISDBT_SONY (DDB_TUNER_XO2 + 2)
#define DDB_TUNER_DVBC2T2_SONY (DDB_TUNER_XO2 + 3)
#define DDB_TUNER_ATSC_ST (DDB_TUNER_XO2 + 4)
#define DDB_TUNER_DVBC2T2_ST (DDB_TUNER_XO2 + 5)
#define DDB_TUNER_DVBC2T2I_SONY (DDB_TUNER_XO2 + 5)
struct ddb_input *input[2];
struct ddb_output *output;
@@ -751,6 +751,6 @@ void ddbridge_mod_rate_handler(unsigned long data);
int ddbridge_flashread(struct ddb *dev, u32 link, u8 *buf, u32 addr, u32 len);
#define DDBRIDGE_VERSION "0.9.26"
#define DDBRIDGE_VERSION "0.9.28"
#endif