summaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2010-10-27 10:55:00 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 08:16:29 -0200
commitea7c681e899bda3fceb37815d63d201c3b4be920 (patch)
treedd0b410bce7108d91ab530a41a484d5ff3586472 /drivers/media/video
parentc429e7b62a54bf34c1995b45faeaeb84104f1705 (diff)
downloadblackbird-op-linux-ea7c681e899bda3fceb37815d63d201c3b4be920.tar.gz
blackbird-op-linux-ea7c681e899bda3fceb37815d63d201c3b4be920.zip
[media] cafe_ccic: fix colorspace corruption on resume
If you suspend and resume during video capture, the video colours are corrupted on resume. This is because the sensor is being unconditionally powered off during the resume path. Only power down during resume if the camera is not in use, and correctly reconfigure the sensor during resume. Fixes http://dev.laptop.org/ticket/10190 Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/cafe_ccic.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 0dfff50891e4..789087cd6a9c 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -859,8 +859,6 @@ static int cafe_cam_configure(struct cafe_camera *cam)
struct v4l2_mbus_framefmt mbus_fmt;
int ret;
- if (cam->state != S_IDLE)
- return -EINVAL;
v4l2_fill_mbus_format(&mbus_fmt, &cam->pix_format, cam->mbus_code);
ret = sensor_call(cam, core, init, 0);
if (ret == 0)
@@ -2196,12 +2194,13 @@ static int cafe_pci_resume(struct pci_dev *pdev)
return ret;
}
cafe_ctlr_init(cam);
- cafe_ctlr_power_down(cam);
mutex_lock(&cam->s_mutex);
if (cam->users > 0) {
cafe_ctlr_power_up(cam);
__cafe_cam_reset(cam);
+ } else {
+ cafe_ctlr_power_down(cam);
}
mutex_unlock(&cam->s_mutex);
OpenPOWER on IntegriCloud