From patchwork Wed Mar 11 12:39:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 45635 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 40ED2214C6 for ; Wed, 11 Mar 2015 12:41:43 +0000 (UTC) Received: by wggy19 with SMTP id y19sf6350615wgg.2 for ; Wed, 11 Mar 2015 05:41:42 -0700 (PDT) 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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=JVZE6xOmuix1Aa+da+KS/BIhQpJMmSXVh2QFFAuNXh4=; b=DWAe+XZ9d2H1pbsA4/omGZtMunwJVtdliTOeuDaN26Mb5LVlFQe3yWLpNMDjTuwb/m E9uNua2FQErjt/6TskhmM+k5LYNa121fbM8RM+aHl/LDXmyKkAVXEbT9iAPP9yabzA57 cYONIHHGrVGxL1Bw4OZxBCK3O3K8PQpvA34qKqvSIPnN/D1d/JzjKvjm1ASQ1opAs+ZH OxMSkxOfNt+AK6sofk9/IxdUjFnTthRRAY5PiNfkbCw3iiZS+RycZkjmgSZgnZghFtHx qjA25hgcYh8FgFmrIPFDfJJtL/vnxIVVboXKgePr3mc5dA9OTcVVYp5JEL3aM3o3ib5v O96w== X-Gm-Message-State: ALoCoQn66MJYbpNdszbWIxVAO1QocvJXrMjrcpA5MCobJRhYSk91KEHcnmD77oaE5z2Cf4knsJbV X-Received: by 10.194.221.65 with SMTP id qc1mr5455646wjc.7.1426077702571; Wed, 11 Mar 2015 05:41:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.38 with SMTP id x6ls153797lax.63.gmail; Wed, 11 Mar 2015 05:41:42 -0700 (PDT) X-Received: by 10.112.16.1 with SMTP id b1mr20435740lbd.39.1426077702276; Wed, 11 Mar 2015 05:41:42 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id q11si2259442lbl.110.2015.03.11.05.41.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 05:41:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbiz12 with SMTP id z12so8471802lbi.12 for ; Wed, 11 Mar 2015 05:41:42 -0700 (PDT) X-Received: by 10.112.185.66 with SMTP id fa2mr33817467lbc.117.1426077701994; Wed, 11 Mar 2015 05:41:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2751795lbj; Wed, 11 Mar 2015 05:41:41 -0700 (PDT) X-Received: by 10.66.154.162 with SMTP id vp2mr76916585pab.73.1426077697146; Wed, 11 Mar 2015 05:41:37 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ff6si6895444pad.132.2015.03.11.05.41.36; Wed, 11 Mar 2015 05:41:37 -0700 (PDT) Received-SPF: none (google.com: linux-acpi-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752938AbbCKMlV (ORCPT + 7 others); Wed, 11 Mar 2015 08:41:21 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:46965 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752930AbbCKMlS (ORCPT ); Wed, 11 Mar 2015 08:41:18 -0400 Received: by pdev10 with SMTP id v10so10905980pde.13 for ; Wed, 11 Mar 2015 05:41:18 -0700 (PDT) X-Received: by 10.66.235.36 with SMTP id uj4mr77673310pac.123.1426077678457; Wed, 11 Mar 2015 05:41:18 -0700 (PDT) Received: from localhost ([180.150.153.56]) by mx.google.com with ESMTPSA id t5sm5945703pde.51.2015.03.11.05.41.16 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 11 Mar 2015 05:41:17 -0700 (PDT) From: Hanjun Guo To: Catalin Marinas , "Rafael J. Wysocki" , Will Deacon , Olof Johansson , Grant Likely Cc: Lorenzo Pieralisi , Arnd Bergmann , Mark Rutland , Graeme Gregory , Sudeep Holla , Jon Masters , Marc Zyngier , Mark Brown , Robert Richter , Timur Tabi , Ashwin Chaugule , suravee.suthikulpanit@amd.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Tomasz Nowicki , Hanjun Guo Subject: [PATCH v10 06/21] ACPI / sleep: Introduce CONFIG_ACPI_GENERIC_SLEEP Date: Wed, 11 Mar 2015 20:39:32 +0800 Message-Id: <1426077587-1561-7-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426077587-1561-1-git-send-email-hanjun.guo@linaro.org> References: <1426077587-1561-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Graeme Gregory ACPI 5.1 does not currently support S states for ARM64 hardware but ACPI code will call acpi_target_system_state() and acpi_sleep_init() for device power management, so introduce CONFIG_ACPI_GENERIC_SLEEP and select it for x86 and ia64 only to make sleep functions available, and also introduce stub function to allow other drivers to function until S states are defined for ARM64. It will be no functional change for x86 and IA64. CC: Rafael J. Wysocki Suggested-by: Rafael J. Wysocki Acked-by: Robert Richter Signed-off-by: Graeme Gregory Signed-off-by: Tomasz Nowicki Signed-off-by: Hanjun Guo --- arch/ia64/Kconfig | 1 + arch/x86/Kconfig | 1 + drivers/acpi/Kconfig | 4 ++++ drivers/acpi/Makefile | 2 +- drivers/acpi/internal.h | 4 ++++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 074e52b..e8728d7 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -10,6 +10,7 @@ config IA64 select ARCH_MIGHT_HAVE_PC_SERIO select PCI if (!IA64_HP_SIM) select ACPI if (!IA64_HP_SIM) + select ACPI_GENERIC_SLEEP if ACPI select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI select HAVE_UNSTABLE_SCHED_CLOCK select HAVE_IDE diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index b7d31ca..9804431 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -22,6 +22,7 @@ config X86_64 ### Arch settings config X86 def_bool y + select ACPI_GENERIC_SLEEP if ACPI select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS select ARCH_HAS_FAST_MULTIPLIER diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index e6c3ddd..a7b9120 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -48,9 +48,13 @@ config ACPI_LEGACY_TABLES_LOOKUP config ARCH_MIGHT_HAVE_ACPI_PDC bool +config ACPI_GENERIC_SLEEP + bool + config ACPI_SLEEP bool depends on SUSPEND || HIBERNATION + depends on ACPI_GENERIC_SLEEP default y config ACPI_PROCFS_POWER diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 623b117..2397822 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -23,7 +23,7 @@ acpi-y += nvs.o # Power management related files acpi-y += wakeup.o -acpi-y += sleep.o +acpi-$(CONFIG_ACPI_GENERIC_SLEEP) += sleep.o acpi-y += device_pm.o acpi-$(CONFIG_ACPI_SLEEP) += proc.o diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 56b321a..b5eef4c 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -161,7 +161,11 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit); /*-------------------------------------------------------------------------- Suspend/Resume -------------------------------------------------------------------------- */ +#ifdef CONFIG_ACPI_GENERIC_SLEEP extern int acpi_sleep_init(void); +#else +static inline int acpi_sleep_init(void) { return -ENOSYS; } +#endif #ifdef CONFIG_ACPI_SLEEP int acpi_sleep_proc_init(void);