aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:25:58 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:25:58 -0500
commit7b791d445500c5674b1ef00fefc0e343ed2f85b7 (patch)
treefcb14a27185616c694817cbc4b534c91099abb6e
parent8811930dc74a503415b35c4a79d14fb0b408a361 (diff)
parent2e6c4e5101633a54aeee1f2e83020ee77fcb70d2 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: acer-wmi, tc1100-wmi: select ACPI_WMI ACPI: WMI: Improve Kconfig description ACPI: DMI: add Panasonic CF-52 and Thinpad X61 ACPI: thermal: syntax, spelling, kernel-doc intel_menlo: build on X86 only ACPI: build WMI on X86 only ACPI: cpufreq: Print _PPC changes via cpufreq debug layer ACPI: add newline to printk
-rw-r--r--Documentation/thermal/sysfs-api.txt23
-rw-r--r--drivers/acpi/Kconfig20
-rw-r--r--drivers/acpi/blacklist.c20
-rw-r--r--drivers/acpi/osl.c2
-rw-r--r--drivers/acpi/processor_perflib.c7
-rw-r--r--drivers/misc/Kconfig5
-rw-r--r--drivers/thermal/Kconfig4
-rw-r--r--drivers/thermal/thermal.c49
8 files changed, 88 insertions, 42 deletions
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index 5776e090359d..ba9c2da5a8c2 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -14,7 +14,7 @@ The generic thermal sysfs provides a set of interfaces for thermal zone devices
14and thermal cooling devices (fan, processor...) to register with the thermal management 14and thermal cooling devices (fan, processor...) to register with the thermal management
15solution and to be a part of it. 15solution and to be a part of it.
16 16
17This how-to focusses on enabling new thermal zone and cooling devices to participate 17This how-to focuses on enabling new thermal zone and cooling devices to participate
18in thermal management. 18in thermal management.
19This solution is platform independent and any type of thermal zone devices and 19This solution is platform independent and any type of thermal zone devices and
20cooling devices should be able to make use of the infrastructure. 20cooling devices should be able to make use of the infrastructure.
@@ -41,9 +41,9 @@ and throttle appropriate devices.
41 name: the thermal zone name. 41 name: the thermal zone name.
42 trips: the total number of trip points this thermal zone supports. 42 trips: the total number of trip points this thermal zone supports.
43 devdata: device private data 43 devdata: device private data
44 ops: thermal zone device callbacks. 44 ops: thermal zone device call-backs.
45 .bind: bind the thermal zone device with a thermal cooling device. 45 .bind: bind the thermal zone device with a thermal cooling device.
46 .unbind: unbing the thermal zone device with a thermal cooling device. 46 .unbind: unbind the thermal zone device with a thermal cooling device.
47 .get_temp: get the current temperature of the thermal zone. 47 .get_temp: get the current temperature of the thermal zone.
48 .get_mode: get the current mode (user/kernel) of the thermal zone. 48 .get_mode: get the current mode (user/kernel) of the thermal zone.
49 "kernel" means thermal management is done in kernel. 49 "kernel" means thermal management is done in kernel.
@@ -69,7 +69,7 @@ and throttle appropriate devices.
69 It tries to bind itself to all the thermal zone devices register at the same time. 69 It tries to bind itself to all the thermal zone devices register at the same time.
70 name: the cooling device name. 70 name: the cooling device name.
71 devdata: device private data. 71 devdata: device private data.
72 ops: thermal cooling devices callbacks. 72 ops: thermal cooling devices call-backs.
73 .get_max_state: get the Maximum throttle state of the cooling device. 73 .get_max_state: get the Maximum throttle state of the cooling device.
74 .get_cur_state: get the Current throttle state of the cooling device. 74 .get_cur_state: get the Current throttle state of the cooling device.
75 .set_cur_state: set the Current throttle state of the cooling device. 75 .set_cur_state: set the Current throttle state of the cooling device.
@@ -109,7 +109,6 @@ RO read only value
109RW read/write value 109RW read/write value
110 110
111All thermal sysfs attributes will be represented under /sys/class/thermal 111All thermal sysfs attributes will be represented under /sys/class/thermal
112/sys/class/thermal/
113 112
114Thermal zone device sys I/F, created once it's registered: 113Thermal zone device sys I/F, created once it's registered:
115|thermal_zone[0-*]: 114|thermal_zone[0-*]:
@@ -129,7 +128,7 @@ Thermal cooling device sys I/F, created once it's registered:
129These two dynamic attributes are created/removed in pairs. 128These two dynamic attributes are created/removed in pairs.
130They represent the relationship between a thermal zone and its associated cooling device. 129They represent the relationship between a thermal zone and its associated cooling device.
131They are created/removed for each 130They are created/removed for each
132thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful exection. 131thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful execution.
133 132
134|thermal_zone[0-*] 133|thermal_zone[0-*]
135 |-----cdev[0-*]: The [0-*]th cooling device in the current thermal zone 134 |-----cdev[0-*]: The [0-*]th cooling device in the current thermal zone
@@ -147,11 +146,11 @@ type Strings which represent the thermal zone type.
147 Optional 146 Optional
148 147
149temp Current temperature as reported by thermal zone (sensor) 148temp Current temperature as reported by thermal zone (sensor)
150 Unit: degree celsius 149 Unit: degree Celsius
151 RO 150 RO
152 Required 151 Required
153 152
154mode One of the predifned values in [kernel, user] 153mode One of the predefined values in [kernel, user]
155 This file gives information about the algorithm 154 This file gives information about the algorithm
156 that is currently managing the thermal zone. 155 that is currently managing the thermal zone.
157 It can be either default kernel based algorithm 156 It can be either default kernel based algorithm
@@ -164,12 +163,12 @@ mode One of the predifned values in [kernel, user]
164 charge of the thermal management. 163 charge of the thermal management.
165 164
166trip_point_[0-*]_temp The temperature above which trip point will be fired 165trip_point_[0-*]_temp The temperature above which trip point will be fired
167 Unit: degree celsius 166 Unit: degree Celsius
168 RO 167 RO
169 Optional 168 Optional
170 169
171trip_point_[0-*]_type Strings which indicate the type of the trip point 170trip_point_[0-*]_type Strings which indicate the type of the trip point
172 Eg. it can be one of critical, hot, passive, 171 E.g. it can be one of critical, hot, passive,
173 active[0-*] for ACPI thermal zone. 172 active[0-*] for ACPI thermal zone.
174 RO 173 RO
175 Optional 174 Optional
@@ -179,7 +178,7 @@ cdev[0-*] Sysfs link to the thermal cooling device node where the sys I/F
179 RO 178 RO
180 Optional 179 Optional
181 180
182cdev[0-*]_trip_point The trip point with which cdev[0-*] is assocated in this thermal zone 181cdev[0-*]_trip_point The trip point with which cdev[0-*] is associated in this thermal zone
183 -1 means the cooling device is not associated with any trip point. 182 -1 means the cooling device is not associated with any trip point.
184 RO 183 RO
185 Optional 184 Optional
@@ -211,7 +210,7 @@ cur_state The current cooling state of this cooling device.
211 210
212ACPI thermal zone may support multiple trip points like critical/hot/passive/active. 211ACPI thermal zone may support multiple trip points like critical/hot/passive/active.
213If an ACPI thermal zone supports critical, passive, active[0] and active[1] at the same time, 212If an ACPI thermal zone supports critical, passive, active[0] and active[1] at the same time,
214it may register itself as a thermale_zone_device (thermal_zone1) with 4 trip points in all. 213it may register itself as a thermal_zone_device (thermal_zone1) with 4 trip points in all.
215It has one processor and one fan, which are both registered as thermal_cooling_device. 214It has one processor and one fan, which are both registered as thermal_cooling_device.
216If the processor is listed in _PSL method, and the fan is listed in _AL0 method, 215If the processor is listed in _PSL method, and the fan is listed in _AL0 method,
217the sys I/F structure will be built like this: 216the sys I/F structure will be built like this:
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 7ef172c2a1d6..f688c214be0c 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -204,13 +204,25 @@ config ACPI_NUMA
204 204
205config ACPI_WMI 205config ACPI_WMI
206 tristate "WMI (EXPERIMENTAL)" 206 tristate "WMI (EXPERIMENTAL)"
207 depends on X86
207 depends on EXPERIMENTAL 208 depends on EXPERIMENTAL
208 help 209 help
209 This driver adds support for the ACPI-WMI mapper device (PNP0C14) 210 This driver adds support for the ACPI-WMI (Windows Management
210 found on some systems. 211 Instrumentation) mapper device (PNP0C14) found on some systems.
212
213 ACPI-WMI is a proprietary extension to ACPI to expose parts of the
214 ACPI firmware to userspace - this is done through various vendor
215 defined methods and data blocks in a PNP0C14 device, which are then
216 made available for userspace to call.
217
218 The implementation of this in Linux currently only exposes this to
219 other kernel space drivers.
220
221 This driver is a required dependency to build the firmware specific
222 drivers needed on many machines, including Acer and HP laptops.
211 223
212 NOTE: You will need another driver or userspace application on top of 224 It is safe to enable this driver even if your DSDT doesn't define
213 this to actually use anything defined in the ACPI-WMI mapper. 225 any ACPI-WMI devices.
214 226
215config ACPI_ASUS 227config ACPI_ASUS
216 tristate "ASUS/Medion Laptop Extras" 228 tristate "ASUS/Medion Laptop Extras"
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index 6dbaa2d15fe0..9ce983ed60f0 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -445,6 +445,8 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
445 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T61"), 445 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T61"),
446 * _OSI(Linux) is a NOP: 446 * _OSI(Linux) is a NOP:
447 * DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"), 447 * DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"),
448 * _OSI(Linux) effect unknown
449 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
448 */ 450 */
449 { 451 {
450 .callback = dmi_enable_osi_linux, 452 .callback = dmi_enable_osi_linux,
@@ -464,6 +466,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
464 }, 466 },
465 { 467 {
466 .callback = dmi_unknown_osi_linux, 468 .callback = dmi_unknown_osi_linux,
469 .ident = "Lenovo ThinkPad X61",
470 .matches = {
471 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
472 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
473 },
474 },
475 {
476 .callback = dmi_unknown_osi_linux,
467 .ident = "Lenovo 3000 V100", 477 .ident = "Lenovo 3000 V100",
468 .matches = { 478 .matches = {
469 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 479 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
@@ -505,6 +515,16 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
505 DMI_MATCH(DMI_PRODUCT_NAME, "NEC VERSA M360"), 515 DMI_MATCH(DMI_PRODUCT_NAME, "NEC VERSA M360"),
506 }, 516 },
507 }, 517 },
518 /* Panasonic */
519 {
520 .callback = dmi_unknown_osi_linux,
521 .ident = "Panasonic",
522 .matches = {
523 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
524 /* Toughbook CF-52 */
525 DMI_MATCH(DMI_PRODUCT_NAME, "CF-52CCABVBG"),
526 },
527 },
508 /* 528 /*
509 * Disable OSI(Linux) warnings on all "Samsung Electronics" 529 * Disable OSI(Linux) warnings on all "Samsung Electronics"
510 * 530 *
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 27ccd68b8f46..a14501c98f40 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -343,7 +343,7 @@ struct acpi_table_header *acpi_find_dsdt_initrd(void)
343 struct kstat stat; 343 struct kstat stat;
344 char *ramfs_dsdt_name = "/DSDT.aml"; 344 char *ramfs_dsdt_name = "/DSDT.aml";
345 345
346 printk(KERN_INFO PREFIX "Checking initramfs for custom DSDT"); 346 printk(KERN_INFO PREFIX "Checking initramfs for custom DSDT\n");
347 347
348 /* 348 /*
349 * Never do this at home, only the user-space is allowed to open a file. 349 * Never do this at home, only the user-space is allowed to open a file.
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index f32010bee4d5..b477a4be8a69 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -50,6 +50,10 @@ ACPI_MODULE_NAME("processor_perflib");
50 50
51static DEFINE_MUTEX(performance_mutex); 51static DEFINE_MUTEX(performance_mutex);
52 52
53/* Use cpufreq debug layer for _PPC changes. */
54#define cpufreq_printk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, \
55 "cpufreq-core", msg)
56
53/* 57/*
54 * _PPC support is implemented as a CPUfreq policy notifier: 58 * _PPC support is implemented as a CPUfreq policy notifier:
55 * This means each time a CPUfreq driver registered also with 59 * This means each time a CPUfreq driver registered also with
@@ -131,6 +135,9 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
131 return -ENODEV; 135 return -ENODEV;
132 } 136 }
133 137
138 cpufreq_printk("CPU %d: _PPC is %d - frequency %s limited\n", pr->id,
139 (int)ppc, ppc ? "" : "not");
140
134 pr->performance_platform_limit = (int)ppc; 141 pr->performance_platform_limit = (int)ppc;
135 142
136 return 0; 143 return 0;
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 1941587a7aa2..c143a86c2ea6 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -106,9 +106,9 @@ config ACER_WMI
106 depends on X86 106 depends on X86
107 depends on EXPERIMENTAL 107 depends on EXPERIMENTAL
108 depends on ACPI 108 depends on ACPI
109 depends on ACPI_WMI
110 depends on LEDS_CLASS 109 depends on LEDS_CLASS
111 depends on BACKLIGHT_CLASS_DEVICE 110 depends on BACKLIGHT_CLASS_DEVICE
111 select ACPI_WMI
112 ---help--- 112 ---help---
113 This is a driver for newer Acer (and Wistron) laptops. It adds 113 This is a driver for newer Acer (and Wistron) laptops. It adds
114 wireless radio and bluetooth control, and on some laptops, 114 wireless radio and bluetooth control, and on some laptops,
@@ -155,7 +155,7 @@ config TC1100_WMI
155 tristate "HP Compaq TC1100 Tablet WMI Extras" 155 tristate "HP Compaq TC1100 Tablet WMI Extras"
156 depends on X86 && !X86_64 156 depends on X86 && !X86_64
157 depends on ACPI 157 depends on ACPI
158 depends on ACPI_WMI 158 select ACPI_WMI
159 ---help--- 159 ---help---
160 This is a driver for the WMI extensions (wireless and bluetooth power 160 This is a driver for the WMI extensions (wireless and bluetooth power
161 control) of the HP Compaq TC1100 tablet. 161 control) of the HP Compaq TC1100 tablet.
@@ -288,6 +288,7 @@ config ATMEL_SSC
288config INTEL_MENLOW 288config INTEL_MENLOW
289 tristate "Thermal Management driver for Intel menlow platform" 289 tristate "Thermal Management driver for Intel menlow platform"
290 depends on ACPI_THERMAL 290 depends on ACPI_THERMAL
291 depends on X86
291 ---help--- 292 ---help---
292 ACPI thermal management enhancement driver on 293 ACPI thermal management enhancement driver on
293 Intel Menlow platform. 294 Intel Menlow platform.
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 9b3f61200000..69f19f224875 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -9,7 +9,7 @@ menuconfig THERMAL
9 Generic Thermal Sysfs driver offers a generic mechanism for 9 Generic Thermal Sysfs driver offers a generic mechanism for
10 thermal management. Usually it's made up of one or more thermal 10 thermal management. Usually it's made up of one or more thermal
11 zone and cooling device. 11 zone and cooling device.
12 each thermal zone contains its own temperature, trip points, 12 Each thermal zone contains its own temperature, trip points,
13 cooling devices. 13 cooling devices.
14 All platforms with ACPI thermal support can use this driver. 14 All platforms with ACPI thermal support can use this driver.
15 If you want this support, you should say Y here 15 If you want this support, you should say Y here.
diff --git a/drivers/thermal/thermal.c b/drivers/thermal/thermal.c
index 3273e348fd14..e782b3e7fcdb 100644
--- a/drivers/thermal/thermal.c
+++ b/drivers/thermal/thermal.c
@@ -267,7 +267,7 @@ thermal_cooling_device_cur_state_store(struct device *dev,
267} 267}
268 268
269static struct device_attribute dev_attr_cdev_type = 269static struct device_attribute dev_attr_cdev_type =
270 __ATTR(type, 0444, thermal_cooling_device_type_show, NULL); 270__ATTR(type, 0444, thermal_cooling_device_type_show, NULL);
271static DEVICE_ATTR(max_state, 0444, 271static DEVICE_ATTR(max_state, 0444,
272 thermal_cooling_device_max_state_show, NULL); 272 thermal_cooling_device_max_state_show, NULL);
273static DEVICE_ATTR(cur_state, 0644, 273static DEVICE_ATTR(cur_state, 0644,
@@ -276,7 +276,7 @@ static DEVICE_ATTR(cur_state, 0644,
276 276
277static ssize_t 277static ssize_t
278thermal_cooling_device_trip_point_show(struct device *dev, 278thermal_cooling_device_trip_point_show(struct device *dev,
279 struct device_attribute *attr, char *buf) 279 struct device_attribute *attr, char *buf)
280{ 280{
281 struct thermal_cooling_device_instance *instance; 281 struct thermal_cooling_device_instance *instance;
282 282
@@ -293,11 +293,12 @@ thermal_cooling_device_trip_point_show(struct device *dev,
293 293
294/** 294/**
295 * thermal_zone_bind_cooling_device - bind a cooling device to a thermal zone 295 * thermal_zone_bind_cooling_device - bind a cooling device to a thermal zone
296 * this function is usually called in the thermal zone device .bind callback.
297 * @tz: thermal zone device 296 * @tz: thermal zone device
298 * @trip: indicates which trip point the cooling devices is 297 * @trip: indicates which trip point the cooling devices is
299 * associated with in this thermal zone. 298 * associated with in this thermal zone.
300 * @cdev: thermal cooling device 299 * @cdev: thermal cooling device
300 *
301 * This function is usually called in the thermal zone device .bind callback.
301 */ 302 */
302int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, 303int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
303 int trip, 304 int trip,
@@ -307,8 +308,7 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
307 struct thermal_cooling_device_instance *pos; 308 struct thermal_cooling_device_instance *pos;
308 int result; 309 int result;
309 310
310 if (trip >= tz->trips || 311 if (trip >= tz->trips || (trip < 0 && trip != THERMAL_TRIPS_NONE))
311 (trip < 0 && trip != THERMAL_TRIPS_NONE))
312 return -EINVAL; 312 return -EINVAL;
313 313
314 if (!tz || !cdev) 314 if (!tz || !cdev)
@@ -361,15 +361,17 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
361 kfree(dev); 361 kfree(dev);
362 return result; 362 return result;
363} 363}
364
364EXPORT_SYMBOL(thermal_zone_bind_cooling_device); 365EXPORT_SYMBOL(thermal_zone_bind_cooling_device);
365 366
366/** 367/**
367 * thermal_zone_unbind_cooling_device - unbind a cooling device from a thermal zone 368 * thermal_zone_unbind_cooling_device - unbind a cooling device from a thermal zone
368 * this function is usually called in the thermal zone device .unbind callback.
369 * @tz: thermal zone device 369 * @tz: thermal zone device
370 * @trip: indicates which trip point the cooling devices is 370 * @trip: indicates which trip point the cooling devices is
371 * associated with in this thermal zone. 371 * associated with in this thermal zone.
372 * @cdev: thermal cooling device 372 * @cdev: thermal cooling device
373 *
374 * This function is usually called in the thermal zone device .unbind callback.
373 */ 375 */
374int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, 376int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
375 int trip, 377 int trip,
@@ -379,8 +381,7 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
379 381
380 mutex_lock(&tz->lock); 382 mutex_lock(&tz->lock);
381 list_for_each_entry_safe(pos, next, &tz->cooling_devices, node) { 383 list_for_each_entry_safe(pos, next, &tz->cooling_devices, node) {
382 if (pos->tz == tz && pos->trip == trip 384 if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) {
383 && pos->cdev == cdev) {
384 list_del(&pos->node); 385 list_del(&pos->node);
385 mutex_unlock(&tz->lock); 386 mutex_unlock(&tz->lock);
386 goto unbind; 387 goto unbind;
@@ -397,6 +398,7 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
397 kfree(pos); 398 kfree(pos);
398 return 0; 399 return 0;
399} 400}
401
400EXPORT_SYMBOL(thermal_zone_unbind_cooling_device); 402EXPORT_SYMBOL(thermal_zone_unbind_cooling_device);
401 403
402static void thermal_release(struct device *dev) 404static void thermal_release(struct device *dev)
@@ -425,7 +427,10 @@ static struct class thermal_class = {
425 * @ops: standard thermal cooling devices callbacks. 427 * @ops: standard thermal cooling devices callbacks.
426 */ 428 */
427struct thermal_cooling_device *thermal_cooling_device_register(char *type, 429struct thermal_cooling_device *thermal_cooling_device_register(char *type,
428 void *devdata, struct thermal_cooling_device_ops *ops) 430 void *devdata,
431 struct
432 thermal_cooling_device_ops
433 *ops)
429{ 434{
430 struct thermal_cooling_device *cdev; 435 struct thermal_cooling_device *cdev;
431 struct thermal_zone_device *pos; 436 struct thermal_zone_device *pos;
@@ -435,7 +440,7 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type,
435 return NULL; 440 return NULL;
436 441
437 if (!ops || !ops->get_max_state || !ops->get_cur_state || 442 if (!ops || !ops->get_max_state || !ops->get_cur_state ||
438 !ops->set_cur_state) 443 !ops->set_cur_state)
439 return NULL; 444 return NULL;
440 445
441 cdev = kzalloc(sizeof(struct thermal_cooling_device), GFP_KERNEL); 446 cdev = kzalloc(sizeof(struct thermal_cooling_device), GFP_KERNEL);
@@ -462,8 +467,7 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type,
462 467
463 /* sys I/F */ 468 /* sys I/F */
464 if (type) { 469 if (type) {
465 result = device_create_file(&cdev->device, 470 result = device_create_file(&cdev->device, &dev_attr_cdev_type);
466 &dev_attr_cdev_type);
467 if (result) 471 if (result)
468 goto unregister; 472 goto unregister;
469 } 473 }
@@ -496,11 +500,11 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type,
496 device_unregister(&cdev->device); 500 device_unregister(&cdev->device);
497 return NULL; 501 return NULL;
498} 502}
503
499EXPORT_SYMBOL(thermal_cooling_device_register); 504EXPORT_SYMBOL(thermal_cooling_device_register);
500 505
501/** 506/**
502 * thermal_cooling_device_unregister - removes the registered thermal cooling device 507 * thermal_cooling_device_unregister - removes the registered thermal cooling device
503 *
504 * @cdev: the thermal cooling device to remove. 508 * @cdev: the thermal cooling device to remove.
505 * 509 *
506 * thermal_cooling_device_unregister() must be called when the device is no 510 * thermal_cooling_device_unregister() must be called when the device is no
@@ -533,8 +537,7 @@ void thermal_cooling_device_unregister(struct
533 } 537 }
534 mutex_unlock(&thermal_list_lock); 538 mutex_unlock(&thermal_list_lock);
535 if (cdev->type[0]) 539 if (cdev->type[0])
536 device_remove_file(&cdev->device, 540 device_remove_file(&cdev->device, &dev_attr_cdev_type);
537 &dev_attr_cdev_type);
538 device_remove_file(&cdev->device, &dev_attr_max_state); 541 device_remove_file(&cdev->device, &dev_attr_max_state);
539 device_remove_file(&cdev->device, &dev_attr_cur_state); 542 device_remove_file(&cdev->device, &dev_attr_cur_state);
540 543
@@ -542,6 +545,7 @@ void thermal_cooling_device_unregister(struct
542 device_unregister(&cdev->device); 545 device_unregister(&cdev->device);
543 return; 546 return;
544} 547}
548
545EXPORT_SYMBOL(thermal_cooling_device_unregister); 549EXPORT_SYMBOL(thermal_cooling_device_unregister);
546 550
547/** 551/**
@@ -555,8 +559,10 @@ EXPORT_SYMBOL(thermal_cooling_device_unregister);
555 * longer needed. 559 * longer needed.
556 */ 560 */
557struct thermal_zone_device *thermal_zone_device_register(char *type, 561struct thermal_zone_device *thermal_zone_device_register(char *type,
558 int trips, void *devdata, 562 int trips,
559 struct thermal_zone_device_ops *ops) 563 void *devdata, struct
564 thermal_zone_device_ops
565 *ops)
560{ 566{
561 struct thermal_zone_device *tz; 567 struct thermal_zone_device *tz;
562 struct thermal_cooling_device *pos; 568 struct thermal_cooling_device *pos;
@@ -625,9 +631,9 @@ struct thermal_zone_device *thermal_zone_device_register(char *type,
625 list_add_tail(&tz->node, &thermal_tz_list); 631 list_add_tail(&tz->node, &thermal_tz_list);
626 if (ops->bind) 632 if (ops->bind)
627 list_for_each_entry(pos, &thermal_cdev_list, node) { 633 list_for_each_entry(pos, &thermal_cdev_list, node) {
628 result = ops->bind(tz, pos); 634 result = ops->bind(tz, pos);
629 if (result) 635 if (result)
630 break; 636 break;
631 } 637 }
632 mutex_unlock(&thermal_list_lock); 638 mutex_unlock(&thermal_list_lock);
633 639
@@ -639,11 +645,11 @@ struct thermal_zone_device *thermal_zone_device_register(char *type,
639 device_unregister(&tz->device); 645 device_unregister(&tz->device);
640 return NULL; 646 return NULL;
641} 647}
648
642EXPORT_SYMBOL(thermal_zone_device_register); 649EXPORT_SYMBOL(thermal_zone_device_register);
643 650
644/** 651/**
645 * thermal_device_unregister - removes the registered thermal zone device 652 * thermal_device_unregister - removes the registered thermal zone device
646 *
647 * @tz: the thermal zone device to remove 653 * @tz: the thermal zone device to remove
648 */ 654 */
649void thermal_zone_device_unregister(struct thermal_zone_device *tz) 655void thermal_zone_device_unregister(struct thermal_zone_device *tz)
@@ -685,6 +691,7 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
685 device_unregister(&tz->device); 691 device_unregister(&tz->device);
686 return; 692 return;
687} 693}
694
688EXPORT_SYMBOL(thermal_zone_device_unregister); 695EXPORT_SYMBOL(thermal_zone_device_unregister);
689 696
690static int __init thermal_init(void) 697static int __init thermal_init(void)