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: 15435 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 D8B0223E39 for ; Wed, 20 Mar 2013 11:32:16 +0000 (UTC) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by fiordland.canonical.com (Postfix) with ESMTP id 8B6AFA1821C for ; Wed, 20 Mar 2013 11:32:16 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id gf12so1184061vcb.24 for ; Wed, 20 Mar 2013 04:32:16 -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=WIUNRJ8+d4VOHg73dSr7XfhkyMs59Exw0XebKfSwB7M=; b=mtHxldff7QOpx9QAj8WrvDO+TwfiEjTNgmdkEzlf6OYKyNrD6x6yXZG3OEQMjteSA6 waDDM6BXWVApWqYBrEJqcptg41QI3aL3H2IXHcIVJwLyM61+InpZyYBS25I53Iy2K4va AhntoqZ2vZLHfgeHbamS7/Pt+69DrYXdAzQd8qg/QA4z3bWc+bv/fBksHgs+/N4F0WCq 24/tbqyEm8nTKPPUDD44HsoPsIcbkTKqV80QekZkBN8CzWklmcl8k4d26yAbVjz8GEgM PVGg/S9LU6AJyTAUsEgkmFxdTN9K6t3hbA3FpDyFx4+xCu4lhE3u88y7kbKIxxDTUzQS B0GA== X-Received: by 10.220.153.143 with SMTP id k15mr7227674vcw.33.1363779136019; Wed, 20 Mar 2013 04:32:16 -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.58.233.198 with SMTP id ty6csp6661vec; Wed, 20 Mar 2013 04:32:15 -0700 (PDT) X-Received: by 10.49.15.198 with SMTP id z6mr6401674qec.6.1363779133720; Wed, 20 Mar 2013 04:32:13 -0700 (PDT) Received: from mail-da0-x22b.google.com (mail-da0-x22b.google.com [2607:f8b0:400e:c00::22b]) by mx.google.com with ESMTPS id u20si6250029qct.99.2013.03.20.04.32.12 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Mar 2013 04:32:13 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c00::22b is neither permitted nor denied by best guess record for domain of vikas.sajjan@linaro.org) client-ip=2607:f8b0:400e:c00::22b; Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400e:c00::22b 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-da0-f43.google.com with SMTP id u36so947979dak.16 for ; Wed, 20 Mar 2013 04:32:12 -0700 (PDT) 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 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 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: ALoCoQnziQLxJKoIiBJMuOK2sZk1FUMxbamD75QBJMjyqeBiTMZdjsR6r7cDUWbozG2IERkvod1D 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);