From patchwork Fri Aug 5 15:34:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Hui X-Patchwork-Id: 3290 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 9E62023F41 for ; Fri, 5 Aug 2011 15:33:08 +0000 (UTC) Received: from mail-qy0-f173.google.com (mail-qy0-f173.google.com [209.85.216.173]) by fiordland.canonical.com (Postfix) with ESMTP id 5FB69A184A2 for ; Fri, 5 Aug 2011 15:33:08 +0000 (UTC) Received: by qyk31 with SMTP id 31so443168qyk.11 for ; Fri, 05 Aug 2011 08:33:07 -0700 (PDT) Received: by 10.229.44.195 with SMTP id b3mr1901096qcf.7.1312558387573; Fri, 05 Aug 2011 08:33:07 -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.229.6.73 with SMTP id 9cs52129qcy; Fri, 5 Aug 2011 08:33:07 -0700 (PDT) Received: by 10.227.12.18 with SMTP id v18mr1980685wbv.89.1312558386187; Fri, 05 Aug 2011 08:33:06 -0700 (PDT) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id ff20si6455723wbb.126.2011.08.05.08.33.05 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Aug 2011 08:33:06 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) smtp.mail=jason.hui@linaro.org Received: by wwi36 with SMTP id 36so1547211wwi.31 for ; Fri, 05 Aug 2011 08:33:05 -0700 (PDT) Received: by 10.216.68.131 with SMTP id l3mr693778wed.43.1312558385675; Fri, 05 Aug 2011 08:33:05 -0700 (PDT) Received: from localhost.localdomain ([109.234.204.184]) by mx.google.com with ESMTPS id e55sm304941wed.2.2011.08.05.08.33.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Aug 2011 08:33:04 -0700 (PDT) From: Jason Liu To: linux-arm-kernel@lists.infradead.org Cc: s.hauer@pengutronix.de, patches@linaro.org Subject: [PATCH] ARM: iMX5: Don't enable DPLL if it already enabled Date: Fri, 5 Aug 2011 23:34:32 +0800 Message-Id: <1312558472-30590-1-git-send-email-jason.hui@linaro.org> X-Mailer: git-send-email 1.7.0.4 If the DPLL is already enabled, don't try to enable it again. Since write to the DPLL control register will make the DPLL reset and which will cause some issues when some child module are sourced from this DPLL. Signed-off-by: Jason Liu Cc: Sascha Hauer --- arch/arm/mach-mx5/clock-mx51-mx53.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c index 7f20308..f7bf996 100644 --- a/arch/arm/mach-mx5/clock-mx51-mx53.c +++ b/arch/arm/mach-mx5/clock-mx51-mx53.c @@ -271,7 +271,11 @@ static int _clk_pll_enable(struct clk *clk) int i = 0; pllbase = _get_pll_base(clk); - reg = __raw_readl(pllbase + MXC_PLL_DP_CTL) | MXC_PLL_DP_CTL_UPEN; + reg = __raw_readl(pllbase + MXC_PLL_DP_CTL); + if (reg & MXC_PLL_DP_CTL_UPEN) + return 0; + + reg |= MXC_PLL_DP_CTL_UPEN; __raw_writel(reg, pllbase + MXC_PLL_DP_CTL); /* Wait for lock */