From patchwork Tue Jan 27 05:59:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenyou Yang X-Patchwork-Id: 5714761 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6E23A9F302 for ; Tue, 27 Jan 2015 06:05:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 844B6201CE for ; Tue, 27 Jan 2015 06:05:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91FFF201CD for ; Tue, 27 Jan 2015 06:05:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YFzFS-0002SS-Ce; Tue, 27 Jan 2015 06:03:38 +0000 Received: from eusmtp01.atmel.com ([212.144.249.243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YFzFF-00021H-8Z for linux-arm-kernel@lists.infradead.org; Tue, 27 Jan 2015 06:03:26 +0000 Received: from apsmtp01.atmel.com (10.168.254.31) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.2.347.0; Tue, 27 Jan 2015 07:03:00 +0100 Received: from shaarm01.corp.atmel.com (10.168.254.13) by apsmtp01.atmel.com (10.168.254.31) with Microsoft SMTP Server id 14.2.347.0; Tue, 27 Jan 2015 14:04:19 +0800 From: Wenyou Yang To: , Subject: [PATCH v3 10/13] pm: at91: rename function name: at91_slow_clock()-->at91_pm_suspend_sram_fn Date: Tue, 27 Jan 2015 13:59:48 +0800 Message-ID: <1422338388-6082-1-git-send-email-wenyou.yang@atmel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1422337810-3257-1-git-send-email-wenyou.yang@atmel.com> References: <1422337810-3257-1-git-send-email-wenyou.yang@atmel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150126_220325_726227_1D33D013 X-CRM114-Status: GOOD ( 11.11 ) X-Spam-Score: -0.7 (/) Cc: sergei.shtylyov@cogentembedded.com, sylvain.rochet@finsecur.com, linux-kernel@vger.kernel.org, linux@maxim.org.za, alexandre.belloni@free-electrons.com, wenyou.yang@atmel.com, peda@axentia.se, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As the file name's renaming, rename the file name at91_slow_clock()--> at91_pm_suspend_sram_fn, rename the function handler's name at the same time. Signed-off-by: Wenyou Yang Acked-by: Alexandre Belloni --- arch/arm/mach-at91/pm.c | 27 +++++++++++++-------------- arch/arm/mach-at91/pm_suspend.S | 24 ++++++++++-------------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index d967c31..ab1a4d6 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -129,13 +129,12 @@ int at91_suspend_entering_slow_clock(void) } EXPORT_SYMBOL(at91_suspend_entering_slow_clock); - -static void (*slow_clock)(void __iomem *pmc, void __iomem *ramc0, +static void (*at91_suspend_sram_fn)(void __iomem *pmc, void __iomem *ramc0, void __iomem *ramc1, int memctrl); -extern void at91_slow_clock(void __iomem *pmc, void __iomem *ramc0, +extern void at91_pm_suspend_in_sram(void __iomem *pmc, void __iomem *ramc0, void __iomem *ramc1, int memctrl); -extern u32 at91_slow_clock_sz; +extern u32 at91_pm_suspend_in_sram_sz; static void at91_pm_suspend(suspend_state_t state) { @@ -144,8 +143,8 @@ static void at91_pm_suspend(suspend_state_t state) pm_data |= (state == PM_SUSPEND_MEM) ? AT91_PM_MODE(AT91_PM_SLOW_CLOCK) : 0; - slow_clock(at91_pmc_base, at91_ramc_base[0], - at91_ramc_base[1], pm_data); + at91_suspend_sram_fn(at91_pmc_base, at91_ramc_base[0], + at91_ramc_base[1], pm_data); } static int at91_pm_enter(suspend_state_t state) @@ -249,17 +248,19 @@ static void __init at91_pm_sram_init(void) goto put_node; } - sram_base = gen_pool_alloc(sram_pool, at91_slow_clock_sz); + sram_base = gen_pool_alloc(sram_pool, at91_pm_suspend_in_sram_sz); if (!sram_base) { - pr_warn("%s: unable to alloc ocram!\n", __func__); + pr_warn("%s: unable to alloc sram!\n", __func__); goto put_node; } sram_pbase = gen_pool_virt_to_phys(sram_pool, sram_base); - slow_clock = __arm_ioremap_exec(sram_pbase, at91_slow_clock_sz, false); + at91_suspend_sram_fn = __arm_ioremap_exec(sram_pbase, + at91_pm_suspend_in_sram_sz, false); - /* Copy the slow_clock handler to SRAM */ - memcpy(slow_clock, at91_slow_clock, at91_slow_clock_sz); + /* Copy the pm suspend handler to SRAM */ + memcpy(at91_suspend_sram_fn, + at91_pm_suspend_in_sram, at91_pm_suspend_in_sram_sz); put_node: of_node_put(node); @@ -269,12 +270,10 @@ static void __init at91_pm_init(void) { at91_pm_sram_init(); - pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : "")); - if (at91_cpuidle_device.dev.platform_data) platform_device_register(&at91_cpuidle_device); - if (slow_clock) + if (at91_suspend_sram_fn) suspend_set_ops(&at91_pm_ops); else pr_info("AT91: PM : Not supported, due to no sram allocated\n"); diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S index 8edbad0..122a3f1 100644 --- a/arch/arm/mach-at91/pm_suspend.S +++ b/arch/arm/mach-at91/pm_suspend.S @@ -55,23 +55,19 @@ mode .req r6 .text -/* void at91_slow_clock(void __iomem *pmc, void __iomem *sdramc, +/* + * void at91_pm_suspend_in_sram(void __iomem *pmc, void __iomem *sdramc, * void __iomem *ramc1, int memctrl) + * @input param: + * @r0: the base address of AT91_PMC + * @r1: the base address of SDRAM Controller (SDRAM, DDRSDR, or AT91_SYS) + * @r2: the base address of second SDRAM Controller or 0 if not present + * @r3: the pm information */ -ENTRY(at91_slow_clock) +ENTRY(at91_pm_suspend_in_sram) /* Save registers on stack */ stmfd sp!, {r4 - r12, lr} - /* - * Register usage: - * R0 = Base address of AT91_PMC - * R1 = Base address of RAM Controller (SDRAM, DDRSDR, or AT91_SYS) - * R2 = Base address of second RAM Controller or 0 if not present - * R3 = Memory controller - * R4 = temporary register - * R5 = temporary register - */ - /* Drain write buffer */ mov tmp1, #0 mcr p15, 0, tmp1, c7, c10, 4 @@ -277,5 +273,5 @@ ram_restored: .saved_sam9_mdr1: .word 0 -ENTRY(at91_slow_clock_sz) - .word .-at91_slow_clock +ENTRY(at91_pm_suspend_in_sram_sz) + .word .-at91_pm_suspend_in_sram