From patchwork Mon Apr 1 08:43:50 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: 15790 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6C9EE23E2C for ; Mon, 1 Apr 2013 08:44:03 +0000 (UTC) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by fiordland.canonical.com (Postfix) with ESMTP id 107F9A1809D for ; Mon, 1 Apr 2013 08:44:02 +0000 (UTC) Received: by mail-ve0-f173.google.com with SMTP id cy12so2277456veb.18 for ; Mon, 01 Apr 2013 01:44:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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; bh=dKlCebkRfeopGo+V28v/0AxwmLlgJ3yKqI2YryIYcF0=; b=S7YN7q0+XUYSLe2djurTdPzwpdZwTKURbxjwZyyGxVZbZ2bdOonC4zoOYzN420bOOQ twu//aLD4vamPD/OKi1fDllultWucXdEQ50MXAgfvm0XxqLKxrlEqJGrx0iDbkqN1IN0 sRNS+H2Cc1Yjjc8B6U18YsFOyH11ol+FMDXrOOl4tSnmudCGghTDSAQoVLWhtiijEsn1 waEgcZh0z+jIQfNeLbjbMVfqwsxBwYQ0H10Q5HsGiA4X+oVwgGosbnaMxRYhTaCb2k45 4nmwJDCyEg5BnQbsLgYamdaXyx96fZoU7t7BTTs7CWNAKfQjYKMSwyqyMJ9o/PRIdTR9 Qvyg== X-Received: by 10.52.31.103 with SMTP id z7mr7250195vdh.56.1364805842408; Mon, 01 Apr 2013 01:44:02 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp72843ved; Mon, 1 Apr 2013 01:44:01 -0700 (PDT) X-Received: by 10.66.72.105 with SMTP id c9mr17443685pav.177.1364805841500; Mon, 01 Apr 2013 01:44:01 -0700 (PDT) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by mx.google.com with ESMTPS id gl1si12972860pac.206.2013.04.01.01.44.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Apr 2013 01:44:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.51 is neither permitted nor denied by best guess record for domain of vikas.sajjan@linaro.org) client-ip=209.85.220.51; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.51 is neither permitted nor denied by best guess record for domain of vikas.sajjan@linaro.org) smtp.mail=vikas.sajjan@linaro.org Received: by mail-pa0-f51.google.com with SMTP id jh10so1216965pab.38 for ; Mon, 01 Apr 2013 01:44:01 -0700 (PDT) X-Received: by 10.68.198.5 with SMTP id iy5mr16469532pbc.162.1364805840937; Mon, 01 Apr 2013 01:44:00 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ef3sm14432877pad.20.2013.04.01.01.43.56 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Apr 2013 01:43:59 -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, linaro-kernel@lists.linaro.org, jy0922.shim@samsung.com, linux-samsung-soc@vger.kernel.org, thomas.abraham@linaro.org Subject: [PATCH v3] drm/exynos: enable FIMD clocks Date: Mon, 1 Apr 2013 14:13:50 +0530 Message-Id: <1364805830-6129-1-git-send-email-vikas.sajjan@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQkS+D5dyp2DP6m7SGX+yAv/EWIuy/5TSfGPgbKrYPtSiWWhd19B3OzWGJ8AhE4tWK6Y13vG 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 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, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 9537761..f2400c8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -799,18 +799,18 @@ static int fimd_clock(struct fimd_context *ctx, bool enable) if (enable) { int ret; - ret = clk_enable(ctx->bus_clk); + ret = clk_prepare_enable(ctx->bus_clk); if (ret < 0) return ret; - ret = clk_enable(ctx->lcd_clk); + ret = clk_prepare_enable(ctx->lcd_clk); if (ret < 0) { - clk_disable(ctx->bus_clk); + clk_disable_unprepare(ctx->bus_clk); return ret; } } else { - clk_disable(ctx->lcd_clk); - clk_disable(ctx->bus_clk); + clk_disable_unprepare(ctx->lcd_clk); + clk_disable_unprepare(ctx->bus_clk); } return 0; @@ -981,8 +981,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);