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: 2371731 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 E4A213FDDA for ; Mon, 1 Apr 2013 16:42:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A99BE61AD for ; Mon, 1 Apr 2013 09:42:45 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by gabe.freedesktop.org (Postfix) with ESMTP id 370E8E5FCC for ; Mon, 1 Apr 2013 01:44:01 -0700 (PDT) Received: by mail-pa0-f46.google.com with SMTP id rl6so1224808pac.19 for ; Mon, 01 Apr 2013 01:44:01 -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=dKlCebkRfeopGo+V28v/0AxwmLlgJ3yKqI2YryIYcF0=; b=ir6iTqHx8s7lptW9Fqdgg3GXbJSZILGQB9vigHdacerFwBr04qseQYtfW5FZg144tD /VScNW1gPf0n8c2NNzvSnB4hliTxAs0RXyzTc/YoTIuyJwS6Xz7gDJCDrDUzU7nTLYir AXKiV2fgJ2q6pv7N5cQttIEFjI81f26KbbrVZszzpJ741w8V36IYwfsWy6B3sSOAM2+a ptGMbN4mXDZzf2HJlGu9AQayP90IwoIretgXXeZN2R9nbOa2w1DaysSruoVCXX8KB3zo grcli0dUqg2uT8qTTFXhS+cJaEq0+8aJ/Vb7oBGA2m8BrDVO4C299p+JSuTfl7Y0Zy5H 7rAg== 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 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: ALoCoQl8ZHbvET995de0V1kvgDG5oR8hkbtPn4fMVabKQa1IzNlnvkt9cIv6MOXUhgn7Y9m7Ca51 X-Mailman-Approved-At: Mon, 01 Apr 2013 09:41:31 -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 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);