From patchwork Mon May 14 05:04:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 8579 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 9E51E23E13 for ; Mon, 14 May 2012 05:04:57 +0000 (UTC) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by fiordland.canonical.com (Postfix) with ESMTP id 2775EA189B9 for ; Mon, 14 May 2012 05:04:57 +0000 (UTC) Received: by obbun3 with SMTP id un3so5208683obb.11 for ; Sun, 13 May 2012 22:04:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :x-spamscore:x-bigfish:x-forefront-antispam-report:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-originatororg:x-gm-message-state; bh=IN/cKIqIoF0Q3Y/ritveNR4db3LpE8Ejv47SW7uiSAo=; b=JCaQavAr293U8csdUi87nFkITOvOn3OicePDmds7aAmCIW7HOuRZbEspiFLzH3mXs3 0NDUN3uypQTt2eAABeY+/0lpRW1ieCsNot2On2orFvR08FCbnhdm7ahjnGca40gN+VMQ C4ayNXg0yNgXImXAYcmaTWbc21FkqjLtS5VjzIU/WS1BatIt+Frcq3vWRToE0dGPmDbP xQI6h357BmgENzMAMYlg/k+wBln0Kh1VxDedTTk43C5MhPqKs+PjjwFS3ZKprdotjPVA N1rsXdBItGVvnc0+5yY37xHGakdx75A7agrqG0ktQXdwYfjzeeHZUZxqWSk03e6+TXHe 5uBQ== Received: by 10.50.154.169 with SMTP id vp9mr3390441igb.53.1336971896429; Sun, 13 May 2012 22:04:56 -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.231.35.72 with SMTP id o8csp317333ibd; Sun, 13 May 2012 22:04:55 -0700 (PDT) Received: by 10.180.81.166 with SMTP id b6mr16450809wiy.0.1336971894924; Sun, 13 May 2012 22:04:54 -0700 (PDT) Received: from tx2outboundpool.messaging.microsoft.com (tx2ehsobe002.messaging.microsoft.com. [65.55.88.12]) by mx.google.com with ESMTPS id gw8si15380315wib.14.2012.05.13.22.04.54 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 May 2012 22:04:54 -0700 (PDT) Received-SPF: neutral (google.com: 65.55.88.12 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) client-ip=65.55.88.12; Authentication-Results: mx.google.com; spf=neutral (google.com: 65.55.88.12 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) smtp.mail=B20223@freescale.com Received: from mail185-tx2-R.bigfish.com (10.9.14.248) by TX2EHSOBE010.bigfish.com (10.9.40.30) with Microsoft SMTP Server id 14.1.225.23; Mon, 14 May 2012 05:04:49 +0000 Received: from mail185-tx2 (localhost [127.0.0.1]) by mail185-tx2-R.bigfish.com (Postfix) with ESMTP id 30032221D76; Mon, 14 May 2012 05:04:49 +0000 (UTC) X-SpamScore: 3 X-BigFish: VS3(zcb8kzzz1202hzz8275bhz2dh2a8h668h839hd24he5bh) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail185-tx2 (localhost.localdomain [127.0.0.1]) by mail185-tx2 (MessageSwitch) id 1336971888292155_16369; Mon, 14 May 2012 05:04:48 +0000 (UTC) Received: from TX2EHSMHS004.bigfish.com (unknown [10.9.14.251]) by mail185-tx2.bigfish.com (Postfix) with ESMTP id 41FEAC0406; Mon, 14 May 2012 05:04:48 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS004.bigfish.com (10.9.99.104) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 14 May 2012 05:04:52 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.2.298.5; Mon, 14 May 2012 00:04:51 -0500 Received: from b20223-02.ap.freescale.net (b20223-02.ap.freescale.net [10.192.242.124]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id q4E54mZ9004439; Mon, 14 May 2012 00:04:49 -0500 (CDT) From: Richard Zhao To: CC: , , Richard Zhao Subject: [PATCH 1/1] ARM: imx6q: prepare and enable init on clks directly instead of clk_get first Date: Mon, 14 May 2012 13:04:47 +0800 Message-ID: <1336971887-24616-1-git-send-email-richard.zhao@freescale.com> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Gm-Message-State: ALoCoQkLe41c06rS/Xb2jltVtq3SQM1B65HIm5No1l1814/YK7TY720iTdIJjFaVZjKJ2mchACk7 This also makes any clk be possible init on. Signed-off-by: Richard Zhao --- arch/arm/mach-imx/clk-imx6q.c | 20 ++++++-------------- 1 files changed, 6 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 1d83d03..f7eb965 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c @@ -122,10 +122,6 @@ static const char *cko1_sels[] = { "pll3_usb_otg", "pll2_bus", "pll1_sys", "pll5 "dummy", "axi", "enfc", "ipu1_di0", "ipu1_di1", "ipu2_di0", "ipu2_di1", "ahb", "ipg", "ipg_per", "ckil", "pll4_audio", }; -static const char * const clks_init_on[] __initconst = { - "mmdc_ch0_axi", "mmdc_ch1_axi", "usboh3", -}; - enum mx6q_clks { dummy, ckil, ckih, osc, pll2_pfd0_352m, pll2_pfd1_594m, pll2_pfd2_396m, pll3_pfd0_720m, pll3_pfd1_540m, pll3_pfd2_508m, pll3_pfd3_454m, @@ -160,11 +156,14 @@ enum mx6q_clks { static struct clk *clk[clk_max]; +static enum mx6q_clks const clks_init_on[] __initconst = { + mmdc_ch0_axi, mmdc_ch1_axi, usboh3, +}; + int __init mx6q_clocks_init(void) { struct device_node *np; void __iomem *base; - struct clk *c; int i, irq; clk[dummy] = imx_clk_fixed("dummy", 0); @@ -424,15 +423,8 @@ int __init mx6q_clocks_init(void) clk_register_clkdev(clk[dummy], NULL, "20bc000.wdog"); clk_register_clkdev(clk[dummy], NULL, "20c0000.wdog"); - for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) { - c = clk_get_sys(clks_init_on[i], NULL); - if (IS_ERR(c)) { - pr_err("%s: failed to get clk %s", __func__, - clks_init_on[i]); - return PTR_ERR(c); - } - clk_prepare_enable(c); - } + for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) + clk_prepare_enable(clk[clks_init_on[i]]); np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt"); base = of_iomap(np, 0);