From patchwork Mon Jul 4 08:06:47 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: 941732 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6485viD001609 for ; Mon, 4 Jul 2011 08:06:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755000Ab1GDIGz (ORCPT ); Mon, 4 Jul 2011 04:06:55 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:49391 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754403Ab1GDIGy (ORCPT ); Mon, 4 Jul 2011 04:06:54 -0400 Received: by iyb12 with SMTP id 12so4263465iyb.19 for ; Mon, 04 Jul 2011 01:06:54 -0700 (PDT) Received: by 10.42.163.8 with SMTP id a8mr5825530icy.525.1309766814084; Mon, 04 Jul 2011 01:06:54 -0700 (PDT) Received: from localhost.localdomain (mailhost.igel.co.jp [219.106.231.130]) by mx.google.com with ESMTPS id d8sm6202962icy.9.2011.07.04.01.06.52 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Jul 2011 01:06:53 -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 v4] fbdev: sh_mobile_meram: Enable/disable MERAM along with LCDC Date: Mon, 4 Jul 2011 17:06:47 +0900 Message-Id: <1309766807-32484-1-git-send-email-dhobsong@igel.co.jp> X-Mailer: git-send-email 1.7.1 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 (demeter2.kernel.org [140.211.167.43]); Mon, 04 Jul 2011 08:06:55 +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 V3 =============== * Remove the MERAM callbacks used to runtime_get/runtime_put the device from the LCDC driver. Instead, just call the functions on the MERAM device directly drivers/video/sh_mobile_lcdcfb.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 019dbd3..15e77f3 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -259,6 +259,8 @@ 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->pdev) + pm_runtime_get_sync(&priv->meram_dev->pdev->dev); } } @@ -267,6 +270,8 @@ 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->pdev) + pm_runtime_put_sync(&priv->meram_dev->pdev->dev); pm_runtime_put(priv->dev); } }