From patchwork Thu May 23 17:31:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 17167 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 891592395B for ; Thu, 23 May 2013 17:33:12 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id s1sf4545552qcw.10 for ; Thu, 23 May 2013 10:32:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=bDniSK1b9SqglZrCVnqh9sKmCvSgtjSAfRGnaLSFnrQ=; b=a9zu9FM3k3lkWEMXy9boJ+tKywxbzuEoWpDmi09bAMzjslybb9cNq8n0Lj0AxLrCh0 Qj9pHzAQVd6hMqRP7af2GAH0wZKkb96c0Lr0Y2Lvyk1WhWcwUT1CkTbWuwQkj+u47QWz Ry5AMrAHohmUlX9eE40c47Z7KJCfTYN99z56JEI39DDqDV2sHL9y21UZQIHRgMa8MSuA BNzsYRZLw5liGcL9zfAbYwj38dDqEUQbg9u9QqkXWaOuMOadtuAmfNH3d4qcZ1SZlDiL Y1Y5ZzO/YVItAOGT/I1bLlIZ49k4My6CS9TV9ZxWi3wPcO5pS4FYMJzGhQNv9x0JPP1v MtOQ== X-Received: by 10.224.59.205 with SMTP id m13mr6766797qah.7.1369330336822; Thu, 23 May 2013 10:32:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.196 with SMTP id 4ls1411900qeg.96.gmail; Thu, 23 May 2013 10:32:16 -0700 (PDT) X-Received: by 10.52.0.102 with SMTP id 6mr5387594vdd.9.1369330336625; Thu, 23 May 2013 10:32:16 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id ra6si1398216vec.35.2013.05.23.10.32.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 10:32:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id ht10so2447527vcb.32 for ; Thu, 23 May 2013 10:32:16 -0700 (PDT) X-Received: by 10.52.176.65 with SMTP id cg1mr5152216vdc.1.1369330336375; Thu, 23 May 2013 10:32:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.126.138 with SMTP id c10csp62520vcs; Thu, 23 May 2013 10:32:15 -0700 (PDT) X-Received: by 10.14.211.69 with SMTP id v45mr33742339eeo.45.1369330334946; Thu, 23 May 2013 10:32:14 -0700 (PDT) Received: from eu1sys200aog111.obsmtp.com (eu1sys200aog111.obsmtp.com [207.126.144.131]) by mx.google.com with SMTP id u46si9282634eeg.66.2013.05.23.10.31.48 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 May 2013 10:32:14 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.131 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.131; Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob111.postini.com ([207.126.147.11]) with SMTP ID DSNKUZ5Sgyp/iAoMRuj6lW6/Ksh7NgV3b/bU@postini.com; Thu, 23 May 2013 17:32:14 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 25DFE50; Thu, 23 May 2013 17:30:47 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id EDBAD4E; Thu, 23 May 2013 17:31:44 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 8C40F24C2C0; Thu, 23 May 2013 19:31:35 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Thu, 23 May 2013 19:31:44 +0200 From: Linus Walleij To: , Rob Herring , Mike Turquette Cc: , Arnd Bergmann , Linus Walleij Subject: [PATCH 6/6] ARM: u300: convert MMC/SD clock to device tree Date: Thu, 23 May 2013 19:31:28 +0200 Message-ID: <1369330288-14856-7-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1369330288-14856-1-git-send-email-linus.walleij@stericsson.com> References: <1369330288-14856-1-git-send-email-linus.walleij@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlHpshSCR/Mujz7LDXvYBe67uChaGCDiapXvKJGZ8/DsUVQI98WNLGaxOSqjUgYkXRW5UXX X-Original-Sender: linus.walleij@stericsson.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Linus Walleij This converts the last of the U300 clocks to being probed from the device tree. Cc: Mike Turquette Signed-off-by: Linus Walleij --- Hi Mike, I'm seeking an ACK on this to take it through the ARM SoC tree. --- .../bindings/clock/ste-u300-syscon-clock.txt | 23 ++++++++++++++++++++++ arch/arm/boot/dts/ste-u300.dts | 9 +++++++-- drivers/clk/clk-u300.c | 22 ++++++++++++++++----- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/ste-u300-syscon-clock.txt b/Documentation/devicetree/bindings/clock/ste-u300-syscon-clock.txt index b6a30f5..7cafcb9 100644 --- a/Documentation/devicetree/bindings/clock/ste-u300-syscon-clock.txt +++ b/Documentation/devicetree/bindings/clock/ste-u300-syscon-clock.txt @@ -55,3 +55,26 @@ gpio: gpio@c0016000 { (...) clocks = <&gpio_clk>; }; + + +Bindings for the MMC/SD card clock: + +Required properties: +- compatible: must be "stericsson,u300-syscon-mclk" +- #clock-cells: must be <0> + +Optional properties: +- clocks: parent clock(s) + +mmc_mclk: mmc_mclk { + #clock-cells = <0>; + compatible = "stericsson,u300-syscon-mclk"; + clocks = <&mmc_pclk>; +}; + +mmcsd: mmcsd@c0001000 { + compatible = "arm,pl18x", "arm,primecell"; + clocks = <&mmc_pclk>, <&mmc_mclk>; + clock-names = "apb_pclk", "mclk"; + (...) +}; diff --git a/arch/arm/boot/dts/ste-u300.dts b/arch/arm/boot/dts/ste-u300.dts index e83aafc..d5dd243 100644 --- a/arch/arm/boot/dts/ste-u300.dts +++ b/arch/arm/boot/dts/ste-u300.dts @@ -205,6 +205,11 @@ clock-id = <5>; clocks = <&fast_clk>; }; + mmc_mclk: mmc_mclk { + #clock-cells = <0>; + compatible = "stericsson,u300-syscon-mclk"; + clocks = <&mmc_pclk>; + }; spi_clk: spi_p_clk@26M { #clock-cells = <0>; compatible = "stericsson,u300-syscon-clk"; @@ -433,8 +438,8 @@ reg = <0xc0001000 0x1000>; interrupt-parent = <&vicb>; interrupts = <6 7>; - clocks = <&mmc_pclk>; - clock-names = "apb_pclk"; + clocks = <&mmc_pclk>, <&mmc_mclk>; + clock-names = "apb_pclk", "mclk"; max-frequency = <24000000>; bus-width = <4>; // SD-card slot mmc-cap-mmc-highspeed; diff --git a/drivers/clk/clk-u300.c b/drivers/clk/clk-u300.c index 5f234d3..8774e05 100644 --- a/drivers/clk/clk-u300.c +++ b/drivers/clk/clk-u300.c @@ -1139,6 +1139,18 @@ mclk_clk_register(struct device *dev, const char *name, return clk; } +static void __init of_u300_syscon_mclk_init(struct device_node *np) +{ + struct clk *clk = ERR_PTR(-EINVAL); + const char *clk_name = np->name; + const char *parent_name; + + parent_name = of_clk_get_parent_name(np, 0); + clk = mclk_clk_register(NULL, clk_name, parent_name, false); + if (!IS_ERR(clk)) + of_clk_add_provider(np, of_clk_src_simple_get, clk); +} + static const __initconst struct of_device_id u300_clk_match[] = { { .compatible = "fixed-clock", @@ -1152,12 +1164,16 @@ static const __initconst struct of_device_id u300_clk_match[] = { .compatible = "stericsson,u300-syscon-clk", .data = of_u300_syscon_clk_init, }, + { + .compatible = "stericsson,u300-syscon-mclk", + .data = of_u300_syscon_mclk_init, + }, }; + void __init u300_clk_init(void __iomem *base) { u16 val; - struct clk *clk; syscon_vbase = base; @@ -1175,8 +1191,4 @@ void __init u300_clk_init(void __iomem *base) writew(val, syscon_vbase + U300_SYSCON_PMCR); of_clk_init(u300_clk_match); - - /* Then this special MMC/SD clock */ - clk = mclk_clk_register(NULL, "mmc_clk", "mmc_p_clk", false); - clk_register_clkdev(clk, NULL, "mmci"); }