mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2023-10-10 13:37:43 +02:00
change FSM card channel number detection to use register 0x1c
This commit is contained in:
parent
983949f4dd
commit
0dd0997133
@ -4358,15 +4358,6 @@ int ddb_init(struct ddb *dev)
|
|||||||
ddb_gtl_init(dev);
|
ddb_gtl_init(dev);
|
||||||
|
|
||||||
ddb_init_boards(dev);
|
ddb_init_boards(dev);
|
||||||
if (dev->link[0].info->type == DDB_MOD &&
|
|
||||||
dev->link[0].info->version == 2) {
|
|
||||||
int ret = ddb_mod_fsm_setup(dev, 0);
|
|
||||||
|
|
||||||
if (ret < 0) {
|
|
||||||
dev_err(dev->dev, "FSM setup failed!\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ddb_i2c_init(dev) < 0)
|
if (ddb_i2c_init(dev) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
ddb_ports_init(dev);
|
ddb_ports_init(dev);
|
||||||
|
@ -684,10 +684,10 @@ static const struct ddb_device_id ddb_device_ids[] = {
|
|||||||
DDB_DEVID(0x0201, 0x0002, ddb_mod),
|
DDB_DEVID(0x0201, 0x0002, ddb_mod),
|
||||||
DDB_DEVID(0x0201, 0x0004, ddb_mod_4), /* dummy entry ! */
|
DDB_DEVID(0x0201, 0x0004, ddb_mod_4), /* dummy entry ! */
|
||||||
DDB_DEVID(0x0203, 0x0001, ddb_mod),
|
DDB_DEVID(0x0203, 0x0001, ddb_mod),
|
||||||
|
DDB_DEVID(0x0210, 0x0000, ddb_mod_fsm_4), /* dummy entry ! */
|
||||||
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(0x0210, 0x0004, ddb_mod_fsm_4), /* dummy entry ! */
|
|
||||||
DDB_DEVID(0x0220, 0x0001, ddb_sdr),
|
DDB_DEVID(0x0220, 0x0001, ddb_sdr),
|
||||||
/* testing on OctopusNet Pro */
|
/* testing on OctopusNet Pro */
|
||||||
DDB_DEVID(0x0320, 0xffff, ddb_octopro_hdin),
|
DDB_DEVID(0x0320, 0xffff, ddb_octopro_hdin),
|
||||||
|
@ -287,10 +287,29 @@ static int __devinit ddb_probe(struct pci_dev *pdev,
|
|||||||
&& dev->link[0].info->version <= 1) {
|
&& dev->link[0].info->version <= 1) {
|
||||||
if (ddbreadl(dev, 0x1c) == 4)
|
if (ddbreadl(dev, 0x1c) == 4)
|
||||||
dev->link[0].info =
|
dev->link[0].info =
|
||||||
get_ddb_info(0xdd01, 0x0201,
|
get_ddb_info(0xdd01, 0x0201, 0xdd01, 0x0004);
|
||||||
0xdd01, 0x0004);
|
}
|
||||||
|
if (dev->link[0].info->type == DDB_MOD
|
||||||
|
&& dev->link[0].info->version == 2) {
|
||||||
|
u32 lic = ddbreadl(dev, 0x1c) & 7;
|
||||||
|
|
||||||
|
switch (lic) {
|
||||||
|
case 0:
|
||||||
|
dev->link[0].info =
|
||||||
|
get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0000);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
dev->link[0].info =
|
||||||
|
get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0003);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
dev->link[0].info =
|
||||||
|
get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0002);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stat = ddb_irq_init(dev);
|
stat = ddb_irq_init(dev);
|
||||||
if (stat < 0)
|
if (stat < 0)
|
||||||
goto fail0;
|
goto fail0;
|
||||||
|
@ -468,7 +468,7 @@ static int mod_setup_max2871(struct ddb *dev, u32 *reg)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ddb_mod_fsm_setup(struct ddb *dev, u32 MaxUsedChannels)
|
static int mod_fsm_setup(struct ddb *dev, u32 MaxUsedChannels)
|
||||||
{
|
{
|
||||||
int status = 0;
|
int status = 0;
|
||||||
u32 Capacity;
|
u32 Capacity;
|
||||||
@ -500,7 +500,6 @@ int ddb_mod_fsm_setup(struct ddb *dev, u32 MaxUsedChannels)
|
|||||||
if (MaxUsedChannels == 0)
|
if (MaxUsedChannels == 0)
|
||||||
MaxUsedChannels = (Capacity & FSM_CAPACITY_CUR) >> 16;
|
MaxUsedChannels = (Capacity & FSM_CAPACITY_CUR) >> 16;
|
||||||
|
|
||||||
dev_info(dev->dev, "max used chan = %u\n", MaxUsedChannels);
|
|
||||||
if (MaxUsedChannels <= 1)
|
if (MaxUsedChannels <= 1)
|
||||||
ddbwritel(dev, FSM_GAIN_N1, FSM_GAIN);
|
ddbwritel(dev, FSM_GAIN_N1, FSM_GAIN);
|
||||||
else if (MaxUsedChannels <= 2)
|
else if (MaxUsedChannels <= 2)
|
||||||
@ -517,9 +516,6 @@ int ddb_mod_fsm_setup(struct ddb *dev, u32 MaxUsedChannels)
|
|||||||
ddbwritel(dev, FSM_GAIN_N96, FSM_GAIN);
|
ddbwritel(dev, FSM_GAIN_N96, FSM_GAIN);
|
||||||
|
|
||||||
ddbwritel(dev, FSM_CONTROL_ENABLE, FSM_CONTROL);
|
ddbwritel(dev, FSM_CONTROL_ENABLE, FSM_CONTROL);
|
||||||
if (MaxUsedChannels == 4)
|
|
||||||
dev->link[0].info = get_ddb_info(0xdd01, 0x0210,
|
|
||||||
0xdd01, 0x0004);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1629,17 +1625,15 @@ out:
|
|||||||
|
|
||||||
static int mod_init_2(struct ddb *dev, u32 Frequency)
|
static int mod_init_2(struct ddb *dev, u32 Frequency)
|
||||||
{
|
{
|
||||||
int i, streams = dev->link[0].info->port_num;
|
int i, status, streams = dev->link[0].info->port_num;
|
||||||
|
|
||||||
dev->mod_base.frequency = Frequency;
|
dev->mod_base.frequency = Frequency;
|
||||||
|
|
||||||
#if 0
|
|
||||||
status = mod_fsm_setup(dev, 0);
|
status = mod_fsm_setup(dev, 0);
|
||||||
if (status) {
|
if (status) {
|
||||||
dev_err(dev->dev, "FSM setup failed!\n");
|
dev_err(dev->dev, "FSM setup failed!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
for (i = 0; i < streams; i++) {
|
for (i = 0; i < streams; i++) {
|
||||||
struct ddb_mod *mod = &dev->mod[i];
|
struct ddb_mod *mod = &dev->mod[i];
|
||||||
|
|
||||||
|
@ -545,7 +545,6 @@ int ddbridge_mod_init(struct ddb *dev);
|
|||||||
void ddbridge_mod_output_stop(struct ddb_output *output);
|
void ddbridge_mod_output_stop(struct ddb_output *output);
|
||||||
int ddbridge_mod_output_start(struct ddb_output *output);
|
int ddbridge_mod_output_start(struct ddb_output *output);
|
||||||
void ddbridge_mod_rate_handler(unsigned long data);
|
void ddbridge_mod_rate_handler(unsigned long data);
|
||||||
int ddb_mod_fsm_setup(struct ddb *dev, u32 MaxUsedChannels);
|
|
||||||
|
|
||||||
void ddb_device_destroy(struct ddb *dev);
|
void ddb_device_destroy(struct ddb *dev);
|
||||||
void ddb_nsd_detach(struct ddb *dev);
|
void ddb_nsd_detach(struct ddb *dev);
|
||||||
|
Loading…
Reference in New Issue
Block a user