]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (6247): Fix bug #8689: Fixes IR stop/start during suspend/resume
authorMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 1 Oct 2007 11:51:39 +0000 (08:51 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 01:14:51 +0000 (22:14 -0300)
IR workqueue should be disabled during suspend. This avoids some troubles, like
the one reported on bug #8689:

"The Hauppauge HVR 1100 ir-remote control does not work after resume from
suspend to ram or disk."

This patch disables IR before suspending, re-enabling it after resume.

Thanks to Peter Poklop <Peter.Poklop@gmx.at> for reporting it and helping with
the fix.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Reviewed-by: Peter Poklop <Peter.Poklop@gmx.at>
drivers/media/video/cx88/cx88-core.c
drivers/media/video/cx88/cx88-input.c
drivers/media/video/cx88/cx88-video.c
drivers/media/video/cx88/cx88.h

index 41f7f374c18389287dc5611c81973606716720aa..716154828ff0b2b3b3cbae5c2eee06271d952314 100644 (file)
@@ -1084,6 +1084,9 @@ EXPORT_SYMBOL(cx88_vdev_init);
 EXPORT_SYMBOL(cx88_core_get);
 EXPORT_SYMBOL(cx88_core_put);
 
+EXPORT_SYMBOL(cx88_ir_start);
+EXPORT_SYMBOL(cx88_ir_stop);
+
 /*
  * Local variables:
  * c-basic-offset: 8
index 78adf4d1cf63ce14d6218df787ef2d2b933bfed1..e52de3968c6351d4fa4cd60874ca767db8e87d2b 100644 (file)
@@ -158,7 +158,7 @@ static void cx88_ir_work(struct work_struct *work)
        mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling));
 }
 
-static void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir)
+void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir)
 {
        if (ir->polling) {
                setup_timer(&ir->timer, ir_timer, (unsigned long)ir);
@@ -172,7 +172,7 @@ static void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir)
        }
 }
 
-static void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir)
+void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir)
 {
        if (ir->sampling) {
                cx_write(MO_DDSCFG_IO, 0x0);
index f94a3b41782afaf9f9a4f6786cd64656bbfb85de..705c29b002ea0979c8d589c7f571df5ed7fec186 100644 (file)
@@ -1954,6 +1954,8 @@ static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state)
        }
        spin_unlock(&dev->slock);
 
+       if (core->ir)
+               cx88_ir_stop(core, core->ir);
        /* FIXME -- shutdown device */
        cx88_shutdown(core);
 
@@ -1993,6 +1995,10 @@ static int cx8800_resume(struct pci_dev *pci_dev)
 
        /* FIXME: re-initialize hardware */
        cx88_reset(core);
+       if (core->ir)
+               cx88_ir_start(core, core->ir);
+
+       cx_set(MO_PCI_INTMSK, core->pci_irqmask);
 
        /* restart video+vbi capture */
        spin_lock(&dev->slock);
index e436a37b44049f606deecfd1688bbd87fbe51907..0e4f8e2786713e777d36e7e5cdd1b03ef37e765a 100644 (file)
@@ -614,6 +614,8 @@ struct cx8802_driver * cx8802_get_driver(struct cx8802_dev *dev, enum cx88_board
 int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci);
 int cx88_ir_fini(struct cx88_core *core);
 void cx88_ir_irq(struct cx88_core *core);
+void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir);
+void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir);
 
 /* ----------------------------------------------------------- */
 /* cx88-mpeg.c                                                 */