diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2009-12-04 03:09:04 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-01-17 08:55:34 -0500 |
commit | 12855cac87218d0c92ffdebb7270cec040cf5a6a (patch) | |
tree | 81a6b9599c17e3f87dcbe3fa4a2296b5593a00fb | |
parent | 3062b1571a1d3520c4d3160ebbfca8002b1d6963 (diff) |
V4L/DVB (13740): [Mantis] Schedule the work instead of handling the task directly
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/mantis/mantis_common.h | 4 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_evm.c | 17 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_link.h | 4 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_pci.c | 2 |
4 files changed, 15 insertions, 12 deletions
diff --git a/drivers/media/dvb/mantis/mantis_common.h b/drivers/media/dvb/mantis/mantis_common.h index f9891ebcfb0d..7f1cfad74883 100644 --- a/drivers/media/dvb/mantis/mantis_common.h +++ b/drivers/media/dvb/mantis/mantis_common.h | |||
@@ -151,4 +151,8 @@ extern int mantis_dvb_exit(struct mantis_pci *mantis); | |||
151 | extern void mantis_dma_xfer(unsigned long data); | 151 | extern void mantis_dma_xfer(unsigned long data); |
152 | extern void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value); | 152 | extern void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value); |
153 | 153 | ||
154 | extern struct dvb_device *mantis_ca_init(struct mantis_pci *mantis); | ||
155 | extern void mantis_ca_exit(struct mantis_pci *mantis); | ||
156 | |||
157 | |||
154 | #endif //__MANTIS_COMMON_H | 158 | #endif //__MANTIS_COMMON_H |
diff --git a/drivers/media/dvb/mantis/mantis_evm.c b/drivers/media/dvb/mantis/mantis_evm.c index c35ddd868f89..745148399981 100644 --- a/drivers/media/dvb/mantis/mantis_evm.c +++ b/drivers/media/dvb/mantis/mantis_evm.c | |||
@@ -22,9 +22,9 @@ | |||
22 | #include "mantis_link.h" | 22 | #include "mantis_link.h" |
23 | #include "mantis_hif.h" | 23 | #include "mantis_hif.h" |
24 | 24 | ||
25 | void mantis_hifevm_tasklet(unsigned long data) | 25 | static void mantis_hifevm_work(struct work_struct *work) |
26 | { | 26 | { |
27 | struct mantis_ca *ca = (struct mantis_ca *) data; | 27 | struct mantis_ca *ca = container_of(work, struct mantis_ca, hif_evm_work); |
28 | struct mantis_pci *mantis = ca->ca_priv; | 28 | struct mantis_pci *mantis = ca->ca_priv; |
29 | 29 | ||
30 | u32 gpif_stat, gpif_mask; | 30 | u32 gpif_stat, gpif_mask; |
@@ -38,15 +38,13 @@ void mantis_hifevm_tasklet(unsigned long data) | |||
38 | if (gpif_stat & MANTIS_CARD_PLUGIN) { | 38 | if (gpif_stat & MANTIS_CARD_PLUGIN) { |
39 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num); | 39 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num); |
40 | mmwrite(0xdada0000, MANTIS_CARD_RESET); | 40 | mmwrite(0xdada0000, MANTIS_CARD_RESET); |
41 | // Plugin call here | 41 | mantis_event_cam_plugin(ca); |
42 | gpif_stat = 0; // crude ! | ||
43 | } | 42 | } |
44 | } else { | 43 | } else { |
45 | if (gpif_stat & MANTIS_CARD_PLUGOUT) { | 44 | if (gpif_stat & MANTIS_CARD_PLUGOUT) { |
46 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Unplug", mantis->num); | 45 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Unplug", mantis->num); |
47 | mmwrite(0xdada0000, MANTIS_CARD_RESET); | 46 | mmwrite(0xdada0000, MANTIS_CARD_RESET); |
48 | // Unplug call here | 47 | mantis_event_cam_unplug(ca); |
49 | gpif_stat = 0; // crude ! | ||
50 | } | 48 | } |
51 | } | 49 | } |
52 | 50 | ||
@@ -91,9 +89,9 @@ int mantis_evmgr_init(struct mantis_ca *ca) | |||
91 | struct mantis_pci *mantis = ca->ca_priv; | 89 | struct mantis_pci *mantis = ca->ca_priv; |
92 | 90 | ||
93 | dprintk(verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager"); | 91 | dprintk(verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager"); |
94 | tasklet_init(&ca->hif_evm_tasklet, mantis_hifevm_tasklet, (unsigned long) ca); | 92 | INIT_WORK(&ca->hif_evm_work, mantis_hifevm_work); |
95 | |||
96 | mantis_pcmcia_init(ca); | 93 | mantis_pcmcia_init(ca); |
94 | schedule_work(&ca->hif_evm_work); | ||
97 | 95 | ||
98 | return 0; | 96 | return 0; |
99 | } | 97 | } |
@@ -103,7 +101,6 @@ void mantis_evmgr_exit(struct mantis_ca *ca) | |||
103 | struct mantis_pci *mantis = ca->ca_priv; | 101 | struct mantis_pci *mantis = ca->ca_priv; |
104 | 102 | ||
105 | dprintk(verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting"); | 103 | dprintk(verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting"); |
106 | tasklet_kill(&ca->hif_evm_tasklet); | 104 | flush_scheduled_work(); |
107 | |||
108 | mantis_pcmcia_exit(ca); | 105 | mantis_pcmcia_exit(ca); |
109 | } | 106 | } |
diff --git a/drivers/media/dvb/mantis/mantis_link.h b/drivers/media/dvb/mantis/mantis_link.h index a45dd7185e06..33b39b781d2e 100644 --- a/drivers/media/dvb/mantis/mantis_link.h +++ b/drivers/media/dvb/mantis/mantis_link.h | |||
@@ -21,6 +21,8 @@ | |||
21 | #ifndef __MANTIS_LINK_H | 21 | #ifndef __MANTIS_LINK_H |
22 | #define __MANTIS_LINK_H | 22 | #define __MANTIS_LINK_H |
23 | 23 | ||
24 | #include <linux/workqueue.h> | ||
25 | |||
24 | enum mantis_sbuf_status { | 26 | enum mantis_sbuf_status { |
25 | MANTIS_SBUF_DATA_AVAIL = 1, | 27 | MANTIS_SBUF_DATA_AVAIL = 1, |
26 | MANTIS_SBUF_DATA_EMPTY = 2, | 28 | MANTIS_SBUF_DATA_EMPTY = 2, |
@@ -40,7 +42,7 @@ enum mantis_slot_state { | |||
40 | struct mantis_ca { | 42 | struct mantis_ca { |
41 | struct mantis_slot slot; | 43 | struct mantis_slot slot; |
42 | 44 | ||
43 | struct tasklet_struct hif_evm_tasklet; | 45 | struct work_struct hif_evm_work; |
44 | 46 | ||
45 | u32 hif_event; | 47 | u32 hif_event; |
46 | wait_queue_head_t hif_opdone_wq; | 48 | wait_queue_head_t hif_opdone_wq; |
diff --git a/drivers/media/dvb/mantis/mantis_pci.c b/drivers/media/dvb/mantis/mantis_pci.c index 814c6ace3d37..6eecd54a4457 100644 --- a/drivers/media/dvb/mantis/mantis_pci.c +++ b/drivers/media/dvb/mantis/mantis_pci.c | |||
@@ -77,7 +77,7 @@ static irqreturn_t mantis_pci_irq(int irq, void *dev_id) | |||
77 | } | 77 | } |
78 | if (stat & MANTIS_INT_IRQ0) { | 78 | if (stat & MANTIS_INT_IRQ0) { |
79 | dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-0 *"); | 79 | dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-0 *"); |
80 | tasklet_schedule(&ca->hif_evm_tasklet); | 80 | schedule_work(&ca->hif_evm_work); |
81 | } | 81 | } |
82 | if (stat & MANTIS_INT_IRQ1) { | 82 | if (stat & MANTIS_INT_IRQ1) { |
83 | dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-1 *"); | 83 | dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-1 *"); |