mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
V4L/DVB (13738): [Mantis] Enable IRQ0 events
Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
50d8260276
commit
d9dd5f7168
@ -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;
|
||||
|
@ -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 .. */
|
||||
|
@ -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);
|
||||
|
@ -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 *");
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user