From patchwork Thu May 5 13:53:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martin X-Patchwork-Id: 6522 Return-path: Envelope-to: mchehab@pedra Delivery-date: Thu, 05 May 2011 10:54:22 -0300 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1QHz0Y-0001JJ-J6 for mchehab@pedra; Thu, 05 May 2011 10:54:22 -0300 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Thu, 05 May 2011 10:54:22 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1QHyzl-0004oo-5I; Thu, 05 May 2011 13:53:33 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754172Ab1EENxX (ORCPT + 1 other); Thu, 5 May 2011 09:53:23 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:37390 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754157Ab1EENxX (ORCPT ); Thu, 5 May 2011 09:53:23 -0400 Received: by wwa36 with SMTP id 36so2386546wwa.1 for ; Thu, 05 May 2011 06:53:22 -0700 (PDT) Received: by 10.227.174.142 with SMTP id t14mr2634467wbz.17.1304603601915; Thu, 05 May 2011 06:53:21 -0700 (PDT) Received: from localhost.localdomain (242.51.18.95.dynamic.jazztel.es [95.18.51.242]) by mx.google.com with ESMTPS id w12sm1373688wby.7.2011.05.05.06.53.20 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 May 2011 06:53:21 -0700 (PDT) From: Javier Martin To: linux-media@vger.kernel.org Cc: g.liakhovetski@gmx.de, laurent.pinchart@ideasonboard.com, Javier Martin Subject: [PATCH] OMAP3: ISP: Fix unbalanced use of omap3isp_get(). Date: Thu, 5 May 2011 15:53:08 +0200 Message-Id: <1304603588-3178-1-git-send-email-javier.martin@vista-silicon.com> X-Mailer: git-send-email 1.7.0.4 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Do not use omap3isp_get() when what we really want to do is just enable clocks, since omap3isp_get() has additional, unwanted, side effects as an increase of the counter. This prevented omap3isp of working with Beagleboard xM and it has been tested only with that platform + mt9p031 sensor. Signed-off-by: Javier Martin --- drivers/media/video/omap3isp/isp.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/omap3isp/isp.c b/drivers/media/video/omap3isp/isp.c index 472a693..ca0831f 100644 --- a/drivers/media/video/omap3isp/isp.c +++ b/drivers/media/video/omap3isp/isp.c @@ -85,9 +85,11 @@ module_param(autoidle, int, 0444); MODULE_PARM_DESC(autoidle, "Enable OMAP3ISP AUTOIDLE support"); static void isp_save_ctx(struct isp_device *isp); - static void isp_restore_ctx(struct isp_device *isp); +static int isp_enable_clocks(struct isp_device *isp); +static void isp_disable_clocks(struct isp_device *isp); + static const struct isp_res_mapping isp_res_maps[] = { { .isp_rev = ISP_REVISION_2_0, @@ -239,10 +241,10 @@ static u32 isp_set_xclk(struct isp_device *isp, u32 xclk, u8 xclksel) /* Do we go from stable whatever to clock? */ if (divisor >= 2 && isp->xclk_divisor[xclksel - 1] < 2) - omap3isp_get(isp); + isp_enable_clocks(isp); /* Stopping the clock. */ else if (divisor < 2 && isp->xclk_divisor[xclksel - 1] >= 2) - omap3isp_put(isp); + isp_disable_clocks(isp); isp->xclk_divisor[xclksel - 1] = divisor;