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: 22625 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E9C6F23FBE for ; Wed, 18 Dec 2013 14:59:45 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id ii20sf886024qab.8 for ; Wed, 18 Dec 2013 06:59:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=JxSf4AKZrRk7tq2OU5BFYmoFziGHz7nnOvRYr6IhJuw=; b=bbbAzfqYVHBHKBT+a597PPSKRvTW9fESMUsmkaEyyY3UDKmfjNuSTQymnP4VpctF7y U35VKue5bqD8aD6phN3p1E5pZQ3Y6QN2Er/Ho1qOdb3T3DhGDmRpjsRdeDE3HIVsPwIv VNE4Ygtg/wWqVAMW/MX8gjxwL2DJE1LQlBwbO16eJeSN4UEc1532US+bdJMbmRxSb+fh 0A4YirA8NTLHdaHHlJYD81x8PSz0Pgq5CKZpAJBNFsLLjNgL9NNfQW6393Vr+njwW3el aadM1AksrPUmHYH5yYKl1DF3sQJ/4Z8XuK0nP1voyap94zjInJ1Jbw70xO+D/bTa+tYv saew== X-Gm-Message-State: ALoCoQk8czy31SJYo7m6BazKkId1exQ2ZHSfxvo3pYGXyZMfuSKqeDtMHWN760hEyQcjyj+mQBeL X-Received: by 10.58.237.10 with SMTP id uy10mr11090125vec.16.1387378785099; Wed, 18 Dec 2013 06:59:45 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.37 with SMTP id e5ls82018qer.84.gmail; Wed, 18 Dec 2013 06:59:45 -0800 (PST) X-Received: by 10.52.171.79 with SMTP id as15mr10918958vdc.1.1387378785017; Wed, 18 Dec 2013 06:59:45 -0800 (PST) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by mx.google.com with ESMTPS id tj7si54637vdc.46.2013.12.18.06.59.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 06:59:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.41 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.41; Received: by mail-vb0-f41.google.com with SMTP id p14so3536649vbm.28 for ; Wed, 18 Dec 2013 06:59:44 -0800 (PST) X-Received: by 10.58.187.81 with SMTP id fq17mr13451832vec.14.1387378784901; Wed, 18 Dec 2013 06:59:44 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp248654ved; Wed, 18 Dec 2013 06:59:44 -0800 (PST) X-Received: by 10.152.120.135 with SMTP id lc7mr11414359lab.38.1387378783348; Wed, 18 Dec 2013 06:59:43 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx.google.com with ESMTPS id y7si135956lal.119.2013.12.18.06.59.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 06:59:43 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.54 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id b8so3963373lan.13 for ; Wed, 18 Dec 2013 06:59:42 -0800 (PST) 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 Cc: Lee Jones , Ulf Hansson 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.41 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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); }