summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci/av7110.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110.c')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c67
1 files changed, 27 insertions, 40 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index 113e7d968..369542f6d 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -166,8 +166,6 @@ static int debiwrite(av7110_t *av7110, u32 config,
struct saa7146_dev *dev = av7110->dev;
u32 cmd;
-// DEB_EE(("av7110: %p\n",av7110));
-
if (count <= 0 || count > 32764)
return -1;
if (wait_for_debi_done(av7110) < 0)
@@ -187,8 +185,6 @@ static u32 debiread(av7110_t *av7110, u32 config, int addr, int count)
struct saa7146_dev *dev = av7110->dev;
u32 result = 0;
-// DEB_EE(("av7110: %p\n",av7110));
-
if (count > 32764 || count <= 0)
return 0;
if (wait_for_debi_done(av7110) < 0)
@@ -280,24 +276,18 @@ ARM_ResetMailBox(av7110_t *av7110)
static inline void
ARM_ClearMailBox(av7110_t *av7110)
{
- DEB_EE(("av7110: %p\n",av7110));
-
iwdebi(av7110, DEBINOSWAP, IRQ_RX, 0, 2);
}
static inline void
ARM_ClearIrq(av7110_t *av7110)
{
- DEB_EE(("av7110: %p\n",av7110));
-
irdebi(av7110, DEBINOSWAP, IRQ_RX, 0, 2);
}
static void
reset_arm(av7110_t *av7110)
{
- DEB_EE(("av7110: %p\n",av7110));
-
saa7146_setgpio(av7110->dev, RESET_LINE, SAA7146_GPIO_OUTLO);
/* Disable DEBI and GPIO irq */
@@ -356,7 +346,10 @@ static int arm_thread(void *data)
lock_kernel();
#if 0
- daemonize();
+ daemonize();
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
+ reparent_to_init ();
+#endif
#else
exit_mm(current);
current->session=current->pgrp=1;
@@ -880,13 +873,12 @@ void debiirq (unsigned long data)
struct av7110_s *av7110 = (struct av7110_s*) data;
int type=av7110->debitype;
int handle=(type>>8)&0x1f;
-
- DEB_EE(("av7110: %p\n",av7110));
+
+// DEB_EE(("av7110: %p\n",av7110));
print_time("debi");
- IER_DISABLE(av7110->dev, MASK_19);
-// saa7146_write(av7110->dev, IER,
-// saa7146_read(av7110->dev, IER) & ~MASK_19 );
+ saa7146_write(av7110->dev, IER,
+ saa7146_read(av7110->dev, IER) & ~MASK_19 );
saa7146_write(av7110->dev, ISR, MASK_19 );
if (type==-1) {
@@ -1063,6 +1055,7 @@ pes_play(void *dest, ring_buffer_t *buf, int dlen)
return blen;
}
+
static
void gpioirq (unsigned long data)
{
@@ -1070,19 +1063,17 @@ void gpioirq (unsigned long data)
u32 rxbuf, txbuf;
int len;
- DEB_EE(("av7110: %p\n",av7110));
+ //printk("GPIO0 irq\n");
- if (av7110->debitype !=-1) {
+ if (av7110->debitype !=-1)
printk("GPIO0 irq oops @ %ld, psr:0x%08x, ssr:0x%08x\n",jiffies,saa7146_read(av7110->dev,PSR),saa7146_read(av7110->dev,SSR));
- }
-
+
spin_lock(&av7110->debilock);
ARM_ClearIrq(av7110);
- IER_DISABLE(av7110->dev, MASK_19);
-// saa7146_write(av7110->dev, IER,
-// saa7146_read(av7110->dev, IER) & ~MASK_19 );
+ saa7146_write(av7110->dev, IER,
+ saa7146_read(av7110->dev, IER) & ~MASK_19 );
saa7146_write(av7110->dev, ISR, MASK_19 );
av7110->debitype = irdebi(av7110, DEBINOSWAP, IRQ_STATE, 0, 2);
@@ -1095,7 +1086,7 @@ void gpioirq (unsigned long data)
DEB_D(("GPIO0 irq %d %d\n", av7110->debitype, av7110->debilen));
print_time("gpio");
- DEB_D(("GPIO0 irq %02x\n", av7110->debitype&0xff));
+ DEB_D(("GPIO0 irq %02x\n", av7110->debitype&0xff));
switch (av7110->debitype&0xff) {
case DATA_TS_PLAY:
@@ -1140,9 +1131,8 @@ void gpioirq (unsigned long data)
iwdebi(av7110, DEBINOSWAP, TX_LEN, len, 2);
iwdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, len, 2);
wait_for_debi_done(av7110);
- IER_ENABLE(av7110->dev, MASK_19);
-// saa7146_write(av7110->dev, IER,
-// saa7146_read(av7110->dev, IER) | MASK_19 );
+ saa7146_write(av7110->dev, IER,
+ saa7146_read(av7110->dev, IER) | MASK_19 );
if (len<5) len=5; /* we want a real DEBI DMA */
iwdebi(av7110, DEBISWAB, DPRAM_BASE+txbuf, 0, (len+3)&~3);
spin_unlock(&av7110->debilock);
@@ -1174,13 +1164,12 @@ void gpioirq (unsigned long data)
iwdebi(av7110, DEBINOSWAP, TX_BUFF, 0, 2);
break;
}
- DEB_D(("GPIO0 PES_PLAY len=%04x\n", len));
+ DEB_D(("GPIO0 PES_PLAY len=%04x\n", len));
iwdebi(av7110, DEBINOSWAP, TX_LEN, len, 2);
iwdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, len, 2);
wait_for_debi_done(av7110);
- IER_ENABLE(av7110->dev, MASK_19);
-// saa7146_write(av7110->dev, IER,
-// saa7146_read(av7110->dev, IER) | MASK_19 );
+ saa7146_write(av7110->dev, IER,
+ saa7146_read(av7110->dev, IER) | MASK_19 );
iwdebi(av7110, DEBISWAB, DPRAM_BASE+txbuf, 0, (len+3)&~3);
spin_unlock(&av7110->debilock);
@@ -1206,9 +1195,8 @@ void gpioirq (unsigned long data)
av7110->bmpp+=len;
av7110->bmplen-=len;
wait_for_debi_done(av7110);
- IER_ENABLE(av7110->dev, MASK_19);
-// saa7146_write(av7110->dev, IER,
-// saa7146_read(av7110->dev, IER) | MASK_19 );
+ saa7146_write(av7110->dev, IER,
+ saa7146_read(av7110->dev, IER) | MASK_19 );
if (len<5) len=5; /* we want a real DEBI DMA */
iwdebi(av7110, DEBISWAB, DPRAM_BASE+txbuf, 0, (len+3)&~3);
spin_unlock(&av7110->debilock);
@@ -1226,9 +1214,8 @@ void gpioirq (unsigned long data)
case DATA_TS_RECORD:
case DATA_PES_RECORD:
wait_for_debi_done(av7110);
- IER_ENABLE(av7110->dev, MASK_19);
-// saa7146_write(av7110->dev, IER,
-// saa7146_read(av7110->dev, IER) | MASK_19);
+ saa7146_write(av7110->dev, IER,
+ saa7146_read(av7110->dev, IER) | MASK_19);
irdebi(av7110, DEBISWAB, DPRAM_BASE+rxbuf, 0, len);
spin_unlock(&av7110->debilock);
return;
@@ -1239,9 +1226,8 @@ void gpioirq (unsigned long data)
iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2);
break;
}
- IER_ENABLE(av7110->dev, MASK_19);
-// saa7146_write(av7110->dev, IER,
-// saa7146_read(av7110->dev, IER) | MASK_19);
+ saa7146_write(av7110->dev, IER,
+ saa7146_read(av7110->dev, IER) | MASK_19);
irdebi(av7110, DEBISWAB, Reserved, 0, len);
spin_unlock(&av7110->debilock);
return;
@@ -4500,6 +4486,7 @@ struct saa7146_ext_vv av7110_vv_data = {
static
struct saa7146_extension av7110_extension = {
.name = "dvb\0",
+ .flags = 0,
.devices = &sub_data[0],
.module = THIS_MODULE,