From patchwork Fri Jun 24 09:41:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102096 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp855262qgy; Fri, 24 Jun 2016 02:42:15 -0700 (PDT) X-Received: by 10.66.89.34 with SMTP id bl2mr5971258pab.80.1466761335410; Fri, 24 Jun 2016 02:42:15 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ab14si5904152pac.110.2016.06.24.02.42.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 02:42:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNbj-0006gF-UK; Fri, 24 Jun 2016 09:41:03 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNac-0004bz-Pm for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2016 09:39:58 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0Ls9Oh-1bMRkj0Z9r-013s59; Fri, 24 Jun 2016 11:39:30 +0200 From: Arnd Bergmann To: Linus Walleij Subject: [PATCH 2/7] ARM: ux500: use CLK_OF_DECLARE() Date: Fri, 24 Jun 2016 11:41:27 +0200 Message-Id: <20160624094132.1852086-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160624094132.1852086-1-arnd@arndb.de> References: <20160624094132.1852086-1-arnd@arndb.de> X-Provags-ID: V03:K0:ziVLpl8yJ/o4xDpdf40P+1qYJ4zHMCZ9bYdY/2+YcNzIyFljfgT KX2Z5r3ui0hAWXyQBeFVQVC04QkNtL658hEtXu1FKOOSxhZry6i7LmSH+uDExfxXusPwuUB RfxvzbT7eTycROBPjQHRL6k7kX6tdYD0Y6hDfcfjrWj5WcENjZAeIKyNpCZqz22ddquOK3R Lr6ENtDgh9pQnJr+6f4HA== X-UI-Out-Filterresults: notjunk:1; V01:K0:1l13Sq4/DOA=:jVTfeCVxJ7TRYrBPWGfgS3 MqJkV6P+90Tsh7myZlhSTjgAa0JmQmDLZw5cvJ6+1Id0d3xFSBMdkOoqH0pzeCRB76AaMJmX5 wleS4cujckKnW3RVbCNQSxTHfZtJcSSeUNDzli/Qxu0NRS0qMwwwpM34HJy8LUI0yPiBSuP9j VVCMByVpAach6i1QNwpZbZvCsOIfoRsWfe3RxpEBFAFMcrkkVCUzn6hYm9pnZaFPp/P/WtO01 Kzfj8w0M9qmO0pfOyxSqHBUZiYwX8uVJj4JStHvPhhtGDyJh6s0xkAdGbslpZKiXup0MgDlXG UutLRcpOk1pdUSzia1EBsSVWhJUuzW1h9Gg1ASdP+cxkIfVONIST9Dn8zc+I2YyeTUL2GHS4j ikmHnXgpPE73c/fXk1ISsCAcVnUv7rbJAyOanxueGuZqlhoERMgNe73YvYxedv8/oqbp+T7C/ vKrC8bs9dxWUPxeq045AiVEmQWFe+YItUW+Zc+mUkKvcdscjwdkD/iraLSi0zi742JX2z5xNP BXwrp2T4/oMXLYhq4Ao8PXXC6BFnaZkqXAn4VT54zxr7QSp4vhC51/U4DgrFemWUcir/0+mUa xY50QCSrVfoIB0OpQTT6G7OWfpZp9K+gRcax2ThgStv1nDYyIpKKQI0THVng76Fy2qJCkpLDe 6BNybj1AOMbBliRjXg8Exynl1skhNuf5XqZf1H9/He6YTyM4TCGBzDXAM0hkrJAkFXt8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160624_023955_292329_40C5E1D4 X-CRM114-Status: GOOD ( 17.11 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.10 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.10 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The ux500 DT support predates the CLK_OF_DECLARE macro and calls directly into the clk driver from platform code. Converting this to CLK_OF_DECLARE makes the code much nicer and similar to how modern platforms do it today. It also removes the last user of cpu_is_u8500_family() etc. Signed-off-by: Arnd Bergmann --- MAINTAINERS | 1 - arch/arm/mach-ux500/cpu.c | 12 ------------ drivers/clk/ux500/u8500_of_clk.c | 16 ++-------------- drivers/clk/ux500/u8540_clk.c | 16 ++-------------- drivers/clk/ux500/u9540_clk.c | 4 ++-- include/linux/platform_data/clk-ux500.h | 17 ----------------- 6 files changed, 6 insertions(+), 60 deletions(-) delete mode 100644 include/linux/platform_data/clk-ux500.h -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/MAINTAINERS b/MAINTAINERS index eff103763782..e78251a18255 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1842,7 +1842,6 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) T: git git://git.linaro.org/people/ulfh/clk.git S: Maintained F: drivers/clk/ux500/ -F: include/linux/platform_data/clk-ux500.h ARM/VERSATILE EXPRESS PLATFORM M: Liviu Dudau diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index f8c2d6f2fb7e..63853e76a4e1 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -66,17 +65,6 @@ void __init ux500_init_irq(void) prcmu_early_init(r.start, r.end-r.start); ux500_pm_init(r.start, r.end-r.start); ux500_l2x0_init(); - - /* - * Init clocks here so that they are available for system timer - * initialization. - */ - if (cpu_is_u8500_family()) - u8500_clk_init(); - else if (cpu_is_u9540()) - u9540_clk_init(); - else if (cpu_is_u8540()) - u8540_clk_init(); } static const char * __init ux500_get_machine(void) diff --git a/drivers/clk/ux500/u8500_of_clk.c b/drivers/clk/ux500/u8500_of_clk.c index 9a736d939806..e960d686d9db 100644 --- a/drivers/clk/ux500/u8500_of_clk.c +++ b/drivers/clk/ux500/u8500_of_clk.c @@ -11,7 +11,6 @@ #include #include #include -#include #include "clk.h" #define PRCC_NUM_PERIPH_CLUSTERS 6 @@ -48,11 +47,6 @@ static struct clk *ux500_twocell_get(struct of_phandle_args *clkspec, return PRCC_SHOW(clk_data, base, bit); } -static const struct of_device_id u8500_clk_of_match[] = { - { .compatible = "stericsson,u8500-clks", }, - { }, -}; - /* CLKRST4 is missing making it hard to index things */ enum clkrst_index { CLKRST1_INDEX = 0, @@ -63,22 +57,15 @@ enum clkrst_index { CLKRST_MAX, }; -void u8500_clk_init(void) +static void u8500_clk_init(struct device_node *np) { struct prcmu_fw_version *fw_version; - struct device_node *np = NULL; struct device_node *child = NULL; const char *sgaclk_parent = NULL; struct clk *clk, *rtc_clk, *twd_clk; u32 bases[CLKRST_MAX]; int i; - if (of_have_populated_dt()) - np = of_find_matching_node(NULL, u8500_clk_of_match); - if (!np) { - pr_err("Either DT or U8500 Clock node not found\n"); - return; - } for (i = 0; i < ARRAY_SIZE(bases); i++) { struct resource r; @@ -573,3 +560,4 @@ void u8500_clk_init(void) of_clk_add_provider(child, of_clk_src_simple_get, twd_clk); } } +CLK_OF_DECLARE(u8500_clks, "stericsson,u8500-clks", u8500_clk_init); diff --git a/drivers/clk/ux500/u8540_clk.c b/drivers/clk/ux500/u8540_clk.c index 86549e59fb42..133859f0e2bf 100644 --- a/drivers/clk/ux500/u8540_clk.c +++ b/drivers/clk/ux500/u8540_clk.c @@ -12,14 +12,8 @@ #include #include #include -#include #include "clk.h" -static const struct of_device_id u8540_clk_of_match[] = { - { .compatible = "stericsson,u8540-clks", }, - { } -}; - /* CLKRST4 is missing making it hard to index things */ enum clkrst_index { CLKRST1_INDEX = 0, @@ -30,19 +24,12 @@ enum clkrst_index { CLKRST_MAX, }; -void u8540_clk_init(void) +static void u8540_clk_init(struct device_node *np) { struct clk *clk; - struct device_node *np = NULL; u32 bases[CLKRST_MAX]; int i; - if (of_have_populated_dt()) - np = of_find_matching_node(NULL, u8540_clk_of_match); - if (!np) { - pr_err("Either DT or U8540 Clock node not found\n"); - return; - } for (i = 0; i < ARRAY_SIZE(bases); i++) { struct resource r; @@ -607,3 +594,4 @@ void u8540_clk_init(void) bases[CLKRST6_INDEX], BIT(0), CLK_SET_RATE_GATE); clk_register_clkdev(clk, NULL, "rng"); } +CLK_OF_DECLARE(u8540_clks, "stericsson,u8540-clks", u8540_clk_init); diff --git a/drivers/clk/ux500/u9540_clk.c b/drivers/clk/ux500/u9540_clk.c index 2138a4c8cbca..7b6bca49ce42 100644 --- a/drivers/clk/ux500/u9540_clk.c +++ b/drivers/clk/ux500/u9540_clk.c @@ -9,10 +9,10 @@ #include #include -#include #include "clk.h" -void u9540_clk_init(void) +static void u9540_clk_init(struct device_node *np) { /* register clocks here */ } +CLK_OF_DECLARE(u9540_clks, "stericsson,u9540-clks", u9540_clk_init); diff --git a/include/linux/platform_data/clk-ux500.h b/include/linux/platform_data/clk-ux500.h deleted file mode 100644 index 3af0da1f3be5..000000000000 --- a/include/linux/platform_data/clk-ux500.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Clock definitions for ux500 platforms - * - * Copyright (C) 2012 ST-Ericsson SA - * Author: Ulf Hansson - * - * License terms: GNU General Public License (GPL) version 2 - */ - -#ifndef __CLK_UX500_H -#define __CLK_UX500_H - -void u8500_clk_init(void); -void u9540_clk_init(void); -void u8540_clk_init(void); - -#endif /* __CLK_UX500_H */