summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cafe_ccic.c
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2007-08-17 06:01:33 +0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-08-20 17:18:04 +0200
commit01659f2a0067d855089811529fa596cbc40f1e75 (patch)
tree9831f561abd58ef8cf8645e6840c9ad9ef784196 /drivers/media/video/cafe_ccic.c
parentV4L/DVB (6016): get_dvb_firmware: update script for new location of tda10046 ... (diff)
downloadlinux-01659f2a0067d855089811529fa596cbc40f1e75.tar.xz
linux-01659f2a0067d855089811529fa596cbc40f1e75.zip
V4L/DVB (6026): Avoid powering up the camera on resume
Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cafe_ccic.c')
-rw-r--r--drivers/media/video/cafe_ccic.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index c08f650df423..88090107cd44 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -2233,12 +2233,21 @@ static int cafe_pci_resume(struct pci_dev *pdev)
if (ret)
return ret;
ret = pci_enable_device(pdev);
+
if (ret) {
cam_warn(cam, "Unable to re-enable device on resume!\n");
return ret;
}
cafe_ctlr_init(cam);
- cafe_ctlr_power_up(cam);
+ cafe_ctlr_power_down(cam);
+
+ mutex_lock(&cam->s_mutex);
+ if (cam->users > 0) {
+ cafe_ctlr_power_up(cam);
+ __cafe_cam_reset(cam);
+ }
+ mutex_unlock(&cam->s_mutex);
+
set_bit(CF_CONFIG_NEEDED, &cam->flags);
if (cam->state == S_SPECREAD)
cam->state = S_IDLE; /* Don't bother restarting */