From patchwork Wed Oct 27 13:55:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 285832 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9RDtFBI022323 for ; Wed, 27 Oct 2010 13:55:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761265Ab0J0NzO (ORCPT ); Wed, 27 Oct 2010 09:55:14 -0400 Received: from mtaout03-winn.ispmail.ntl.com ([81.103.221.49]:41062 "EHLO mtaout03-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759656Ab0J0NzN (ORCPT ); Wed, 27 Oct 2010 09:55:13 -0400 Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20101027135503.HHIY3075.mtaout03-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com>; Wed, 27 Oct 2010 14:55:03 +0100 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20101027135502.MWQE28282.aamtaout03-winn.ispmail.ntl.com@zog.reactivated.net>; Wed, 27 Oct 2010 14:55:02 +0100 Received: by zog.reactivated.net (Postfix, from userid 1000) id BA4869D401B; Wed, 27 Oct 2010 14:55:00 +0100 (BST) From: Daniel Drake To: mchehab@infradead.org Cc: linux-media@vger.kernel.org Cc: corbet@lwn.net Subject: [PATCH] cafe_ccic: fix colorspace corruption on resume Message-Id: <20101027135500.BA4869D401B@zog.reactivated.net> Date: Wed, 27 Oct 2010 14:55:00 +0100 (BST) X-Cloudmark-Analysis: v=1.1 cv=3ENABmdyEd/Fm7fR7+mZIuMDn6+IErAeEhlfWBImZFk= c=1 sm=0 a=hDA5WRErTQ4A:10 a=Op-mwl0xAAAA:8 a=5PnIUpbMXDfBSgknpEwA:9 a=eGfasPz778y0HlKYrKZhrgdECiAA:4 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Oct 2010 13:55:15 +0000 (UTC) diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c index 7bc3667..d147525 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) @@ -2197,12 +2195,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);