From patchwork Tue Jan 27 06:01:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenyou Yang X-Patchwork-Id: 5714791 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 A0F519F302 for ; Tue, 27 Jan 2015 06:07:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D5DA9201CE for ; Tue, 27 Jan 2015 06:06:59 +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 0CF42201CD for ; Tue, 27 Jan 2015 06:06:59 +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 1YFzH9-0004yW-On; Tue, 27 Jan 2015 06:05:23 +0000 Received: from nasmtp01.atmel.com ([192.199.1.245] helo=DVREDG01.corp.atmel.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YFzH0-0003am-BM for linux-arm-kernel@lists.infradead.org; Tue, 27 Jan 2015 06:05:14 +0000 Received: from apsmtp01.atmel.com (10.168.254.31) by DVREDG01.corp.atmel.com (10.42.103.30) with Microsoft SMTP Server (TLS) id 14.2.347.0; Mon, 26 Jan 2015 23:04:50 -0700 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:06:24 +0800 From: Wenyou Yang To: , Subject: [PATCH v3 13/13] pm: at91: amend the pm_suspend entry for at91_cpuidle_device Date: Tue, 27 Jan 2015 14:01:54 +0800 Message-ID: <1422338514-8595-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_220514_460595_59C3050E X-CRM114-Status: GOOD ( 10.14 ) X-Spam-Score: -0.0 (/) 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 Because the at91_xxx_standby() function is substitued by the at91_pm_suspend(), the pm_suspend entry for at91_cpuidle_device changes as well. Signed-off-by: Wenyou Yang Acked-by: Alexandre Belloni --- arch/arm/mach-at91/pm.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index ab1a4d6..faa5d30 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -40,8 +40,6 @@ static struct { int memctrl; } at91_pm_data; -static void (*at91_pm_standby)(void); - static int at91_pm_valid_state(suspend_state_t state) { switch (state) { @@ -214,12 +212,15 @@ static struct platform_device at91_cpuidle_device = { .name = "cpuidle-at91", }; -void at91_pm_set_standby(void (*at91_standby)(void)) +static void at91_cpuidle_suspend(void) { - if (at91_standby) { - at91_cpuidle_device.dev.platform_data = at91_standby; - at91_pm_standby = at91_standby; - } + at91_pm_suspend(PM_SUSPEND_STANDBY); +} + +static void at91_cpuidle_set_suspend(void (*at91_suspend)(void)) +{ + if (at91_suspend) + at91_cpuidle_device.dev.platform_data = at91_suspend; } static void __init at91_pm_sram_init(void) @@ -270,6 +271,8 @@ static void __init at91_pm_init(void) { at91_pm_sram_init(); + at91_cpuidle_set_suspend(at91_cpuidle_suspend); + if (at91_cpuidle_device.dev.platform_data) platform_device_register(&at91_cpuidle_device);