aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-08-18 05:57:55 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:05:54 -0400
commit8ddac9ee4b6f08d7cacf79202ab882eefc55b0c0 (patch)
tree7b14520928ff9417c1ea9d0de1cbff73068dcb73 /drivers/media
parent7c03a4488bf6d28078488c70c82357d4286cacc5 (diff)
V4L/DVB (6064): cx88: Add symbolic names for the PCI interrupt bits
Used for the PCI_INTMSK and PCI_INT_STAT registers. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx88/cx88-alsa.c16
-rw-r--r--drivers/media/video/cx88/cx88-cards.c4
-rw-r--r--drivers/media/video/cx88/cx88-core.c2
-rw-r--r--drivers/media/video/cx88/cx88-input.c4
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c9
-rw-r--r--drivers/media/video/cx88/cx88-reg.h22
-rw-r--r--drivers/media/video/cx88/cx88-vbi.c4
-rw-r--r--drivers/media/video/cx88/cx88-video.c9
8 files changed, 49 insertions, 21 deletions
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index 2d666b56020c..a529c0a87d1a 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -149,9 +149,11 @@ static int _cx88_start_audio_dma(snd_cx88_card_t *chip)
149 /* reset counter */ 149 /* reset counter */
150 cx_write(MO_AUDD_GPCNTRL,GP_COUNT_CONTROL_RESET); 150 cx_write(MO_AUDD_GPCNTRL,GP_COUNT_CONTROL_RESET);
151 151
152 dprintk(1,"Enabling IRQ, setting mask from 0x%x to 0x%x\n",chip->core->pci_irqmask,(chip->core->pci_irqmask | 0x02)); 152 dprintk(1, "Enabling IRQ, setting mask from 0x%x to 0x%x\n",
153 chip->core->pci_irqmask,
154 chip->core->pci_irqmask | PCI_INT_AUDINT);
153 /* enable irqs */ 155 /* enable irqs */
154 cx_set(MO_PCI_INTMSK, chip->core->pci_irqmask | 0x02); 156 cx_set(MO_PCI_INTMSK, chip->core->pci_irqmask | PCI_INT_AUDINT);
155 157
156 158
157 /* Enables corresponding bits at AUD_INT_STAT */ 159 /* Enables corresponding bits at AUD_INT_STAT */
@@ -184,7 +186,7 @@ static int _cx88_stop_audio_dma(snd_cx88_card_t *chip)
184 cx_clear(MO_AUD_DMACNTRL, 0x11); 186 cx_clear(MO_AUD_DMACNTRL, 0x11);
185 187
186 /* disable irqs */ 188 /* disable irqs */
187 cx_clear(MO_PCI_INTMSK, 0x02); 189 cx_clear(MO_PCI_INTMSK, PCI_INT_AUDINT);
188 cx_clear(MO_AUD_INTMSK, 190 cx_clear(MO_AUD_INTMSK,
189 (1<<16)| 191 (1<<16)|
190 (1<<12)| 192 (1<<12)|
@@ -273,7 +275,8 @@ static irqreturn_t cx8801_irq(int irq, void *dev_id)
273 int loop, handled = 0; 275 int loop, handled = 0;
274 276
275 for (loop = 0; loop < MAX_IRQ_LOOP; loop++) { 277 for (loop = 0; loop < MAX_IRQ_LOOP; loop++) {
276 status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x02); 278 status = cx_read(MO_PCI_INTSTAT) &
279 (core->pci_irqmask | PCI_INT_AUDINT);
277 if (0 == status) 280 if (0 == status)
278 goto out; 281 goto out;
279 dprintk( 3, "cx8801_irq\n" ); 282 dprintk( 3, "cx8801_irq\n" );
@@ -282,8 +285,7 @@ static irqreturn_t cx8801_irq(int irq, void *dev_id)
282 handled = 1; 285 handled = 1;
283 cx_write(MO_PCI_INTSTAT, status); 286 cx_write(MO_PCI_INTSTAT, status);
284 287
285 if (status & 0x02) 288 if (status & PCI_INT_AUDINT) {
286 {
287 dprintk( 2, " ALSA IRQ handling\n" ); 289 dprintk( 2, " ALSA IRQ handling\n" );
288 cx8801_aud_irq(chip); 290 cx8801_aud_irq(chip);
289 } 291 }
@@ -293,7 +295,7 @@ static irqreturn_t cx8801_irq(int irq, void *dev_id)
293 dprintk( 0, "clearing mask\n" ); 295 dprintk( 0, "clearing mask\n" );
294 dprintk(1,"%s/0: irq loop -- clearing mask\n", 296 dprintk(1,"%s/0: irq loop -- clearing mask\n",
295 core->name); 297 core->name);
296 cx_clear(MO_PCI_INTMSK,0x02); 298 cx_clear(MO_PCI_INTMSK, PCI_INT_AUDINT);
297 } 299 }
298 300
299 out: 301 out:
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index e73e8c96d5b9..a4eb6a87a761 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -2063,7 +2063,9 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
2063 atomic_inc(&core->refcount); 2063 atomic_inc(&core->refcount);
2064 core->pci_bus = pci->bus->number; 2064 core->pci_bus = pci->bus->number;
2065 core->pci_slot = PCI_SLOT(pci->devfn); 2065 core->pci_slot = PCI_SLOT(pci->devfn);
2066 core->pci_irqmask = 0x00fc00; 2066 core->pci_irqmask = PCI_INT_RISC_RD_BERRINT | PCI_INT_RISC_WR_BERRINT |
2067 PCI_INT_BRDG_BERRINT | PCI_INT_SRC_DMA_BERRINT |
2068 PCI_INT_DST_DMA_BERRINT | PCI_INT_IPB_DMA_BERRINT;
2067 mutex_init(&core->lock); 2069 mutex_init(&core->lock);
2068 2070
2069 core->nr = nr; 2071 core->nr = nr;
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index 0765e9db5339..970926b97ee4 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -498,7 +498,7 @@ int cx88_core_irq(struct cx88_core *core, u32 status)
498{ 498{
499 int handled = 0; 499 int handled = 0;
500 500
501 if (status & (1<<18)) { 501 if (status & PCI_INT_IR_SMPINT) {
502 cx88_ir_irq(core); 502 cx88_ir_irq(core);
503 handled++; 503 handled++;
504 } 504 }
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index 120f56857f0e..c78a95ef7581 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -167,7 +167,7 @@ static void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir)
167 schedule_work(&ir->work); 167 schedule_work(&ir->work);
168 } 168 }
169 if (ir->sampling) { 169 if (ir->sampling) {
170 core->pci_irqmask |= (1 << 18); /* IR_SMP_INT */ 170 core->pci_irqmask |= PCI_INT_IR_SMPINT;
171 cx_write(MO_DDS_IO, 0xa80a80); /* 4 kHz sample rate */ 171 cx_write(MO_DDS_IO, 0xa80a80); /* 4 kHz sample rate */
172 cx_write(MO_DDSCFG_IO, 0x5); /* enable */ 172 cx_write(MO_DDSCFG_IO, 0x5); /* enable */
173 } 173 }
@@ -177,7 +177,7 @@ static void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir)
177{ 177{
178 if (ir->sampling) { 178 if (ir->sampling) {
179 cx_write(MO_DDSCFG_IO, 0x0); 179 cx_write(MO_DDSCFG_IO, 0x0);
180 core->pci_irqmask &= ~(1 << 18); 180 core->pci_irqmask &= ~PCI_INT_IR_SMPINT;
181 } 181 }
182 182
183 if (ir->polling) { 183 if (ir->polling) {
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index 5da47e251e66..d46114685ed1 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -148,7 +148,7 @@ static int cx8802_start_dma(struct cx8802_dev *dev,
148 148
149 /* enable irqs */ 149 /* enable irqs */
150 dprintk( 1, "setting the interrupt mask\n" ); 150 dprintk( 1, "setting the interrupt mask\n" );
151 cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x04); 151 cx_set(MO_PCI_INTMSK, core->pci_irqmask | PCI_INT_TSINT);
152 cx_set(MO_TS_INTMSK, 0x1f0011); 152 cx_set(MO_TS_INTMSK, 0x1f0011);
153 153
154 /* start dma */ 154 /* start dma */
@@ -166,7 +166,7 @@ static int cx8802_stop_dma(struct cx8802_dev *dev)
166 cx_clear(MO_TS_DMACNTRL, 0x11); 166 cx_clear(MO_TS_DMACNTRL, 0x11);
167 167
168 /* disable irqs */ 168 /* disable irqs */
169 cx_clear(MO_PCI_INTMSK, 0x000004); 169 cx_clear(MO_PCI_INTMSK, PCI_INT_TSINT);
170 cx_clear(MO_TS_INTMSK, 0x1f0011); 170 cx_clear(MO_TS_INTMSK, 0x1f0011);
171 171
172 /* Reset the controller */ 172 /* Reset the controller */
@@ -413,7 +413,8 @@ static irqreturn_t cx8802_irq(int irq, void *dev_id)
413 int loop, handled = 0; 413 int loop, handled = 0;
414 414
415 for (loop = 0; loop < MAX_IRQ_LOOP; loop++) { 415 for (loop = 0; loop < MAX_IRQ_LOOP; loop++) {
416 status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x04); 416 status = cx_read(MO_PCI_INTSTAT) &
417 (core->pci_irqmask | PCI_INT_TSINT);
417 if (0 == status) 418 if (0 == status)
418 goto out; 419 goto out;
419 dprintk( 1, "cx8802_irq\n" ); 420 dprintk( 1, "cx8802_irq\n" );
@@ -424,7 +425,7 @@ static irqreturn_t cx8802_irq(int irq, void *dev_id)
424 425
425 if (status & core->pci_irqmask) 426 if (status & core->pci_irqmask)
426 cx88_core_irq(core,status); 427 cx88_core_irq(core,status);
427 if (status & 0x04) 428 if (status & PCI_INT_TSINT)
428 cx8802_mpeg_irq(dev); 429 cx8802_mpeg_irq(dev);
429 }; 430 };
430 if (MAX_IRQ_LOOP == loop) { 431 if (MAX_IRQ_LOOP == loop) {
diff --git a/drivers/media/video/cx88/cx88-reg.h b/drivers/media/video/cx88/cx88-reg.h
index d3bf5b17b1d4..2b1d102cd220 100644
--- a/drivers/media/video/cx88/cx88-reg.h
+++ b/drivers/media/video/cx88/cx88-reg.h
@@ -582,6 +582,28 @@
582/* ---------------------------------------------------------------------- */ 582/* ---------------------------------------------------------------------- */
583/* various constants */ 583/* various constants */
584 584
585// DMA
586/* Interrupt mask/status */
587#define PCI_INT_VIDINT (1 << 0)
588#define PCI_INT_AUDINT (1 << 1)
589#define PCI_INT_TSINT (1 << 2)
590#define PCI_INT_VIPINT (1 << 3)
591#define PCI_INT_HSTINT (1 << 4)
592#define PCI_INT_TM1INT (1 << 5)
593#define PCI_INT_SRCDMAINT (1 << 6)
594#define PCI_INT_DSTDMAINT (1 << 7)
595#define PCI_INT_RISC_RD_BERRINT (1 << 10)
596#define PCI_INT_RISC_WR_BERRINT (1 << 11)
597#define PCI_INT_BRDG_BERRINT (1 << 12)
598#define PCI_INT_SRC_DMA_BERRINT (1 << 13)
599#define PCI_INT_DST_DMA_BERRINT (1 << 14)
600#define PCI_INT_IPB_DMA_BERRINT (1 << 15)
601#define PCI_INT_I2CDONE (1 << 16)
602#define PCI_INT_I2CRACK (1 << 17)
603#define PCI_INT_IR_SMPINT (1 << 18)
604#define PCI_INT_GPIO_INT0 (1 << 19)
605#define PCI_INT_GPIO_INT1 (1 << 20)
606
585#define SEL_BTSC 0x01 607#define SEL_BTSC 0x01
586#define SEL_EIAJ 0x02 608#define SEL_EIAJ 0x02
587#define SEL_A2 0x04 609#define SEL_A2 0x04
diff --git a/drivers/media/video/cx88/cx88-vbi.c b/drivers/media/video/cx88/cx88-vbi.c
index 86c1cf8334bc..16c0d36bb6b2 100644
--- a/drivers/media/video/cx88/cx88-vbi.c
+++ b/drivers/media/video/cx88/cx88-vbi.c
@@ -67,7 +67,7 @@ static int cx8800_start_vbi_dma(struct cx8800_dev *dev,
67 q->count = 1; 67 q->count = 1;
68 68
69 /* enable irqs */ 69 /* enable irqs */
70 cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x01); 70 cx_set(MO_PCI_INTMSK, core->pci_irqmask | PCI_INT_VIDINT);
71 cx_set(MO_VID_INTMSK, 0x0f0088); 71 cx_set(MO_VID_INTMSK, 0x0f0088);
72 72
73 /* enable capture */ 73 /* enable capture */
@@ -91,7 +91,7 @@ int cx8800_stop_vbi_dma(struct cx8800_dev *dev)
91 cx_clear(VID_CAPTURE_CONTROL,0x18); 91 cx_clear(VID_CAPTURE_CONTROL,0x18);
92 92
93 /* disable irqs */ 93 /* disable irqs */
94 cx_clear(MO_PCI_INTMSK, 0x000001); 94 cx_clear(MO_PCI_INTMSK, PCI_INT_VIDINT);
95 cx_clear(MO_VID_INTMSK, 0x0f0088); 95 cx_clear(MO_VID_INTMSK, 0x0f0088);
96 return 0; 96 return 0;
97} 97}
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index e158ea2454af..e96c688cba9f 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -423,7 +423,7 @@ static int start_video_dma(struct cx8800_dev *dev,
423 q->count = 1; 423 q->count = 1;
424 424
425 /* enable irqs */ 425 /* enable irqs */
426 cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x01); 426 cx_set(MO_PCI_INTMSK, core->pci_irqmask | PCI_INT_VIDINT);
427 427
428 /* Enables corresponding bits at PCI_INT_STAT: 428 /* Enables corresponding bits at PCI_INT_STAT:
429 bits 0 to 4: video, audio, transport stream, VIP, Host 429 bits 0 to 4: video, audio, transport stream, VIP, Host
@@ -456,7 +456,7 @@ static int stop_video_dma(struct cx8800_dev *dev)
456 cx_clear(VID_CAPTURE_CONTROL,0x06); 456 cx_clear(VID_CAPTURE_CONTROL,0x06);
457 457
458 /* disable irqs */ 458 /* disable irqs */
459 cx_clear(MO_PCI_INTMSK, 0x000001); 459 cx_clear(MO_PCI_INTMSK, PCI_INT_VIDINT);
460 cx_clear(MO_VID_INTMSK, 0x0f0011); 460 cx_clear(MO_VID_INTMSK, 0x0f0011);
461 return 0; 461 return 0;
462} 462}
@@ -1604,7 +1604,8 @@ static irqreturn_t cx8800_irq(int irq, void *dev_id)
1604 int loop, handled = 0; 1604 int loop, handled = 0;
1605 1605
1606 for (loop = 0; loop < 10; loop++) { 1606 for (loop = 0; loop < 10; loop++) {
1607 status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x01); 1607 status = cx_read(MO_PCI_INTSTAT) &
1608 (core->pci_irqmask | PCI_INT_VIDINT);
1608 if (0 == status) 1609 if (0 == status)
1609 goto out; 1610 goto out;
1610 cx_write(MO_PCI_INTSTAT, status); 1611 cx_write(MO_PCI_INTSTAT, status);
@@ -1612,7 +1613,7 @@ static irqreturn_t cx8800_irq(int irq, void *dev_id)
1612 1613
1613 if (status & core->pci_irqmask) 1614 if (status & core->pci_irqmask)
1614 cx88_core_irq(core,status); 1615 cx88_core_irq(core,status);
1615 if (status & 0x01) 1616 if (status & PCI_INT_VIDINT)
1616 cx8800_vid_irq(dev); 1617 cx8800_vid_irq(dev);
1617 }; 1618 };
1618 if (10 == loop) { 1619 if (10 == loop) {