diff options
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/budget-ci.c')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/budget-ci.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/linux/drivers/media/dvb/ttpci/budget-ci.c b/linux/drivers/media/dvb/ttpci/budget-ci.c index 77d75a78e..1e54b0671 100644 --- a/linux/drivers/media/dvb/ttpci/budget-ci.c +++ b/linux/drivers/media/dvb/ttpci/budget-ci.c @@ -329,24 +329,36 @@ static int ciintf_slot_reset(struct dvb_ca_en50221* ca, int slot) { dvb_delay(1); budget_debiwrite(budget_ci, DEBICICTL, DEBIADDR_CICONTROL, 1, CICONTROL_RESET); + saa7146_setgpio(saa, 1, SAA7146_GPIO_OUTHI); + ttpci_budget_set_video_port(saa, BUDGET_VIDEO_PORTB); return 0; } static int ciintf_slot_shutdown(struct dvb_ca_en50221* ca, int slot) { + struct budget_ci* budget_ci = (struct budget_ci*) ca->data; + struct saa7146_dev *saa = budget_ci->budget.dev; + if (slot != 0) return -EINVAL; - // no implementation necessary + saa7146_setgpio(saa, 1, SAA7146_GPIO_OUTHI); + ttpci_budget_set_video_port(saa, BUDGET_VIDEO_PORTB); return 0; } static int ciintf_slot_ts_enable(struct dvb_ca_en50221* ca, int slot) { struct budget_ci* budget_ci = (struct budget_ci*) ca->data; + struct saa7146_dev *saa = budget_ci->budget.dev; int tmp; if (slot != 0) return -EINVAL; + + saa7146_setgpio(saa, 1, SAA7146_GPIO_OUTLO); + tmp = budget_debiread(budget_ci, DEBICICTL, DEBIADDR_CICONTROL, 1); budget_debiwrite(budget_ci, DEBICICTL, DEBIADDR_CICONTROL, 1, tmp | CICONTROL_ENABLETS); + + ttpci_budget_set_video_port(saa, BUDGET_VIDEO_PORTA); return 0; } @@ -423,10 +435,10 @@ static int ciintf_init(struct budget_ci* budget_ci) budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable; budget_ci->ca.data = budget_ci; if ((result = dvb_ca_en50221_init(budget_ci->budget.dvb_adapter, - &budget_ci->ca, - DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE | - DVB_CA_EN50221_FLAG_IRQ_FR | - DVB_CA_EN50221_FLAG_IRQ_DA, + &budget_ci->ca, + DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE | + DVB_CA_EN50221_FLAG_IRQ_FR | + DVB_CA_EN50221_FLAG_IRQ_DA, 1)) != 0) { printk("budget_ci: CI interface detected, but initialisation failed.\n"); goto error; @@ -442,9 +454,6 @@ static int ciintf_init(struct budget_ci* budget_ci) printk("budget_ci: CI interface initialised\n"); budget_ci->budget.ci_present = 1; - // route TS data out to CI interface - saa7146_setgpio(saa, 1, SAA7146_GPIO_OUTLO); - // forge a fake CI IRQ so the CAM state is setup correctly flags = DVB_CA_EN50221_CAMCHANGE_REMOVED; if (budget_ci->slot_status != SLOTSTATUS_NONE) flags = DVB_CA_EN50221_CAMCHANGE_INSERTED; |