From a340af14b4c08a53c5f7d821d8bd910e17403384 Mon Sep 17 00:00:00 2001 From: Frank Seidel Date: Fri, 7 Dec 2007 13:20:42 +0100 Subject: ACPI: Add autoload info to dock driver References: https://bugzilla.novell.com/show_bug.cgi?id=302482 Signed-off-by: Thomas Renninger Signed-off-by: Kay Sievers Signed-off-by: Frank Seidel Signed-off-by: Len Brown --- include/acpi/acpi_drivers.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index f85f77a538aa..581daa451ffc 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -48,6 +48,7 @@ #define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN" #define ACPI_VIDEO_HID "LNXVIDEO" #define ACPI_BAY_HID "LNXIOBAY" +#define ACPI_DOCK_HID "LNXDOCK" /* -------------------------------------------------------------------------- PCI -- cgit v1.2.3 From 239665a3bb0a2234980f918913add31bc536cfd1 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Fri, 23 Nov 2007 20:08:02 -0500 Subject: ACPI: tables: complete searching upon RSDP w/ bad checksum. ACPI tables follow a tree structure in memory. The root of the tree is the RSDP (Root System Description Pointer). To find the RSDP, the OS searches for the signature "RSD PTR " in well known physical memory locations. Then the OS computes a table checksum to verify that the signature is really part of a valid table header. Some systems have a proper signature but an invalid checksum; followed elsewhere by a proper signature with valid checksum. http://bugzilla.kernel.org/show_bug.cgi?id=9444 The Linux RSDP scanning code bailed out on those systems and as a result they booted with ACPI disabled. Fix this by deleting the Linux RSDP scanning code and plugging in the ACPICA RSDP scanning code. Signed-off-by: Len Brown --- include/linux/acpi.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 8ccedf7a0a5a..8deb61171558 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -79,7 +79,6 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table); typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); char * __acpi_map_table (unsigned long phys_addr, unsigned long size); -unsigned long acpi_find_rsdp (void); int acpi_boot_init (void); int acpi_boot_table_init (void); int acpi_numa_init (void); -- cgit v1.2.3 From 3eb8749a37990b505ab94466038c067444bbd7eb Mon Sep 17 00:00:00 2001 From: Mattia Dongili Date: Mon, 14 Jan 2008 18:05:45 +0900 Subject: sony-laptop: add Type4 model Recent Vaio models (UX, SZ and presumably TZ and others) add more events and a slightly different handling of Fn key events for additional hotkeys (s1, s2, zoom-in/out, etc.). Signed-off-by: Mattia Dongili Signed-off-by: Len Brown --- include/linux/sonypi.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h index 40c7b5d993b9..f41ffd7c2dd9 100644 --- a/include/linux/sonypi.h +++ b/include/linux/sonypi.h @@ -101,6 +101,8 @@ #define SONYPI_EVENT_FNKEY_RELEASED 59 #define SONYPI_EVENT_WIRELESS_ON 60 #define SONYPI_EVENT_WIRELESS_OFF 61 +#define SONYPI_EVENT_ZOOM_IN_PRESSED 62 +#define SONYPI_EVENT_ZOOM_OUT_PRESSED 63 /* get/set brightness */ #define SONYPI_IOCGBRT _IOR('v', 0, __u8) -- cgit v1.2.3 From f757397097d0713c949af76dccabb65a2785782e Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Thu, 31 Jan 2008 17:28:18 -0800 Subject: cpuidle: build fix for non-x86 Convert cpu_idle_wait() to cpuidle_kick_cpus() macro which is SMP-only, and gives error on non supported CPU. Signed-off-by: Kevin Hilman Acked-by: Venkatesh Pallipadi Acked-by: Rafael J. Wysocki Signed-off-by: Len Brown --- include/linux/cpuidle.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 16a51546db44..cb95f5a9075a 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -72,6 +72,19 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data) state->driver_data = data; } +#ifdef CONFIG_SMP +#ifdef CONFIG_ARCH_HAS_CPU_IDLE_WAIT +static inline void cpuidle_kick_cpus(void) +{ + cpu_idle_wait(); +} +#else /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */ +#error "Arch needs cpu_idle_wait() equivalent here" +#endif /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */ +#else /* !CONFIG_SMP */ +static inline void cpuidle_kick_cpus(void) {} +#endif /* !CONFIG_SMP */ + struct cpuidle_state_kobj { struct cpuidle_state *state; struct completion kobj_unregister; -- cgit v1.2.3 From 203d3d4aa482339b4816f131f713e1b8ee37f6dd Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Thu, 17 Jan 2008 15:51:08 +0800 Subject: the generic thermal sysfs driver The Generic Thermal sysfs driver for thermal management. Signed-off-by: Zhang Rui Signed-off-by: Thomas Sujith Signed-off-by: Len Brown --- include/linux/thermal.h | 90 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 include/linux/thermal.h (limited to 'include') diff --git a/include/linux/thermal.h b/include/linux/thermal.h new file mode 100644 index 000000000000..e4b76c7afb51 --- /dev/null +++ b/include/linux/thermal.h @@ -0,0 +1,90 @@ +/* + * thermal.h ($Revision: 0 $) + * + * Copyright (C) 2008 Intel Corp + * Copyright (C) 2008 Zhang Rui + * Copyright (C) 2008 Sujith Thomas + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * 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. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#ifndef __THERMAL_H__ +#define __THERMAL_H__ + +#include +#include + +struct thermal_zone_device; +struct thermal_cooling_device; + +struct thermal_zone_device_ops { + int (*bind) (struct thermal_zone_device *, + struct thermal_cooling_device *); + int (*unbind) (struct thermal_zone_device *, + struct thermal_cooling_device *); + int (*get_temp) (struct thermal_zone_device *, char *); + int (*get_mode) (struct thermal_zone_device *, char *); + int (*set_mode) (struct thermal_zone_device *, const char *); + int (*get_trip_type) (struct thermal_zone_device *, int, char *); + int (*get_trip_temp) (struct thermal_zone_device *, int, char *); +}; + +struct thermal_cooling_device_ops { + int (*get_max_state) (struct thermal_cooling_device *, char *); + int (*get_cur_state) (struct thermal_cooling_device *, char *); + int (*set_cur_state) (struct thermal_cooling_device *, unsigned int); +}; + +#define THERMAL_TRIPS_NONE -1 +#define THERMAL_MAX_TRIPS 10 +#define THERMAL_NAME_LENGTH 20 +struct thermal_cooling_device { + int id; + char type[THERMAL_NAME_LENGTH]; + struct device device; + void *devdata; + struct thermal_cooling_device_ops *ops; + struct list_head node; +}; + +struct thermal_zone_device { + int id; + char type[THERMAL_NAME_LENGTH]; + struct device device; + void *devdata; + int trips; + struct thermal_zone_device_ops *ops; + struct list_head cooling_devices; + struct idr idr; + struct mutex lock; /* protect cooling devices list */ + struct list_head node; +}; + +struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, + struct thermal_zone_device_ops *); +void thermal_zone_device_unregister(struct thermal_zone_device *); + +int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, + struct thermal_cooling_device *); +int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, + struct thermal_cooling_device *); + +struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, + struct thermal_cooling_device_ops *); +void thermal_cooling_device_unregister(struct thermal_cooling_device *); + +#endif /* __THERMAL_H__ */ -- cgit v1.2.3 From d9460fd227ed2ce52941b6a12ad4de05c195f6aa Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Thu, 17 Jan 2008 15:51:23 +0800 Subject: ACPI: register ACPI Processor as generic thermal cooling device Register ACPI processor as thermal cooling devices. A combination of processor T-state and P-state are used for thermal throttling. the processor will reduce the frequency first and then set the T-state. we use cpufreq_thermal_reduction_pctg to calculate the cpufreq limit, and call cpufreq_verify_with_limit to set the cpufreq limit. if cpufreq driver is loaded, then we have four cooling state for cpufreq control. cooling state 0: cpufreq limit == max_freq cooling state 1: cpufreq limit == max_freq * 80% cooling state 2: cpufreq limit == max_freq * 60% cooling state 3: cpufreq limit == max_freq * 40% after the cpufreq limit is set to 40 percentage of the max_freq, we use T-state for cooling. eg. a processor has P-state support, and it has 8 T-state (T0-T7), the max_state of the proceesor is 10: state cpufreq-limit T-state 0: max_freq T0 1: max_freq * 80% T0 2: max_freq * 60% T0 3: max_freq * 40% T0 4: max_freq * 40% T1 5: max_freq * 40% T2 6: max_freq * 40% T3 7: max_freq * 40% T4 8: max_freq * 40% T5 9: max_freq * 40% T6 10: max_freq * 40% T7 Signed-off-by: Zhang Rui Signed-off-by: Zhao Yakui Signed-off-by: Thomas Sujith Signed-off-by: Len Brown --- include/acpi/processor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 76411b1fc4fd..0787635a11aa 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -4,7 +4,7 @@ #include #include #include - +#include #include #define ACPI_PROCESSOR_BUSY_METRIC 10 @@ -218,7 +218,7 @@ struct acpi_processor { struct acpi_processor_performance *performance; struct acpi_processor_throttling throttling; struct acpi_processor_limit limit; - + struct thermal_cooling_device *cdev; /* the _PDC objects for this processor, if any */ struct acpi_object_list *pdc; }; @@ -330,7 +330,7 @@ extern struct cpuidle_driver acpi_idle_driver; /* in processor_thermal.c */ int acpi_processor_get_limit_info(struct acpi_processor *pr); extern struct file_operations acpi_processor_limit_fops; - +extern struct thermal_cooling_device_ops processor_cooling_ops; #ifdef CONFIG_CPU_FREQ void acpi_thermal_cpufreq_init(void); void acpi_thermal_cpufreq_exit(void); -- cgit v1.2.3 From 207339398ecb0835331c748612898dad2a09fdec Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Thu, 17 Jan 2008 15:51:21 +0800 Subject: ACPI: attach thermal zone info Intel menlow driver needs to get the pointer of themal_zone_device structure of an ACPI thermal zone. Attach this to each ACPI thermal zone device object. Signed-off-by: Zhang Rui Signed-off-by: Thomas Sujith 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 fb7171b1bd22..504af20b10c1 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -321,6 +321,8 @@ struct acpi_bus_event { extern struct kobject *acpi_kobj; extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); +void acpi_bus_private_data_handler(acpi_handle, u32, void *); +int acpi_bus_get_private_data(acpi_handle, void **); /* * External Functions */ -- cgit v1.2.3 From 041d4bbf128f645fe53bb22309efb9db14dbf5b5 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Thu, 17 Jan 2008 15:51:19 +0800 Subject: ACPI: CELSIUS_TO_KELVIN fixup Fix an imprecision in CELSIUS_TO_KELVIN and move these two macroes to a proper place. Signed-off-by: Zhang Rui Signed-off-by: Thomas Sujith Signed-off-by: Len Brown --- include/linux/thermal.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/thermal.h b/include/linux/thermal.h index e4b76c7afb51..bba7712cadc7 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -61,6 +61,10 @@ struct thermal_cooling_device { struct list_head node; }; +#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \ + ((long)t-2732+5)/10 : ((long)t-2732-5)/10) +#define CELSIUS_TO_KELVIN(t) ((t)*10+2732) + struct thermal_zone_device { int id; char type[THERMAL_NAME_LENGTH]; -- cgit v1.2.3 From 1180509f6b3ec3ac2505375a78ccd72d270f2169 Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Mon, 28 Jan 2008 13:53:42 +0800 Subject: ACPI : Update T-state coordination after getting _TSD info Accordint to ACPI spec, the _TSD object provides T-state control cross logical processor dependency information to OSPM. After the _TSD data for all cpus are obtained, OSPM will set up the T-state coordination between CPUs. Of course if the _TSD doesn't exist or _TSD data is incorrect , it is assumed that there is no T-state coordination and T-state is changed independently. Now there is no proper solution to update T-state coordination after one cpu is hotplugged. So this patch won't support hotplugged cpu very well. Signed-off-by: Zhao Yakui Signed-off-by: Len Brown --- include/acpi/processor.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 76411b1fc4fd..d90ad0d63c24 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -176,6 +176,8 @@ struct acpi_processor_throttling { u32 address; u8 duty_offset; u8 duty_width; + u8 tsd_valid_flag; + unsigned int shared_type; struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING]; }; @@ -316,7 +318,7 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) int acpi_processor_get_throttling_info(struct acpi_processor *pr); extern int acpi_processor_set_throttling(struct acpi_processor *pr, int state); extern struct file_operations acpi_processor_throttling_fops; - +extern void acpi_processor_throttling_init(void); /* in processor_idle.c */ int acpi_processor_power_init(struct acpi_processor *pr, struct acpi_device *device); -- cgit v1.2.3 From e6298c6d60838495978cdbe5555dc290785bb961 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Fri, 25 Jan 2008 15:40:02 -0500 Subject: DMI: remove duplicate helper routine Use existing dmi_get_system_info(), Delete duplicate dmi_get_slot() Spotted-by: Wim Van Sebroeck Signed-off-by: Len Brown --- include/linux/dmi.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 5b42a659a308..b1251b2af568 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h @@ -79,7 +79,6 @@ extern void dmi_scan_machine(void); extern int dmi_get_year(int field); extern int dmi_name_in_vendors(const char *str); extern int dmi_available; -extern char *dmi_get_slot(int slot); #else @@ -90,7 +89,6 @@ static inline const struct dmi_device * dmi_find_device(int type, const char *na static inline int dmi_get_year(int year) { return 0; } static inline int dmi_name_in_vendors(const char *s) { return 0; } #define dmi_available 0 -static inline char *dmi_get_slot(int slot) { return NULL; } #endif -- cgit v1.2.3 From bff431e49ff531a343fbb2b4426e313000844f32 Mon Sep 17 00:00:00 2001 From: Carlos Corbacho Date: Tue, 5 Feb 2008 02:17:04 +0000 Subject: ACPI: WMI: Add ACPI-WMI mapping driver The following is an implementation of the Windows Management Instrumentation (WMI) ACPI interface mapper (PNP0C14). What it does: Parses the _WDG method and exports functions to process WMI method calls, data block query/ set commands (both based on GUID) and does basic event handling. How: WMI presents an in kernel interface here (essentially, a minimal wrapper around ACPI) (const char *guid assume the 36 character ASCII representation of a GUID - e.g. 67C3371D-95A3-4C37-BB61-DD47B491DAAB) wmi_evaluate_method(const char *guid, u8 instance, u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out) wmi_query_block(const char *guid, u8 instance, struct acpi_buffer *out) wmi_set_block(const char *guid, u38 instance, const struct acpi_buffer *in) wmi_install_notify_handler(acpi_notify_handler handler); wmi_remove_notify_handler(void); wmi_get_event_data(u32 event, struct acpi_buffer *out) wmi_has_guid(const char guid*) wmi_has_guid() is a helper function to find if a GUID exists or not on the system (a quick and easy way for WMI dependant drivers to see if the the method/ block they want exists, since GUIDs are supposed to be unique). Event handling - allow a WMI based driver to register a notifier handler for each GUID with WMI. When a notification is sent to a GUID in WMI, the handler registered with WMI is then called (it is left to the caller to ask for the WMI event data associated with the GUID, if needed). What it won't do: Unicode - The MS article[1] calls for converting between ASCII and Unicode (or vice versa) if a GUID is marked as "string". This is left up to the calling driver. Handle a MOF[1] - the WMI mapper just exports methods, data and events to userspace. MOF handling is down to userspace. Userspace interface - this will be added later. [1] http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx === ChangeLog == v1 (2007-10-02): * Initial release v2 (2007-10-05): * Cleaned up code - split up super "wmi_evaluate_block" -> each external symbol now handles its own ACPI calls, rather than handing off to a "super" method (and in turn, is a lot simpler to read) * Added a find_guid() symbol - return true if a given GUID exists on the system * wmi_* functions now return type acpi_status (since they are just fancy wrappers around acpi_evaluate_object()) * Removed extra debug code v3 (2007-10-27) * More code clean up - now passes checkpatch.pl * Change data block calls - ref MS spec, method ID is not required for them, so drop it from the function parameters. * Const'ify guid in the function call parameters. * Fix _WDG buffer handling - copy the data to our own private structure. * Change WMI from tristate to bool - otherwise the external functions are not exported in linux/acpi.h if you try to build WMI as a module. * Fix more flag comparisons. * Add a maintainers entry - since I wrote this, I should take the blame for it. v4 (2007-10-30) * Add missing brace from after fixing checkpatch errors. * Rewrote event handling - allow external drivers to register with WMI to handle WMI events * Clean up flags and sanitise flag handling v5 (2007-11-03) * Add sysfs interface for userspace. Export events over netlink again. * Remove module left overs, fully convert to built-in driver. * Tweak in-kernel API to use u8 for instance, since this is what the GUID blocks use (so instance cannot be greater than u8). * Export wmi_get_event_data() for in kernel WMI drivers. v6 (2007-11-07) * Split out userspace into a different patch v7 (2007-11-20) * Fix driver to handle multiple PNP0C14 devices - store all GUIDs using the kernel's built in list functions, and just keep adding to the list every time we handle a PNP0C14 devices - GUIDs will always be unique, and WMI callers do not know or care about different devices. * Change WMI event handler registration to use its' own event handling struct; we should not pass an acpi_handle down to any WMI based drivers - they should be able to function with only the calls provided in WMI. * Update my e-mail address v8 (2007-11-28) * Convert back to a module. * Update Kconfig to default to building as a module. * Remove an erroneous printk. * Simply comments for string flag (since we now leave the handling to the caller). v9 (2007-12-07) * Add back missing MODULE_DEVICE_TABLE for autoloading * Checkpatch fixes v10 (2007-12-12) * Workaround broken GUIDs declared expensive without a WCxx method. * Minor cleanups v11 (2007-12-17) * More fixing for broken GUIDs declared expensive without a WCxx method. * Add basic EmbeddedControl region handling. v12 (2007-12-18) * Changed EC region handling code, as per Alexey's comments. v13 (2007-12-27) * Changed event handling so that we can have one event handler registered per GUID, as per Matthew Garrett's suggestion. v14 (2008-01-12) * Remove ACPI debug statements v15 (2008-02-01) * Replace two remaining 'x == NULL' type tests with '!x' v16 (2008-02-05) * Change MAINTAINERS entry, as I am not, and never have been, paid to work on WMI * Remove 'default' line from Kconfig Signed-off-by: Carlos Corbacho CC: Matthew Garrett CC: Alexey Starikovskiy Signed-off-by: Len Brown --- include/linux/acpi.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include') diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 63f2e6ed698f..fab9f70fe39d 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -192,6 +192,26 @@ extern int ec_transaction(u8 command, #endif /*CONFIG_ACPI_EC*/ +#if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE) + +typedef void (*wmi_notify_handler) (u32 value, void *context); + +extern acpi_status wmi_evaluate_method(const char *guid, u8 instance, + u32 method_id, + const struct acpi_buffer *in, + struct acpi_buffer *out); +extern acpi_status wmi_query_block(const char *guid, u8 instance, + struct acpi_buffer *out); +extern acpi_status wmi_set_block(const char *guid, u8 instance, + const struct acpi_buffer *in); +extern acpi_status wmi_install_notify_handler(const char *guid, + wmi_notify_handler handler, void *data); +extern acpi_status wmi_remove_notify_handler(const char *guid); +extern acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out); +extern bool wmi_has_guid(const char *guid); + +#endif /* CONFIG_ACPI_WMI */ + extern int acpi_blacklisted(void); #ifdef CONFIG_DMI extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); -- cgit v1.2.3 From 7c2670bbb53820d0a4fab8d74593eeccd1eef225 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 22 Jan 2008 18:46:50 +0100 Subject: ACPI: battery: add sysfs serial number egrep serial /proc/acpi/battery/BAT0/info serial number: 32090 serial number can tell you from the imminent danger of beeing set on fire. Signed-off-by: maximilian attems Acked-by: Alexey Starikovskiy Signed-off-by: Len Brown --- include/linux/power_supply.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 5cbf3e371012..68ed19ccf1f7 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -94,6 +94,7 @@ enum power_supply_property { /* Properties of type `const char *' */ POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_MANUFACTURER, + POWER_SUPPLY_PROP_SERIAL_NUMBER, }; enum power_supply_type { -- cgit v1.2.3 From 6ed31e92e94830c138fbd470486383380710069a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Piel?= Date: Tue, 5 Feb 2008 00:04:50 +0100 Subject: ACPI: Taint kernel on ACPI table override (format corrected) When an ACPI table is overridden (for now this can happen only for DSDT) display a big warning and taint the kernel with flag A. Signed-off-by: Eric Piel Signed-off-by: Len Brown --- include/linux/kernel.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 18222f267bc4..9e01f376840a 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -243,6 +243,7 @@ extern enum system_states { #define TAINT_BAD_PAGE (1<<5) #define TAINT_USER (1<<6) #define TAINT_DIE (1<<7) +#define TAINT_OVERRIDDEN_ACPI_TABLE (1<<8) extern void dump_stack(void) __cold; -- cgit v1.2.3 From 5229e87d59cef33539322948bd8e3b5a537f7c97 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Wed, 6 Feb 2008 01:26:55 -0500 Subject: ACPI: create /sys/firmware/acpi/interrupts See Documentation/ABI/testing/sysfs-firmware-acpi Based-on-original-patch-by: Luming Yu Acked-by: Greg Kroah-Hartman Signed-off-by: Len Brown --- include/acpi/acglobal.h | 4 ---- include/acpi/acpiosxf.h | 3 +++ include/linux/acpi.h | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index 347a911d8237..47a1fd8f2d8a 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h @@ -117,10 +117,6 @@ extern u32 acpi_dbg_layer; extern u32 acpi_gbl_nesting_level; -/* Event counters */ - -ACPI_EXTERN u32 acpi_gpe_count; - /* Support for dynamic control method tracing mechanism */ ACPI_EXTERN u32 acpi_gbl_original_dbg_level; diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index ca882b8e7d10..1a16cfbe9e0d 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -181,6 +181,9 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_status acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine); +void acpi_os_gpe_count(u32 gpe_number); +void acpi_os_fixed_event_count(u32 fixed_event_number); + /* * Threads and Scheduling */ diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 63f2e6ed698f..cb911f3e40f5 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -115,7 +115,9 @@ int acpi_unmap_lsapic(int cpu); int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); +void acpi_irq_stats_init(void); +extern u32 acpi_irq_handled; extern int acpi_mp_config; extern struct acpi_mcfg_allocation *pci_mmcfg_config; -- cgit v1.2.3 From df92e695998e1bc6e426a840eb86d6d1ee87e2a5 Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Mon, 4 Feb 2008 23:31:22 -0800 Subject: ACPI: track opregion names to avoid driver resource conflicts. Small ACPICA extension to be able to store the name of operation regions in osl.c later In ACPI, AML can define accesses to IO ports and System Memory by Operation Regions. Those are not registered as done by PNPACPI using resource templates (and _CRS/_SRS methods). The IO ports and System Memory regions may get accessed by arbitrary AML code. When native drivers are accessing the same resources bad things can happen (e.g. a critical shutdown temperature of 3000 C every 2 months or so). It is not really possible to register the operation regions via request_resource, as they often overlap with pnp or other resources (e.g. statically setup IO resources below 0x100). This approach stores all Operation Region declarations (IO and System Memory only) at ACPI table parse time. It offers a similar functionality like request_region and let drivers which are known to possibly use the same IO ports and Memory which are also often used by ACPI (hwmon and i2c) check for ACPI interference. A boot parameter acpi_enforce_resources=strict/lax/no is provided, which is default set to lax: - strict: let conflicting drivers fail to load with an error message - lax: let conflicting driver work normal with a warning message - no: no functional change at all Depending on the feedback and the kind of interferences we see, this should be set to strict at later time. Goal of this patch set is: - Identify ACPI interferences in bug reports (very hard to reproduce and to identify) - Find BIOSes for that an ACPI driver should exist for specific HW instead of a native one. - stability in general Provide acpi_check_{mem_}region. Drivers can additionally check against possible ACPI interference by also invoking this shortly before they call request_region. If -EBUSY is returned, the driver must not load. Use acpi_enforce_resources=strict/lax/no options to: - strict: let conflicting drivers fail to load with an error message - lax: let conflicting driver work normal with a warning message - no: no functional change at all Cc: "Mark M. Hoffman" Cc: Jean Delvare Cc: Len Brown Cc: Bjorn Helgaas Signed-off-by: Thomas Renninger Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- include/acpi/acpiosxf.h | 4 ++-- include/linux/acpi.h | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index ca882b8e7d10..c082c7de88a0 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -239,8 +239,8 @@ acpi_status acpi_os_validate_interface(char *interface); acpi_status acpi_osi_invalidate(char* interface); acpi_status -acpi_os_validate_address(u8 space_id, - acpi_physical_address address, acpi_size length); +acpi_os_validate_address(u8 space_id, acpi_physical_address address, + acpi_size length, char *name); u64 acpi_os_get_timer(void); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 63f2e6ed698f..893f90a5dea9 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -217,6 +217,11 @@ extern int pnpacpi_disabled; #define PXM_INVAL (-1) #define NID_INVAL (-1) +int acpi_check_region(resource_size_t start, resource_size_t n, + const char *name); +int acpi_check_mem_region(resource_size_t start, resource_size_t n, + const char *name); + #else /* CONFIG_ACPI */ static inline int acpi_boot_init(void) @@ -229,5 +234,17 @@ static inline int acpi_boot_table_init(void) return 0; } +static inline int acpi_check_region(resource_size_t start, resource_size_t n, + const char *name) +{ + return 0; +} + +static inline int acpi_check_mem_region(resource_size_t start, + resource_size_t n, const char *name) +{ + return 0; +} + #endif /* !CONFIG_ACPI */ #endif /*_LINUX_ACPI_H*/ -- cgit v1.2.3 From 443dea72d5f428170de6d6e3c4c1a1e2b7632b65 Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Mon, 4 Feb 2008 23:31:23 -0800 Subject: ACPI: Export acpi_check_resource_conflict Export acpi_check_resource_conflict(), sometimes drivers already have a struct resource at hand so no need to use the wrappers to build a new one. Signed-off-by: Jean Delvare Cc: "Mark M. Hoffman" Cc: Bjorn Helgaas Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- include/linux/acpi.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 893f90a5dea9..a031df8c83ae 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -25,6 +25,7 @@ #ifndef _LINUX_ACPI_H #define _LINUX_ACPI_H +#include /* for struct resource */ #ifdef CONFIG_ACPI @@ -217,6 +218,8 @@ extern int pnpacpi_disabled; #define PXM_INVAL (-1) #define NID_INVAL (-1) +int acpi_check_resource_conflict(struct resource *res); + int acpi_check_region(resource_size_t start, resource_size_t n, const char *name); int acpi_check_mem_region(resource_size_t start, resource_size_t n, @@ -234,6 +237,11 @@ static inline int acpi_boot_table_init(void) return 0; } +static inline int acpi_check_resource_conflict(struct resource *res) +{ + return 0; +} + static inline int acpi_check_region(resource_size_t start, resource_size_t n, const char *name) { -- cgit v1.2.3 From bc71bec91f9875ef825d12104acf3bf4ca215fa4 Mon Sep 17 00:00:00 2001 From: "venkatesh.pallipadi@intel.com" Date: Thu, 31 Jan 2008 17:35:04 -0800 Subject: ACPI: enable MWAIT for C1 idle Add MWAIT idle for C1 state instead of halt, on platforms that support C1 state with MWAIT. Renames cx->space_id to something more appropriate. Signed-off-by: Venkatesh Pallipadi Signed-off-by: Len Brown --- include/acpi/processor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 6e253b5b0f3b..f6d7c508917c 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -34,6 +34,7 @@ #define ACPI_CSTATE_SYSTEMIO (0) #define ACPI_CSTATE_FFH (1) +#define ACPI_CSTATE_HALT (2) /* Power Management */ @@ -64,7 +65,7 @@ struct acpi_processor_cx { u8 valid; u8 type; u32 address; - u8 space_id; + u8 entry_method; u8 index; u32 latency; u32 latency_ticks; -- cgit v1.2.3 From 9a0b841586c3c6c846effdbe75885c2ebc0031b0 Mon Sep 17 00:00:00 2001 From: "venkatesh.pallipadi@intel.com" Date: Thu, 31 Jan 2008 17:35:06 -0800 Subject: cpuidle: Add a poll_idle method Add a default poll idle state with 0 latency. Provides an option to users to use poll_idle by using 0 as the latency requirement. Signed-off-by: Venkatesh Pallipadi Signed-off-by: Len Brown --- include/linux/cpuidle.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index b0fd85ab9efb..385d45b616db 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -46,9 +46,10 @@ struct cpuidle_state { /* Idle State Flags */ #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ #define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */ -#define CPUIDLE_FLAG_SHALLOW (0x10) /* low latency, minimal savings */ -#define CPUIDLE_FLAG_BALANCED (0x20) /* medium latency, moderate savings */ -#define CPUIDLE_FLAG_DEEP (0x40) /* high latency, large savings */ +#define CPUIDLE_FLAG_POLL (0x10) /* no latency, no savings */ +#define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */ +#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ +#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) @@ -178,4 +179,10 @@ static inline void cpuidle_unregister_governor(struct cpuidle_governor *gov) { } #endif +#ifdef CONFIG_ARCH_HAS_CPU_RELAX +#define CPUIDLE_DRIVER_STATE_START 1 +#else +#define CPUIDLE_DRIVER_STATE_START 0 +#endif + #endif /* _LINUX_CPUIDLE_H */ -- cgit v1.2.3 From 9ee85241fdaab358dff1d8647f20a478cfa512a1 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Fri, 25 Jan 2008 14:48:06 +0800 Subject: ACPI: create notifier chain to get hotkey events to graphics driver Kernel mode graphics drivers need this ACPI notifier chaine so that they can get notified upon hotkey events. Signed-off-by: Zhang Rui Signed-off-by: Len Brown --- include/acpi/acpi_bus.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index fb7171b1bd22..3f9f1417ff09 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -321,6 +321,9 @@ struct acpi_bus_event { extern struct kobject *acpi_kobj; extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); +extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); +extern int register_acpi_notifier(struct notifier_block *); +extern int unregister_acpi_notifier(struct notifier_block *); /* * External Functions */ -- cgit v1.2.3 From 4e83dd95b343a4ecfdb236aa046a5366a29e6f1e Mon Sep 17 00:00:00 2001 From: Len Brown Date: Fri, 23 Nov 2007 18:33:11 -0500 Subject: ACPICA: fix CONFIG_ACPI_DEBUG_FUNC_TRACE build 798d91039849486c7a4f1a458a5680cb55a65408 (ACPI: create CONFIG_ACPI_DEBUG_FUNC_TRACE) failed to associate the new tracing config option with the tracing code. Signed-off-by: Len Brown --- include/acpi/acmacros.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 45662f6dbdb6..99d171c87c84 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -486,7 +486,7 @@ #define ACPI_FUNCTION_NAME(name) #endif -#ifdef DEBUG_FUNC_TRACE +#ifdef CONFIG_ACPI_DEBUG_FUNC_TRACE #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ acpi_ut_trace(ACPI_DEBUG_PARAMETERS) @@ -565,7 +565,7 @@ #endif /* ACPI_SIMPLE_RETURN_MACROS */ -#else /* !DEBUG_FUNC_TRACE */ +#else /* !CONFIG_ACPI_DEBUG_FUNC_TRACE */ #define ACPI_FUNCTION_TRACE(a) #define ACPI_FUNCTION_TRACE_PTR(a,b) @@ -584,7 +584,7 @@ #define return_UINT32(s) return(s) #define return_PTR(s) return(s) -#endif /* DEBUG_FUNC_TRACE */ +#endif /* CONFIG_ACPI_DEBUG_FUNC_TRACE */ /* Conditional execution */ -- cgit v1.2.3 From ee1ce6fcb383ba1da9d16e1ba902f592211aa508 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 6 Dec 2007 22:00:36 -0500 Subject: ACPI: cleanup acpi.h Two cleanups to : * Stop defining acpi_mp_config, it isn't used anywhere. * Discard nested "#ifdef CONFIG_ACPI", they are useless and error-prone. Signed-off-by: Jean Delvare Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- include/linux/acpi.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'include') diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 63f2e6ed698f..ff68f13a9377 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -43,8 +43,6 @@ #include -#ifdef CONFIG_ACPI - enum acpi_irq_model_id { ACPI_IRQ_MODEL_PIC = 0, ACPI_IRQ_MODEL_IOAPIC, @@ -116,20 +114,12 @@ int acpi_unmap_lsapic(int cpu); int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); -extern int acpi_mp_config; - extern struct acpi_mcfg_allocation *pci_mmcfg_config; extern int pci_mmcfg_config_num; extern int sbf_port; extern unsigned long acpi_realmode_flags; -#else /* !CONFIG_ACPI */ - -#define acpi_mp_config 0 - -#endif /* !CONFIG_ACPI */ - int acpi_register_gsi (u32 gsi, int triggering, int polarity); int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); @@ -145,8 +135,6 @@ extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity); */ void acpi_unregister_gsi (u32 gsi); -#ifdef CONFIG_ACPI - struct acpi_prt_entry { struct list_head node; struct acpi_pci_id id; @@ -179,8 +167,6 @@ struct acpi_pci_driver { int acpi_pci_register_driver(struct acpi_pci_driver *driver); void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); -#endif /* CONFIG_ACPI */ - #ifdef CONFIG_ACPI_EC extern int ec_read(u8 addr, u8 *val); -- cgit v1.2.3 From e5685b9d35c2cc0a98425b05df30cb837dd1e632 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Wed, 24 Oct 2007 18:24:42 +0200 Subject: ACPI: misc cleanups This patch contains the following possible cleanups: - make the following needlessly global code static: - drivers/acpi/bay.c:dev_attr_eject - drivers/acpi/bay.c:dev_attr_present - drivers/acpi/dock.c:dev_attr_docked - drivers/acpi/dock.c:dev_attr_flags - drivers/acpi/dock.c:dev_attr_uid - drivers/acpi/dock.c:dev_attr_undock - drivers/acpi/pci_bind.c:acpi_pci_unbind() - drivers/acpi/pci_link.c:acpi_link_lock - drivers/acpi/sbs.c:acpi_sbs_callback() - drivers/acpi/sbshc.c:acpi_smbus_transaction() - drivers/acpi/sleep/main.c:acpi_sleep_prepare() - #if 0 the following unused global functions: - drivers/acpi/numa.c:acpi_unmap_pxm_to_node() - remove the following unused EXPORT_SYMBOL's: - acpi_register_gsi - acpi_unregister_gsi - acpi_strict - acpi_bus_receive_event - register_acpi_bus_type - unregister_acpi_bus_type - acpi_os_printf - acpi_os_sleep - acpi_os_stall - acpi_os_read_pci_configuration - acpi_os_create_semaphore - acpi_os_delete_semaphore - acpi_os_wait_semaphore - acpi_os_signal_semaphore - acpi_os_signal - acpi_pci_irq_enable - acpi_get_pxm Signed-off-by: Adrian Bunk Acked-by: Alexey Starikovskiy Signed-off-by: Len Brown --- include/acpi/acpi_drivers.h | 1 - include/acpi/acpi_numa.h | 1 - 2 files changed, 2 deletions(-) (limited to 'include') diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index f85f77a538aa..a77196bcb993 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -73,7 +73,6 @@ struct pci_bus; acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id); int acpi_pci_bind(struct acpi_device *device); -int acpi_pci_unbind(struct acpi_device *device); int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus); diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h index 62c5ee4311da..173972672175 100644 --- a/include/acpi/acpi_numa.h +++ b/include/acpi/acpi_numa.h @@ -15,7 +15,6 @@ extern int pxm_to_node(int); extern int node_to_pxm(int); extern void __acpi_map_pxm_to_node(int, int); extern int acpi_map_pxm_to_node(int); -extern void __cpuinit acpi_unmap_pxm_to_node(int); #endif /* CONFIG_ACPI_NUMA */ #endif /* __ACP_NUMA_H */ -- cgit v1.2.3 From 9b7131542178f5f948e4bb6bea6e1c545e697b06 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Thu, 7 Feb 2008 04:16:34 -0500 Subject: Revert "cpuidle: build fix for non-x86" This reverts commit f757397097d0713c949af76dccabb65a2785782e. which ironically broke the ia64 build --- include/linux/cpuidle.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'include') diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index c8eb8c71809e..385d45b616db 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -73,19 +73,6 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data) state->driver_data = data; } -#ifdef CONFIG_SMP -#ifdef CONFIG_ARCH_HAS_CPU_IDLE_WAIT -static inline void cpuidle_kick_cpus(void) -{ - cpu_idle_wait(); -} -#else /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */ -#error "Arch needs cpu_idle_wait() equivalent here" -#endif /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */ -#else /* !CONFIG_SMP */ -static inline void cpuidle_kick_cpus(void) {} -#endif /* !CONFIG_SMP */ - struct cpuidle_state_kobj { struct cpuidle_state *state; struct completion kobj_unregister; -- cgit v1.2.3