From patchwork Fri Jun 3 22:56:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 9154229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D25026082E for ; Fri, 3 Jun 2016 22:57:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4BD028340 for ; Fri, 3 Jun 2016 22:57:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B991B28344; Fri, 3 Jun 2016 22:57:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87FC828340 for ; Fri, 3 Jun 2016 22:57:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 447976E5A4; Fri, 3 Jun 2016 22:57:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109]) by gabe.freedesktop.org (Postfix) with ESMTPS id A31F06E5AA for ; Fri, 3 Jun 2016 22:57:04 +0000 (UTC) Received: from trochilidae.toradex.int (75-146-58-181-Washington.hfc.comcastbusiness.net [75.146.58.181]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 5B71C5C1952; Sat, 4 Jun 2016 00:54:17 +0200 (CEST) From: Stefan Agner To: thierry.reding@gmail.com, airlied@linux.ie, dri-devel@lists.freedesktop.org, stefan@agner.ch Subject: [PATCH v2 4/6] drm/fsl-dcu: use clk helpers Date: Fri, 3 Jun 2016 15:56:42 -0700 Message-Id: <1464994604-4473-5-git-send-email-stefan@agner.ch> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1464994604-4473-1-git-send-email-stefan@agner.ch> References: <1464994604-4473-1-git-send-email-stefan@agner.ch> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1464994459; bh=UBNX30BwpsPI9nr8DthxlPgeT2CR+4v8D+T2XKFsXss=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=xqlC/99B/I3Uz1Pjpb+Ezvgvgxpq6+2SDCzywAkQ8OdJUIaCRmYOYSUSWkUf2MFc3PNXwkrYsNovt4CQhWZgEP2DdrOmGEk1BohaYKxDBqSWN2vzbuHq/fjmgR3pN9pTcMja9SywKWxGNU2FhmUcWtAr7lmRZgLCWqQ8WBzNc8o= Cc: jianwei.wang.chn@gmail.com, meng.yi@nxp.com, alexander.stein@systec-electronic.com, linux-kernel@vger.kernel.org, alison.wang@freescale.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use clk_prepare_enable and clk_disable_unprepare helpers. This also fixes a sequence issue in the enable path which lead to a warning on resume. Signed-off-by: Stefan Agner --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index 9daca1f..06a4d01 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -232,8 +232,7 @@ static int fsl_dcu_drm_pm_suspend(struct device *dev) drm_kms_helper_poll_disable(fsl_dev->drm); regcache_cache_only(fsl_dev->regmap, true); regcache_mark_dirty(fsl_dev->regmap); - clk_disable(fsl_dev->clk); - clk_unprepare(fsl_dev->clk); + clk_disable_unprepare(fsl_dev->clk); return 0; } @@ -246,15 +245,9 @@ static int fsl_dcu_drm_pm_resume(struct device *dev) if (!fsl_dev) return 0; - ret = clk_enable(fsl_dev->clk); + ret = clk_prepare_enable(fsl_dev->clk); if (ret < 0) { dev_err(dev, "failed to enable dcu clk\n"); - clk_unprepare(fsl_dev->clk); - return ret; - } - ret = clk_prepare(fsl_dev->clk); - if (ret < 0) { - dev_err(dev, "failed to prepare dcu clk\n"); return ret; }