diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/acpi/acglobal.h | 4 | ||||
-rw-r--r-- | include/acpi/acpi_bus.h | 5 | ||||
-rw-r--r-- | include/acpi/acpi_drivers.h | 1 | ||||
-rw-r--r-- | include/acpi/acpiosxf.h | 7 | ||||
-rw-r--r-- | include/acpi/processor.h | 13 | ||||
-rw-r--r-- | include/linux/acpi.h | 48 | ||||
-rw-r--r-- | include/linux/cpuidle.h | 26 | ||||
-rw-r--r-- | include/linux/dmi.h | 2 | ||||
-rw-r--r-- | include/linux/power_supply.h | 1 | ||||
-rw-r--r-- | include/linux/sonypi.h | 2 | ||||
-rw-r--r-- | include/linux/thermal.h | 94 |
11 files changed, 186 insertions, 17 deletions
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/acpi_bus.h b/include/acpi/acpi_bus.h index fb7171b1bd22..2f1c68c7a727 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -321,6 +321,11 @@ 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 **); +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 */ diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index a77196bcb993..9757a040a505 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 diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index ca882b8e7d10..022a5fd80c8e 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 */ @@ -239,8 +242,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/acpi/processor.h b/include/acpi/processor.h index 6e253b5b0f3b..cdc8004cfd12 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -4,7 +4,7 @@ #include <linux/kernel.h> #include <linux/cpu.h> #include <linux/cpuidle.h> - +#include <linux/thermal.h> #include <asm/acpi.h> #define ACPI_PROCESSOR_BUSY_METRIC 10 @@ -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; @@ -176,6 +177,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]; }; @@ -218,7 +221,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; }; @@ -316,7 +319,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); @@ -330,7 +333,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); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index ff68f13a9377..ddbe7efe590e 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -25,6 +25,7 @@ #ifndef _LINUX_ACPI_H #define _LINUX_ACPI_H +#include <linux/ioport.h> /* for struct resource */ #ifdef CONFIG_ACPI @@ -78,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); @@ -113,6 +113,8 @@ 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 struct acpi_mcfg_allocation *pci_mmcfg_config; extern int pci_mmcfg_config_num; @@ -178,6 +180,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); @@ -203,6 +225,13 @@ 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, + const char *name); + #else /* CONFIG_ACPI */ static inline int acpi_boot_init(void) @@ -215,5 +244,22 @@ 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) +{ + 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*/ diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index b0fd85ab9efb..c8eb8c71809e 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) @@ -72,6 +73,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; @@ -178,4 +192,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 */ 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 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 { 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) diff --git a/include/linux/thermal.h b/include/linux/thermal.h new file mode 100644 index 000000000000..bba7712cadc7 --- /dev/null +++ b/include/linux/thermal.h @@ -0,0 +1,94 @@ +/* + * thermal.h ($Revision: 0 $) + * + * Copyright (C) 2008 Intel Corp + * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com> + * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com> + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * 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 <linux/idr.h> +#include <linux/device.h> + +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; +}; + +#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]; + 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__ */ |