summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/common/saa7146_core.c4
-rw-r--r--linux/drivers/media/common/saa7146_i2c.c2
-rw-r--r--linux/drivers/media/common/saa7146_vbi.c8
-rw-r--r--linux/drivers/media/common/saa7146_video.c4
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c36
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_hw.c16
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-core.c4
-rw-r--r--linux/include/media/saa7146.h6
8 files changed, 38 insertions, 42 deletions
diff --git a/linux/drivers/media/common/saa7146_core.c b/linux/drivers/media/common/saa7146_core.c
index 4f8364d76..c4088bec6 100644
--- a/linux/drivers/media/common/saa7146_core.c
+++ b/linux/drivers/media/common/saa7146_core.c
@@ -292,7 +292,7 @@ static irqreturn_t interrupt_hw(int irq, void *dev_id, struct pt_regs *regs)
if (0 != (isr & (MASK_16|MASK_17))) {
u32 status = saa7146_read(dev, I2C_STATUS);
if( (0x3 == (status & 0x3)) || (0 == (status & 0x1)) ) {
- IER_DISABLE(dev, MASK_16|MASK_17);
+ SAA7146_IER_DISABLE(dev, MASK_16|MASK_17);
/* only wake up if we expect something */
if( 0 != dev->i2c_op ) {
u32 psr = (saa7146_read(dev, PSR) >> 16) & 0x2;
@@ -311,7 +311,7 @@ static irqreturn_t interrupt_hw(int irq, void *dev_id, struct pt_regs *regs)
if( 0 != isr ) {
ERR(("warning: interrupt enabled, but not handled properly.(0x%08x)\n",isr));
ERR(("disabling interrupt source(s)!\n"));
- IER_DISABLE(dev,isr);
+ SAA7146_IER_DISABLE(dev,isr);
}
return IRQ_HANDLED;
}
diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c
index 4f912c905..1a83c0148 100644
--- a/linux/drivers/media/common/saa7146_i2c.c
+++ b/linux/drivers/media/common/saa7146_i2c.c
@@ -190,7 +190,7 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d
saa7146_write(dev, I2C_TRANSFER, *dword);
dev->i2c_op = 1;
- IER_ENABLE(dev, MASK_16|MASK_17);
+ SAA7146_IER_ENABLE(dev, MASK_16|MASK_17);
saa7146_write(dev, MC2, (MASK_00 | MASK_16));
wait_event_interruptible(dev->i2c_wq, dev->i2c_op == 0);
diff --git a/linux/drivers/media/common/saa7146_vbi.c b/linux/drivers/media/common/saa7146_vbi.c
index ecbd93eee..1b8661f4a 100644
--- a/linux/drivers/media/common/saa7146_vbi.c
+++ b/linux/drivers/media/common/saa7146_vbi.c
@@ -91,7 +91,7 @@ static int vbi_workaround(struct saa7146_dev *dev)
saa7146_write(dev, MC2, MASK_04|MASK_20);
/* enable rps1 irqs */
- IER_ENABLE(dev,MASK_28);
+ SAA7146_IER_ENABLE(dev,MASK_28);
/* prepare to wait to be woken up by the irq-handler */
add_wait_queue(&vv->vbi_wq, &wait);
@@ -109,7 +109,7 @@ static int vbi_workaround(struct saa7146_dev *dev)
current->state = TASK_RUNNING;
/* disable rps1 irqs */
- IER_DISABLE(dev,MASK_28);
+ SAA7146_IER_DISABLE(dev,MASK_28);
/* stop video-dma3 */
saa7146_write(dev, MC1, MASK_20);
@@ -191,7 +191,7 @@ static void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf
WRITE_RPS1(CMD_STOP);
/* enable rps1 irqs */
- IER_ENABLE(dev, MASK_28);
+ SAA7146_IER_ENABLE(dev, MASK_28);
/* write the address of the rps-program */
saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle);
@@ -345,7 +345,7 @@ static void vbi_stop(struct saa7146_fh *fh, struct file *file)
saa7146_write(dev, MC1, MASK_29);
/* disable rps1 irqs */
- IER_DISABLE(dev, MASK_28);
+ SAA7146_IER_DISABLE(dev, MASK_28);
/* shut down dma 3 transfers */
saa7146_write(dev, MC1, MASK_20);
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c
index 8cce44602..5b37c8f4f 100644
--- a/linux/drivers/media/common/saa7146_video.c
+++ b/linux/drivers/media/common/saa7146_video.c
@@ -760,7 +760,7 @@ static int video_begin(struct saa7146_fh *fh)
saa7146_write(dev, MC2, MASK_27 );
/* enable rps0 irqs */
- IER_ENABLE(dev, MASK_27);
+ SAA7146_IER_ENABLE(dev, MASK_27);
vv->video_fh = fh;
vv->video_status = STATUS_CAPTURE;
@@ -805,7 +805,7 @@ static int video_end(struct saa7146_fh *fh, struct file *file)
saa7146_write(dev, MC1, MASK_28);
/* disable rps0 irqs */
- IER_DISABLE(dev, MASK_27);
+ SAA7146_IER_DISABLE(dev, MASK_27);
/* shut down all used video dma transfers */
saa7146_write(dev, MC1, dmas);
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index 4294ea92f..dd6b89c20 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -350,18 +350,17 @@ static inline void print_time(char *s)
#endif
}
-static void debiirq (unsigned long data)
+static void debiirq(unsigned long data)
{
- struct av7110 *av7110 = (struct av7110*) data;
+ struct av7110 *av7110 = (struct av7110 *) data;
int type = av7110->debitype;
int handle = (type >> 8) & 0x1f;
// dprintk(4, "%p\n",av7110);
print_time("debi");
- saa7146_write(av7110->dev, IER,
- saa7146_read(av7110->dev, IER) & ~MASK_19);
- saa7146_write(av7110->dev, ISR, MASK_19);
+ SAA7146_IER_DISABLE(av7110->dev, MASK_19);
+ SAA7146_ISR_CLEAR(av7110->dev, MASK_19);
if (type == -1) {
printk("DEBI irq oops @ %ld, psr:0x%08x, ssr:0x%08x\n",
@@ -482,13 +481,13 @@ static void debiirq (unsigned long data)
spin_unlock(&av7110->debilock);
}
-static void gpioirq (unsigned long data)
+static void gpioirq(unsigned long data)
{
- struct av7110 *av7110 = (struct av7110*) data;
+ struct av7110 *av7110 = (struct av7110 *) data;
u32 rxbuf, txbuf;
int len;
- if (av7110->debitype !=-1)
+ if (av7110->debitype != -1)
printk("dvb-ttpci: GPIO0 irq oops @ %ld, psr:0x%08x, ssr:0x%08x\n",
jiffies, saa7146_read(av7110->dev, PSR),
saa7146_read(av7110->dev, SSR));
@@ -497,9 +496,8 @@ static void gpioirq (unsigned long data)
ARM_ClearIrq(av7110);
- saa7146_write(av7110->dev, IER,
- saa7146_read(av7110->dev, IER) & ~MASK_19);
- saa7146_write(av7110->dev, ISR, MASK_19);
+ SAA7146_IER_DISABLE(av7110->dev, MASK_19);
+ SAA7146_ISR_CLEAR(av7110->dev, MASK_19);
av7110->debitype = irdebi(av7110, DEBINOSWAP, IRQ_STATE, 0, 2);
av7110->debilen = irdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, 0, 2);
@@ -580,7 +578,7 @@ static void gpioirq (unsigned long data)
}
DVB_RINGBUFFER_SKIP(cibuf, 2);
- dvb_ringbuffer_read(cibuf, av7110->debi_virt,len, 0);
+ dvb_ringbuffer_read(cibuf, av7110->debi_virt, len, 0);
wake_up(&cibuf->queue);
iwdebi(av7110, DEBINOSWAP, TX_LEN, len, 2);
@@ -1981,9 +1979,8 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
sema_init(&av7110->pid_mutex, 1);
/* locks for data transfers from/to AV7110 */
- spin_lock_init (&av7110->debilock);
+ spin_lock_init(&av7110->debilock);
sema_init(&av7110->dcomlock, 1);
- av7110->debilock = SPIN_LOCK_UNLOCKED;
av7110->debitype = -1;
/* default OSD window */
@@ -2100,11 +2097,8 @@ static int av7110_detach (struct saa7146_dev* saa)
dvb_unregister(av7110);
- IER_DISABLE(saa, (MASK_19 | MASK_03));
-// saa7146_write (av7110->dev, IER,
-// saa7146_read(av7110->dev, IER) & ~(MASK_19 | MASK_03));
-
- saa7146_write(av7110->dev, ISR,(MASK_19 | MASK_03));
+ SAA7146_IER_DISABLE(saa, MASK_19 | MASK_03);
+ SAA7146_ISR_CLEAR(saa, MASK_19 | MASK_03);
av7110_ca_exit(av7110);
av7110_av_exit(av7110);
@@ -2134,10 +2128,10 @@ static void av7110_irq(struct saa7146_dev* dev, u32 *isr)
struct av7110 *av7110 = dev->ext_priv;
if (*isr & MASK_19)
- tasklet_schedule (&av7110->debi_tasklet);
+ tasklet_schedule(&av7110->debi_tasklet);
if (*isr & MASK_03)
- tasklet_schedule (&av7110->gpio_tasklet);
+ tasklet_schedule(&av7110->gpio_tasklet);
}
diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c
index f47b6d42c..82cf9c4ab 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c
@@ -110,16 +110,16 @@ void av7110_reset_arm(struct av7110 *av7110)
saa7146_setgpio(av7110->dev, RESET_LINE, SAA7146_GPIO_OUTLO);
/* Disable DEBI and GPIO irq */
- IER_DISABLE(av7110->dev, (MASK_19 | MASK_03));
- saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
+ SAA7146_IER_DISABLE(av7110->dev, MASK_19 | MASK_03);
+ SAA7146_ISR_CLEAR(av7110->dev, MASK_19 | MASK_03);
saa7146_setgpio(av7110->dev, RESET_LINE, SAA7146_GPIO_OUTHI);
msleep(30); /* the firmware needs some time to initialize */
ARM_ResetMailBox(av7110);
- saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
- IER_ENABLE(av7110->dev, MASK_03);
+ SAA7146_ISR_CLEAR(av7110->dev, MASK_19 | MASK_03);
+ SAA7146_IER_ENABLE(av7110->dev, MASK_03);
av7110->arm_ready = 1;
dprintk(1, "reset ARM\n");
@@ -223,8 +223,8 @@ int av7110_bootarm(struct av7110 *av7110)
saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTLO);
/* Disable DEBI and GPIO irq */
- IER_DISABLE(av7110->dev, MASK_03 | MASK_19);
- saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
+ SAA7146_IER_DISABLE(av7110->dev, MASK_03 | MASK_19);
+ SAA7146_ISR_CLEAR(av7110->dev, MASK_19 | MASK_03);
/* enable DEBI */
saa7146_write(av7110->dev, MC1, 0x08800880);
@@ -280,8 +280,8 @@ int av7110_bootarm(struct av7110 *av7110)
//ARM_ClearIrq(av7110);
ARM_ResetMailBox(av7110);
- saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03));
- IER_ENABLE(av7110->dev, MASK_03);
+ SAA7146_ISR_CLEAR(av7110->dev, MASK_19 | MASK_03);
+ SAA7146_IER_ENABLE(av7110->dev, MASK_03);
av7110->arm_errors = 0;
av7110->arm_ready = 1;
diff --git a/linux/drivers/media/dvb/ttpci/budget-core.c b/linux/drivers/media/dvb/ttpci/budget-core.c
index b36e98b8f..7489d7230 100644
--- a/linux/drivers/media/dvb/ttpci/budget-core.c
+++ b/linux/drivers/media/dvb/ttpci/budget-core.c
@@ -55,7 +55,7 @@ static int stop_ts_capture(struct budget *budget)
return budget->feeding;
saa7146_write(budget->dev, MC1, MASK_20); // DMA3 off
- IER_DISABLE(budget->dev, MASK_10);
+ SAA7146_IER_DISABLE(budget->dev, MASK_10);
return 0;
}
@@ -122,7 +122,7 @@ static int start_ts_capture(struct budget *budget)
saa7146_write(dev, MC2, (MASK_04 | MASK_20));
saa7146_write(dev, MC1, (MASK_04 | MASK_20)); // DMA3 on
- IER_ENABLE(budget->dev, MASK_10); // VPE
+ SAA7146_IER_ENABLE(budget->dev, MASK_10); // VPE
return ++budget->feeding;
}
diff --git a/linux/include/media/saa7146.h b/linux/include/media/saa7146.h
index 9d99d044b..38667239f 100644
--- a/linux/include/media/saa7146.h
+++ b/linux/include/media/saa7146.h
@@ -63,10 +63,12 @@ extern unsigned int saa7146_debug;
#define DEB_INT(x) if (0!=(DEBUG_VARIABLE&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */
#define DEB_CAP(x) if (0!=(DEBUG_VARIABLE&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */
-#define IER_DISABLE(x,y) \
+#define SAA7146_IER_DISABLE(x,y) \
saa7146_write(x, IER, saa7146_read(x, IER) & ~(y));
-#define IER_ENABLE(x,y) \
+#define SAA7146_IER_ENABLE(x,y) \
saa7146_write(x, IER, saa7146_read(x, IER) | (y));
+#define SAA7146_ISR_CLEAR(x,y) \
+ saa7146_write(x, ISR, (y));
struct saa7146_dev;
struct saa7146_extension;