diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2009-12-04 03:26:46 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-01-17 08:55:39 -0500 |
commit | 17b77fc2d404910ca691661038ceb4c02d912d16 (patch) | |
tree | 93692d7f1844e2717f18f352d5367aa75c3741a0 /drivers/media | |
parent | f668c7292bda7f64400eaa8d45c3a785eecab990 (diff) |
V4L/DVB (13771): [Mantis] Reset Flags at the earliest possible
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/mantis/mantis_common.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_evm.c | 18 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_pci.c | 12 |
3 files changed, 19 insertions, 13 deletions
diff --git a/drivers/media/dvb/mantis/mantis_common.h b/drivers/media/dvb/mantis/mantis_common.h index ac3eefec0a7b..27ecfdb6e6f7 100644 --- a/drivers/media/dvb/mantis/mantis_common.h +++ b/drivers/media/dvb/mantis/mantis_common.h | |||
@@ -139,6 +139,8 @@ struct mantis_pci { | |||
139 | /* A12 A13 A14 */ | 139 | /* A12 A13 A14 */ |
140 | u32 gpio_status; | 140 | u32 gpio_status; |
141 | 141 | ||
142 | u32 gpif_status; | ||
143 | |||
142 | struct mantis_ca *mantis_ca; | 144 | struct mantis_ca *mantis_ca; |
143 | }; | 145 | }; |
144 | 146 | ||
diff --git a/drivers/media/dvb/mantis/mantis_evm.c b/drivers/media/dvb/mantis/mantis_evm.c index d603601c09b1..4c4c1448ddd4 100644 --- a/drivers/media/dvb/mantis/mantis_evm.c +++ b/drivers/media/dvb/mantis/mantis_evm.c | |||
@@ -27,19 +27,11 @@ static void mantis_hifevm_work(struct work_struct *work) | |||
27 | struct mantis_ca *ca = container_of(work, struct mantis_ca, hif_evm_work); | 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, rst_mask, rst_stat; | 30 | u32 gpif_stat, gpif_mask; |
31 | |||
32 | rst_mask = MANTIS_GPIF_WRACK | | ||
33 | MANTIS_GPIF_OTHERR | | ||
34 | MANTIS_SBUF_WSTO | | ||
35 | MANTIS_GPIF_EXTIRQ; | ||
36 | 31 | ||
37 | gpif_stat = mmread(MANTIS_GPIF_STATUS); | 32 | gpif_stat = mmread(MANTIS_GPIF_STATUS); |
38 | gpif_mask = mmread(MANTIS_GPIF_IRQCFG); | 33 | gpif_mask = mmread(MANTIS_GPIF_IRQCFG); |
39 | 34 | ||
40 | rst_stat = gpif_stat & rst_mask; | ||
41 | mmwrite(rst_stat, MANTIS_GPIF_STATUS); | ||
42 | |||
43 | if (gpif_stat & MANTIS_GPIF_DETSTAT) { | 35 | if (gpif_stat & MANTIS_GPIF_DETSTAT) { |
44 | if (gpif_stat & MANTIS_CARD_PLUGIN) { | 36 | if (gpif_stat & MANTIS_CARD_PLUGIN) { |
45 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num); | 37 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num); |
@@ -60,13 +52,13 @@ static void mantis_hifevm_work(struct work_struct *work) | |||
60 | } | 52 | } |
61 | } | 53 | } |
62 | 54 | ||
63 | if (gpif_stat & MANTIS_GPIF_EXTIRQ) | 55 | if (mantis->gpif_status & MANTIS_GPIF_EXTIRQ) |
64 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Ext IRQ", mantis->num); | 56 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Ext IRQ", mantis->num); |
65 | 57 | ||
66 | if (gpif_stat & MANTIS_SBUF_WSTO) | 58 | if (mantis->gpif_status & MANTIS_SBUF_WSTO) |
67 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Timeout", mantis->num); | 59 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Timeout", mantis->num); |
68 | 60 | ||
69 | if (gpif_stat & MANTIS_GPIF_OTHERR) | 61 | if (mantis->gpif_status & MANTIS_GPIF_OTHERR) |
70 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Alignment Error", mantis->num); | 62 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Alignment Error", mantis->num); |
71 | 63 | ||
72 | if (gpif_stat & MANTIS_SBUF_OVFLW) | 64 | if (gpif_stat & MANTIS_SBUF_OVFLW) |
@@ -75,7 +67,7 @@ static void mantis_hifevm_work(struct work_struct *work) | |||
75 | if (gpif_stat & MANTIS_GPIF_BRRDY) | 67 | if (gpif_stat & MANTIS_GPIF_BRRDY) |
76 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Read Ready", mantis->num); | 68 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Smart Buffer Read Ready", mantis->num); |
77 | 69 | ||
78 | if (gpif_stat & MANTIS_GPIF_WRACK) | 70 | if (mantis->gpif_status & MANTIS_GPIF_WRACK) |
79 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Slave Write ACK", mantis->num); | 71 | dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): Slave Write ACK", mantis->num); |
80 | 72 | ||
81 | if (gpif_stat & MANTIS_GPIF_INTSTAT) | 73 | if (gpif_stat & MANTIS_GPIF_INTSTAT) |
diff --git a/drivers/media/dvb/mantis/mantis_pci.c b/drivers/media/dvb/mantis/mantis_pci.c index 4873fa9586e0..f57e2a43b9ed 100644 --- a/drivers/media/dvb/mantis/mantis_pci.c +++ b/drivers/media/dvb/mantis/mantis_pci.c | |||
@@ -53,6 +53,8 @@ MODULE_DEVICE_TABLE(pci, mantis_pci_table); | |||
53 | static irqreturn_t mantis_pci_irq(int irq, void *dev_id) | 53 | 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 | u32 rst_stat = 0, rst_mask = 0; | ||
57 | |||
56 | struct mantis_pci *mantis; | 58 | struct mantis_pci *mantis; |
57 | struct mantis_ca *ca; | 59 | struct mantis_ca *ca; |
58 | 60 | ||
@@ -69,6 +71,15 @@ static irqreturn_t mantis_pci_irq(int irq, void *dev_id) | |||
69 | if (!(stat & mask)) | 71 | if (!(stat & mask)) |
70 | return IRQ_NONE; | 72 | return IRQ_NONE; |
71 | 73 | ||
74 | rst_mask = MANTIS_GPIF_WRACK | | ||
75 | MANTIS_GPIF_OTHERR | | ||
76 | MANTIS_SBUF_WSTO | | ||
77 | MANTIS_GPIF_EXTIRQ; | ||
78 | |||
79 | rst_stat = mmread(MANTIS_GPIF_STATUS); | ||
80 | rst_stat &= rst_mask; | ||
81 | mmwrite(rst_stat, MANTIS_GPIF_STATUS); | ||
82 | |||
72 | mantis->mantis_int_stat = stat; | 83 | mantis->mantis_int_stat = stat; |
73 | mantis->mantis_int_mask = mask; | 84 | mantis->mantis_int_mask = mask; |
74 | dprintk(verbose, MANTIS_DEBUG, 0, "=== Interrupts[%04x/%04x]= [", stat, mask); | 85 | dprintk(verbose, MANTIS_DEBUG, 0, "=== Interrupts[%04x/%04x]= [", stat, mask); |
@@ -77,6 +88,7 @@ static irqreturn_t mantis_pci_irq(int irq, void *dev_id) | |||
77 | } | 88 | } |
78 | if (stat & MANTIS_INT_IRQ0) { | 89 | if (stat & MANTIS_INT_IRQ0) { |
79 | dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-0 *"); | 90 | dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-0 *"); |
91 | mantis->gpif_status = rst_stat; | ||
80 | schedule_work(&ca->hif_evm_work); | 92 | schedule_work(&ca->hif_evm_work); |
81 | } | 93 | } |
82 | if (stat & MANTIS_INT_IRQ1) { | 94 | if (stat & MANTIS_INT_IRQ1) { |