From patchwork Wed Feb 25 08:39:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 5878701 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E63FFBF440 for ; Wed, 25 Feb 2015 08:48:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 099E820304 for ; Wed, 25 Feb 2015 08:48:20 +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 0E03D2028D for ; Wed, 25 Feb 2015 08:48:19 +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 1YQXao-0002IL-PR; Wed, 25 Feb 2015 08:45:18 +0000 Received: from mail-pd0-f181.google.com ([209.85.192.181]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQXXs-0000Bw-8E for linux-arm-kernel@lists.infradead.org; Wed, 25 Feb 2015 08:42:17 +0000 Received: by pdjy10 with SMTP id y10so3314761pdj.13 for ; Wed, 25 Feb 2015 00:41:53 -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:in-reply-to :references; bh=agiyn7nydwB52KYo4PhLo6dscCSYzuDyLJWrGOXRtbk=; b=KtyGFZnXrAu2rBKOjdzG0cZrpxRDpLtTK2QNIv2vXgnsFyLflny+TvJ9xruPi0lDsH GkjmXSwXX3RUMhcTAwHCxcukcRGNXLljNBMmwxh1OjGHPQjEIvyjcgig3mYzKEZZgVBA O2u/nDcTVlwC7LFmTYwPv2g42PkoFgehn7XLsKr+TrQgChl+RZJBlvVfajW+jyrBkjt3 Ec0cQjJAtDK2iicV4gnxdCVt+aFreFHzJfOshT3gsFtN+9pZZMHh+oHw4hgfrvzVQ0On bV5YB6zpW3Ncvuh1mWqV0JMwMwkBS0A8/5Ax+9nMNNznd96U4h6S/qewH/uChP49w4Bl /gPQ== X-Gm-Message-State: ALoCoQlRhTIllsD26AAqNxV/XhPVVmwcMECzBeK7UfLqRzimB8tXDaYEuKBHZtl1zSeNslfovcUF X-Received: by 10.68.209.133 with SMTP id mm5mr3765530pbc.54.1424853713827; Wed, 25 Feb 2015 00:41:53 -0800 (PST) Received: from localhost ([167.160.116.82]) by mx.google.com with ESMTPSA id nq16sm30964141pdb.85.2015.02.25.00.41.51 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 25 Feb 2015 00:41:53 -0800 (PST) From: Hanjun Guo To: Catalin Marinas , "Rafael J. Wysocki" , Will Deacon , Olof Johansson , Grant Likely Subject: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c Date: Wed, 25 Feb 2015 16:39:47 +0800 Message-Id: <1424853601-6675-8-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424853601-6675-1-git-send-email-hanjun.guo@linaro.org> References: <1424853601-6675-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150225_004216_362237_E5903116 X-CRM114-Status: GOOD ( 13.39 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , Ashwin Chaugule , Lorenzo Pieralisi , Robert Richter , Arnd Bergmann , Graeme Gregory , linaro-acpi@lists.linaro.org, Marc Zyngier , Jon Masters , Timur Tabi , linux-kernel@vger.kernel.org, Tomasz Nowicki , linux-acpi@vger.kernel.org, Mark Brown , Hanjun Guo , suravee.suthikulpanit@amd.com, Sudeep Holla , 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: , 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.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 From: Graeme Gregory ACPI 5.1 does not currently support S states for ARM64 hardware but ACPI code will call acpi_target_system_state() for device power management, so introduce acpi_sleep.c to allow other drivers to function until S states are defined. Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 specific. TODO: merge this with drivers/acpi/sleep.c once we fix the specification. CC: Rafael J. Wysocki Tested-by: Suravee Suthikulpanit Tested-by: Yijing Wang Tested-by: Mark Langsdorf Tested-by: Jon Masters Tested-by: Timur Tabi Tested-by: Robert Richter Acked-by: Robert Richter Signed-off-by: Graeme Gregory Signed-off-by: Tomasz Nowicki Signed-off-by: Hanjun Guo --- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/acpi_sleep.c | 28 ++++++++++++++++++++++++++++ drivers/acpi/Makefile | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/kernel/acpi_sleep.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 218eb7e..4435943 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB) += kgdb.o arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o arm64-obj-$(CONFIG_PCI) += pci.o arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o -arm64-obj-$(CONFIG_ACPI) += acpi.o +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o obj-y += $(arm64-obj-y) vdso/ obj-m += $(arm64-obj-m) diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c new file mode 100644 index 0000000..54578ef --- /dev/null +++ b/arch/arm64/kernel/acpi_sleep.c @@ -0,0 +1,28 @@ +/* + * ARM64 Specific Sleep Functionality + * + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Graeme Gregory + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include + +/* + * Currently the ACPI 5.1 standard does not define S states in a + * manner which is usable for ARM64. These two stubs are sufficient + * that system initialises and device PM works. + */ +u32 acpi_target_system_state(void) +{ + return ACPI_STATE_S0; +} +EXPORT_SYMBOL_GPL(acpi_target_system_state); + +int __init acpi_sleep_init(void) +{ + return -ENOSYS; +} diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 623b117..c32edf5 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -23,7 +23,9 @@ acpi-y += nvs.o # Power management related files acpi-y += wakeup.o +ifneq (,$(findstring $(ARCH),x86 ia64)) acpi-y += sleep.o +endif acpi-y += device_pm.o acpi-$(CONFIG_ACPI_SLEEP) += proc.o