From 09f98a825a821f7a3f1b162f9ed023f37213a63b Mon Sep 17 00:00:00 2001 From: Tang Liang Date: Fri, 9 Dec 2011 10:05:54 +0800 Subject: x86, acpi, tboot: Have a ACPI os prepare sleep instead of calling tboot_sleep. The ACPI suspend path makes a call to tboot_sleep right before it writes the PM1A, PM1B values. We replace the direct call to tboot via an registration callback similar to __acpi_register_gsi. CC: Len Brown Acked-by: Joseph Cihula Acked-by: Rafael J. Wysocki [v1: Added __attribute__ ((unused))] [v2: Introduced a wrapper instead of changing tboot_sleep return values] [v3: Added return value AE_CTRL_SKIP for acpi_os_sleep_prepare] Signed-off-by: Tang Liang [v1: Fix compile issues on IA64 and PPC64] [v2: Fix where __acpi_os_prepare_sleep==NULL and did not go in sleep properly] Signed-off-by: Konrad Rzeszutek Wilk --- include/acpi/acexcep.h | 1 + include/linux/acpi.h | 10 ++++++++++ include/linux/tboot.h | 1 - 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 5b6c391efc8e..fa0d22ce089e 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h @@ -57,6 +57,7 @@ #define ACPI_SUCCESS(a) (!(a)) #define ACPI_FAILURE(a) (a) +#define ACPI_SKIP(a) (a == AE_CTRL_SKIP) #define AE_OK (acpi_status) 0x0000 /* diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 6001b4da39dd..fccd017b8b6e 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -359,4 +359,14 @@ static inline int suspend_nvs_register(unsigned long a, unsigned long b) } #endif +#ifdef CONFIG_ACPI +void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state, + u32 pm1a_ctrl, u32 pm1b_ctrl)); + +acpi_status acpi_os_prepare_sleep(u8 sleep_state, + u32 pm1a_control, u32 pm1b_control); +#else +#define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) +#endif + #endif /*_LINUX_ACPI_H*/ diff --git a/include/linux/tboot.h b/include/linux/tboot.h index 1dba6ee55203..c75128bed5fa 100644 --- a/include/linux/tboot.h +++ b/include/linux/tboot.h @@ -143,7 +143,6 @@ static inline int tboot_enabled(void) extern void tboot_probe(void); extern void tboot_shutdown(u32 shutdown_type); -extern void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control); extern struct acpi_table_header *tboot_get_dmar_table( struct acpi_table_header *dmar_tbl); extern int tboot_force_iommu(void); -- cgit v1.2.1 From e1689795a784a7c41ac4cf9032794986b095a133 Mon Sep 17 00:00:00 2001 From: Robert Lee Date: Tue, 20 Mar 2012 15:22:42 -0500 Subject: cpuidle: Add common time keeping and irq enabling Make necessary changes to implement time keeping and irq enabling in the core cpuidle code. This will allow the removal of these functionalities from various platform cpuidle implementations whose timekeeping and irq enabling follows the form in this common code. Signed-off-by: Robert Lee Tested-by: Jean Pihet Tested-by: Amit Daniel Tested-by: Robert Lee Reviewed-by: Kevin Hilman Reviewed-by: Daniel Lezcano Reviewed-by: Deepthi Dharwar Acked-by: Jean Pihet Signed-off-by: Len Brown --- include/linux/cpuidle.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 712abcc205ae..927db28a2a4c 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -15,6 +15,7 @@ #include #include #include +#include #define CPUIDLE_STATE_MAX 8 #define CPUIDLE_NAME_LEN 16 @@ -122,6 +123,8 @@ struct cpuidle_driver { struct module *owner; unsigned int power_specified:1; + /* set to 1 to use the core cpuidle time keeping (for all states). */ + unsigned int en_core_tk_irqen:1; struct cpuidle_state states[CPUIDLE_STATE_MAX]; int state_count; int safe_state_index; @@ -140,7 +143,10 @@ extern void cpuidle_pause_and_lock(void); extern void cpuidle_resume_and_unlock(void); extern int cpuidle_enable_device(struct cpuidle_device *dev); extern void cpuidle_disable_device(struct cpuidle_device *dev); - +extern int cpuidle_wrap_enter(struct cpuidle_device *dev, + struct cpuidle_driver *drv, int index, + int (*enter)(struct cpuidle_device *dev, + struct cpuidle_driver *drv, int index)); #else static inline void disable_cpuidle(void) { } static inline int cpuidle_idle_call(void) { return -ENODEV; } @@ -157,6 +163,11 @@ static inline void cpuidle_resume_and_unlock(void) { } static inline int cpuidle_enable_device(struct cpuidle_device *dev) {return -ENODEV; } static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } +static inline int cpuidle_wrap_enter(struct cpuidle_device *dev, + struct cpuidle_driver *drv, int index, + int (*enter)(struct cpuidle_device *dev, + struct cpuidle_driver *drv, int index)) +{ return -ENODEV; } #endif -- cgit v1.2.1 From 6a92c36688bd6d8e68e19ca9b5e41e8197921b59 Mon Sep 17 00:00:00 2001 From: Vincenzo Frascino Date: Wed, 21 Mar 2012 12:55:03 -0700 Subject: thermal: add support for thermal sensor present on SPEAr13xx machines ST's SPEAr13xx machines are based on CortexA9 ARM processors. These machines contain a thermal sensor for junction temperature monitoring. This patch adds support for this thermal sensor in existing thermal framework. [akpm@linux-foundation.org: little code cleanup] [akpm@linux-foundation.org: print the pointer correctly] [viresh.kumar@st.com: thermal/spear_thermal: add compilation dependency on PLAT_SPEAR] Signed-off-by: Vincenzo Frascino Signed-off-by: Viresh Kumar Signed-off-by: Viresh Kumar Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- include/linux/platform_data/spear_thermal.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 include/linux/platform_data/spear_thermal.h (limited to 'include') diff --git a/include/linux/platform_data/spear_thermal.h b/include/linux/platform_data/spear_thermal.h new file mode 100644 index 000000000000..724f2e1cbbcb --- /dev/null +++ b/include/linux/platform_data/spear_thermal.h @@ -0,0 +1,26 @@ +/* + * SPEAr thermal driver platform data. + * + * Copyright (C) 2011-2012 ST Microelectronics + * Author: Vincenzo Frascino + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ +#ifndef SPEAR_THERMAL_H +#define SPEAR_THERMAL_H + +/* SPEAr Thermal Sensor Platform Data */ +struct spear_thermal_pdata { + /* flags used to enable thermal sensor */ + unsigned int thermal_flags; +}; + +#endif /* SPEAR_THERMAL_H */ -- cgit v1.2.1 From 2feec47d4c5f80b05f1650f5a24865718978eea4 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Tue, 14 Feb 2012 15:00:53 +0800 Subject: ACPICA: ACPI 5: Support for new FADT SleepStatus, SleepControl registers Adds sleep and wake support for systems with these registers. One new file, hwxfsleep.c Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/actbl.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 8e1b92f6f650..8dea54665dcf 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h @@ -309,6 +309,13 @@ enum acpi_prefered_pm_profiles { PM_TABLET = 8 }; +/* Values for sleep_status and sleep_control registers (V5 FADT) */ + +#define ACPI_X_WAKE_STATUS 0x80 +#define ACPI_X_SLEEP_TYPE_MASK 0x1C +#define ACPI_X_SLEEP_TYPE_POSITION 0x02 +#define ACPI_X_SLEEP_ENABLE 0x20 + /* Reset to default packing */ #pragma pack() -- cgit v1.2.1 From d08310fe0d6bd8c82da94e8d8ef48bdbe14d2bd1 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Tue, 14 Feb 2012 15:22:51 +0800 Subject: ACPICA: Move ACPI timer prototypes to public acpixf file These prototypes were incorrectly declared in achware.h. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpixf.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index a28da35ba45e..67cd51c8ee0a 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -418,6 +418,18 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); acpi_status acpi_leave_sleep_state(u8 sleep_state); +/* + * ACPI Timer interfaces + */ +#ifdef ACPI_FUTURE_USAGE +acpi_status acpi_get_timer_resolution(u32 *resolution); + +acpi_status acpi_get_timer(u32 *ticks); + +acpi_status +acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 *time_elapsed); +#endif /* ACPI_FUTURE_USAGE */ + /* * Error/Warning output */ -- cgit v1.2.1 From 33620c5419e8a11814dd11e02a80e6ef77a43407 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Tue, 14 Feb 2012 18:14:27 +0800 Subject: ACPICA: Support for custom ACPICA build for ACPI 5 reduced hardware Add ACPI_REDUCED_HARDWARE flag that removes all hardware-related code (about 10% code, 5% static data). Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acconfig.h | 248 ++++++++++++++++++++++++++++++++++++++++++++++++ include/acpi/acexcep.h | 6 +- include/acpi/acpixf.h | 219 ++++++++++++++++++++++++++++-------------- 3 files changed, 401 insertions(+), 72 deletions(-) create mode 100644 include/acpi/acconfig.h (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h new file mode 100644 index 000000000000..03f14856bd09 --- /dev/null +++ b/include/acpi/acconfig.h @@ -0,0 +1,248 @@ +/****************************************************************************** + * + * Name: acconfig.h - Global configuration constants + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2012, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef _ACCONFIG_H +#define _ACCONFIG_H + +/****************************************************************************** + * + * Configuration options + * + *****************************************************************************/ + +/* + * ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the + * ACPI subsystem. This includes the DEBUG_PRINT output + * statements. When disabled, all DEBUG_PRINT + * statements are compiled out. + * + * ACPI_APPLICATION - Use this switch if the subsystem is going to be run + * at the application level. + * + */ + +/* + * OS name, used for the _OS object. The _OS object is essentially obsolete, + * but there is a large base of ASL/AML code in existing machines that check + * for the string below. The use of this string usually guarantees that + * the ASL will execute down the most tested code path. Also, there is some + * code that will not execute the _OSI method unless _OS matches the string + * below. Therefore, change this string at your own risk. + */ +#define ACPI_OS_NAME "Microsoft Windows NT" + +/* Maximum objects in the various object caches */ + +#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */ +#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ +#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ +#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ +#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */ + +/* + * Should the subsystem abort the loading of an ACPI table if the + * table checksum is incorrect? + */ +#define ACPI_CHECKSUM_ABORT FALSE + +/* + * Generate a version of ACPICA that only supports "reduced hardware" + * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized + * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware" + * model. In other words, no ACPI hardware is supported. + * + * If TRUE, this means no support for the following: + * PM Event and Control registers + * SCI interrupt (and handler) + * Fixed Events + * General Purpose Events (GPEs) + * Global Lock + * ACPI PM timer + * FACS table (Waking vectors and Global Lock) + */ +#define ACPI_REDUCED_HARDWARE FALSE + +/****************************************************************************** + * + * Subsystem Constants + * + *****************************************************************************/ + +/* Version of ACPI supported */ + +#define ACPI_CA_SUPPORT_LEVEL 5 + +/* Maximum count for a semaphore object */ + +#define ACPI_MAX_SEMAPHORE_COUNT 256 + +/* Maximum object reference count (detects object deletion issues) */ + +#define ACPI_MAX_REFERENCE_COUNT 0x1000 + +/* Default page size for use in mapping memory for operation regions */ + +#define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */ + +/* owner_id tracking. 8 entries allows for 255 owner_ids */ + +#define ACPI_NUM_OWNERID_MASKS 8 + +/* Size of the root table array is increased by this increment */ + +#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4 + +/* Maximum number of While() loop iterations before forced abort */ + +#define ACPI_MAX_LOOP_ITERATIONS 0xFFFF + +/* Maximum sleep allowed via Sleep() operator */ + +#define ACPI_MAX_SLEEP 2000 /* Two seconds */ + +/* Address Range lists are per-space_id (Memory and I/O only) */ + +#define ACPI_ADDRESS_RANGE_MAX 2 + +/****************************************************************************** + * + * ACPI Specification constants (Do not change unless the specification changes) + * + *****************************************************************************/ + +/* Number of distinct GPE register blocks and register width */ + +#define ACPI_MAX_GPE_BLOCKS 2 +#define ACPI_GPE_REGISTER_WIDTH 8 + +/* Method info (in WALK_STATE), containing local variables and argumetns */ + +#define ACPI_METHOD_NUM_LOCALS 8 +#define ACPI_METHOD_MAX_LOCAL 7 + +#define ACPI_METHOD_NUM_ARGS 7 +#define ACPI_METHOD_MAX_ARG 6 + +/* Length of _HID, _UID, _CID, and UUID values */ + +#define ACPI_DEVICE_ID_LENGTH 0x09 +#define ACPI_MAX_CID_LENGTH 48 +#define ACPI_UUID_LENGTH 16 + +/* + * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG + */ +#define ACPI_OBJ_NUM_OPERANDS 8 +#define ACPI_OBJ_MAX_OPERAND 7 + +/* Number of elements in the Result Stack frame, can be an arbitrary value */ + +#define ACPI_RESULTS_FRAME_OBJ_NUM 8 + +/* + * Maximal number of elements the Result Stack can contain, + * it may be an arbitray value not exceeding the types of + * result_size and result_count (now u8). + */ +#define ACPI_RESULTS_OBJ_NUM_MAX 255 + +/* Names within the namespace are 4 bytes long */ + +#define ACPI_NAME_SIZE 4 +#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ +#define ACPI_PATH_SEPARATOR '.' + +/* Sizes for ACPI table headers */ + +#define ACPI_OEM_ID_SIZE 6 +#define ACPI_OEM_TABLE_ID_SIZE 8 + +/* Constants used in searching for the RSDP in low memory */ + +#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ +#define ACPI_EBDA_PTR_LENGTH 2 +#define ACPI_EBDA_WINDOW_SIZE 1024 +#define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */ +#define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000 +#define ACPI_RSDP_SCAN_STEP 16 + +/* Operation regions */ + +#define ACPI_USER_REGION_BEGIN 0x80 + +/* Maximum space_ids for Operation Regions */ + +#define ACPI_MAX_ADDRESS_SPACE 255 + +/* Array sizes. Used for range checking also */ + +#define ACPI_MAX_MATCH_OPCODE 5 + +/* RSDP checksums */ + +#define ACPI_RSDP_CHECKSUM_LENGTH 20 +#define ACPI_RSDP_XCHECKSUM_LENGTH 36 + +/* SMBus, GSBus and IPMI bidirectional buffer size */ + +#define ACPI_SMBUS_BUFFER_SIZE 34 +#define ACPI_GSBUS_BUFFER_SIZE 34 +#define ACPI_IPMI_BUFFER_SIZE 66 + +/* _sx_d and _sx_w control methods */ + +#define ACPI_NUM_sx_d_METHODS 4 +#define ACPI_NUM_sx_w_METHODS 5 + +/****************************************************************************** + * + * ACPI AML Debugger + * + *****************************************************************************/ + +#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ + +#define ACPI_DEBUGGER_COMMAND_PROMPT '-' +#define ACPI_DEBUGGER_EXECUTE_PROMPT '%' + +#endif /* _ACCONFIG_H */ diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 5b6c391efc8e..47b3902957b0 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h @@ -89,8 +89,9 @@ #define AE_SAME_HANDLER (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL) #define AE_NO_HANDLER (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL) #define AE_OWNER_ID_LIMIT (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL) +#define AE_NOT_CONFIGURED (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL) -#define AE_CODE_ENV_MAX 0x001B +#define AE_CODE_ENV_MAX 0x001C /* * Programmer exceptions @@ -213,7 +214,8 @@ char const *acpi_gbl_exception_names_env[] = { "AE_ABORT_METHOD", "AE_SAME_HANDLER", "AE_NO_HANDLER", - "AE_OWNER_ID_LIMIT" + "AE_OWNER_ID_LIMIT", + "AE_NOT_CONFIGURED" }; char const *acpi_gbl_exception_names_pgm[] = { diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 67cd51c8ee0a..e8600dd92573 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -49,6 +49,7 @@ #define ACPI_CA_VERSION 0x20120111 +#include "acconfig.h" #include "actypes.h" #include "actbl.h" @@ -71,6 +72,33 @@ extern u8 acpi_gbl_copy_dsdt_locally; extern u8 acpi_gbl_truncate_io_addresses; extern u8 acpi_gbl_disable_auto_repair; +/* + * Hardware-reduced prototypes. All interfaces that use these macros will + * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag + * is set to TRUE. + */ +#if (!ACPI_REDUCED_HARDWARE) +#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ + prototype; + +#define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ + prototype; + +#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ + prototype; + +#else +#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ + static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);} + +#define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ + static ACPI_INLINE prototype {return(AE_OK);} + +#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ + static ACPI_INLINE prototype {} + +#endif /* !ACPI_REDUCED_HARDWARE */ + extern u32 acpi_current_gpe_count; extern struct acpi_table_fadt acpi_gbl_FADT; extern u8 acpi_gbl_system_awake_and_running; @@ -96,9 +124,8 @@ acpi_status acpi_terminate(void); acpi_status acpi_subsystem_status(void); #endif -acpi_status acpi_enable(void); - -acpi_status acpi_disable(void); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) #ifdef ACPI_FUTURE_USAGE acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); @@ -235,17 +262,34 @@ acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle); acpi_status acpi_install_initialization_handler(acpi_init_handler handler, u32 function); -acpi_status -acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler, - void *context); - -acpi_status -acpi_install_fixed_event_handler(u32 acpi_event, - acpi_event_handler handler, void *context); - -acpi_status -acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler); - +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_install_global_event_handler + (ACPI_GBL_EVENT_HANDLER handler, void *context)) + +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_install_fixed_event_handler(u32 + acpi_event, + acpi_event_handler + handler, + void + *context)) +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_remove_fixed_event_handler(u32 acpi_event, + acpi_event_handler + handler)) +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_install_gpe_handler(acpi_handle + gpe_device, + u32 gpe_number, + u32 type, + acpi_gpe_handler + address, + void *context)) +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_remove_gpe_handler(acpi_handle gpe_device, + u32 gpe_number, + acpi_gpe_handler + address)) acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, @@ -266,15 +310,6 @@ acpi_remove_address_space_handler(acpi_handle device, acpi_adr_space_type space_id, acpi_adr_space_handler handler); -acpi_status -acpi_install_gpe_handler(acpi_handle gpe_device, - u32 gpe_number, - u32 type, acpi_gpe_handler address, void *context); - -acpi_status -acpi_remove_gpe_handler(acpi_handle gpe_device, - u32 gpe_number, acpi_gpe_handler address); - #ifdef ACPI_FUTURE_USAGE acpi_status acpi_install_exception_handler(acpi_exception_handler handler); #endif @@ -284,9 +319,11 @@ acpi_status acpi_install_interface_handler(acpi_interface_handler handler); /* * Global Lock interfaces */ -acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle); - -acpi_status acpi_release_global_lock(u32 handle); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_acquire_global_lock(u16 timeout, + u32 *handle)) +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_release_global_lock(u32 handle)) /* * Interfaces to AML mutex objects @@ -299,47 +336,75 @@ acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname); /* * Fixed Event interfaces */ -acpi_status acpi_enable_event(u32 event, u32 flags); - -acpi_status acpi_disable_event(u32 event, u32 flags); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_enable_event(u32 event, u32 flags)) -acpi_status acpi_clear_event(u32 event); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_disable_event(u32 event, u32 flags)) -acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event)) +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_get_event_status(u32 event, + acpi_event_status + *event_status)) /* * General Purpose Event (GPE) Interfaces */ -acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); - -acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); - -acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); - -acpi_status -acpi_setup_gpe_for_wake(acpi_handle parent_device, - acpi_handle gpe_device, u32 gpe_number); - -acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action); - -acpi_status -acpi_get_gpe_status(acpi_handle gpe_device, - u32 gpe_number, acpi_event_status *event_status); - -acpi_status acpi_disable_all_gpes(void); - -acpi_status acpi_enable_all_runtime_gpes(void); - -acpi_status acpi_get_gpe_device(u32 gpe_index, acpi_handle *gpe_device); - -acpi_status -acpi_install_gpe_block(acpi_handle gpe_device, - struct acpi_generic_address *gpe_block_address, - u32 register_count, u32 interrupt_number); - -acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); - -acpi_status acpi_update_all_gpes(void); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void)) + +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_enable_gpe(acpi_handle gpe_device, + u32 gpe_number)) + +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_disable_gpe(acpi_handle gpe_device, + u32 gpe_number)) + +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_clear_gpe(acpi_handle gpe_device, + u32 gpe_number)) + +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_set_gpe(acpi_handle gpe_device, + u32 gpe_number, u8 action)) + +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_finish_gpe(acpi_handle gpe_device, + u32 gpe_number)) + +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_setup_gpe_for_wake(acpi_handle + parent_device, + acpi_handle gpe_device, + u32 gpe_number)) +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_set_gpe_wake_mask(acpi_handle gpe_device, + u32 gpe_number, + u8 action)) +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_get_gpe_status(acpi_handle gpe_device, + u32 gpe_number, + acpi_event_status + *event_status)) + +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) + +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) + +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_get_gpe_device(u32 gpe_index, + acpi_handle * gpe_device)) + +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_install_gpe_block(acpi_handle gpe_device, + struct + acpi_generic_address + *gpe_block_address, + u32 register_count, + u32 interrupt_number)) +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_remove_gpe_block(acpi_handle gpe_device)) /* * Resource interfaces @@ -391,20 +456,31 @@ acpi_buffer_to_resource(u8 *aml_buffer, */ acpi_status acpi_reset(void); -acpi_status acpi_read_bit_register(u32 register_id, u32 *return_value); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_read_bit_register(u32 register_id, + u32 *return_value)) -acpi_status acpi_write_bit_register(u32 register_id, u32 value); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_write_bit_register(u32 register_id, + u32 value)) -acpi_status acpi_set_firmware_waking_vector(u32 physical_address); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_set_firmware_waking_vector(u32 + physical_address)) #if ACPI_MACHINE_WIDTH == 64 -acpi_status acpi_set_firmware_waking_vector64(u64 physical_address); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_set_firmware_waking_vector64(u64 + physical_address)) #endif acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); +/* + * Sleep/Wake interfaces + */ acpi_status acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); @@ -412,7 +488,7 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state); acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); -acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)) acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); @@ -422,12 +498,15 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state); * ACPI Timer interfaces */ #ifdef ACPI_FUTURE_USAGE -acpi_status acpi_get_timer_resolution(u32 *resolution); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_get_timer_resolution(u32 *resolution)) -acpi_status acpi_get_timer(u32 *ticks); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks)) -acpi_status -acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 *time_elapsed); +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status + acpi_get_timer_duration(u32 start_ticks, + u32 end_ticks, + u32 *time_elapsed)) #endif /* ACPI_FUTURE_USAGE */ /* -- cgit v1.2.1 From 653f4b538f66d37db560e0f56af08117136d29b7 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Tue, 14 Feb 2012 18:29:55 +0800 Subject: ACPICA: Expand OSL memory read/write interfaces to 64 bits This change expands acpi_os_read_memory and acpi_os_write_memory to a full 64 bits. This allows 64 bit transfers via the acpi_read and acpi_write interfaces. Note: The internal acpi_hw_read and acpi_hw_write interfaces remain at 32 bits, because 64 bits is not needed to access the standard ACPI registers. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpiosxf.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 7c9aebe8a7aa..1cd22045fbd4 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -217,14 +217,10 @@ acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width); * Platform and hardware-independent physical memory interfaces */ acpi_status -acpi_os_read_memory(acpi_physical_address address, u32 * value, u32 width); -acpi_status -acpi_os_read_memory64(acpi_physical_address address, u64 *value, u32 width); +acpi_os_read_memory(acpi_physical_address address, u64 *value, u32 width); acpi_status -acpi_os_write_memory(acpi_physical_address address, u32 value, u32 width); -acpi_status -acpi_os_write_memory64(acpi_physical_address address, u64 value, u32 width); +acpi_os_write_memory(acpi_physical_address address, u64 value, u32 width); /* * Platform and hardware-independent PCI configuration space access -- cgit v1.2.1 From ea143604c5c8426923bbed7cd389fdaed7d58a2e Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Tue, 14 Feb 2012 18:23:39 +0800 Subject: ACPICA: ACPI 5: Update debug output for new notify values Add new notify values, add support for "hardware specific" notifies. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/actypes.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index d5dee7ce9474..48c4d5f8a492 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -532,8 +532,9 @@ typedef u64 acpi_integer; #define ACPI_NOTIFY_DEVICE_PLD_CHECK (u8) 0x09 #define ACPI_NOTIFY_RESERVED (u8) 0x0A #define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B +#define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C -#define ACPI_NOTIFY_MAX 0x0B +#define ACPI_NOTIFY_MAX 0x0C /* * Types associated with ACPI names and objects. The first group of @@ -698,7 +699,8 @@ typedef u32 acpi_event_status; #define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY) #define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3 -#define ACPI_MAX_SYS_NOTIFY 0x7f +#define ACPI_MAX_SYS_NOTIFY 0x7F +#define ACPI_MAX_DEVICE_SPECIFIC_NOTIFY 0xBF /* Address Space (Operation Region) Types */ -- cgit v1.2.1 From f7b004a17c9183f023796dea0d70284684ec000d Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Tue, 14 Feb 2012 18:31:56 +0800 Subject: ACPICA: Add acpi_os_physical_table_override interface This interface allows the host to override a table via a physical address, instead of the logical address required by acpi_os_table_override. This simplifies the host implementation. Initial implementation by Thomas Renninger. ACPICA implementation creates a single function for table overrides that attempts both a logical and a physical override. Signed-off-by: Bob Moore Signed-off-by: Thomas Renninger Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpiosxf.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 1cd22045fbd4..21a5548c6686 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -95,6 +95,11 @@ acpi_status acpi_os_table_override(struct acpi_table_header *existing_table, struct acpi_table_header **new_table); +acpi_status +acpi_os_physical_table_override(struct acpi_table_header *existing_table, + acpi_physical_address * new_address, + u32 *new_table_length); + /* * Spinlock primitives */ -- cgit v1.2.1 From 72a8887a356076dfa39bd6691c52446f90a50480 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Tue, 14 Feb 2012 18:57:13 +0800 Subject: ACPICA: Add table-driven dispatch for sleep/wake functions Simplifies the code, especially the compile-time ACPI_REDUCED_HARDWARE option. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/actypes.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 48c4d5f8a492..349615833a4a 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -788,6 +788,15 @@ typedef u8 acpi_adr_space_type; #define ACPI_ENABLE_EVENT 1 #define ACPI_DISABLE_EVENT 0 +/* Sleep function dispatch */ + +typedef acpi_status(*ACPI_SLEEP_FUNCTION) (u8 sleep_state); + +struct acpi_sleep_functions { + ACPI_SLEEP_FUNCTION legacy_function; + ACPI_SLEEP_FUNCTION extended_function; +}; + /* * External ACPI object definition */ -- cgit v1.2.1 From dd0228e9220b6c8320ffbf64e58fdac041ec0931 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Mon, 20 Feb 2012 13:50:13 +0800 Subject: ACPICA: Update to version 20120215 Version 20120215. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpixf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index e8600dd92573..fb8a238115d6 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -47,7 +47,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20120111 +#define ACPI_CA_VERSION 0x20120215 #include "acconfig.h" #include "actypes.h" -- cgit v1.2.1 From 4efeeecd884de36b77c64489dee7eb7ca4d6bed0 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 21 Mar 2012 09:42:45 +0800 Subject: ACPICA: Clarify METHOD_NAME* defines for full-pathname cases Changed the METHOD_NAME* defines that define a full pathname to the method to METHOD_PATHNAME* in order to make it clear that it is not a simple 4-character ACPI name. Used for the various sleep/wake methods. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acnames.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index 5b5af0d30a97..38f508816e4a 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h @@ -46,6 +46,7 @@ /* Method names - these methods can appear anywhere in the namespace */ +#define METHOD_NAME__SB_ "_SB_" #define METHOD_NAME__HID "_HID" #define METHOD_NAME__CID "_CID" #define METHOD_NAME__UID "_UID" @@ -64,11 +65,11 @@ /* Method names - these methods must appear at the namespace root */ -#define METHOD_NAME__BFS "\\_BFS" -#define METHOD_NAME__GTS "\\_GTS" -#define METHOD_NAME__PTS "\\_PTS" -#define METHOD_NAME__SST "\\_SI._SST" -#define METHOD_NAME__WAK "\\_WAK" +#define METHOD_PATHNAME__BFS "\\_BFS" +#define METHOD_PATHNAME__GTS "\\_GTS" +#define METHOD_PATHNAME__PTS "\\_PTS" +#define METHOD_PATHNAME__SST "\\_SI._SST" +#define METHOD_PATHNAME__WAK "\\_WAK" /* Definitions of the predefined namespace names */ @@ -79,6 +80,5 @@ #define ACPI_PREFIX_LOWER (u32) 0x69706361 /* "acpi" */ #define ACPI_NS_ROOT_PATH "\\" -#define ACPI_NS_SYSTEM_BUS "_SB_" #endif /* __ACNAMES_H__ */ -- cgit v1.2.1 From 8a73b17e4c0e09cb5b80deee5451e29b830df4cc Mon Sep 17 00:00:00 2001 From: Lin Ming Date: Wed, 21 Mar 2012 10:01:49 +0800 Subject: ACPICA: Sleep/Wake interfaces: optionally execute _GTS and _BFS Enhanced the sleep/wake interfaces to optionally execute the _GTS method (Going To Sleep), and the _BFS method (Back From Sleep). Windows apparently does not execute these methods, and therefore these methods are often untested. It has been seen on some systems where the execution of these methods causes errors and also prevents the machine from entering S5. It is therefore suggested that host operating systems do not execute these methods by default. In the future, perhaps these methods can be optionally executed based on the age of the system and/or what is the newest version of Windows that the BIOS asks for via _OSI. Signed-off-by: Lin Ming Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/acpixf.h | 4 ++-- include/acpi/actypes.h | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index fb8a238115d6..488c986ebe44 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -486,11 +486,11 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); acpi_status acpi_enter_sleep_state_prep(u8 sleep_state); -acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); +acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags); ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)) -acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); +acpi_status acpi_leave_sleep_state_prep(u8 sleep_state, u8 flags); acpi_status acpi_leave_sleep_state(u8 sleep_state); diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 349615833a4a..eba66043cf1b 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -517,6 +517,13 @@ typedef u64 acpi_integer; #define ACPI_SLEEP_TYPE_MAX 0x7 #define ACPI_SLEEP_TYPE_INVALID 0xFF +/* + * Sleep/Wake flags + */ +#define ACPI_NO_OPTIONAL_METHODS 0x00 /* Do not execute any optional methods */ +#define ACPI_EXECUTE_GTS 0x01 /* For enter sleep interface */ +#define ACPI_EXECUTE_BFS 0x02 /* For leave sleep prep interface */ + /* * Standard notify values */ @@ -790,7 +797,7 @@ typedef u8 acpi_adr_space_type; /* Sleep function dispatch */ -typedef acpi_status(*ACPI_SLEEP_FUNCTION) (u8 sleep_state); +typedef acpi_status(*ACPI_SLEEP_FUNCTION) (u8 sleep_state, u8 flags); struct acpi_sleep_functions { ACPI_SLEEP_FUNCTION legacy_function; -- cgit v1.2.1 From 5aa3c16c6b196857ea24ec1c589e3db3c4c64c96 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 21 Mar 2012 11:02:24 +0800 Subject: ACPICA: Update to version 20120320 Version 20120320. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpixf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 488c986ebe44..982110134672 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -47,7 +47,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20120215 +#define ACPI_CA_VERSION 0x20120320 #include "acconfig.h" #include "actypes.h" -- cgit v1.2.1 From 0090def6c37c8ea29508a435e581f2ef26fea10f Mon Sep 17 00:00:00 2001 From: Lin Ming Date: Thu, 29 Mar 2012 14:09:39 +0800 Subject: ACPI: Add interface to register/unregister device to/from power resources Devices may share same list of power resources in _PR0, for example Device(Dev0) { Name (_PR0, Package (0x01) { P0PR, P1PR }) } Device(Dev1) { Name (_PR0, Package (0x01) { P0PR, P1PR } } Assume Dev0 and Dev1 were runtime suspended. Then Dev0 is resumed first and it goes into D0 state. But Dev1 is left in D0_Uninitialised state. This is wrong. In this case, Dev1 must be resumed too. In order to hand this case, each power resource maintains a list of devices which relies on it. When power resource is ON, it will check if the devices on its list can be resumed. The device can only be resumed when all the power resouces of its _PR0 are ON. Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpi_bus.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 6cd5b6403a7b..e168fffe1db5 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -323,6 +323,8 @@ int acpi_bus_set_power(acpi_handle handle, int state); int acpi_bus_update_power(acpi_handle handle, int *state_p); bool acpi_bus_power_manageable(acpi_handle handle); bool acpi_bus_can_wakeup(acpi_handle handle); +int acpi_power_resource_register_device(struct device *dev, acpi_handle handle); +void acpi_power_resource_unregister_device(struct device *dev, acpi_handle handle); #ifdef CONFIG_ACPI_PROC_EVENT int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data); -- cgit v1.2.1 From 3a53396b0381ec9d5180fd8fe7a681c8ce95fd9a Mon Sep 17 00:00:00 2001 From: ShuoX Liu Date: Wed, 28 Mar 2012 15:19:11 -0700 Subject: cpuidle: add a sysfs entry to disable specific C state for debug purpose. Some C states of new CPU might be not good. One reason is BIOS might configure them incorrectly. To help developers root cause it quickly, the patch adds a new sysfs entry, so developers could disable specific C state manually. In addition, C state might have much impact on performance tuning, as it takes much time to enter/exit C states, which might delay interrupt processing. With the new debug option, developers could check if a deep C state could impact performance and how much impact it could cause. Also add this option in Documentation/cpuidle/sysfs.txt. [akpm@linux-foundation.org: check kstrtol return value] Signed-off-by: ShuoX Liu Reviewed-by: Yanmin Zhang Reviewed-and-Tested-by: Deepthi Dharwar Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- include/linux/cpuidle.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 927db28a2a4c..ca4e4983773f 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -46,6 +46,7 @@ struct cpuidle_state { unsigned int exit_latency; /* in US */ unsigned int power_usage; /* in mW */ unsigned int target_residency; /* in US */ + unsigned int disable; int (*enter) (struct cpuidle_device *dev, struct cpuidle_driver *drv, -- cgit v1.2.1 From db70b04407a63668e5fee773f76f90367492fd25 Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Mon, 26 Mar 2012 14:51:27 +0200 Subject: cpuidle: remove useless array definition in cpuidle_structure All the modules name are ro-data, it is never copied to the array. eg. static struct cpuidle_driver intel_idle_driver = { .name = "intel_idle", .owner = THIS_MODULE, }; It safe to assign the pointer of this ro-data to a const char *. By this way we save 12 bytes. Signed-off-by: Daniel Lezcano Acked-by: Deepthi Dharwar Tested-by: Deepthi Dharwar Signed-off-by: Len Brown --- include/linux/cpuidle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index ca4e4983773f..f7f1d9040da3 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -120,7 +120,7 @@ static inline int cpuidle_get_last_residency(struct cpuidle_device *dev) ****************************/ struct cpuidle_driver { - char name[CPUIDLE_NAME_LEN]; + const char *name; struct module *owner; unsigned int power_specified:1; -- cgit v1.2.1 From e07510585a88c0f6c6c728e2e006aa913496d4ae Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Mon, 26 Mar 2012 14:51:28 +0200 Subject: cpuidle: remove unused 'governor_data' field As far as I can see, this field is never used in the code. Signed-off-by: Daniel Lezcano Signed-off-by: Len Brown --- include/linux/cpuidle.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index f7f1d9040da3..f3ebbba368b3 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -98,7 +98,6 @@ struct cpuidle_device { struct list_head device_list; struct kobject kobj; struct completion kobj_unregister; - void *governor_data; }; DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); -- cgit v1.2.1 From b24e5098853653554baf6ec975b9e855f3d6e5c0 Mon Sep 17 00:00:00 2001 From: Lin Ming Date: Tue, 27 Mar 2012 15:43:25 +0800 Subject: ACPI, PCI: Move acpi_dev_run_wake() to ACPI core acpi_dev_run_wake() is a generic function which can be used by other subsystem too. Rename it to acpi_pm_device_run_wake, to be consistent with acpi_pm_device_sleep_wake. Then move it to ACPI core. Acked-by: Rafael J. Wysocki Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpi_bus.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index e168fffe1db5..f1c8ca60e824 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -394,8 +394,13 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p) #endif #ifdef CONFIG_PM_SLEEP +int acpi_pm_device_run_wake(struct device *, bool); int acpi_pm_device_sleep_wake(struct device *, bool); #else +static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) +{ + return -ENODEV; +} static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) { return -ENODEV; -- cgit v1.2.1 From 1a022e3f1be11730bd8747b1af96a0274bf6356e Mon Sep 17 00:00:00 2001 From: Boris Ostrovsky Date: Tue, 13 Mar 2012 19:55:09 +0100 Subject: idle, x86: Allow off-lined CPU to enter deeper C states Currently when a CPU is off-lined it enters either MWAIT-based idle or, if MWAIT is not desired or supported, HLT-based idle (which places the processor in C1 state). This patch allows processors without MWAIT support to stay in states deeper than C1. Signed-off-by: Boris Ostrovsky Signed-off-by: Len Brown --- include/linux/cpuidle.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index f3ebbba368b3..d557bcd0ada7 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -51,6 +51,8 @@ struct cpuidle_state { int (*enter) (struct cpuidle_device *dev, struct cpuidle_driver *drv, int index); + + int (*enter_dead) (struct cpuidle_device *dev, int index); }; /* Idle State Flags */ @@ -147,6 +149,8 @@ extern int cpuidle_wrap_enter(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index, int (*enter)(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index)); +extern int cpuidle_play_dead(void); + #else static inline void disable_cpuidle(void) { } static inline int cpuidle_idle_call(void) { return -ENODEV; } @@ -168,6 +172,7 @@ static inline int cpuidle_wrap_enter(struct cpuidle_device *dev, int (*enter)(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index)) { return -ENODEV; } +static inline int cpuidle_play_dead(void) {return -ENODEV; } #endif -- cgit v1.2.1 From 02401c06b7f6bec65f314e3cec7894502c973501 Mon Sep 17 00:00:00 2001 From: Boris Ostrovsky Date: Tue, 13 Mar 2012 19:55:10 +0100 Subject: cpuidle: power_usage should be declared signed integer power_usage is always assigned a negative value and should be declared a signed integer Signed-off-by: Boris Ostrovsky Signed-off-by: Len Brown --- include/linux/cpuidle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index d557bcd0ada7..6c26a3da0e03 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -44,7 +44,7 @@ struct cpuidle_state { unsigned int flags; unsigned int exit_latency; /* in US */ - unsigned int power_usage; /* in mW */ + int power_usage; /* in mW */ unsigned int target_residency; /* in US */ unsigned int disable; -- cgit v1.2.1