From patchwork Tue Apr 23 11:49: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: 2477301 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 6D422DF2E5 for ; Tue, 23 Apr 2013 11:50:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755212Ab3DWLuC (ORCPT ); Tue, 23 Apr 2013 07:50:02 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:60502 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755361Ab3DWLuB (ORCPT ); Tue, 23 Apr 2013 07:50:01 -0400 Received: by mail-pd0-f177.google.com with SMTP id p11so383618pdj.8 for ; Tue, 23 Apr 2013 04:50:00 -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=SKHPvQDyMHIO9r//pDtDh4Trp+y/BD95d7yRyAzRfxQ=; b=WaxTPBEZgl2q/ARYVOE1E13oWFnckeL15lVvXabGlUzUg627Zds/n/GX+EmfNliIYN 73/BHWuvulakOfK4yir2fdTrqQKUgOTEB5sbB/szdhwwRWAvkcfbBdADa1Lcl2ufAH7J LphM4flJPYriq+ulot3U3bHqGMSdZ0sIxOa/it9BqwKH52zPUX3pz6WPQoFenut8Wn1O GYT1LrGdyhXAdRvMN2PDnhsQegO1DkHt4ZPpGswb7oCBlLd33mAXwJ6d/ul3aig8E4gp GSnNHvXjhwEBw6b4IMJZ3cdjraQbquLBrY+o7YlSt1Po6cTxFeI0/9H5dcLUJXRiMNdf IbEA== X-Received: by 10.68.40.131 with SMTP id x3mr8899387pbk.216.1366717800485; Tue, 23 Apr 2013 04:50:00 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id tx9sm29256585pbc.27.2013.04.23.04.49.55 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 04:49:59 -0700 (PDT) From: Vikas Sajjan To: dri-devel@lists.freedesktop.org Cc: linux-samsung-soc@vger.kernel.org, inki.dae@samsung.com, sylvester.nawrocki@gmail.com, kgene.kim@samsung.com, t.figa@samsung.com, viresh.kumar@linaro.org Subject: [PATCH v5] drm/exynos: enable FIMD clocks Date: Tue, 23 Apr 2013 17:19:50 +0530 Message-Id: <1366717790-18507-1-git-send-email-vikas.sajjan@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQl3iEvkz9Wu+M2cdiE7EbAA0qfxe+cNyxXJ6yC+f6V1xB2Gq5S/tIhYoAW8svx8aRUpdclQ Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Common Clock Framework introduced the need to prepare clocks before enabling them, otherwise clk_enable() fails. This patch adds clk_prepare_enable and clk_disable_unprepare() calls to the driver. This patch also removes clk_disable() from fimd_remove() as it will be done by pm_runtime_put_sync. Signed-off-by: Vikas Sajjan --- Changes since v4: - replaced clk_enable() and clk_disable() with clk_prepare_enable() and clk_disable_unprepare() in fimd_clock() and removed clk_disable() from fimd_remove() as dicussed at http://lists.freedesktop.org/archives/dri-devel/2013-April/037727.html 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 | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 4073430..746b282 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -801,18 +801,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; @@ -996,9 +996,6 @@ static int fimd_remove(struct platform_device *pdev) if (ctx->suspended) goto out; - clk_disable(ctx->lcd_clk); - clk_disable(ctx->bus_clk); - pm_runtime_set_suspended(dev); pm_runtime_put_sync(dev);