From patchwork Thu Mar 28 16:11:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Andersson X-Patchwork-Id: 2357991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 098103FD40 for ; Thu, 28 Mar 2013 16:22:54 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ULFY4-0000re-VV; Thu, 28 Mar 2013 16:19:33 +0000 Received: from eu1sys200aog113.obsmtp.com ([207.126.144.135]) by merlin.infradead.org with smtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ULFR5-0005rj-EP for linux-arm-kernel@lists.infradead.org; Thu, 28 Mar 2013 16:12:26 +0000 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob113.postini.com ([207.126.147.11]) with SMTP ID DSNKUVRr3daXI4vxOKAI6BhrUuNa8bKPr6j/@postini.com; Thu, 28 Mar 2013 16:12:19 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 636861C5; Thu, 28 Mar 2013 16:11:54 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EC64B51B0; Thu, 28 Mar 2013 16:11:53 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 89989A807B; Thu, 28 Mar 2013 17:11:47 +0100 (CET) Received: from steludxu2826.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.279.5; Thu, 28 Mar 2013 17:11:53 +0100 From: Rickard Andersson To: , , Subject: [PATCH V2 07/12] ARM: ux500: Create u8500-clk device Date: Thu, 28 Mar 2013 17:11:33 +0100 Message-ID: <1364487098-10319-8-git-send-email-rickard.andersson@stericsson.com> X-Mailer: git-send-email 1.8.2 In-Reply-To: <1364487098-10319-1-git-send-email-rickard.andersson@stericsson.com> References: <1364487098-10319-1-git-send-email-rickard.andersson@stericsson.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130328_121219_976190_4EDF6AEF X-CRM114-Status: GOOD ( 17.46 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [207.126.144.135 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: hongbo.zhang@linaro.org, ulf.hansson@linaro.org, khilman@linaro.org, linus.walleij@stericsson.com, daniel.lezcano@linaro.org, rickard.andersson@stericsson.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add platform device for u8500-clk. Also add the device to the generic power domain APE. Signed-off-by: Rickard Andersson --- arch/arm/boot/dts/dbx5x0.dtsi | 9 ++++++++ arch/arm/mach-ux500/board-mop500.c | 8 +++++++ arch/arm/mach-ux500/cpu-db8500.c | 1 + arch/arm/mach-ux500/devices-db8500.c | 41 ++++++++++++++++++++++++++++++++++++ arch/arm/mach-ux500/devices-db8500.h | 1 + drivers/clk/ux500/u8500_clk.c | 6 ++++++ 6 files changed, 66 insertions(+) diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi index 63f2fbc..b1438d2 100644 --- a/arch/arm/boot/dts/dbx5x0.dtsi +++ b/arch/arm/boot/dts/dbx5x0.dtsi @@ -657,6 +657,15 @@ status = "disabled"; }; + clk { + compatible = "stericsson,u8500-clk"; + reg = <0x8012f000 0x1000>, + <0x8011f000 0x1000>, + <0x8000f000 0x1000>, + <0xa03ff000 0x1000>, + <0xa03cf000 0x1000>; + }; + external-bus@50000000 { compatible = "simple-bus"; reg = <0x50000000 0x4000000>; diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 77d3d1a..b351f25 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -649,9 +649,17 @@ struct generic_pm_domain ape_domain = { .name = "APE", }; +static __init void add_platform_device_to_genpd(struct platform_device *pdev, + struct generic_pm_domain *genpd) +{ + pm_genpd_add_device(genpd, &pdev->dev); +} + static void __init init_pm_domains(void) { pm_genpd_init(&ape_domain, NULL, false); + + add_platform_device_to_genpd(&db8500_clk_device, &ape_domain); } static void __init mop500_init_machine(void) diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 5b286e0..6ead606 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -142,6 +142,7 @@ static struct platform_device db8500_prcmu_device = { }; static struct platform_device *platform_devs[] __initdata = { + &db8500_clk_device, &u8500_dma40_device, &db8500_pmu_device, &db8500_prcmu_device, diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c index 318d490..ad6036b 100644 --- a/arch/arm/mach-ux500/devices-db8500.c +++ b/arch/arm/mach-ux500/devices-db8500.c @@ -194,3 +194,44 @@ struct platform_device u8500_ske_keypad_device = { .num_resources = ARRAY_SIZE(keypad_resources), .resource = keypad_resources, }; + +static struct resource clk_resources[] = { + [0] = { + .start = U8500_CLKRST1_BASE, + .end = U8500_CLKRST1_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + .name = "clkrst1_base", + }, + [1] = { + .start = U8500_CLKRST2_BASE, + .end = U8500_CLKRST2_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + .name = "clkrst2_base", + }, + [2] = { + .start = U8500_CLKRST3_BASE, + .end = U8500_CLKRST3_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + .name = "clkrst3_base", + }, + [3] = { + .start = U8500_CLKRST5_BASE, + .end = U8500_CLKRST5_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + .name = "clkrst5_base", + }, + [4] = { + .start = U8500_CLKRST6_BASE, + .end = U8500_CLKRST6_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + .name = "clkrst6_base", + }, +}; + +struct platform_device db8500_clk_device = { + .name = "u8500-clk", + .id = -1, + .num_resources = ARRAY_SIZE(clk_resources), + .resource = clk_resources + +}; diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h index a5e05f6..0094f3a 100644 --- a/arch/arm/mach-ux500/devices-db8500.h +++ b/arch/arm/mach-ux500/devices-db8500.h @@ -14,6 +14,7 @@ struct ske_keypad_platform_data; struct pl022_ssp_controller; +extern struct platform_device db8500_clk_device; static inline struct platform_device * db8500_add_ske_keypad(struct device *parent, diff --git a/drivers/clk/ux500/u8500_clk.c b/drivers/clk/ux500/u8500_clk.c index 63ed580..8a3ac27 100644 --- a/drivers/clk/ux500/u8500_clk.c +++ b/drivers/clk/ux500/u8500_clk.c @@ -566,9 +566,15 @@ static struct notifier_block prcc_context_notifier = { .notifier_call = prcc_context_call, }; +static const struct of_device_id u8500_clk_match[] = { + { .compatible = "stericsson,u8500-clk", }, + {}, +}; + static struct platform_driver u8500_clk_plat_driver = { .driver = { .name = "u8500-clk", + .of_match_table = u8500_clk_match, }, };