diff options
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/budget-av.c')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/budget-av.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/ttpci/budget-av.c b/linux/drivers/media/dvb/ttpci/budget-av.c index 56f9d9360..78edb73e2 100644 --- a/linux/drivers/media/dvb/ttpci/budget-av.c +++ b/linux/drivers/media/dvb/ttpci/budget-av.c @@ -121,6 +121,8 @@ static int ciintf_read_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int ad return -EINVAL; saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTHI); + udelay(1); + result = ttpci_budget_debiread(&budget_av->budget, DEBICICAM, address & 0xfff, 1, 0, 0); if (result == -ETIMEDOUT) @@ -137,6 +139,8 @@ static int ciintf_write_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int a return -EINVAL; saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTHI); + udelay(1); + result = ttpci_budget_debiwrite(&budget_av->budget, DEBICICAM, address & 0xfff, 1, value, 0, 0); if (result == -ETIMEDOUT) @@ -153,6 +157,8 @@ static int ciintf_read_cam_control(struct dvb_ca_en50221 *ca, int slot, u8 addre return -EINVAL; saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTLO); + udelay(1); + result = ttpci_budget_debiread(&budget_av->budget, DEBICICAM, address & 3, 1, 0, 0); if (result == -ETIMEDOUT) @@ -169,6 +175,8 @@ static int ciintf_write_cam_control(struct dvb_ca_en50221 *ca, int slot, u8 addr return -EINVAL; saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTLO); + udelay(1); + result = ttpci_budget_debiwrite(&budget_av->budget, DEBICICAM, address & 3, 1, value, 0, 0); if (result == -ETIMEDOUT) @@ -190,7 +198,10 @@ static int ciintf_slot_reset(struct dvb_ca_en50221 *ca, int slot) saa7146_setgpio(saa, 0, SAA7146_GPIO_OUTHI); msleep(100); saa7146_setgpio(saa, 0, SAA7146_GPIO_OUTLO); - msleep(2000); /* horrendous I know, but its the only way to be absolutely sure without an IRQ line! */ + + int max = 20; + while (--max > 0 && ciintf_read_attribute_mem(ca, slot, 0) != 0x1d) + msleep(100); ttpci_budget_set_video_port(saa, BUDGET_VIDEO_PORTB); return 0; |