From patchwork Fri May 31 09:19:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 17349 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E4FE325CAB for ; Fri, 31 May 2013 09:21:43 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id gd11sf1547994vcb.1 for ; Fri, 31 May 2013 02:21:43 -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=hwhGqB9hDhFRr8STv+q6QXHAgtZPDfMWQQ4OQfGrRrs=; b=nAu3xk852+FY9qtU220uDJqEsockohkYeJC0KmqJI682fFELgC+/R7k5YDVMvD0BOu lQ/HMVDECep7JP7BPEd1aHhJ3ngo5bxwej7CX2hg6V/DWHentf1cY9oH1On7Wscv3tQg pkYDt8YXaXfjvzEQB0mfret4BOZ1kkDThbu7WD1jOwB8Vijj7TLhIUt6/wt49+IYkwDa e6EQmoFZ4FhgZKx1FkrMlyfLmWukiglGmBZe7rMxFnnEelzDpMiF50NhStxSxxdOiJdg wNyPTRSRRKoX0mv5rB3RaGF6mzqh7YN87P0KtjxTJX7ze/vtA1uB3oiSOyKJ1yNCMSDK gxBg== X-Received: by 10.224.53.198 with SMTP id n6mr6298339qag.2.1369992103665; Fri, 31 May 2013 02:21:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.119.1 with SMTP id kq1ls847276qeb.26.gmail; Fri, 31 May 2013 02:21:43 -0700 (PDT) X-Received: by 10.52.25.40 with SMTP id z8mr7811596vdf.7.1369992103414; Fri, 31 May 2013 02:21:43 -0700 (PDT) Received: from mail-vb0-x22d.google.com (mail-vb0-x22d.google.com [2607:f8b0:400c:c02::22d]) by mx.google.com with ESMTPS id iz8si27824917vdb.58.2013.05.31.02.21.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 02:21:43 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22d; Received: by mail-vb0-f45.google.com with SMTP id 12so876961vbf.18 for ; Fri, 31 May 2013 02:21:43 -0700 (PDT) X-Received: by 10.58.187.164 with SMTP id ft4mr9230782vec.5.1369992103322; Fri, 31 May 2013 02:21:43 -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.229.199 with SMTP id jj7csp42460vcb; Fri, 31 May 2013 02:21:42 -0700 (PDT) X-Received: by 10.14.4.130 with SMTP id 2mr12591764eej.125.1369992100241; Fri, 31 May 2013 02:21:40 -0700 (PDT) Received: from eu1sys200aog105.obsmtp.com (eu1sys200aog105.obsmtp.com [207.126.144.119]) by mx.google.com with SMTP id v46si30074856een.77.2013.05.31.02.21.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 31 May 2013 02:21:40 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.119 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.119; Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob105.postini.com ([207.126.147.11]) with SMTP ID DSNKUahriQA9ZFY+n5Kg/faPb5z71Th8F3kk@postini.com; Fri, 31 May 2013 09:21:39 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 7631F63; Fri, 31 May 2013 09:20:11 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 804FF57; Fri, 31 May 2013 09:21:11 +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 EB46E24C07C; Fri, 31 May 2013 11:21:05 +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; Fri, 31 May 2013 11:21:11 +0200 From: Linus Walleij To: Cc: Arnd Bergmann , Linus Walleij Subject: [PATCH 36/39] ARM: u300: convert MMC/SD clock to device tree Date: Fri, 31 May 2013 11:19:11 +0200 Message-ID: <1369991954-17406-37-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1369991954-17406-1-git-send-email-linus.walleij@stericsson.com> References: <1369991954-17406-1-git-send-email-linus.walleij@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmCggbFeK7WrEwHw4PO2CyRkhWM1O8aUBcUVWeRzgddSp88m6u8TY6kVly3f6Hn2kwCSio9 X-Original-Sender: linus.walleij@stericsson.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22d 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. Acked-by: Mike Turquette Signed-off-by: Linus Walleij --- .../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 7edc5e5..05a0821 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"); }