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

handle revision 1 mods differently

This commit is contained in:
none 2021-06-23 11:18:35 +02:00
parent 8f5af7742d
commit c23435e275
2 changed files with 29 additions and 5 deletions

View File

@ -2602,7 +2602,7 @@ static int ddb_port_match_link_i2c(struct ddb_port *port)
static void ddb_ports_init(struct ddb *dev)
{
u32 i, l, p;
u32 i, l, p, ports;
struct ddb_port *port;
const struct ddb_info *info;
const struct ddb_regmap *rm;
@ -2614,7 +2614,12 @@ static void ddb_ports_init(struct ddb *dev)
rm = info->regmap;
if (!rm)
continue;
for (i = 0; i < info->port_num; i++, p++) {
ports = info->port_num;
if ((l == 0) && (dev->link[l].info->type == DDB_MOD) &&
(dev->link[0].ids.revision == 1)) {
ports = ddbreadl(dev, 0x260) >> 24;
}
for (i = 0; i < ports; i++, p++) {
port = &dev->port[p];
port->dev = dev;
port->nr = i;
@ -3266,8 +3271,8 @@ static long ddb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
ddbid.device = dev->link[0].ids.device;
ddbid.subvendor = dev->link[0].ids.subvendor;
ddbid.subdevice = dev->link[0].ids.subdevice;
ddbid.hw = ddbreadl(dev, 0);
ddbid.regmap = ddbreadl(dev, 4);
ddbid.hw = dev->link[0].ids.hwid;
ddbid.regmap = dev->link[0].ids.regmapid;
if (copy_to_user(parg, &ddbid, sizeof(ddbid)))
return -EFAULT;
break;

View File

@ -1863,6 +1863,8 @@ static int mod_init_2(struct ddb *dev, u32 Frequency)
dev_err(dev->dev, "FSM setup failed!\n");
return -1;
}
if (dev->link[0].ids.revision == 1)
return 0;
for (i = 0; i < streams; i++) {
struct ddb_mod *mod = &dev->mod[i];
@ -2026,7 +2028,7 @@ static int mod_init_sdr_iq(struct ddb *dev)
ret = rfdac_init(dev);
if (ret)
dev_err(dev->dev, "RFDAC setup failed\n");
ddbwritel(dev, 0x01, 0x240);
if (dev->link[0].ids.revision == 1)
@ -2049,6 +2051,23 @@ static int mod_init_sdr_iq(struct ddb *dev)
int ddbridge_mod_init(struct ddb *dev)
{
dev_info(dev->dev, "Revision: %u\n", dev->link[0].ids.revision);
if (dev->link[0].ids.revision == 1) {
switch (dev->link[0].info->version) {
case 0:
case 1:
return mod_init_1(dev, 722000000);
case 2: /* FSM */
return mod_init_2(dev, 114000000);
case 16: /* PAL */
return mod_init_3(dev, 503250000);
case 17: /* raw IQ */
case 18: /* IQ+FFT */
return mod_init_sdr_iq(dev);
default:
return -1;
}
}
switch (dev->link[0].info->version) {
case 0:
case 1: