From patchwork Wed Dec 18 14:59:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 3370511 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CDEAF9F314 for ; Wed, 18 Dec 2013 15:00:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 909F8205EC for ; Wed, 18 Dec 2013 15:00:26 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 3123D205E9 for ; Wed, 18 Dec 2013 15:00:20 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtIbc-00065Q-G4; Wed, 18 Dec 2013 15:00:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtIba-0000Gv-5p; Wed, 18 Dec 2013 15:00:10 +0000 Received: from mail-la0-f48.google.com ([209.85.215.48]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtIbW-0000G4-Is for linux-arm-kernel@lists.infradead.org; Wed, 18 Dec 2013 15:00:07 +0000 Received: by mail-la0-f48.google.com with SMTP id n7so3921441lam.35 for ; Wed, 18 Dec 2013 06:59:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JxSf4AKZrRk7tq2OU5BFYmoFziGHz7nnOvRYr6IhJuw=; b=P1mKCdv13sm0nAJpw4htx82t3B2383O2lU7NNVM8A353lYMBEFR8cEt/arpr6LMacO d8GHOZAGpwOFiiSRSb/+G2Kx0znlKgGlTjTIP0wuY6DdDCcgcliRkPL9oL+Pl3ii/gvD 2PzZNntTJ9kKNugp9WPUI2+O32opcK+vYrI0s6ub+UHpbP562B9WI78d/gxqtn7Z2/3E 2qlb1LhQYXV99AYX+3fvbpH9/1Hn3tuPEVwG29on1D1Gyvw92j7iUIKwO0e5nK4OzoDO Qp4TXZu9J9bwKps1c/eTm1HqpMLF2s9Ri5MaRKX/hUEWlhaoSlFkVXtjvCJQ7H8zZb7x 652g== X-Gm-Message-State: ALoCoQn552cheajx0HzV1xgE+Xhcg7rwSD4DZCeQdsFXrbY6/sSFXPY45/24dI8VA7QMIDvAI/S3 X-Received: by 10.152.9.9 with SMTP id v9mr11300865laa.41.1387378782473; Wed, 18 Dec 2013 06:59:42 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id sd11sm240166lab.2.2013.12.18.06.59.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 06:59:41 -0800 (PST) From: Ulf Hansson To: linux-arm-kernel@lists.infradead.org, Linus Walleij Subject: [PATCH] ARM: ux500: Enable system suspend with WFI support Date: Wed, 18 Dec 2013 15:59:37 +0100 Message-Id: <1387378777-7639-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131218_100006_765590_E9286137 X-CRM114-Status: GOOD ( 12.05 ) X-Spam-Score: -2.6 (--) Cc: Ulf Hansson , Lee Jones 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: , MIME-Version: 1.0 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.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 When building for CONFIG_SUSPEND, add the platform suspend callbacks to enable system suspend for ux500. At this initial step, only WFI state is supported, which is reached for both PM_SUSPEND_MEM and PM_SUSPEND_STANDBY. Signed-off-by: Ulf Hansson --- arch/arm/mach-ux500/pm.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c index 1a468f0..b80a9a2 100644 --- a/arch/arm/mach-ux500/pm.c +++ b/arch/arm/mach-ux500/pm.c @@ -3,6 +3,8 @@ * Author: Rickard Andersson for * ST-Ericsson. * Author: Daniel Lezcano for Linaro. + * Author: Ulf Hansson for Linaro. + * * License terms: GNU General Public License (GPL) version 2 * */ @@ -11,6 +13,7 @@ #include #include #include +#include #include #include "db8500-regs.h" @@ -152,6 +155,27 @@ int prcmu_copy_gic_settings(void) return 0; } +#ifdef CONFIG_SUSPEND +static int ux500_suspend_enter(suspend_state_t state) +{ + cpu_do_idle(); + return 0; +} + +static int ux500_suspend_valid(suspend_state_t state) +{ + return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY; +} + +static const struct platform_suspend_ops ux500_suspend_ops = { + .enter = ux500_suspend_enter, + .valid = ux500_suspend_valid, +}; +#define UX500_SUSPEND_OPS (&ux500_suspend_ops) +#else +#define UX500_SUSPEND_OPS NULL +#endif + void __init ux500_pm_init(u32 phy_base, u32 size) { prcmu_base = ioremap(phy_base, size); @@ -164,4 +188,7 @@ void __init ux500_pm_init(u32 phy_base, u32 size) * This will make sure that the GIC is correctly configured. */ prcmu_gic_recouple(); + + /* Set up ux500 suspend callbacks. */ + suspend_set_ops(UX500_SUSPEND_OPS); }