From patchwork Tue Aug 14 08:15:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 177183 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5D7E42C0086 for ; Tue, 14 Aug 2012 18:18:37 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T1CHL-0003v6-E1; Tue, 14 Aug 2012 08:15:07 +0000 Received: from co1ehsobe004.messaging.microsoft.com ([216.32.180.187] helo=co1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T1CHH-0003uM-Ng for linux-arm-kernel@lists.infradead.org; Tue, 14 Aug 2012 08:15:04 +0000 Received: from mail76-co1-R.bigfish.com (10.243.78.231) by CO1EHSOBE002.bigfish.com (10.243.66.65) with Microsoft SMTP Server id 14.1.225.23; Tue, 14 Aug 2012 08:15:00 +0000 Received: from mail76-co1 (localhost [127.0.0.1]) by mail76-co1-R.bigfish.com (Postfix) with ESMTP id EC2CA600212; Tue, 14 Aug 2012 08:15:00 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: VS3(zcb8kzzz1202hzz8275dhz2dh87h2a8h668h839hd24he5bhe96hf0ah107ah) X-FB-DOMAIN-IP-MATCH: fail Received: from mail76-co1 (localhost.localdomain [127.0.0.1]) by mail76-co1 (MessageSwitch) id 1344932097659147_10643; Tue, 14 Aug 2012 08:14:57 +0000 (UTC) Received: from CO1EHSMHS002.bigfish.com (unknown [10.243.78.243]) by mail76-co1.bigfish.com (Postfix) with ESMTP id 9F145180044; Tue, 14 Aug 2012 08:14:57 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS002.bigfish.com (10.243.66.12) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 14 Aug 2012 08:14:57 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.2.298.5; Tue, 14 Aug 2012 03:14:56 -0500 Received: from S2101-09.ap.freescale.net ([10.192.185.27]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id q7E8ErvU025806; Tue, 14 Aug 2012 01:14:54 -0700 From: Shawn Guo To: Subject: [PATCH] ARM: imx6q: register fixed clocks in the common way Date: Tue, 14 Aug 2012 16:15:56 +0800 Message-ID: <1344932156-8275-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.32.180.187 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org With DT clock support in place, we can register fixed clocks in DT standard way. Signed-off-by: Shawn Guo --- arch/arm/boot/dts/imx6q.dtsi | 11 +++++++---- arch/arm/mach-imx/clk-imx6q.c | 21 +++++++-------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index 3d3c64b..0052fe7 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -65,17 +65,20 @@ #size-cells = <0>; ckil { - compatible = "fsl,imx-ckil", "fixed-clock"; + #clock-cells = <0>; + compatible = "fixed-clock"; clock-frequency = <32768>; }; - ckih1 { - compatible = "fsl,imx-ckih1", "fixed-clock"; + ckih { + #clock-cells = <0>; + compatible = "fixed-clock"; clock-frequency = <0>; }; osc { - compatible = "fsl,imx-osc", "fixed-clock"; + #clock-cells = <0>; + compatible = "fixed-clock"; clock-frequency = <24000000>; }; }; diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index ea89520..475bc93 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c @@ -162,27 +162,20 @@ static enum mx6q_clks const clks_init_on[] __initconst = { mmdc_ch0_axi, rom, }; +static const struct of_device_id clk_match[] __initconst = { + { .compatible = "fixed-clock", .data = of_fixed_clk_setup, }, + { /* sentinel */ } +}; + int __init mx6q_clocks_init(void) { struct device_node *np; void __iomem *base; int i, irq; - clk[dummy] = imx_clk_fixed("dummy", 0); + of_clk_init(clk_match); - /* retrieve the freqency of fixed clocks from device tree */ - for_each_compatible_node(np, NULL, "fixed-clock") { - u32 rate; - if (of_property_read_u32(np, "clock-frequency", &rate)) - continue; - - if (of_device_is_compatible(np, "fsl,imx-ckil")) - clk[ckil] = imx_clk_fixed("ckil", rate); - else if (of_device_is_compatible(np, "fsl,imx-ckih1")) - clk[ckih] = imx_clk_fixed("ckih", rate); - else if (of_device_is_compatible(np, "fsl,imx-osc")) - clk[osc] = imx_clk_fixed("osc", rate); - } + clk[dummy] = imx_clk_fixed("dummy", 0); np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop"); base = of_iomap(np, 0);