From patchwork Wed Mar 20 11:31:59 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: 2311161 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 0F71940213 for ; Thu, 21 Mar 2013 06:40:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D7243E62CB for ; Wed, 20 Mar 2013 23:40:37 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 32C61E65C6 for ; Wed, 20 Mar 2013 04:32:12 -0700 (PDT) Received: by mail-pb0-f54.google.com with SMTP id rr4so1281756pbb.13 for ; Wed, 20 Mar 2013 04:32:12 -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=WIUNRJ8+d4VOHg73dSr7XfhkyMs59Exw0XebKfSwB7M=; b=ctGhpIvUucoENwvpAUciIuKFngpHbyFGPcbaznrfF3nXcUy5kLLjzG4BqXuuVAaKn6 LC72B2T3N1uZs8D3O7b/LKuTSAg2hWeiq7i18n3hISuCRMxblfKYsvybxv5RchQtCz5i Dl+sUfikHIg6FprmujhjA6uka+Qz6dJE6PsB+RFDz80x/hlCR91SVhjCdAdUP1DF6Vz6 xm8JUEo2zZk9VfGAbAg9E5tVmnFpW/CRi9Ody7DrwAYAKUUHWzJz6ADoEpF+cpshtfxb 6PjDyCkcpcy1HHyNJpueqTDRObQVG7vaCwiqBVQODe8S9IMKP2WrzMFTZidyLexcPwGt m/Uw== X-Received: by 10.68.189.65 with SMTP id gg1mr8309869pbc.122.1363779132079; Wed, 20 Mar 2013 04:32:12 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id qa6sm1800145pbc.46.2013.03.20.04.32.07 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Mar 2013 04:32:10 -0700 (PDT) From: Vikas Sajjan To: dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/exynos: enable FIMD clocks Date: Wed, 20 Mar 2013 17:01:59 +0530 Message-Id: <1363779119-3255-1-git-send-email-vikas.sajjan@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQn8pQo4lRCkCMfb55l2iiTLG2Ji/iZzsnxtO6zMQYNqOmwAQEcYAM9oj6pj33oqYlWxlbFP X-Mailman-Approved-At: Wed, 20 Mar 2013 23:39:15 -0700 Cc: linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, linaro-kernel@lists.linaro.org, linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org While migrating to common clock framework (CCF), 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. By calling clk_prepare_enable() for FIMD clocks fixes the issue. this patch also replaces clk_disable() with clk_disable_unprepare() during exit. Signed-off-by: Vikas Sajjan --- 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 | 17 +++++++++++++++-- 1 file changed, 15 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..014d750 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -934,6 +934,19 @@ static int fimd_probe(struct platform_device *pdev) return ret; } + ret = clk_prepare_enable(ctx->lcd_clk); + if (ret) { + dev_err(dev, "failed to enable 'sclk_fimd' clock\n"); + return ret; + } + + ret = clk_prepare_enable(ctx->bus_clk); + if (ret) { + clk_disable_unprepare(ctx->lcd_clk); + dev_err(dev, "failed to enable 'fimd' clock\n"); + return ret; + } + ctx->vidcon0 = pdata->vidcon0; ctx->vidcon1 = pdata->vidcon1; ctx->default_win = pdata->default_win; @@ -981,8 +994,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_disable_unprepare(ctx->lcd_clk); + clk_disable_unprepare(ctx->bus_clk); pm_runtime_set_suspended(dev); pm_runtime_put_sync(dev);