summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/mantis
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2009-12-04 05:07:41 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-01-17 11:55:33 -0200
commitd9dd5f7168d6a61491996fc02e4deb9d96308178 (patch)
treeaa37612d5fc6af4d82119d89d7821ce145a1a4c9 /drivers/media/dvb/mantis
parent50d82602760c99d2c954c33360990c00146532cd (diff)
downloadlinux-d9dd5f7168d6a61491996fc02e4deb9d96308178.tar.bz2
V4L/DVB (13738): [Mantis] Enable IRQ0 events
Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/mantis')
-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)
}
ca->ca_priv = mantis;
- mantis->mantis_ca = ca;
- mantis_evmgr_init(ca);
dprintk(verbose, MANTIS_ERROR, 0, "CA: Registering Mantis Adapter(%d) Slot(0)\n", mantis->num);
if (dvb_register_device(dvb_adapter, &dvbdev, &mantis_ca, ca, DVB_DEVICE_CA) == 0) {
ca->ca_dev = dvbdev;
+ mantis->mantis_ca = ca;
+ mantis_evmgr_init(ca);
return ca->ca_dev;
}
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)
dvb_net_init(&mantis->dvb_adapter, &mantis->dvbnet, &mantis->demux.dmx);
tasklet_init(&mantis->tasklet, mantis_dma_xfer, (unsigned long) mantis);
mantis_frontend_init(mantis);
+ mantis_ca_init(mantis);
+
return 0;
/* 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)
if (gpif_stat & MANTIS_GPIF_DETSTAT) {
if (gpif_stat & MANTIS_CARD_PLUGIN) {
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num);
mmwrite(0xdada0000, MANTIS_CARD_RESET);
// Plugin call here
gpif_stat = 0; // crude !
}
} else {
if (gpif_stat & MANTIS_CARD_PLUGOUT) {
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Unplug", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Unplug", mantis->num);
mmwrite(0xdada0000, MANTIS_CARD_RESET);
// Unplug call here
gpif_stat = 0; // crude !
@@ -48,34 +48,34 @@ void mantis_hifevm_tasklet(unsigned long data)
}
if (gpif_stat & MANTIS_GPIF_EXTIRQ)
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Ext IRQ", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Ext IRQ", mantis->num);
if (gpif_stat & MANTIS_SBUF_WSTO)
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Timeout", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Timeout", mantis->num);
if (gpif_stat & MANTIS_GPIF_OTHERR)
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Alignment Error", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Alignment Error", mantis->num);
if (gpif_stat & MANTIS_SBUF_OVFLW)
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Overflow", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Overflow", mantis->num);
if (gpif_stat & MANTIS_GPIF_BRRDY) {
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Read Ready", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Read Ready", mantis->num);
ca->sbuf_status = MANTIS_SBUF_DATA_AVAIL;
if (ca->hif_job_queue & MANTIS_HIF_MEMRD)
wake_up(&ca->hif_brrdyw_wq);
}
if (gpif_stat & MANTIS_GPIF_WRACK)
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Slave Write ACK", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Slave Write ACK", mantis->num);
if (gpif_stat & MANTIS_GPIF_INTSTAT)
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): GPIF IRQ", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): GPIF IRQ", mantis->num);
if (gpif_stat & MANTIS_SBUF_EMPTY)
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Empty", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Empty", mantis->num);
if (gpif_stat & MANTIS_SBUF_OPDONE) {
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer operation complete", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer operation complete", mantis->num);
if (ca->hif_job_queue) {
wake_up(&ca->hif_opdone_wq);
ca->hif_event = MANTIS_SBUF_OPDONE;
@@ -87,7 +87,7 @@ int mantis_evmgr_init(struct mantis_ca *ca)
{
struct mantis_pci *mantis = ca->ca_priv;
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager");
+ dprintk(verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager");
tasklet_init(&ca->hif_evm_tasklet, mantis_hifevm_tasklet, (unsigned long) ca);
mantis_pcmcia_init(ca);
@@ -99,7 +99,7 @@ void mantis_evmgr_exit(struct mantis_ca *ca)
{
struct mantis_pci *mantis = ca->ca_priv;
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting");
+ dprintk(verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting");
tasklet_kill(&ca->hif_evm_tasklet);
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)
{
u32 stat = 0, mask = 0, lstat = 0, mstat = 0;
struct mantis_pci *mantis;
+ struct mantis_ca *ca;
mantis = (struct mantis_pci *) dev_id;
if (unlikely(mantis == NULL)) {
dprintk(verbose, MANTIS_ERROR, 1, "Mantis == NULL");
return IRQ_NONE;
}
+ ca = mantis->mantis_ca;
+
stat = mmread(MANTIS_INT_STAT);
mask = mmread(MANTIS_INT_MASK);
mstat = lstat = stat & ~MANTIS_INT_RISCSTAT;
@@ -72,14 +75,9 @@ static irqreturn_t mantis_pci_irq(int irq, void *dev_id)
if (stat & MANTIS_INT_RISCEN) {
dprintk(verbose, MANTIS_DEBUG, 0, "* DMA enabl *");
}
- if (stat & MANTIS_INT_I2CRACK) {
- dprintk(verbose, MANTIS_DEBUG, 0, "* I2C R-ACK *");
- }
- if (stat & MANTIS_INT_PCMCIA7) {
- dprintk(verbose, MANTIS_DEBUG, 0, "* PCMCIA-07 *");
- }
if (stat & MANTIS_INT_IRQ0) {
dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-0 *");
+ tasklet_schedule(&ca->hif_evm_tasklet);
}
if (stat & MANTIS_INT_IRQ1) {
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)
u32 gpif_irqcfg;
if (ca->slot_state == MODULE_XTRACTED) {
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event: CAM Plugged IN: Adapter(%d) Slot(0)", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event: CAM Plugged IN: Adapter(%d) Slot(0)", mantis->num);
udelay(50);
mmwrite(0xda000000, MANTIS_CARD_RESET);
gpif_irqcfg = mmread(MANTIS_GPIF_IRQCFG);
@@ -56,7 +56,7 @@ void mantis_event_cam_unplug(struct mantis_ca *ca)
u32 gpif_irqcfg;
if (ca->slot_state == MODULE_INSERTED) {
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event: CAM Unplugged: Adapter(%d) Slot(0)", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Event: CAM Unplugged: Adapter(%d) Slot(0)", mantis->num);
udelay(50);
mmwrite(0x00da0000, MANTIS_CARD_RESET);
gpif_irqcfg = mmread(MANTIS_GPIF_IRQCFG);
@@ -75,15 +75,16 @@ int mantis_pcmcia_init(struct mantis_ca *ca)
u32 gpif_stat, card_stat;
+ mmwrite(mmread(MANTIS_INT_MASK) | MANTIS_INT_IRQ0, MANTIS_INT_MASK);
gpif_stat = mmread(MANTIS_GPIF_STATUS);
card_stat = mmread(MANTIS_GPIF_IRQCFG);
if (gpif_stat & MANTIS_GPIF_DETSTAT) {
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "CAM found on Adapter(%d) Slot(0)", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "CAM found on Adapter(%d) Slot(0)", mantis->num);
mmwrite(card_stat | MANTIS_MASK_PLUGOUT, MANTIS_GPIF_IRQCFG);
ca->slot_state = MODULE_INSERTED;
} else {
- dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Empty Slot on Adapter(%d) Slot(0)", mantis->num);
+ dprintk(verbose, MANTIS_DEBUG, 1, "Empty Slot on Adapter(%d) Slot(0)", mantis->num);
mmwrite(card_stat | MANTIS_MASK_PLUGIN, MANTIS_GPIF_IRQCFG);
ca->slot_state = MODULE_XTRACTED;
}