summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-10-11 13:45:51 +0000
committerGerd Knorr <devnull@localhost>2004-10-11 13:45:51 +0000
commit10a75fb37fbb1ab822371d834328d87a8409ff23 (patch)
tree16771aae63cf043f537945f068234c837e207080 /linux
parentb5cc9df47c0f31bde79d05b4cd3e0d8c115155f9 (diff)
downloadmediapointer-dvb-s2-10a75fb37fbb1ab822371d834328d87a8409ff23.tar.gz
mediapointer-dvb-s2-10a75fb37fbb1ab822371d834328d87a8409ff23.tar.bz2
- some powermanagement stuff.
- misc minor fixes.
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/bttv-driver.c4
-rw-r--r--linux/drivers/media/video/cx88/cx88-cards.c11
-rw-r--r--linux/drivers/media/video/cx88/cx88-i2c.c4
-rw-r--r--linux/drivers/media/video/cx88/cx88-tvaudio.c4
-rw-r--r--linux/drivers/media/video/cx88/cx88-vbi.c18
-rw-r--r--linux/drivers/media/video/cx88/cx88-video.c55
-rw-r--r--linux/drivers/media/video/cx88/cx88.h3
7 files changed, 77 insertions, 22 deletions
diff --git a/linux/drivers/media/video/bttv-driver.c b/linux/drivers/media/video/bttv-driver.c
index 606545967..f432cad03 100644
--- a/linux/drivers/media/video/bttv-driver.c
+++ b/linux/drivers/media/video/bttv-driver.c
@@ -1,6 +1,6 @@
/*
- $Id: bttv-driver.c,v 1.19 2004/10/08 11:22:20 kraxel Exp $
+ $Id: bttv-driver.c,v 1.20 2004/10/11 13:45:51 kraxel Exp $
bttv - Bt848 frame grabber driver
@@ -1447,7 +1447,7 @@ buffer_queue(void *priv, struct videobuf_buffer *vb)
buf->vb.state = STATE_QUEUED;
list_add_tail(&buf->vb.queue,&btv->capture);
- if (NULL == btv->curr.top && NULL == btv->curr.bottom) {
+ if (!btv->curr.frame_irq) {
btv->loop_irq |= 1;
bttv_set_dma(btv, 0x03);
}
diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c
index fb87022de..8a1ee5792 100644
--- a/linux/drivers/media/video/cx88/cx88-cards.c
+++ b/linux/drivers/media/video/cx88/cx88-cards.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-cards.c,v 1.42 2004/10/06 13:45:15 kraxel Exp $
+ * $Id: cx88-cards.c,v 1.43 2004/10/11 13:45:51 kraxel Exp $
*
* device driver for Conexant 2388x based TV cards
* card-specific stuff.
@@ -306,8 +306,8 @@ struct cx88_board cx88_boards[] = {
}},
},
[CX88_BOARD_KWORLD_DVB_T] = {
- .name = "KWorld/VStream XPert DVB-t",
- .tuner_type = UNSET,
+ .name = "KWorld/VStream XPert DVB-T",
+ .tuner_type = TUNER_ABSENT,
.input = {{
.type = CX88_VMUX_DVB,
.vmux = 0,
@@ -393,7 +393,6 @@ struct cx88_board cx88_boards[] = {
.vmux = 2,
.gpio0 = 0x0f00,
}},
- .dvb = 0,
#if 0
.ts = {
.type = CX88_TS,
@@ -403,7 +402,7 @@ struct cx88_board cx88_boards[] = {
},
[CX88_BOARD_HAUPPAUGE_DVB_T1] = {
.name = "Hauppauge Nova-T DVB-T",
- .tuner_type = UNSET,
+ .tuner_type = TUNER_ABSENT,
.input = {{
.type = CX88_VMUX_DVB,
.vmux = 0,
@@ -412,7 +411,7 @@ struct cx88_board cx88_boards[] = {
},
[CX88_BOARD_CONEXANT_DVB_T1] = {
.name = "Conexant DVB-T reference design",
- .tuner_type = UNSET,
+ .tuner_type = TUNER_ABSENT,
.input = {{
.type = CX88_VMUX_DVB,
.vmux = 0,
diff --git a/linux/drivers/media/video/cx88/cx88-i2c.c b/linux/drivers/media/video/cx88/cx88-i2c.c
index 7e33e9c1e..0f4660c05 100644
--- a/linux/drivers/media/video/cx88/cx88-i2c.c
+++ b/linux/drivers/media/video/cx88/cx88-i2c.c
@@ -1,5 +1,5 @@
/*
- $Id: cx88-i2c.c,v 1.16 2004/10/07 12:29:56 kraxel Exp $
+ $Id: cx88-i2c.c,v 1.17 2004/10/11 13:45:51 kraxel Exp $
cx88-i2c.c -- all the i2c code is here
@@ -176,7 +176,7 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
memcpy(&core->i2c_client, &cx8800_i2c_client_template,
sizeof(core->i2c_client));
- if (core->tuner_type != UNSET)
+ if (core->tuner_type != TUNER_ABSENT)
core->i2c_adap.class |= I2C_CLASS_TV_ANALOG;
if (cx88_boards[core->board].dvb)
core->i2c_adap.class |= I2C_CLASS_TV_DIGITAL;
diff --git a/linux/drivers/media/video/cx88/cx88-tvaudio.c b/linux/drivers/media/video/cx88/cx88-tvaudio.c
index d92c93ec6..84018b589 100644
--- a/linux/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/linux/drivers/media/video/cx88/cx88-tvaudio.c
@@ -1,5 +1,5 @@
/*
- $Id: cx88-tvaudio.c,v 1.21 2004/10/07 12:29:56 kraxel Exp $
+ $Id: cx88-tvaudio.c,v 1.22 2004/10/11 13:45:51 kraxel Exp $
cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver
@@ -820,7 +820,7 @@ int cx88_audio_thread(void *data)
/* just monitor the audio status for now ... */
memset(&t,0,sizeof(t));
cx88_get_stereo(core,&t);
- msleep(1000);
+ msleep_interruptible(1000);
}
dprintk("cx88: tvaudio thread exiting\n");
diff --git a/linux/drivers/media/video/cx88/cx88-vbi.c b/linux/drivers/media/video/cx88/cx88-vbi.c
index 210553f00..acc93d2d8 100644
--- a/linux/drivers/media/video/cx88/cx88-vbi.c
+++ b/linux/drivers/media/video/cx88/cx88-vbi.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-vbi.c,v 1.11 2004/10/07 12:29:56 kraxel Exp $
+ * $Id: cx88-vbi.c,v 1.12 2004/10/11 13:45:51 kraxel Exp $
*/
#include <linux/kernel.h>
#include <linux/module.h>
@@ -77,6 +77,22 @@ int cx8800_start_vbi_dma(struct cx8800_dev *dev,
return 0;
}
+int cx8800_stop_vbi_dma(struct cx8800_dev *dev)
+{
+ struct cx88_core *core = dev->core;
+
+ /* stop dma */
+ cx_clear(MO_VID_DMACNTRL, 0x88);
+
+ /* disable capture */
+ cx_clear(VID_CAPTURE_CONTROL,0x18);
+
+ /* disable irqs */
+ cx_clear(MO_PCI_INTMSK, 0x000001);
+ cx_clear(MO_VID_INTMSK, 0x0f0088);
+ return 0;
+}
+
int cx8800_restart_vbi_queue(struct cx8800_dev *dev,
struct cx88_dmaqueue *q)
{
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c
index 25113b471..14d2cb074 100644
--- a/linux/drivers/media/video/cx88/cx88-video.c
+++ b/linux/drivers/media/video/cx88/cx88-video.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-video.c,v 1.37 2004/10/07 12:29:56 kraxel Exp $
+ * $Id: cx88-video.c,v 1.38 2004/10/11 13:45:51 kraxel Exp $
*
* device driver for Conexant 2388x based TV cards
* video4linux video interface
@@ -444,6 +444,22 @@ static int start_video_dma(struct cx8800_dev *dev,
return 0;
}
+static int stop_video_dma(struct cx8800_dev *dev)
+{
+ struct cx88_core *core = dev->core;
+
+ /* stop dma */
+ cx_clear(MO_VID_DMACNTRL, 0x11);
+
+ /* disable capture */
+ cx_clear(VID_CAPTURE_CONTROL,0x06);
+
+ /* disable irqs */
+ cx_clear(MO_PCI_INTMSK, 0x000001);
+ cx_clear(MO_VID_INTMSK, 0x0f0011);
+ return 0;
+}
+
static int restart_video_queue(struct cx8800_dev *dev,
struct cx88_dmaqueue *q)
{
@@ -2132,10 +2148,24 @@ static int cx8800_suspend(struct pci_dev *pci_dev, u32 state)
struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
struct cx88_core *core = dev->core;
- printk("%s: suspend %d\n", core->name, state);
+ /* stop video+vbi capture */
+ spin_lock(&dev->slock);
+ if (!list_empty(&dev->vidq.active)) {
+ printk("%s: suspend video\n", core->name);
+ stop_video_dma(dev);
+ del_timer(&dev->vidq.timeout);
+ }
+ if (!list_empty(&dev->vbiq.active)) {
+ printk("%s: suspend vbi\n", core->name);
+ cx8800_stop_vbi_dma(dev);
+ del_timer(&dev->vbiq.timeout);
+ }
+ spin_unlock(&dev->slock);
- cx88_shutdown(dev->core); /* FIXME */
- del_timer(&dev->vidq.timeout);
+#if 1
+ /* FIXME -- shutdown device */
+ cx88_shutdown(dev->core);
+#endif
pci_save_state(pci_dev, dev->state.pci_cfg);
if (0 != pci_set_power_state(pci_dev, state)) {
@@ -2159,12 +2189,21 @@ static int cx8800_resume(struct pci_dev *pci_dev)
pci_set_power_state(pci_dev, 0);
pci_restore_state(pci_dev, dev->state.pci_cfg);
- /* re-initialize hardware */
- cx88_reset(dev->core); /* FIXME */
+#if 1
+ /* FIXME: re-initialize hardware */
+ cx88_reset(dev->core);
+#endif
- /* restart video capture */
+ /* restart video+vbi capture */
spin_lock(&dev->slock);
- restart_video_queue(dev,&dev->vidq);
+ if (!list_empty(&dev->vidq.active)) {
+ printk("%s: resume video\n", core->name);
+ restart_video_queue(dev,&dev->vidq);
+ }
+ if (!list_empty(&dev->vbiq.active)) {
+ printk("%s: resume vbi\n", core->name);
+ cx8800_restart_vbi_queue(dev,&dev->vbiq);
+ }
spin_unlock(&dev->slock);
return 0;
diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h
index f14f2a715..8a02f0fec 100644
--- a/linux/drivers/media/video/cx88/cx88.h
+++ b/linux/drivers/media/video/cx88/cx88.h
@@ -1,5 +1,5 @@
/*
- * $Id: cx88.h,v 1.35 2004/09/23 13:58:19 kraxel Exp $
+ * $Id: cx88.h,v 1.36 2004/10/11 13:45:51 kraxel Exp $
*
* v4l2 device driver for cx2388x based TV cards
*
@@ -478,6 +478,7 @@ void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f);
int cx8800_start_vbi_dma(struct cx8800_dev *dev,
struct cx88_dmaqueue *q,
struct cx88_buffer *buf);
+int cx8800_stop_vbi_dma(struct cx8800_dev *dev);
int cx8800_restart_vbi_queue(struct cx8800_dev *dev,
struct cx88_dmaqueue *q);
void cx8800_vbi_timeout(unsigned long data);