diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-01 07:51:39 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 21:14:51 -0400 |
commit | 13595a51c0da8ec212ba6f5df79519dbd74166c0 (patch) | |
tree | b013f7d1714e9f627d8f01bcd2fcf0a5d330ee23 /drivers/media | |
parent | b25be97929c85b2017379e05588740f564a61c22 (diff) |
V4L/DVB (6247): Fix bug #8689: Fixes IR stop/start during suspend/resume
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>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/cx88/cx88-core.c | 3 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-input.c | 4 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 6 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 2 |
4 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index 41f7f374c183..716154828ff0 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c | |||
@@ -1084,6 +1084,9 @@ EXPORT_SYMBOL(cx88_vdev_init); | |||
1084 | EXPORT_SYMBOL(cx88_core_get); | 1084 | EXPORT_SYMBOL(cx88_core_get); |
1085 | EXPORT_SYMBOL(cx88_core_put); | 1085 | EXPORT_SYMBOL(cx88_core_put); |
1086 | 1086 | ||
1087 | EXPORT_SYMBOL(cx88_ir_start); | ||
1088 | EXPORT_SYMBOL(cx88_ir_stop); | ||
1089 | |||
1087 | /* | 1090 | /* |
1088 | * Local variables: | 1091 | * Local variables: |
1089 | * c-basic-offset: 8 | 1092 | * c-basic-offset: 8 |
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index 78adf4d1cf63..e52de3968c63 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c | |||
@@ -158,7 +158,7 @@ static void cx88_ir_work(struct work_struct *work) | |||
158 | mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling)); | 158 | mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling)); |
159 | } | 159 | } |
160 | 160 | ||
161 | static void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir) | 161 | void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir) |
162 | { | 162 | { |
163 | if (ir->polling) { | 163 | if (ir->polling) { |
164 | setup_timer(&ir->timer, ir_timer, (unsigned long)ir); | 164 | 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) | |||
172 | } | 172 | } |
173 | } | 173 | } |
174 | 174 | ||
175 | static void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir) | 175 | void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir) |
176 | { | 176 | { |
177 | if (ir->sampling) { | 177 | if (ir->sampling) { |
178 | cx_write(MO_DDSCFG_IO, 0x0); | 178 | cx_write(MO_DDSCFG_IO, 0x0); |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index f94a3b41782a..705c29b002ea 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -1954,6 +1954,8 @@ static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state) | |||
1954 | } | 1954 | } |
1955 | spin_unlock(&dev->slock); | 1955 | spin_unlock(&dev->slock); |
1956 | 1956 | ||
1957 | if (core->ir) | ||
1958 | cx88_ir_stop(core, core->ir); | ||
1957 | /* FIXME -- shutdown device */ | 1959 | /* FIXME -- shutdown device */ |
1958 | cx88_shutdown(core); | 1960 | cx88_shutdown(core); |
1959 | 1961 | ||
@@ -1993,6 +1995,10 @@ static int cx8800_resume(struct pci_dev *pci_dev) | |||
1993 | 1995 | ||
1994 | /* FIXME: re-initialize hardware */ | 1996 | /* FIXME: re-initialize hardware */ |
1995 | cx88_reset(core); | 1997 | cx88_reset(core); |
1998 | if (core->ir) | ||
1999 | cx88_ir_start(core, core->ir); | ||
2000 | |||
2001 | cx_set(MO_PCI_INTMSK, core->pci_irqmask); | ||
1996 | 2002 | ||
1997 | /* restart video+vbi capture */ | 2003 | /* restart video+vbi capture */ |
1998 | spin_lock(&dev->slock); | 2004 | spin_lock(&dev->slock); |
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index e436a37b4404..0e4f8e278671 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -614,6 +614,8 @@ struct cx8802_driver * cx8802_get_driver(struct cx8802_dev *dev, enum cx88_board | |||
614 | int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci); | 614 | int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci); |
615 | int cx88_ir_fini(struct cx88_core *core); | 615 | int cx88_ir_fini(struct cx88_core *core); |
616 | void cx88_ir_irq(struct cx88_core *core); | 616 | void cx88_ir_irq(struct cx88_core *core); |
617 | void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir); | ||
618 | void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir); | ||
617 | 619 | ||
618 | /* ----------------------------------------------------------- */ | 620 | /* ----------------------------------------------------------- */ |
619 | /* cx88-mpeg.c */ | 621 | /* cx88-mpeg.c */ |