From patchwork Mon Apr 8 11:07:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas C Sajjan X-Patchwork-Id: 2407881 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1F432DFB78 for ; Mon, 8 Apr 2013 11:08:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934191Ab3DHLIB (ORCPT ); Mon, 8 Apr 2013 07:08:01 -0400 Received: from mail-da0-f42.google.com ([209.85.210.42]:36223 "EHLO mail-da0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761729Ab3DHLH7 (ORCPT ); Mon, 8 Apr 2013 07:07:59 -0400 Received: by mail-da0-f42.google.com with SMTP id n15so2565940dad.29 for ; Mon, 08 Apr 2013 04:07:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=LVeu5zhVSmApfUfdpl8Niganc4ew1qQzuyT+gNgDg0A=; b=QLBdzlTba9TM15rQsHgbwuI3U2S0LJB2kt7kROmgJiMitagems0ChDE1U8gqvgcxfp otVXvQcuKQzWXrLzqEHU93wO7uD9I5lUZpzGDRIavxI47fTcIkg38D4XgUbMBGQuWF7v vLmdIkT1+Vn4SlA+jnzadz6LmsiROPJInnNNaVLZmK51U8GCaXmnnJw6n6VaUR4V51hk Ysy2RLjyCOivNKbQKBHYL15n8NHStdWuO7yJelkPWV8YoztV13GWWS8zR4Q/2Uu1IEGp 7rnFPekuxAXE1EbYIDy2rfvdOom3QG9/PNoe2UOMZyw2VVki843v1fX3xPgrF3oJiNB+ xMIg== X-Received: by 10.66.254.136 with SMTP id ai8mr35783276pad.26.1365419278504; Mon, 08 Apr 2013 04:07:58 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id pa2sm37874152pac.9.2013.04.08.04.07.53 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 04:07:57 -0700 (PDT) From: Vikas Sajjan To: dri-devel@lists.freedesktop.org Cc: linux-media@vger.kernel.org, kgene.kim@samsung.com, inki.dae@samsung.com, patches@linaro.org, linaro-kernel@lists.linaro.org, jy0922.shim@samsung.com, linux-samsung-soc@vger.kernel.org, thomas.abraham@linaro.org Subject: [PATCH v4] drm/exynos: prepare FIMD clocks Date: Mon, 8 Apr 2013 16:37:45 +0530 Message-Id: <1365419265-21238-1-git-send-email-vikas.sajjan@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQmyCersJcvb551WmtgogzzW3ppbKO7B2jY0OBVeLvy2LqpPkl9NWTKliOl8oQQzeApmEljG Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org While migrating to common clock framework (CCF), I found that the FIMD clocks were pulled down by the CCF. If CCF finds any clock(s) which has NOT been claimed by any of the drivers, then such clock(s) are PULLed low by CCF. Calling clk_prepare() for FIMD clocks fixes the issue. This patch also replaces clk_disable() with clk_unprepare() during exit, since clk_prepare() is called in fimd_probe(). Signed-off-by: Vikas Sajjan --- Changes since v3: - added clk_prepare() in fimd_probe() and clk_unprepare() in fimd_remove() as suggested by Viresh Kumar Changes since v2: - moved clk_prepare_enable() and clk_disable_unprepare() from fimd_probe() to fimd_clock() as suggested by Inki Dae Changes since v1: - added error checking for clk_prepare_enable() and also replaced clk_disable() with clk_disable_unprepare() during exit. --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 9537761..aa22370 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -934,6 +934,16 @@ static int fimd_probe(struct platform_device *pdev) return ret; } + ret = clk_prepare(ctx->bus_clk); + if (ret < 0) + return ret; + + ret = clk_prepare(ctx->lcd_clk); + if (ret < 0) { + clk_unprepare(ctx->bus_clk); + return ret; + } + ctx->vidcon0 = pdata->vidcon0; ctx->vidcon1 = pdata->vidcon1; ctx->default_win = pdata->default_win; @@ -981,8 +991,8 @@ static int fimd_remove(struct platform_device *pdev) if (ctx->suspended) goto out; - clk_disable(ctx->lcd_clk); - clk_disable(ctx->bus_clk); + clk_unprepare(ctx->lcd_clk); + clk_unprepare(ctx->bus_clk); pm_runtime_set_suspended(dev); pm_runtime_put_sync(dev);