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: 15970 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B54A23900 for ; Mon, 8 Apr 2013 11:08:15 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id j34sf7712015qco.3 for ; Mon, 08 Apr 2013 04:08:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=LVeu5zhVSmApfUfdpl8Niganc4ew1qQzuyT+gNgDg0A=; b=OSs+mMM7g4WK+7Z6Id+6VS/nYBNP9nsplHsUznk4cSau9AZIiLHk6/PwyeXa1g1pdM AKDZhEz6laxUvqckvhZSSvtSwdFvG8/uCue4qGvjEV2ChvbGEAeXXH58LP4sWoCXKBGo LFTEQ+Kcxxq7XNmdvv8QLanx/oBfQth7P84EUGMRex8f4UaEB5Mda764oVG574BcEKpi QpHOEQneLJ4hQdDNWB6t8x4lc+uuzWawOLitol7AYe5A/5cNqsJwWIMU6uSxvSxtc/SO 0/92PY4W0f/D8PtFGVfxFScdyL0TdLFvPzMQX7k9mFMkZEnY4V/ih/UY3X2YJp6QBxxN zQbw== X-Received: by 10.224.207.2 with SMTP id fw2mr5657748qab.6.1365419281108; Mon, 08 Apr 2013 04:08:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.39.105 with SMTP id o9ls3302153qek.45.gmail; Mon, 08 Apr 2013 04:08:01 -0700 (PDT) X-Received: by 10.52.100.163 with SMTP id ez3mr456151vdb.6.1365419281010; Mon, 08 Apr 2013 04:08:01 -0700 (PDT) Received: from mail-vb0-x231.google.com (mail-vb0-x231.google.com [2607:f8b0:400c:c02::231]) by mx.google.com with ESMTPS id a1si18058500vef.20.2013.04.08.04.08.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 04:08:01 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::231 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::231; Received: by mail-vb0-f49.google.com with SMTP id 11so3635189vbf.22 for ; Mon, 08 Apr 2013 04:08:00 -0700 (PDT) X-Received: by 10.52.66.197 with SMTP id h5mr457636vdt.47.1365419280904; Mon, 08 Apr 2013 04:08:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.85.136 with SMTP id h8csp13547vez; Mon, 8 Apr 2013 04:08:00 -0700 (PDT) X-Received: by 10.66.154.111 with SMTP id vn15mr35482433pab.99.1365419279958; Mon, 08 Apr 2013 04:07:59 -0700 (PDT) Received: from mail-da0-x233.google.com (mail-da0-x233.google.com [2607:f8b0:400e:c00::233]) by mx.google.com with ESMTPS id eh10si14353726pac.57.2013.04.08.04.07.59 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 04:07:59 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c00::233 is neither permitted nor denied by best guess record for domain of vikas.sajjan@linaro.org) client-ip=2607:f8b0:400e:c00::233; Received: by mail-da0-f51.google.com with SMTP id g27so2553290dan.24 for ; Mon, 08 Apr 2013 04:07:59 -0700 (PDT) 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: ALoCoQlF9hqlR0uwvyJDW+A18ZLlFMnIdMOYEc+/dbebVCOKyS1/Fm8M3+7DazZfJg5f8DxbYrJf X-Original-Sender: vikas.sajjan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::231 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);