summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88/cx88-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-video.c')
-rw-r--r--linux/drivers/media/video/cx88/cx88-video.c55
1 files changed, 47 insertions, 8 deletions
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;