aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h23
-rw-r--r--include/linux/cpuidle.h26
-rw-r--r--include/linux/dmi.h2
-rw-r--r--include/linux/power_supply.h1
-rw-r--r--include/linux/sonypi.h2
-rw-r--r--include/linux/thermal.h94
6 files changed, 142 insertions, 6 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index a031df8c83ae..25fb4dcc0e6b 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -81,7 +81,6 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table);
81typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); 81typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
82 82
83char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 83char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
84unsigned long acpi_find_rsdp (void);
85int acpi_boot_init (void); 84int acpi_boot_init (void);
86int acpi_boot_table_init (void); 85int acpi_boot_table_init (void);
87int acpi_numa_init (void); 86int acpi_numa_init (void);
@@ -116,7 +115,9 @@ int acpi_unmap_lsapic(int cpu);
116 115
117int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); 116int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);
118int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); 117int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
118void acpi_irq_stats_init(void);
119 119
120extern u32 acpi_irq_handled;
120extern int acpi_mp_config; 121extern int acpi_mp_config;
121 122
122extern struct acpi_mcfg_allocation *pci_mmcfg_config; 123extern struct acpi_mcfg_allocation *pci_mmcfg_config;
@@ -193,6 +194,26 @@ extern int ec_transaction(u8 command,
193 194
194#endif /*CONFIG_ACPI_EC*/ 195#endif /*CONFIG_ACPI_EC*/
195 196
197#if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE)
198
199typedef void (*wmi_notify_handler) (u32 value, void *context);
200
201extern acpi_status wmi_evaluate_method(const char *guid, u8 instance,
202 u32 method_id,
203 const struct acpi_buffer *in,
204 struct acpi_buffer *out);
205extern acpi_status wmi_query_block(const char *guid, u8 instance,
206 struct acpi_buffer *out);
207extern acpi_status wmi_set_block(const char *guid, u8 instance,
208 const struct acpi_buffer *in);
209extern acpi_status wmi_install_notify_handler(const char *guid,
210 wmi_notify_handler handler, void *data);
211extern acpi_status wmi_remove_notify_handler(const char *guid);
212extern acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out);
213extern bool wmi_has_guid(const char *guid);
214
215#endif /* CONFIG_ACPI_WMI */
216
196extern int acpi_blacklisted(void); 217extern int acpi_blacklisted(void);
197#ifdef CONFIG_DMI 218#ifdef CONFIG_DMI
198extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); 219extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d);
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 {
46/* Idle State Flags */ 46/* Idle State Flags */
47#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ 47#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */
48#define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */ 48#define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */
49#define CPUIDLE_FLAG_SHALLOW (0x10) /* low latency, minimal savings */ 49#define CPUIDLE_FLAG_POLL (0x10) /* no latency, no savings */
50#define CPUIDLE_FLAG_BALANCED (0x20) /* medium latency, moderate savings */ 50#define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */
51#define CPUIDLE_FLAG_DEEP (0x40) /* high latency, large savings */ 51#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */
52#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */
52 53
53#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 54#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
54 55
@@ -72,6 +73,19 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data)
72 state->driver_data = data; 73 state->driver_data = data;
73} 74}
74 75
76#ifdef CONFIG_SMP
77#ifdef CONFIG_ARCH_HAS_CPU_IDLE_WAIT
78static inline void cpuidle_kick_cpus(void)
79{
80 cpu_idle_wait();
81}
82#else /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */
83#error "Arch needs cpu_idle_wait() equivalent here"
84#endif /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */
85#else /* !CONFIG_SMP */
86static inline void cpuidle_kick_cpus(void) {}
87#endif /* !CONFIG_SMP */
88
75struct cpuidle_state_kobj { 89struct cpuidle_state_kobj {
76 struct cpuidle_state *state; 90 struct cpuidle_state *state;
77 struct completion kobj_unregister; 91 struct completion kobj_unregister;
@@ -178,4 +192,10 @@ static inline void cpuidle_unregister_governor(struct cpuidle_governor *gov) { }
178 192
179#endif 193#endif
180 194
195#ifdef CONFIG_ARCH_HAS_CPU_RELAX
196#define CPUIDLE_DRIVER_STATE_START 1
197#else
198#define CPUIDLE_DRIVER_STATE_START 0
199#endif
200
181#endif /* _LINUX_CPUIDLE_H */ 201#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);
79extern int dmi_get_year(int field); 79extern int dmi_get_year(int field);
80extern int dmi_name_in_vendors(const char *str); 80extern int dmi_name_in_vendors(const char *str);
81extern int dmi_available; 81extern int dmi_available;
82extern char *dmi_get_slot(int slot);
83 82
84#else 83#else
85 84
@@ -90,7 +89,6 @@ static inline const struct dmi_device * dmi_find_device(int type, const char *na
90static inline int dmi_get_year(int year) { return 0; } 89static inline int dmi_get_year(int year) { return 0; }
91static inline int dmi_name_in_vendors(const char *s) { return 0; } 90static inline int dmi_name_in_vendors(const char *s) { return 0; }
92#define dmi_available 0 91#define dmi_available 0
93static inline char *dmi_get_slot(int slot) { return NULL; }
94 92
95#endif 93#endif
96 94
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 {
94 /* Properties of type `const char *' */ 94 /* Properties of type `const char *' */
95 POWER_SUPPLY_PROP_MODEL_NAME, 95 POWER_SUPPLY_PROP_MODEL_NAME,
96 POWER_SUPPLY_PROP_MANUFACTURER, 96 POWER_SUPPLY_PROP_MANUFACTURER,
97 POWER_SUPPLY_PROP_SERIAL_NUMBER,
97}; 98};
98 99
99enum power_supply_type { 100enum 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 @@
101#define SONYPI_EVENT_FNKEY_RELEASED 59 101#define SONYPI_EVENT_FNKEY_RELEASED 59
102#define SONYPI_EVENT_WIRELESS_ON 60 102#define SONYPI_EVENT_WIRELESS_ON 60
103#define SONYPI_EVENT_WIRELESS_OFF 61 103#define SONYPI_EVENT_WIRELESS_OFF 61
104#define SONYPI_EVENT_ZOOM_IN_PRESSED 62
105#define SONYPI_EVENT_ZOOM_OUT_PRESSED 63
104 106
105/* get/set brightness */ 107/* get/set brightness */
106#define SONYPI_IOCGBRT _IOR('v', 0, __u8) 108#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 @@
1/*
2 * thermal.h ($Revision: 0 $)
3 *
4 * Copyright (C) 2008 Intel Corp
5 * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com>
6 * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com>
7 *
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *
22 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 */
24
25#ifndef __THERMAL_H__
26#define __THERMAL_H__
27
28#include <linux/idr.h>
29#include <linux/device.h>
30
31struct thermal_zone_device;
32struct thermal_cooling_device;
33
34struct thermal_zone_device_ops {
35 int (*bind) (struct thermal_zone_device *,
36 struct thermal_cooling_device *);
37 int (*unbind) (struct thermal_zone_device *,
38 struct thermal_cooling_device *);
39 int (*get_temp) (struct thermal_zone_device *, char *);
40 int (*get_mode) (struct thermal_zone_device *, char *);
41 int (*set_mode) (struct thermal_zone_device *, const char *);
42 int (*get_trip_type) (struct thermal_zone_device *, int, char *);
43 int (*get_trip_temp) (struct thermal_zone_device *, int, char *);
44};
45
46struct thermal_cooling_device_ops {
47 int (*get_max_state) (struct thermal_cooling_device *, char *);
48 int (*get_cur_state) (struct thermal_cooling_device *, char *);
49 int (*set_cur_state) (struct thermal_cooling_device *, unsigned int);
50};
51
52#define THERMAL_TRIPS_NONE -1
53#define THERMAL_MAX_TRIPS 10
54#define THERMAL_NAME_LENGTH 20
55struct thermal_cooling_device {
56 int id;
57 char type[THERMAL_NAME_LENGTH];
58 struct device device;
59 void *devdata;
60 struct thermal_cooling_device_ops *ops;
61 struct list_head node;
62};
63
64#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \
65 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
66#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
67
68struct thermal_zone_device {
69 int id;
70 char type[THERMAL_NAME_LENGTH];
71 struct device device;
72 void *devdata;
73 int trips;
74 struct thermal_zone_device_ops *ops;
75 struct list_head cooling_devices;
76 struct idr idr;
77 struct mutex lock; /* protect cooling devices list */
78 struct list_head node;
79};
80
81struct thermal_zone_device *thermal_zone_device_register(char *, int, void *,
82 struct thermal_zone_device_ops *);
83void thermal_zone_device_unregister(struct thermal_zone_device *);
84
85int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
86 struct thermal_cooling_device *);
87int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
88 struct thermal_cooling_device *);
89
90struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
91 struct thermal_cooling_device_ops *);
92void thermal_cooling_device_unregister(struct thermal_cooling_device *);
93
94#endif /* __THERMAL_H__ */