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: 2369631 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 43C73DFB7B for ; Mon, 1 Apr 2013 08:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757853Ab3DAIoE (ORCPT ); Mon, 1 Apr 2013 04:44:04 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:52452 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757737Ab3DAIoB (ORCPT ); Mon, 1 Apr 2013 04:44:01 -0400 Received: by mail-pa0-f51.google.com with SMTP id jh10so1217090pab.10 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=gnIb1rTHCZf+PyZNOw4dtyBW22oBw+++55xbviknTStxGqvkFMjH0b0UOWua+RnO/j O+dgA4UC5BB4pSpNZ+zaExl7OpuhV6OzrcxCzlhFe7kRps8tzWcrIoh/5FxtadJinUp2 nsfdg3rTenre6lwoenztHtGU2p931gYs7IwJlv8ap9V55RyfhrOeWsGYjc5SvWdRthWc x7FY6SVnG/L9+ySri85e1BZ89J5Vylyi89YTGix4JKqNaVs5RCfqYHfohTMDiSSV6EY+ FQE0ntzxJebyVmaqbxPWZ33ujYGm08J2h+krleXQLOqRVjiFV6vKMH0nNfMljZCGv0SA cLyQ== 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: ALoCoQmXoBBr0AT5LNd4y1FkkdzS5V969hf9JMI/qw6ioJX4l5MW5tc0C1FPMjTGoN1+R8te0SbT Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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);