From patchwork Mon Jul 11 12:35:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 964292 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 p6BCZE5F015916 for ; Mon, 11 Jul 2011 12:35:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750901Ab1GKMfN (ORCPT ); Mon, 11 Jul 2011 08:35:13 -0400 Received: from perceval.ideasonboard.com ([95.142.166.194]:33636 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1749667Ab1GKMfM (ORCPT ); Mon, 11 Jul 2011 08:35:12 -0400 Received: from localhost.localdomain (unknown [91.178.195.123]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2F48A3599D; Mon, 11 Jul 2011 12:35:11 +0000 (UTC) From: Laurent Pinchart To: linux-fbdev@vger.kernel.org Cc: linux-sh@vger.kernel.org, Magnus Damm , Damian Hobson-Garcia Subject: [PATCH] fbdev: sh_mobile_lcdc: Turn dot clock on before resuming from runtime PM Date: Mon, 11 Jul 2011 14:35:54 +0200 Message-Id: <1310387754-23033-1-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.7.3.4 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, 11 Jul 2011 12:35:14 +0000 (UTC) Resuming from runtime PM restores all LCDC registers. If the dot clock is off at that time display panning information will be corrupted. Turn the dot clock on before resuming from runtime PM. Similarly, turn the clock off after suspending the LCDC. Signed-off-by: Laurent Pinchart Cc: Magnus Damm Cc: Damian Hobson-Garcia Tested-by: Guennadi Liakhovetski --- drivers/video/sh_mobile_lcdcfb.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) This patch should fix the LCDC panning issue caused by runtime suspend. It applies on top of Rafael J. Wysocki's pm-domains branch and Damian Hobson-Garcia's MERAM patches. diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 48a40e3..e9b80bc 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -256,9 +256,9 @@ struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = { static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv) { if (atomic_inc_and_test(&priv->hw_usecnt)) { - pm_runtime_get_sync(priv->dev); if (priv->dot_clk) clk_enable(priv->dot_clk); + pm_runtime_get_sync(priv->dev); if (priv->meram_dev && priv->meram_dev->pdev) pm_runtime_get_sync(&priv->meram_dev->pdev->dev); } @@ -267,11 +267,11 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv) 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); + if (priv->dot_clk) + clk_disable(priv->dot_clk); } }