diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2009-12-04 03:05:19 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-01-17 08:55:33 -0500 |
commit | fadfa070d30434dd228362c933827eb6ce137f2d (patch) | |
tree | d80f50e487196758fe0e8bc3dce6876ed8d5ce82 /drivers/media/dvb/mantis/mantis_evm.c | |
parent | d575571e8eda92c2cfd727ef050d17e30878fee6 (diff) |
V4L/DVB (13735): [Mantis] Implement the Event Manager tasklet
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/mantis/mantis_evm.c')
-rw-r--r-- | drivers/media/dvb/mantis/mantis_evm.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/drivers/media/dvb/mantis/mantis_evm.c b/drivers/media/dvb/mantis/mantis_evm.c index c9359d6ddc23..9f1740ea389c 100644 --- a/drivers/media/dvb/mantis/mantis_evm.c +++ b/drivers/media/dvb/mantis/mantis_evm.c | |||
@@ -20,12 +20,76 @@ | |||
20 | 20 | ||
21 | #include "mantis_common.h" | 21 | #include "mantis_common.h" |
22 | #include "mantis_link.h" | 22 | #include "mantis_link.h" |
23 | #include "mantis_hif.h" | ||
24 | |||
25 | void mantis_hifevm_tasklet(unsigned long data) | ||
26 | { | ||
27 | struct mantis_ca *ca = (struct mantis_ca *) data; | ||
28 | struct mantis_pci *mantis = ca->ca_priv; | ||
29 | |||
30 | u32 gpif_stat; | ||
31 | |||
32 | gpif_stat = mmread(MANTIS_GPIF_STATUS); | ||
33 | |||
34 | if (gpif_stat & MANTIS_GPIF_DETSTAT) { | ||
35 | if (gpif_stat & MANTIS_CARD_PLUGIN) { | ||
36 | dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num); | ||
37 | mmwrite(0xdada0000, MANTIS_CARD_RESET); | ||
38 | // Plugin call here | ||
39 | gpif_stat = 0; // crude ! | ||
40 | } | ||
41 | } else { | ||
42 | if (gpif_stat & MANTIS_CARD_PLUGOUT) { | ||
43 | dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Unplug", mantis->num); | ||
44 | mmwrite(0xdada0000, MANTIS_CARD_RESET); | ||
45 | // Unplug call here | ||
46 | gpif_stat = 0; // crude ! | ||
47 | } | ||
48 | } | ||
49 | |||
50 | if (gpif_stat & MANTIS_GPIF_EXTIRQ) | ||
51 | dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Ext IRQ", mantis->num); | ||
52 | |||
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); | ||
55 | |||
56 | if (gpif_stat & MANTIS_GPIF_OTHERR) | ||
57 | dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Alignment Error", mantis->num); | ||
58 | |||
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); | ||
61 | |||
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); | ||
64 | ca->sbuf_status = MANTIS_SBUF_DATA_AVAIL; | ||
65 | if (ca->hif_job_queue & MANTIS_HIF_MEMRD) | ||
66 | wake_up(&ca->hif_brrdyw_wq); | ||
67 | } | ||
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); | ||
70 | |||
71 | if (gpif_stat & MANTIS_GPIF_INTSTAT) | ||
72 | dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): GPIF IRQ", mantis->num); | ||
73 | |||
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); | ||
76 | |||
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); | ||
79 | if (ca->hif_job_queue) { | ||
80 | wake_up(&ca->hif_opdone_wq); | ||
81 | ca->hif_event = MANTIS_SBUF_OPDONE; | ||
82 | } | ||
83 | } | ||
84 | } | ||
23 | 85 | ||
24 | int mantis_evmgr_init(struct mantis_ca *ca) | 86 | int mantis_evmgr_init(struct mantis_ca *ca) |
25 | { | 87 | { |
26 | struct mantis_pci *mantis = ca->ca_priv; | 88 | struct mantis_pci *mantis = ca->ca_priv; |
27 | 89 | ||
28 | dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager"); | 90 | dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager"); |
91 | tasklet_init(&ca->hif_evm_tasklet, mantis_hifevm_tasklet, (unsigned long) ca); | ||
92 | |||
29 | return 0; | 93 | return 0; |
30 | } | 94 | } |
31 | 95 | ||
@@ -34,4 +98,5 @@ void mantis_evmgr_exit(struct mantis_ca *ca) | |||
34 | struct mantis_pci *mantis = ca->ca_priv; | 98 | struct mantis_pci *mantis = ca->ca_priv; |
35 | 99 | ||
36 | dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting"); | 100 | dprintk(mantis->verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting"); |
101 | tasklet_kill(&ca->hif_evm_tasklet); | ||
37 | } | 102 | } |