From patchwork Wed Jun 22 07:49:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damian Hobson-Garcia X-Patchwork-Id: 903772 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5M7n5nQ012642 for ; Wed, 22 Jun 2011 07:49:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751746Ab1FVHtG (ORCPT ); Wed, 22 Jun 2011 03:49:06 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:43759 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751613Ab1FVHtG (ORCPT ); Wed, 22 Jun 2011 03:49:06 -0400 Received: by mail-pv0-f174.google.com with SMTP id 12so344170pvg.19 for ; Wed, 22 Jun 2011 00:49:05 -0700 (PDT) Received: by 10.142.12.6 with SMTP id 6mr55785wfl.422.1308728945568; Wed, 22 Jun 2011 00:49:05 -0700 (PDT) Received: from localhost.localdomain (mailhost.igel.co.jp [219.106.231.130]) by mx.google.com with ESMTPS id g8sm266171pba.21.2011.06.22.00.49.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Jun 2011 00:49:05 -0700 (PDT) From: Damian Hobson-Garcia To: Magnus Damm , lethal@linux-sh.org, linux-sh@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: taki@igel.co.jp, matsu@igel.co.jp, Damian Hobson-Garcia Subject: [PATCH 2/5 v3] fbdev: sh_mobile_meram: Enable/disable MERAM along with LCDC Date: Wed, 22 Jun 2011 16:49:49 +0900 Message-Id: <1308728992-9660-3-git-send-email-dhobsong@igel.co.jp> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1308728992-9660-1-git-send-email-dhobsong@igel.co.jp> References: <1308728992-9660-1-git-send-email-dhobsong@igel.co.jp> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 22 Jun 2011 07:49:10 +0000 (UTC) The MERAM reference counts should be tied to the two LCDC devices (LCD/HDMI) so that when they are enable/disabled, the MERAM is as well. Signed-off-by: Damian Hobson-Garcia --- Changes from V2 =============== * Change the names of the clk_on/clk_off callbacks to pm_get_sync/pm_put_sync to better reflect their actual functionality drivers/video/sh_mobile_lcdcfb.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 019dbd3..78cc828 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -259,6 +259,11 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv) pm_runtime_get_sync(priv->dev); if (priv->dot_clk) clk_enable(priv->dot_clk); + if (priv->meram_dev && priv->meram_dev->ops) { + struct sh_mobile_meram_info *mdev; + mdev = priv->meram_dev; + mdev->ops->meram_pm_get_sync(mdev); + } } } @@ -267,6 +272,11 @@ static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv) if (atomic_sub_return(1, &priv->hw_usecnt) == -1) { if (priv->dot_clk) clk_disable(priv->dot_clk); + if (priv->meram_dev && priv->meram_dev->ops) { + struct sh_mobile_meram_info *mdev; + mdev = priv->meram_dev; + mdev->ops->meram_pm_put_sync(mdev); + } pm_runtime_put(priv->dev); } }