aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb/mantis/mantis_ca.c4
-rw-r--r--drivers/media/dvb/mantis/mantis_dvb.c2
-rw-r--r--drivers/media/dvb/mantis/mantis_evm.c26
-rw-r--r--drivers/media/dvb/mantis/mantis_pci.c10
-rw-r--r--drivers/media/dvb/mantis/mantis_pcmcia.c9
5 files changed, 26 insertions, 25 deletions
diff --git a/drivers/media/dvb/mantis/mantis_ca.c b/drivers/media/dvb/mantis/mantis_ca.c
index 6e440d31b79b..e6de3c9d3ce4 100644
--- a/drivers/media/dvb/mantis/mantis_ca.c
+++ b/drivers/media/dvb/mantis/mantis_ca.c
@@ -93,12 +93,12 @@ struct dvb_device *mantis_ca_init(struct mantis_pci *mantis)
93 } 93 }
94 94
95 ca->ca_priv = mantis; 95 ca->ca_priv = mantis;
96 mantis->mantis_ca = ca;
97 mantis_evmgr_init(ca);
98 96
99 dprintk(verbose, MANTIS_ERROR, 0, "CA: Registering Mantis Adapter(%d) Slot(0)\n", mantis->num); 97 dprintk(verbose, MANTIS_ERROR, 0, "CA: Registering Mantis Adapter(%d) Slot(0)\n", mantis->num);
100 if (dvb_register_device(dvb_adapter, &dvbdev, &mantis_ca, ca, DVB_DEVICE_CA) == 0) { 98 if (dvb_register_device(dvb_adapter, &dvbdev, &mantis_ca, ca, DVB_DEVICE_CA) == 0) {
101 ca->ca_dev = dvbdev; 99 ca->ca_dev = dvbdev;
100 mantis->mantis_ca = ca;
101 mantis_evmgr_init(ca);
102 return ca->ca_dev; 102 return ca->ca_dev;
103 } 103 }
104 return 0; 104 return 0;
diff --git a/drivers/media/dvb/mantis/mantis_dvb.c b/drivers/media/dvb/mantis/mantis_dvb.c
index 9634b972a0f9..3325b59ce19c 100644
--- a/drivers/media/dvb/mantis/mantis_dvb.c
+++ b/drivers/media/dvb/mantis/mantis_dvb.c
@@ -190,6 +190,8 @@ int __devinit mantis_dvb_init(struct mantis_pci *mantis)
190 dvb_net_init(&mantis->dvb_adapter, &mantis->dvbnet, &mantis->demux.dmx); 190 dvb_net_init(&mantis->dvb_adapter, &mantis->dvbnet, &mantis->demux.dmx);
191 tasklet_init(&mantis->tasklet, mantis_dma_xfer, (unsigned long) mantis); 191 tasklet_init(&mantis->tasklet, mantis_dma_xfer, (unsigned long) mantis);
192 mantis_frontend_init(mantis); 192 mantis_frontend_init(mantis);
193 mantis_ca_init(mantis);
194
193 return 0; 195 return 0;
194 196
195 /* Error conditions .. */ 197 /* Error conditions .. */
diff --git a/drivers/media/dvb/mantis/mantis_evm.c b/drivers/media/dvb/mantis/mantis_evm.c
index c4a1c89431e1..d81068d08345 100644
--- a/drivers/media/dvb/mantis/mantis_evm.c
+++ b/drivers/media/dvb/mantis/mantis_evm.c
@@ -33,14 +33,14 @@ void mantis_hifevm_tasklet(unsigned long data)
33 33
34 if (gpif_stat & MANTIS_GPIF_DETSTAT) { 34 if (gpif_stat & MANTIS_GPIF_DETSTAT) {
35 if (gpif_stat & MANTIS_CARD_PLUGIN) { 35 if (gpif_stat & MANTIS_CARD_PLUGIN) {
36 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num); 36 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num);
37 mmwrite(0xdada0000, MANTIS_CARD_RESET); 37 mmwrite(0xdada0000, MANTIS_CARD_RESET);
38 // Plugin call here 38 // Plugin call here
39 gpif_stat = 0; // crude ! 39 gpif_stat = 0; // crude !
40 } 40 }
41 } else { 41 } else {
42 if (gpif_stat & MANTIS_CARD_PLUGOUT) { 42 if (gpif_stat & MANTIS_CARD_PLUGOUT) {
43 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Unplug", mantis->num); 43 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Unplug", mantis->num);
44 mmwrite(0xdada0000, MANTIS_CARD_RESET); 44 mmwrite(0xdada0000, MANTIS_CARD_RESET);
45 // Unplug call here 45 // Unplug call here
46 gpif_stat = 0; // crude ! 46 gpif_stat = 0; // crude !
@@ -48,34 +48,34 @@ void mantis_hifevm_tasklet(unsigned long data)
48 } 48 }
49 49
50 if (gpif_stat & MANTIS_GPIF_EXTIRQ) 50 if (gpif_stat & MANTIS_GPIF_EXTIRQ)
51 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Ext IRQ", mantis->num); 51 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Ext IRQ", mantis->num);
52 52
53 if (gpif_stat & MANTIS_SBUF_WSTO) 53 if (gpif_stat & MANTIS_SBUF_WSTO)
54 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Timeout", mantis->num); 54 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Timeout", mantis->num);
55 55
56 if (gpif_stat & MANTIS_GPIF_OTHERR) 56 if (gpif_stat & MANTIS_GPIF_OTHERR)
57 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Alignment Error", mantis->num); 57 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Alignment Error", mantis->num);
58 58
59 if (gpif_stat & MANTIS_SBUF_OVFLW) 59 if (gpif_stat & MANTIS_SBUF_OVFLW)
60 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Overflow", mantis->num); 60 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Overflow", mantis->num);
61 61
62 if (gpif_stat & MANTIS_GPIF_BRRDY) { 62 if (gpif_stat & MANTIS_GPIF_BRRDY) {
63 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Read Ready", mantis->num); 63 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Read Ready", mantis->num);
64 ca->sbuf_status = MANTIS_SBUF_DATA_AVAIL; 64 ca->sbuf_status = MANTIS_SBUF_DATA_AVAIL;
65 if (ca->hif_job_queue & MANTIS_HIF_MEMRD) 65 if (ca->hif_job_queue & MANTIS_HIF_MEMRD)
66 wake_up(&ca->hif_brrdyw_wq); 66 wake_up(&ca->hif_brrdyw_wq);
67 } 67 }
68 if (gpif_stat & MANTIS_GPIF_WRACK) 68 if (gpif_stat & MANTIS_GPIF_WRACK)
69 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Slave Write ACK", mantis->num); 69 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Slave Write ACK", mantis->num);
70 70
71 if (gpif_stat & MANTIS_GPIF_INTSTAT) 71 if (gpif_stat & MANTIS_GPIF_INTSTAT)
72 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): GPIF IRQ", mantis->num); 72 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): GPIF IRQ", mantis->num);
73 73
74 if (gpif_stat & MANTIS_SBUF_EMPTY) 74 if (gpif_stat & MANTIS_SBUF_EMPTY)
75 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Empty", mantis->num); 75 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Empty", mantis->num);
76 76
77 if (gpif_stat & MANTIS_SBUF_OPDONE) { 77 if (gpif_stat & MANTIS_SBUF_OPDONE) {
78 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer operation complete", mantis->num); 78 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer operation complete", mantis->num);
79 if (ca->hif_job_queue) { 79 if (ca->hif_job_queue) {
80 wake_up(&ca->hif_opdone_wq); 80 wake_up(&ca->hif_opdone_wq);
81 ca->hif_event = MANTIS_SBUF_OPDONE; 81 ca->hif_event = MANTIS_SBUF_OPDONE;
@@ -87,7 +87,7 @@ int mantis_evmgr_init(struct mantis_ca *ca)
87{ 87{
88 struct mantis_pci *mantis = ca->ca_priv; 88 struct mantis_pci *mantis = ca->ca_priv;
89 89
90 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager"); 90 dprintk(verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager");
91 tasklet_init(&ca->hif_evm_tasklet, mantis_hifevm_tasklet, (unsigned long) ca); 91 tasklet_init(&ca->hif_evm_tasklet, mantis_hifevm_tasklet, (unsigned long) ca);
92 92
93 mantis_pcmcia_init(ca); 93 mantis_pcmcia_init(ca);
@@ -99,7 +99,7 @@ void mantis_evmgr_exit(struct mantis_ca *ca)
99{ 99{
100 struct mantis_pci *mantis = ca->ca_priv; 100 struct mantis_pci *mantis = ca->ca_priv;
101 101
102 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting"); 102 dprintk(verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting");
103 tasklet_kill(&ca->hif_evm_tasklet); 103 tasklet_kill(&ca->hif_evm_tasklet);
104 104
105 mantis_pcmcia_exit(ca); 105 mantis_pcmcia_exit(ca);
diff --git a/drivers/media/dvb/mantis/mantis_pci.c b/drivers/media/dvb/mantis/mantis_pci.c
index 402f866e12d9..814c6ace3d37 100644
--- a/drivers/media/dvb/mantis/mantis_pci.c
+++ b/drivers/media/dvb/mantis/mantis_pci.c
@@ -54,12 +54,15 @@ static irqreturn_t mantis_pci_irq(int irq, void *dev_id)
54{ 54{
55 u32 stat = 0, mask = 0, lstat = 0, mstat = 0; 55 u32 stat = 0, mask = 0, lstat = 0, mstat = 0;
56 struct mantis_pci *mantis; 56 struct mantis_pci *mantis;
57 struct mantis_ca *ca;
57 58
58 mantis = (struct mantis_pci *) dev_id; 59 mantis = (struct mantis_pci *) dev_id;
59 if (unlikely(mantis == NULL)) { 60 if (unlikely(mantis == NULL)) {
60 dprintk(verbose, MANTIS_ERROR, 1, "Mantis == NULL"); 61 dprintk(verbose, MANTIS_ERROR, 1, "Mantis == NULL");
61 return IRQ_NONE; 62 return IRQ_NONE;
62 } 63 }
64 ca = mantis->mantis_ca;
65
63 stat = mmread(MANTIS_INT_STAT); 66 stat = mmread(MANTIS_INT_STAT);
64 mask = mmread(MANTIS_INT_MASK); 67 mask = mmread(MANTIS_INT_MASK);
65 mstat = lstat = stat & ~MANTIS_INT_RISCSTAT; 68 mstat = lstat = stat & ~MANTIS_INT_RISCSTAT;
@@ -72,14 +75,9 @@ static irqreturn_t mantis_pci_irq(int irq, void *dev_id)
72 if (stat & MANTIS_INT_RISCEN) { 75 if (stat & MANTIS_INT_RISCEN) {
73 dprintk(verbose, MANTIS_DEBUG, 0, "* DMA enabl *"); 76 dprintk(verbose, MANTIS_DEBUG, 0, "* DMA enabl *");
74 } 77 }
75 if (stat & MANTIS_INT_I2CRACK) {
76 dprintk(verbose, MANTIS_DEBUG, 0, "* I2C R-ACK *");
77 }
78 if (stat & MANTIS_INT_PCMCIA7) {
79 dprintk(verbose, MANTIS_DEBUG, 0, "* PCMCIA-07 *");
80 }
81 if (stat & MANTIS_INT_IRQ0) { 78 if (stat & MANTIS_INT_IRQ0) {
82 dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-0 *"); 79 dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-0 *");
80 tasklet_schedule(&ca->hif_evm_tasklet);
83 } 81 }
84 if (stat & MANTIS_INT_IRQ1) { 82 if (stat & MANTIS_INT_IRQ1) {
85 dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-1 *"); 83 dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-1 *");
diff --git a/drivers/media/dvb/mantis/mantis_pcmcia.c b/drivers/media/dvb/mantis/mantis_pcmcia.c
index 960123f1ed44..47cc720d35dd 100644
--- a/drivers/media/dvb/mantis/mantis_pcmcia.c
+++ b/drivers/media/dvb/mantis/mantis_pcmcia.c
@@ -32,7 +32,7 @@ void mantis_event_cam_plugin(struct mantis_ca *ca)
32 u32 gpif_irqcfg; 32 u32 gpif_irqcfg;
33 33
34 if (ca->slot_state == MODULE_XTRACTED) { 34 if (ca->slot_state == MODULE_XTRACTED) {
35 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event: CAM Plugged IN: Adapter(%d) Slot(0)", mantis->num); 35 dprintk(verbose, MANTIS_DEBUG, 1, "Event: CAM Plugged IN: Adapter(%d) Slot(0)", mantis->num);
36 udelay(50); 36 udelay(50);
37 mmwrite(0xda000000, MANTIS_CARD_RESET); 37 mmwrite(0xda000000, MANTIS_CARD_RESET);
38 gpif_irqcfg = mmread(MANTIS_GPIF_IRQCFG); 38 gpif_irqcfg = mmread(MANTIS_GPIF_IRQCFG);
@@ -56,7 +56,7 @@ void mantis_event_cam_unplug(struct mantis_ca *ca)
56 u32 gpif_irqcfg; 56 u32 gpif_irqcfg;
57 57
58 if (ca->slot_state == MODULE_INSERTED) { 58 if (ca->slot_state == MODULE_INSERTED) {
59 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event: CAM Unplugged: Adapter(%d) Slot(0)", mantis->num); 59 dprintk(verbose, MANTIS_DEBUG, 1, "Event: CAM Unplugged: Adapter(%d) Slot(0)", mantis->num);
60 udelay(50); 60 udelay(50);
61 mmwrite(0x00da0000, MANTIS_CARD_RESET); 61 mmwrite(0x00da0000, MANTIS_CARD_RESET);
62 gpif_irqcfg = mmread(MANTIS_GPIF_IRQCFG); 62 gpif_irqcfg = mmread(MANTIS_GPIF_IRQCFG);
@@ -75,15 +75,16 @@ int mantis_pcmcia_init(struct mantis_ca *ca)
75 75
76 u32 gpif_stat, card_stat; 76 u32 gpif_stat, card_stat;
77 77
78 mmwrite(mmread(MANTIS_INT_MASK) | MANTIS_INT_IRQ0, MANTIS_INT_MASK);
78 gpif_stat = mmread(MANTIS_GPIF_STATUS); 79 gpif_stat = mmread(MANTIS_GPIF_STATUS);
79 card_stat = mmread(MANTIS_GPIF_IRQCFG); 80 card_stat = mmread(MANTIS_GPIF_IRQCFG);
80 81
81 if (gpif_stat & MANTIS_GPIF_DETSTAT) { 82 if (gpif_stat & MANTIS_GPIF_DETSTAT) {
82 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "CAM found on Adapter(%d) Slot(0)", mantis->num); 83 dprintk(verbose, MANTIS_DEBUG, 1, "CAM found on Adapter(%d) Slot(0)", mantis->num);
83 mmwrite(card_stat | MANTIS_MASK_PLUGOUT, MANTIS_GPIF_IRQCFG); 84 mmwrite(card_stat | MANTIS_MASK_PLUGOUT, MANTIS_GPIF_IRQCFG);
84 ca->slot_state = MODULE_INSERTED; 85 ca->slot_state = MODULE_INSERTED;
85 } else { 86 } else {
86 dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Empty Slot on Adapter(%d) Slot(0)", mantis->num); 87 dprintk(verbose, MANTIS_DEBUG, 1, "Empty Slot on Adapter(%d) Slot(0)", mantis->num);
87 mmwrite(card_stat | MANTIS_MASK_PLUGIN, MANTIS_GPIF_IRQCFG); 88 mmwrite(card_stat | MANTIS_MASK_PLUGIN, MANTIS_GPIF_IRQCFG);
88 ca->slot_state = MODULE_XTRACTED; 89 ca->slot_state = MODULE_XTRACTED;
89 } 90 }