[go: nahoru, domu]

History log of /drivers/acpi/thermal.c
Revision Date Author Comments
7b83fd9d91a411158f72d36958103c708c3b5a86 25-Mar-2014 Aaron Lu <aaron.lu@intel.com> Thermal: move the KELVIN_TO_MILLICELSIUS macro to thermal.h

This macro can be used by other component so move it to a common header,
but in a slightly different way: define two macros, one macro with an
offset and the other doesn't.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
e6f8a4d60b905eae1a20cbb0c72c67b26b2f02fd 20-May-2014 Lan Tianyu <tianyu.lan@intel.com> ACPI / thermal: Use acpi_bus_attach_private_data() to attach private data

Use acpi_bus_attach_private_data() to attach private data
instead of acpi_attach_data().

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2807bd18cc60ec471917b5158e98e4d7b7e030fb 26-May-2014 Aaron Lu <aaron.lu@intel.com> ACPI / thermal: fix workqueue destroy order

When the thermal module is to be removed, we should destroy the wq
acpi_thermal_pm_queue after the ACPI driver's remove callback is
executed as we will need to flush the workqueue there, or a NULL pointer
access will be hit.

Reported-and-tested-by: Kui Zhang <kuizhang@gmail.com>
References: http://www.spinics.net/lists/kernel/msg1747251.html
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ee17fdf24bf815650c87b3bb35fbab42681523a8 29-Mar-2014 Zhihui Zhang <zzhsuny@gmail.com> ACPI / thermal: Fix wrong variable usage in debug statement

A debug statement in acpi_thermal_trips_update() uses a wrong trip
point (tz->trips.critical instead of tz->trips.hot) to get the
temperature value from. Fix that.

Signed-off-by: Zhihui Zhang <zzhsuny@gmail.com>
[rjw: Subject and changelog]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
a59ffb2062df3a5c346dbed931fa1e587fd0f0f3 04-Mar-2014 Aaron Lu <aaron.lu@intel.com> ACPI / thermal: make acpi_thermal_check asynchronous on resume

On resume we do not need to wait for acpi_thermal_check to finish.
Instead, we can run it asynchronously and not block the whole system
resume. Also, we make sure when we are suspending again, previously
queued work for acpi_thermal_check is done.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
fae9e2a4b1c59d11edfa7c99c34293bf9fbf2bde 13-Feb-2014 Shuah Khan <shuah.kh@samsung.com> ACPI / thermal: fix thermal driver compile error when CONFIG_PM_SLEEP is undefined

The ACPI thermal driver defines acpi_thermal_resume() when
CONFIG_PM_SLEEP is defined. This results in the following compile
error when CONFIG_PM_SLEEP is undefined.

CC drivers/acpi/thermal.o
drivers/acpi/thermal.c:107:8: error: ‘acpi_thermal_resume’ undeclared here (not in a function)
make[2]: *** [drivers/acpi/thermal.o] Error 1

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ec9c9c2ec1d164f3c5f3c9ac41f43de40040e43c 07-Jan-2014 Emil Goode <emilgoode@gmail.com> ACPI / thermal: remove const from thermal_zone_device_ops declaration

The following commit introduced the requirement to not declare
thermal_zone_device_ops structs as const in order to allow
changing the .get_temp callback.

commit 4e5e4705bf69ea450f58fc709ac5888f321a9299
Author: Eduardo Valentin <eduardo.valentin@ti.com>
Date: Wed Jul 3 15:35:39 2013 -0400

thermal: introduce device tree parser

Modify acpi_thermal_zone_ops to follow the new requirement.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
[rjw: Changelog]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8b48463f89429af408ff695244dc627e1acff4f7 03-Dec-2013 Lv Zheng <lv.zheng@intel.com> ACPI: Clean up inclusions of ACPI header files

Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and
<acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h>
inclusions and remove some inclusions of those files that aren't
necessary.

First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>
should not be included directly from any files that are built for
CONFIG_ACPI unset, because that generally leads to build warnings about
undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set,
<linux/acpi.h> includes those files and for CONFIG_ACPI unset it
provides stub ACPI symbols to be used in that case.

Second, there are ordering dependencies between those files that always
have to be met. Namely, it is required that <acpi/acpi_bus.h> be included
prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the
latter depends on are always there. And <acpi/acpi.h> which provides
basic ACPICA type declarations should always be included prior to any other
ACPI headers in CONFIG_ACPI builds. That also is taken care of including
<linux/acpi.h> as appropriate.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff)
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
766a8a6dd89268107df1f6783f6a6338efcbf07e 13-Sep-2013 Andy Shevchenko <andriy.shevchenko@linux.intel.com> ACPI / thermal: convert printk(LEVEL...) to pr_<lvl>

Convert printks to pr_* format. Additionally re-use PREFIX constant instead of
hardcoded strings.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
e994d713a73716b54085a092b267099e40aa5513 25-Sep-2013 Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> ACPI/thermal : Remove zone disabled warning

Once thermal zone is disabled to move thermal control to user space,
too many warnings printed in logs. Remove pr_warn from this path,
instead warn when user mode issues request to disable thermal zone.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
668e02004462487df8ec6c65c665ddb8af78dc12 27-Aug-2013 Lan Tianyu <tianyu.lan@intel.com> ACPI / thermal: Add check of "_TZD" availability and evaluating result

Some machines don't provide _TZD, so check the availability of it
before carrying out futher operations.

If _TZD is present, also check the result of its evaluation.

[rjw: Changelog]
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
70f2903b506100396dbdb301ae1ead74842a6894 14-Aug-2013 Lan Tianyu <tianyu.lan@intel.com> ACPI / thermal: Use THERMAL_TRIPS_NONE macro to replace number

It's unreadable to pass "-1" as trip parameter directly to
thermal_zone_bind_cooling_device(). Use THERMAL_TRIPS_NONE instead.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
b22131c254a9a3cfe0184b234ab8bd737b4c8ba2 14-Aug-2013 Lan Tianyu <tianyu.lan@intel.com> ACPI / thermal: Remove unused macros in the driver/acpi/thermal.c

The ACPI_THERMAL_FILE* macros are not used now, so remove them.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8a6036b92620a4ea0a1285d5c134ac9610ff4b32 14-Aug-2013 Lan Tianyu <tianyu.lan@intel.com> ACPI / thermal: Remove the unused lock of struct acpi_thermal

The acpi_thermal->lock now just is initialized when a thermal zone
device is added and destroyed when the thermal zone is removed.
It is never used in any other places, so remove it.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1696d9dc57e062ce5200f6a42a6aaada15b434bb 15-Jul-2013 Thomas Renninger <trenn@suse.de> ACPI: Remove the old /proc/acpi/event interface

It is quite some time that this one has been deprecated.
Get rid of it.

Should some really important user be overseen, it may be reverted and
the userspace program worked on first, but it is time to do something
to get rid of this old stuff...

Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: Matthew Garrett <matthew.garrett@nebula.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
0db98202605c3d32e023d43c30b5bd878f520976 28-Jun-2013 Jiang Liu <jiang.liu@huawei.com> ACPI: introduce helper function acpi_execute_simple_method()

Introduce helper function acpi_execute_simple_method() and use it in
a number of places to simplify code.

[rjw: Changelog]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
94a409319561ec1847fd9bf996a2d5843ad00932 26-Apr-2013 Zhang Rui <rui.zhang@intel.com> ACPI / thermal: do not always return THERMAL_TREND_RAISING for active trip points

Commit 4ae46be "Thermal: Introduce thermal_zone_trip_update()"
introduced a regression causing the fan to be always on even when
the system is idle.

My original idea in that commit is that:
- when the current temperature is above the trip point,
keep the fan on, even if the temperature is dropping.
- when the current temperature is below the trip point,
turn on the fan when the temperature is raising,
turn off the fan when the temperature is dropping.

But this is what the code actually does:
- when the current temperature is above the trip point,
the fan keeps on.
- when the current temperature is below the trip point,
the fan is always on because thermal_get_trend()
in driver/acpi/thermal.c returns THERMAL_TREND_RAISING.
Thus the fan keeps running even if the system is idle.

Fix this in drivers/acpi/thermal.c.

[rjw: Changelog]
References: https://bugzilla.kernel.org/show_bug.cgi?id=56591
References: https://bugzilla.kernel.org/show_bug.cgi?id=56601
References: https://bugzilla.kernel.org/show_bug.cgi?id=50041#c45
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Matthias <morpheusxyz123@yahoo.de>
Tested-by: Ville Syrjälä <syrjala@sci.fi>
Cc: 3.7+ <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
51fac8388a0325a43f0ae67453ece2c373e2ec28 24-Jan-2013 Rafael J. Wysocki <rafael.j.wysocki@intel.com> ACPI: Remove useless type argument of driver .remove() operation

The second argument of ACPI driver .remove() operation is only used
by the ACPI processor driver and the value passed to that driver
through it is always available from the given struct acpi_device
object's removal_type field. For this reason, the second ACPI driver
.remove() argument is in fact useless, so drop it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Jiang Liu <jiang.liu@huawei.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
ca4e713080dd7f23cd1cf5d3871e0b717ee9b254 15-Jan-2013 Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> ACPI / thermal: Use mode to enable/disable kernel thermal processing

As per documentation, "mode" sysfs interface should be able to
enable/disable thermal processing in the kernel, so that user space
is able to take more control.

Currently, ACPI thermal driver is not following this setting, so
modify it to match the interface documentation.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7e3cf246b532a640ff1176d0b988aa0a9338e36f 29-Nov-2012 Colin Ian King <colin.king@canonical.com> ACPI thermal: remove unnecessary newline from exception message

ACPI_EXCEPTION() already appends a newline, so there is no
need for the thermal trip point message to include one too.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
261cba2deb7d3bebd180c35d5dbf8961f6e9afc4 27-Nov-2012 Zhang Rui <rui.zhang@intel.com> ACPI / thermal: _TMP and _CRT/_HOT/_PSV/_ACx dependency fix

On some platforms, _TMP and _CRT/_HOT/_PSV/_ACx have dependency.
And there is no way for OS to detect this dependency.

commit 9bcb8118965ab4631a65ee0726e6518f75cda6c5 shows us a problem
that _TMP must be evaluate after _CRT/_HOT/_PSV/_ACx, or else
firmware will shutdown the system.

But the machine in https://bugzilla.kernel.org/show_bug.cgi?id=43284
shows us that _PSV would return valid value only if _TMP has been
evaluated once.

With this patch, all of the control methods will be evaluated once,
in the _CRT/_HOT/_PSV/_CRT/_TMP order, before they are actually used.

[rjw: Added a local variable for the handle and modified the loop
slightly.]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: katabami <katabami@lavabit.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
50125a9b27dd09e9afdc1b8712ba0b3859886c68 18-Sep-2012 Durgadoss R <durgadoss.r@intel.com> Thermal: Pass zone parameters as argument to tzd_register

This patch adds the thermal zone parameter as an argument to
the tzd_register() function call; and updates other drivers
using this function.

Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
4ae46befb49d4173122e0afa995c4e93d01948a2 27-Jun-2012 Zhang Rui <rui.zhang@intel.com> Thermal: Introduce thermal_zone_trip_update()

This function is used to update the cooling state of
all the cooling devices that are bound to an active trip point.

This will be used for passive cooling as well, in the future patches.
as both active and passive cooling can share the same algorithm,
which is

1. if the temperature is higher than a trip point,
a. if the trend is THERMAL_TREND_RAISING, use higher cooling
state for this trip point
b. if the trend is THERMAL_TREND_DROPPING, use lower cooling
state for this trip point

2. if the temperature is lower than a trip point, use lower
cooling state for this trip point.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Eduardo Valentin <eduardo.valentin@ti.com>
1b7ddb840c3908464b19d4aa4f6dc4c463302442 27-Jun-2012 Zhang Rui <rui.zhang@intel.com> Thermal: Remove tc1/tc2 in generic thermal layer.

Remove tc1/tc2 in generic thermal layer.
.get_trend() callback starts to take effect from this patch.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Valentin, Eduardo <eduardo.valentin@ti.com>
601f3d4242be6ed6f72a2aadabc91e8255dad811 27-Jun-2012 Zhang Rui <rui.zhang@intel.com> Thermal: Introduce .get_trend() callback.

According to ACPI spec, tc1 and tc2 are used by OSPM
to anticipate the temperature trends.
We introduced the same concept to the generic thermal layer
for passive cooling, but now it seems that these values
are hard to be used on other platforms.

So We introduce .get_trend() as a more general solution.

For the platform thermal drivers that have their own way to
anticipate the temperature trends, they should provide
their own .get_trend() callback.
Or else, we will calculate the temperature trends by simply
comparing the current temperature and the cached previous
temperature reading.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Valentin, Eduardo <eduardo.valentin@ti.com>
9d99842f99d847191ebd0c28469d2c70fcc5bf9e 26-Jun-2012 Zhang Rui <rui.zhang@intel.com> Thermal: set upper and lower limits

set upper and lower limits when binding
a thermal cooling device to a thermal zone device.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Eduardo Valentin <eduardo.valentin@ti.com>
9069240480e24a2d6ce23404c9ad6cabf59b7258 09-Aug-2012 Rafael J. Wysocki <rjw@sisk.pl> ACPI / PM: Fix unused function warnings for CONFIG_PM_SLEEP

According to compiler warnings, several suspend/resume functions
in ACPI drivers are not used for CONFIG_PM_SLEEP unset, so add
#ifdefs to prevent them from being built in that case.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
8eaa8d6ca27788aa23659082362a608c1fabcdfe 25-Jul-2012 Zhang Rui <rui.zhang@intel.com> Thermal: Documentation update

With commit 6503e5df08008b9a47022b5e9ebba658c8fa69af,
the value of /sys/class/thermal/thermal_zoneX/mode has been changed
from user/kernel to enabled/disabled.
Update the documentation so that users won't be confused.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
c56f5c0342dfee11a1a13d2f5bb7618de5b17590 25-Jul-2012 Durgadoss R <dugardoss.r@intel.com> Thermal: Make Thermal trip points writeable

Some of the thermal drivers using the Generic Thermal Framework
require (all/some) trip points to be writeable. This patch makes
the trip point temperatures writeable on a per-trip point basis,
and modifies the required function call in thermal.c. This patch
also updates the Documentation to reflect the new change.

Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
167cffb646aa4a7f3267b07eae1af16b54bc0e9b 27-Jun-2012 Rafael J. Wysocki <rjw@sisk.pl> ACPI: Use struct dev_pm_ops for power management in the thermal driver

Make the ACPI thermal driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct acpi_device_ops.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
9bcb8118965ab4631a65ee0726e6518f75cda6c5 01-Feb-2012 Matthew Garrett <mjg@redhat.com> ACPI: Evaluate thermal trip points before reading temperature

An HP laptop (Pavilion G4-1016tx) has the following code in _TMP:

Store (\_SB.PCI0.LPCB.EC0.RTMP, Local0)
If (LGreaterEqual (Local0, S4TP))
{
Store (One, HTS4)
}

S4TP is initialised at 0 and not programmed further until either _HOT or
_CRT is called. If we evaluate _TMP before the trip points then HTS4 will
always be set, causing the firmware to generate a message on boot
complaining that the system shut down because of overheating. The simplest
solution is just to reverse the checking of trip points and _TMP in thermal
init.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
9c8b04be443b33939f374a811c82abeebe0a61d1 25-Jun-2011 Vasiliy Kulikov <segoon@openwall.com> ACPI: constify ops structs

Structs battery_file, acpi_dock_ops, file_operations,
thermal_cooling_device_ops, thermal_zone_device_ops, kernel_param_ops
are not changed in runtime. It is safe to make them const.
register_hotplug_dock_device() was altered to take const "ops" argument
to respect acpi_dock_ops' const notion.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
488a76c52606199100adf09c8eb7cbedbd94e9d9 25-Nov-2010 Rafael J. Wysocki <rjw@sisk.pl> ACPI / Fan: Rework the handling of power resources

Use the new function acpi_bus_update_power() for manipulating power
resources used by ACPI fan devices, which allows them to be put into
the right state during initialization and resume. Consequently,
remove the flags.force_power_state field from struct acpi_device,
which is not necessary any more.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
c57b62f5b1e6dd69ff8c96f6db7f86ea31c0e21f 08-Oct-2010 Zhang Rui <rui.zhang@intel.com> ACPI thermal: remove deprecated procfs I/F

Remove the deprecated ACPI thermal driver procfs I/F,
as stated in the changelog of commit 43d9f87b79804f2d75d9d8a81c862b179f055a15

sysfs I/F is available at /sys/class/thermal/thermal_zoneX/

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
43d9f87b79804f2d75d9d8a81c862b179f055a15 15-Jul-2010 Zhang Rui <rui.zhang@intel.com> ACPI thermal: make procfs I/F depend on CONFIG_ACPI_PROCFS

Mark the ACPI thermal procfs I/F deprecated, because /sys/class/thermal/
is already available and has been working for years w/o any problem.

The ACPI thermal procfs I/F will be removed in 2.6.37.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
fa80945269f312bc609e8384302f58b03c916e12 20-Feb-2010 Thomas Renninger <trenn@suse.de> ACPI thermal: Don't invalidate thermal zone if critical trip point is bad

V2: Corrected integer/long conversion.

Some BIOSes return a negative value for the critical trip point.
Especially since Windows 2006...
We currently invalidate the whole thermal zone in this case.
But it may still be needed for cooling, also without critical
trip point.

This patch invalidates the critical trip point if no _CRT
function is found or if it returns negative values, but does
not invalidate the whole thermal zone in this case.

Reference: http://bugzilla.novell.com/show_bug.cgi?id=531547

Signed-off-by: Thomas Renninger <trenn@suse.de>
Tested-by: clarkt@cnsp.com
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
8b7ef6d8f16274da42344cd50746ddb1c93c25ea 16-Feb-2010 Thomas Renninger <trenn@suse.de> ACPI thermal: Check for thermal zone requirement

ACPI spec says (11.5 Thermal Zone Interface Requirements):
A thermal zone must contain at least one trip point
(critical, near critical, active, or passive)

Check this once at init time.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Tested-by: clarkt@cnsp.com
Signed-off-by: Len Brown <len.brown@intel.com>
bf2abdd79ac81c52957bf0d0d5430cec5433cfb7 17-Nov-2009 Frans Pop <elendil@planet.nl> acpi: thermal: display forced passive trip points in proc

Users can force a passive trip point for a thermal zone that does not have
_PSV defined in ACPI by setting the passive attribute in sysfs. It's
useful to display such trip points in /proc/acpi/thermal_zone.

.../TZ1/cooling_mode:<setting not supported>
.../TZ1/polling_frequency:polling frequency: 10 seconds
.../TZ1/state:state: ok
.../TZ1/temperature:temperature: 53 C
.../TZ1/trip_points:critical (S5): 110 C
.../TZ1/trip_points:passive (forced): 95 C

And if not set (passive is 0):
.../TZ1/trip_points:passive (forced):<not set>

Signed-off-by: Frans Pop <elendil@planet.nl>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
7fb2616e249184e217f9818a7662596165710ea4 26-Oct-2009 Frans Pop <elendil@planet.nl> acpi: thermal: display forced passive trip points in proc

Users can force a passive trip point for a thermal zone that does not
have _PSV defined in ACPI by setting the passive attribute in sysfs.
It's useful to display such trip points in /proc/acpi/thermal_zone.

.../TZ1/cooling_mode:<setting not supported>
.../TZ1/polling_frequency:polling frequency: 10 seconds
.../TZ1/state:state: ok
.../TZ1/temperature:temperature: 53 C
.../TZ1/trip_points:critical (S5): 110 C
.../TZ1/trip_points:passive (forced): 95 C

And if not set (passive is 0):
.../TZ1/trip_points:passive (forced):<not set>

Signed-off-by: Frans Pop <elendil@planet.nl>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
a192a9580bcc41692be1f36b77c3b681827f566a 28-Jul-2009 Len Brown <len.brown@intel.com> ACPI: Move definition of PREFIX from acpi_bus.h to internal..h

Linux/ACPI core files using internal.h all PREFIX "ACPI: ",
however, not all ACPI drivers use/want it -- and they
should not have to #undef PREFIX to define their own.

Add GPL commment to internal.h while we are there.

This does not change any actual console output,
asside from a whitespace fix.

Signed-off-by: Len Brown <len.brown@intel.com>
67405439bca28c4dbecd3fefd97fbdb282a302d9 14-Apr-2009 Matthew Garrett <mjg59@srcf.ucam.org> thermal: Fix polling frequency for systems without passive cooling

The polling interval (in deciseconds) was accidently interpreted as
being in milliseconds in one codepath, resulting in excessively frequent
polling. Ensure that the conversion is performed.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
342d550db1bc0b879007a8cdb38645558e839680 07-Apr-2009 Bjorn Helgaas <bjorn.helgaas@hp.com> ACPI: thermal: use .notify method instead of installing handler directly

This patch adds a .notify() method. The presence of .notify() causes
Linux/ACPI to manage event handlers and notify handlers on our behalf,
so we don't have to install and remove them ourselves.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
13614e37e94da4606a300ee6fe25c8c4a19ee670 06-Apr-2009 Jean Delvare <khali@linux-fr.org> ACPI: Adjust Kelvin offset to match local implementation

The exact offset between Kelvin and degree Celsius is 273.15. However
ACPI handles temperature values with a single decimal place. As a
consequence, some implementations use an offset of 273.1 and others
use an offset of 273.2. Try to find out which one is being used, to
present the most accurate and visually appealing number.

Tested on a Sony Vaio PGC-GR214EP (which uses 273.1) and a Lenovo
Thinkpad T60p (which uses 273.2).

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
99b76233803beab302123d243eea9e41149804f3 25-Mar-2009 Alexey Dobriyan <adobriyan@gmail.com> proc 2/2: remove struct proc_dir_entry::owner

Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
as correctly noted at bug #12454. Someone can lookup entry with NULL
->owner, thus not pinning enything, and release it later resulting
in module refcount underflow.

We can keep ->owner and supply it at registration time like ->proc_fops
and ->data.

But this leaves ->owner as easy-manipulative field (just one C assignment)
and somebody will forget to unpin previous/pin current module when
switching ->owner. ->proc_fops is declared as "const" which should give
some thoughts.

->read_proc/->write_proc were just fixed to not require ->owner for
protection.

rmmod'ed directories will be empty and return "." and ".." -- no harm.
And directories with tricky enough readdir and lookup shouldn't be modular.
We definitely don't want such modular code.

Removing ->owner will also make PDE smaller.

So, let's nuke it.

Kudos to Jeff Layton for reminding about this, let's say, oversight.

http://bugzilla.kernel.org/show_bug.cgi?id=12454

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
b731d7b6a7b4c2ca4b5e9384cb5197e4e8204651 13-Mar-2009 Adam Buchbinder <adam.buchbinder@gmail.com> trivial: Fix misspelling of "Celsius".

A few comments say "Celcius"; this fixes them. No code changes.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f6f5c45e06e86d94621cd5c1c4508bdee1952fc8 02-Mar-2009 Stephen Rothwell <sfr@canb.auug.org.au> ACPI: update thermal for bus_id removal

> drivers/acpi/thermal.c: In function 'thermal_notify':
> drivers/acpi/thermal.c:768: error: 'struct device' has no member named 'bus_id'
>
> Caused by commit b1569e99c795bf83b4ddf41c4f1c42761ab7f75e ("ACPI: move
> thermal trip handling to generic thermal layer") interacting with commit
> d4a078fca590911cdf87a8eaffee1b6e643c2558 ("driver core: get rid of struct
> device's bus_id string array").
>

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Len Brown <len.brown@intel.com>
b1569e99c795bf83b4ddf41c4f1c42761ab7f75e 03-Dec-2008 Matthew Garrett <mjg59@srcf.ucam.org> ACPI: move thermal trip handling to generic thermal layer

The ACPI code currently carries its own thermal trip handling, meaning that
any other thermal implementation will need to reimplement it. Move the code
to the generic thermal layer.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
6503e5df08008b9a47022b5e9ebba658c8fa69af 27-Nov-2008 Matthew Garrett <mjg59@srcf.ucam.org> thermal: use integers rather than strings for thermal values

The thermal API currently uses strings to pass values to userspace. This
makes it difficult to use from within the kernel. Change the interface
to use integers and fix up the consumers.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
0e4240d94628530a912d216cad1e32d2e3827327 16-Jan-2009 Zhang Rui <rui.zhang@intel.com> thermal fixup for broken BIOS which has invalid trip points.

ACPI thermal driver only re-evaluate VALID trip points.

For the broken BIOS show in
http://bugzilla.kernel.org/show_bug.cgi?id=8544
the active[0] is set to invalid at boot time
and it will not be re-evaluated again.
We can still get a single warning message at boot time.

http://marc.info/?l=linux-kernel&m=120496222629983&w=2

http://bugzilla.kernel.org/show_bug.cgi?id=12203

Signed-off-by: Zhang Rui<rui.zhang@intel.com>
Tested-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Len Brown <len.brown@intel.com>
89595b8f2850a080d290bf778ec933ea1d99f78e 08-Nov-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> ACPI: consolidate ACPI_*_COMPONENT definitions in acpi_drivers.h

Move all the component definitions for drivers to a single shared place,
include/acpi/acpi_drivers.h.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
0794469da3f7b2093575cbdfc1108308dd3641ce 30-Oct-2008 Kay Sievers <kay.sievers@vrfy.org> ACPI: struct device - replace bus_id with dev_name(), dev_set_name()

This patch is part of a larger patch series which will remove
the "char bus_id[20]" name string from struct device. The device
name is managed in the kobject anyway, and without any size
limitation, and just needlessly copied into "struct device".

To set and read the device name dev_name(dev) and dev_set_name(dev)
must be used. If your code uses static kobjects, which it shouldn't
do, "const char *init_name" can be used to statically provide the
name the registered device should have. At registration time, the
init_name field is cleared, to enforce the use of dev_name(dev) to
access the device name at a later time.

We need to get rid of all occurrences of bus_id in the entire tree
to be able to enable the new interface. Please apply this patch,
and possibly convert any remaining remaining occurrences of bus_id.

We want to submit a patch to -next, which will remove bus_id from
"struct device", to find the remaining pieces to convert, and finally
switch over to the new api, which will remove the 20 bytes array
and does no longer have a size limitation.

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Len Brown <len.brown@intel.com>
55ac9a018f83e4f42f3c6ce98a8dbda73b985935 28-Sep-2008 Lin Ming <ming.m.lin@intel.com> ACPI: replace ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ...) with printk

ACPI_DB_ERROR and ACPI_DB_WARN were removed from ACPICA core.
So replace ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ...) with printk(KERN_ERR PREFIX ...)
and ACPI_DEBUG_PRINT((ACPI_DB_WARN, ...) with printk(KERN_WARNING PREFIX ...)

We do not use ACPI_ERROR/ACPI_WARNING since they're not exported, see
-------------------------------------------------------------
commit 6468463abd7051fcc29f3ee7c931f9bbbb26f5a4
Author: Len Brown <len.brown@intel.com>
Date: Mon Jun 26 23:41:38 2006 -0400

ACPI: un-export ACPI_ERROR() -- use printk(KERN_ERR...)

Signed-off-by: Len Brown <len.brown@intel.com>
-------------------------------------------------------------

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
22a94d79a34bf010d11996d30eed8ee3fc1a4fbf 17-Oct-2008 Zhang Rui <rui.zhang@intel.com> ACPI: Allow overriding to higher critical trip point.

http://bugzilla.kernel.org/show_bug.cgi?id=9129

lenb: Note that overriding a critical trip point
may simply fool the user into thinking that they
have control that they do not actually have.
For it is EC firmware that decides when the EC
sends Linux temperature change events, and the
EC may or may not decide to send Linux these events
anywhere in the neighborhood of the fake
override trip points. Beware.

note also that thermal.nocrt is already available
to disable crtical trip point actios,
and thermal.crt=-1 is already available to
disabled critical trip points entirely.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
27663c5855b10af9ec67bc7dfba001426ba21222 10-Oct-2008 Matthew Wilcox <willy@linux.intel.com> ACPI: Change acpi_evaluate_integer to support 64-bit on 32-bit kernels

As of version 2.0, ACPI can return 64-bit integers. The current
acpi_evaluate_integer only supports 64-bit integers on 64-bit platforms.
Change the argument to take a pointer to an acpi_integer so we support
64-bit integers on all platforms.

lenb: replaced use of "acpi_integer" with "unsigned long long"
lenb: fixed bug in acpi_thermal_trips_update()

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
db89b4f0dbab837d0f3de2c3e9427a8d5393afa3 22-Sep-2008 Pavel Machek <pavel@suse.cz> ACPI: catch calls of acpi_driver_data on pointer of wrong type

Catch attempts to use of acpi_driver_data on pointers of wrong type.

akpm: rewritten to use proper C typechecking and remove the
"function"-used-as-lvalue thing.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
fc3a8828b139c24aade3f9d608775e36c248f8f5 02-May-2008 Greg Kroah-Hartman <gregkh@suse.de> driver core: fix a lot of printk usages of bus_id

We have the dev_printk() variants for this kind of thing, use them
instead of directly trying to access the bus_id field of struct device.

This is done in order to remove bus_id entirely.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ea51011a27db48ea0a80a5e20de3969b292d5d4d 14-Jul-2008 Zhao Yakui <yakui.zhao@intel.com> ACPI : Set FAN device to correct state in boot phase

Subject:ACPI: Set FAN device to correct state in boot phase
From: Zhao Yakui <yakui.zhao@intel.com>

On some laptops when ACPI FAN driver is loaded, maybe the FAN device will be
turned on. But if the temperature is below the threshold, the corresponding
FAN device should be turned off in the course of loading thermal driver.

So it is necessary to set the FAN device to the correct state in course of loading
the thermal driver.

http://bugzilla.kernel.org/show_bug.cgi?id=8049

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
a39a2d7c72b358c6253a2ec28e17b023b7f6f41c 20-May-2008 Arjan van de Ven <arjan@linux.intel.com> ACPI: Reject below-freezing temperatures as invalid critical temperatures

My laptop thinks that it's a good idea to give -73C as the critical
CPU temperature.... which isn't the best thing since it causes a shutdown
right at bootup.

Temperatures below freezing are clearly invalid critical thresholds
so just reject these as such.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
cf7acfab032ff262f42954328cdfd20a5d9aaaac 29-Apr-2008 Denis V. Lunev <den@openvz.org> acpi: use non-racy method for proc entries creation

Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.

Add correct ->owner to proc_fops to fix reading/module unloading race.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
76ecb4f2d7ea5c3aac8970b9529775316507c6d2 10-Apr-2008 Zhang, Rui <rui.zhang@intel.com> ACPI: update thermal temperature

Fix the problem that thermal_get_temp returns the cached value,
which causes the temperature in generic thermal never updates.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
e9ae71078b2c8657c0e8de808b76b76049806906 22-Apr-2008 Zhang Rui <rui.zhang@intel.com> thermal: update the documentation

Update the documentation for the thermal driver hwmon sys I/F.

Change the ACPI thermal zone type to be consistent with hwmon.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
9ec732ff80b7e8a9096666f78ae584d3b393bc84 10-Apr-2008 Zhang, Rui <rui.zhang@intel.com> thermal: add new get_crit_temp callback

Add a new callback so that the generic thermal can get
the critical trip point info of a thermal zone,
which is needed for building the tempX_crit hwmon sysfs attribute.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
d83fd8a26769c75d51a6b05d8dcb3e36302dd8ba 28-Apr-2008 Andrew Morton <akpm@linux-foundation.org> drivers/acpi/thermal.c: fix build with CONFIG_DMI=n

drivers/acpi/thermal.c: In function 'acpi_thermal_init':
drivers/acpi/thermal.c:1794: error: 'thermal_dmi_table' undeclared (first use in this function)
drivers/acpi/thermal.c:1794: error: (Each undeclared identifier is reported only once
drivers/acpi/thermal.c:1794: error: for each function it appears in.)

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
bb070e43497d4fcfea7d8b52003fe1376c218343 09-Apr-2008 Krzysztof Helt <krzysztof.h1@wp.pl> acpi thermal: fix result check

thermal_zone_device_register() uses the ERR_PTR macro on its return values. A
correct check is to use the IS_ERR() macro.

The 2.6.25 kernels panic on Compaq AP550 without this patch as it has more
then 10 (THERMAL_MAX_TRIPS) trip points (there are 12).

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Len Brown <lenb@kernel.org>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
5e012760dfd5ec24c41b9eab9e654a88360bb026 28-Feb-2008 Zhang, Rui <rui.zhang@intel.com> ACPI: thermal: show temperature in millidegree Celsius

as now required by the generic thermal I/F

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
653a00c9662304ef72a3eb4e681c91720960e0b4 17-Jan-2008 Zhang Rui <rui.zhang@intel.com> ACPI: thermal fixup

The alias name may be used in _PSL, _ALx and _TZD,
so we bind the cooling device only if the acpi_device node matches.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Thomas Sujith <sujith.thomas@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
041d4bbf128f645fe53bb22309efb9db14dbf5b5 17-Jan-2008 Zhang Rui <rui.zhang@intel.com> 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 <rui.zhang@intel.com>
Signed-off-by: Thomas Sujith <sujith.thomas@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
207339398ecb0835331c748612898dad2a09fdec 17-Jan-2008 Zhang Rui <rui.zhang@intel.com> 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 <rui.zhang@intel.com>
Signed-off-by: Thomas Sujith <sujith.thomas@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
ce44e19701ac1de004815c225585ff617c5948b4 17-Jan-2008 Zhang Rui <rui.zhang@intel.com> ACPI: ACPI thermal zone handle notification correctly

Change the ACPI thermal action upon notification 0x81 and 0x82.

According to the ACPI spec, we should:
re-evaluate _PSV and _ACx methods upon notification 0x81
re-evaluate _PSL and _ALx and _TZD upon notificaiton 0x82.
But the current code re-evaluates all the trip points for 0x81 while
only re-evaluates _TZD for 0x82.

Fix this violation of ACPI spec.

TODO: devices in _PSL, _ALx and _TZD may change after a notification 0x82.
At this time, we need to re-bind the cooling devices with the thermal zone.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Thomas Sujith <sujith.thomas@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
3f655ef8c439e0775ffb7d1ead5d1d4f060e1f8b 17-Jan-2008 Zhang Rui <rui.zhang@intel.com> ACPI: register ACPI thermal zone as generic thermal zone devices

Register ACPI thermal zone as thermal zone device.

the new sys I/F for ACPI thermal zone will be like this:

/sys/class/thermal:
|thermal_zone1:
|-----type: "ACPI thermal zone". RO
|-----temp: the current temperature. RO
|-----mode: the current working mode. RW.
the default value is "kernel" which means thermal
management is done by ACPI thermal driver.
"echo user > mode" prevents all the ACPI thermal driver
actions upon any trip points.
|-----trip_point_0_temp: the threshold of trip point 0. RO.
|-----trip_point_0_type: "critical". RO.
the type of trip point 0
This may be one of critical/hot/passive/active[x]
for an ACPI thermal zone.
...
|-----trip_point_3_temp:
|-----trip_point_3_type: "active[1]"

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Thomas Sujith <sujith.thomas@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
223630fe3dc564b94e51ff4eb839828c9083f2f6 07-Dec-2007 Zhang Rui <rui.zhang@intel.com> export thermal notification to userspace when nocrt is set

module parameter is used to prevent the thermal_zone action upon
critical trip points.
But exporting this notification to userspace is still useful.
By setting nocrt with this patch applied, ACPI will take no action
but exporting the events to userspace upon critical/hot trip points.

http://bugzilla.kernel.org/show_bug.cgi?id=9139

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
1855256c497ecfefc730df6032243f26855ce52c 03-Oct-2007 Jeff Garzik <jeff@garzik.org> drivers/firmware: const-ify DMI API and internals

Three main sets of changes:

1) dmi_get_system_info() return value should have been marked const,
since callers should not be changing that data.

2) const-ify DMI internals, since DMI firmware tables should,
whenever possible, be marked const to ensure we never ever write to
that data area.

3) const-ify DMI API, to enable marking tables const where possible
in low-level drivers.

And if we're really lucky, this might enable some additional
optimizations on the part of the compiler.

The bulk of the changes are #2 and #3, which are interrelated. #1 could
have been a separate patch, but it was so small compared to the others,
it was easier to roll it into this changeset.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
6e2157858ac94530fddbf19dc59ab6b392baf1f3 31-Aug-2007 Alexey Starikovskiy <astarikovskiy@suse.de> ACPI: Thermal: Drop concurrent thermal checks

Fix for #3686, where get_temperature() may cause thermal notify, which
causes one more get_temperature().

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
21bc42ab852549f4a547d18d77e0e4d1b24ffd96 04-Sep-2007 Len Brown <len.brown@intel.com> ACPI: thermal: use round_jiffies when thermal zone polling is enabled

Properly functioning systems do not use thermal zone polling,
they use event-based notification.

However, some users enable periodic thermal zone polling
to work around bugs on their platforms, and at least one
platform exists with a real _TZP that requests polling.

While thermal zone polling (_TZP) is specified in units to 0.1 seconds,
it actually has a maximum granularity of 1 second. Thus, we can safely
round up the _TZP timeout to occur on the next 1-second boundary.
This will batch it with other 1-second-granularity timers in the
system and thus potentially extend processor idle duration.

Note that the same timer is used both for _TZP
and for passive processor thermal throttling.
We can not round up the timeout when it is used
for passive thermal throttling.

Also, we can not make this a deferrable timer,
as temperature is just as relevant during idle
as it is during non-idle.

Signed-off-by: Len Brown <len.brown@intel.com>
2db9ccba8d4bb8e3aa6d0cd8e7544c5736963bbc 24-Aug-2007 Pavel Machek <pavel@ucw.cz> ACPI: /proc/acpi/thermal_zone trip points are now read-only, mark them as such

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Len Brown <len.brown@intel.com>
14e04fb34ffa82ee61ae69f98d8fca12d2e8e31c 23-Aug-2007 Len Brown <len.brown@intel.com> ACPI: Schedule /proc/acpi/event for removal

Schedule /proc/acpi/event for removal in 6 months.

Re-name acpi_bus_generate_event() to acpi_bus_generate_proc_event()
to make sure there is no confusion that it is for /proc/acpi/event only.

Add CONFIG_ACPI_PROC_EVENT to allow removal of /proc/acpi/event.
There is no functional change if CONFIG_ACPI_PROC_EVENT=y

Signed-off-by: Len Brown <len.brown@intel.com>
962ce8ca0604af0c3c5609f7613d4ec5fcfac623 22-Aug-2007 Zhang Rui <rui.zhang@intel.com> ACPI: don't duplicate input events on netlink

The previous events patch added a netlink event for every
user of the legacy /proc/acpi/event interface.

However, some users of /proc/acpi/event are really input events,
and they already report their events via the input layer.

Introduce a new interface, acpi_bus_generate_netlink_event(),
which is explicitly called by devices that want to repoprt
events via netlink. This allows the input-like events
to opt-out of generating netlink events. In summary:

events that are sent via netlink:
ac/battery/sbs
thermal
processor
thinkpad_acpi dock/bay

events that are sent via input layer:
button
video hotkey
thinkpad_acpi hotkey
asus_acpi/asus-laptop hotkey
sonypi/sonylaptop

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
8c99fdce30787b0d1fc00b907d4cd55a714e4cdd 21-Aug-2007 Len Brown <len.brown@intel.com> ACPI: thermal: set "thermal.nocrt" via DMI on Gigabyte GA-7ZX

This system BIOS sets a critical temperature to 65C,
which is too low.

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=155496

Signed-off-by: Len Brown <len.brown@intel.com>
c52a7419af18594426bc601d1ea346dbbcf71e28 14-Aug-2007 Len Brown <len.brown@intel.com> ACPI: thermal: create "thermal.crt=C" bootparam

Some hardware will malfunction at a temperature below
the BIOS provided critical shutdown threshold.

This hook allows moving the critical trip points down
to a temperature which provokes a graceful shutdown
before the hardware malfunction.

http://bugzilla.kernel.org/show_bug.cgi?id=8884

WARNING: A trip-point override will not get noticed
until the system delivers a temperature change event,
or unless thermal zone polling is enabled.
eg. "thermal.tzp=10"

Signed-off-by: Len Brown <len.brown@intel.com>
3c1d36da1d5ed36979340efd233ddaacc45b0a02 14-Aug-2007 Len Brown <len.brown@intel.com> ACPI: thermal: clean up MODULE_PARM_DESC newlines

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Len Brown <len.brown@intel.com>
0b5bfa1cbefdc6e4c60f30ed545389b5ffe0f75f 12-Aug-2007 Len Brown <len.brown@intel.com> ACPI: thermal: add DMI hooks to handle AOpen's broken Award BIOS

Use DMI to:
1. enable polling (BIOS thermal events are broken)
2. disable active trip points (BIOS fan control is broken)
3. disable passive trip point (BIOS hard-codes it too low)

The actual temperature reading does work,
and with the aid of polling, the critical
trip point should work too.

http://bugzilla.kernel.org/show_bug.cgi?id=8842

Signed-off-by: Len Brown <len.brown@intel.com>
f8707ec9643769957065405b5090e4aa64fd8214 12-Aug-2007 Len Brown <len.brown@intel.com> ACPI: thermal: create "thermal.act=" to disable or override active trip point

thermal.act=-1 disables all active trip points
in all ACPI thermal zones.

thermal.act=C, where C > 0, overrides all lowest temperature
active trip points in all thermal zones to C degrees Celsius.
Raising this trip-point may allow you to keep your system silent
up to a higher temperature. However, it will not allow you to
raise the lowest temperature trip point above the next higher
trip point (if there is one). Lowering this trip point may
kick in the fan sooner.

Note that overriding this trip-point will disable any BIOS attempts
to implement hysteresis around the lowest temperature trip point.
This may result in the fan starting and stopping frequently
if temperature frequently crosses C.

WARNING: raising trip points above the manufacturer's defaults
may cause the system to run at higher temperature and shorten
its life.

Signed-off-by: Len Brown <len.brown@intel.com>
f54871456162aff557d57bec51639b1288d4a84b 12-Aug-2007 Len Brown <len.brown@intel.com> ACPI: thermal: create "thermal.nocrt" to disable critical actions

thermal.nocrt=1 disables actions on _CRT and _HOT
ACPI thermal zone trip-points. They will be marked
as <disabled> in /proc/acpi/thermal_zone/*/trip_points.

There are two cases where this option is used:

1. Debugging a hot system crossing valid trip point.

If your system fan is spinning at full speed,
be sure that the vent is not clogged with dust.
Many laptops have very fine thermal fins that are easily blocked.

Check that the processor fan-sink is properly seated,
has the proper thermal grease, and is really spinning.

Check for fan related options in BIOS SETUP.
Sometimes there is a performance vs quiet option.
Defaults are generally the most conservative.

If your fan is not spinning, yet /proc/acpi/fan/
has files in it, please file a Linux/ACPI bug.

WARNING: you risk shortening the lifetime of your
hardware if you use this parameter on a hot system.
Note that this refers to all system components,
including the disk drive.

2. Working around a cool system crossing critical
trip point due to erroneous temperature reading.

Try again with CONFIG_HWMON=n
There is known potential for conflict between the
the hwmon sub-system and the ACPI BIOS.
If this fixes it, notify lm-sensors@lm-sensors.org
and linux-acpi@vger.kernel.org

Otherwise, file a Linux/ACPI bug, or notify
just linux-acpi@vger.kernel.org.

Signed-off-by: Len Brown <len.brown@intel.com>
a70cdc5200b0eb9fc3ef64efb29baac9b2cf2431 12-Aug-2007 Len Brown <len.brown@intel.com> ACPI: thermal: create "thermal.psv=" to override passive trip points

"thermal.psv=-1" disables passive trip points
for all ACPI thermal zones.

"thermal.psv=C", where 'C' is degrees Celsius,
overrides all existing passive trip points
for all ACPI thermal zones.

thermal.psv is checked at module load time,
and in response to trip-point change events.

Note that if the system does not deliver thermal zone
temperature change events near the new trip-point,
then it will not be noticed. To force your custom
trip point to be noticed, you may need to enable polling:
eg. thermal.tzp=3000 invokes polling every 5 minutes.

Note that once passive thermal throttling is invoked,
it has its own internal Thermal Sampling Period (_TSP),
that is unrelated to _TZP.

WARNING: disabling or raising a thermal trip point
may result in increased running temperature and
shorter hardware lifetime on some systems.

Signed-off-by: Len Brown <len.brown@intel.com>
730ff34de766a6fddee25ac1c32bc49c1a2fd758 12-Aug-2007 Len Brown <len.brown@intel.com> ACPI: thermal: expose "thermal.tzp=" to set global polling frequency

Thermal Zone Polling frequency (_TZP) is an optional ACPI object
recommending the rate that the OS should poll the associated thermal zone.

If _TZP is 0, no polling should be used.
If _TZP is non-zero, then the platform recommends that
the OS poll the thermal zone at the specified rate.
The minimum period is 30 seconds.
The maximum period is 5 minutes.

(note _TZP and thermal.tzp units are in deci-seconds,
so _TZP = 300 corresponds to 30 seconds)

If _TZP is not present, ACPI 3.0b recommends that the
thermal zone be polled at an "OS provided default frequency".

However, common industry practice is:
1. The BIOS never specifies any _TZP
2. High volume OS's from this century never poll any thermal zones

Ie. The OS depends on the platform's ability to
provoke thermal events when necessary, and
the "OS provided default frequency" is "never":-)

There is a proposal that ACPI 4.0 be updated to reflect
common industry practice -- ie. no _TZP, no polling.

The Linux kernel already follows this practice --
thermal zones are not polled unless _TZP is present and non-zero.

But thermal zone polling is useful as a workaround for systems
which have ACPI thermal control, but have an issue preventing
thermal events. Indeed, some Linux distributions still
set a non-zero thermal polling frequency for this reason.

But rather than ask the user to write a polling frequency
into all the /proc/acpi/thermal_zone/*/polling_frequency
files, here we simply document and expose the already
existing module parameter to do the same at system level,
to simplify debugging those broken platforms.

Note that thermal.tzp is a module-load time parameter only.

Signed-off-by: Len Brown <len.brown@intel.com>
72b33ef8bb1ac7f6c5a16d23304ab25ddc73d93d 12-Aug-2007 Len Brown <len.brown@intel.com> ACPI: thermal: create "thermal.off=1" to disable ACPI thermal support

"thermal.off=1" disables all ACPI thermal support at boot time.

CONFIG_ACPI_THERMAL=n can do this at build time.
"# rmmod thermal" can do this at run time,
as long as thermal is built as a module.

WARNING: On some systems, disabling ACPI thermal support
will cause the system to run hotter and reduce the
lifetime of the hardware.

Signed-off-by: Len Brown <len.brown@intel.com>
1ba90e3a87c46500623afdc3898573e4a5ebb21b 23-Jul-2007 Thomas Renninger <trenn@suse.de> ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI drivers

modpost is going to use these to create e.g. acpi:ACPI0001
in modules.alias.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
10a0a8d4e3f6bf2d077f94344441909abe670f5a 18-Jul-2007 Jeremy Fitzhardinge <jeremy@xensource.com> Add common orderly_poweroff()

Various pieces of code around the kernel want to be able to trigger an
orderly poweroff. This pulls them together into a single
implementation.

By default the poweroff command is /sbin/poweroff, but it can be set
via sysctl: kernel/poweroff_cmd. This is split at whitespace, so it
can include command-line arguments.

This patch replaces four other instances of invoking either "poweroff"
or "shutdown -h now": two sbus drivers, and acpi thermal
management.

sparc64 has its own "powerd"; still need to determine whether it should
be replaced by orderly_poweroff().

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Acked-by: Len Brown <lenb@kernel.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David S. Miller <davem@davemloft.net>
e7c746ef098770f863ba294adac5b30d124ba469 18-Jun-2007 Thomas Renninger <trenn@suse.de> ACPI: gracefully print null trip-point device

if acpi_bus_get_device() returns NULL, print nothing
instead of "<NUL" in /proc/acpi/thermal_zone/*/trip_points

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
68ccfaa8222f2a26f0689fad9e8c0c3f4c19f599 19-Nov-2006 Thomas Renninger <trenn@suse.de> ACPI: thermal: Replace pointer with name in trip_points

For users with active thermal trip points, they need
the fan's name, rather than its address, to understand
where to look to observe and control fan state.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
eaca2d3f6c4de9d4274a4e2be54c9693e76b0303 01-May-2007 Len Brown <len.brown@intel.com> ACPI: delete un-reliable concept of cooling mode

The scheme where the thermal driver displayed the
cooling mode /proc/acpi/thermal_zone/*/cooling_mode
was flawed in two ways.

First, the success of _SCP doesn't actually mean
that the BIOS moved any trip points.
On many BIOS, _SCP is present, but does nothing.
So displaying what _SCP executed actually
was wrong more times than it was right.

Second, examining the relative position of the
trip points when the thermal_zone is added
is insufficient -- as the BIOS reserves the right
to change the trip points at run-time.

The only reliable way for the user to determine if
the thermal zone is in active, passive, or critical
mode is to examine the relative position of the trip points.
The user can do this without the kernel doing it
for them by looking in /proc/acpi/thermal_zone/*/trip_points

New contents for /proc/acpi/thermal_zone/*/cooling_mode:

If _SCP available:
"0 - Active; 1 - Passive\n"

If _SCP unavailable:
"<setting not supported>\n"

Signed-off-by: Len Brown <len.brown@intel.com>
11ccc0f249cb01a129f54760b8ff087f242935d4 01-May-2007 Len Brown <len.brown@intel.com> ACPI: thermal trip points are read-only

/proc/acpi/thermal_zone/*/trip_points displays
what the kernel reads from the BIOS via ACPI.

If you echo a string of ':' deliminted numbers to this file
then it will change what it displays.

But it shouldn't, since the kernel has no way to communicate
these changes to ACPI thermal zones. ACPI thermal zone
trip points are read-only.

The kernel does have the opportunity to ask the BIOS to change
the trip points with _SCP - Set Cooling Policy.

Request Active Cooling Mode:
# echo 0 > /proc/acpi/thermal_zone/*/cooling_policy

Request Passive Cooling Mode:
# echo 1 > /proc/acpi/thermal_zone/*/cooling_policy

However, in practice it is quite rare for the BIOS
to support the optional _SCP, and it is even more rare
for the BIOS to export an _SCP that actually changes
the trip points.

Signed-off-by: Len Brown <len.brown@intel.com>
94e22e13ad063c614b458a019b428ffc118e5c06 23-Apr-2007 Andrew Morton <akpm@linux-foundation.org> acpi-thermal: fix mod_timer() interval

Use relative time, not absolute. Discovered by Jung-Ik (John) Lee
<jilee@google.com>.

Cc: Jung-Ik (John) Lee <jilee@google.com>
Acked-by: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
b1028c545ced13590dd9a9a8086543aef26c7187 16-Feb-2007 Konstantin Karasyov <konstantin.a.karasyov@intel.com> ACPI: fix fan after resume from S3

http://bugzilla.kernel.org/show_bug.cgi?id=7570

Signed-off-by: Konstantin Karasyov <konstantin.a.karasyov@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
636cedf9df6a6442364e78b51925f306a1056e43 16-Feb-2007 Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk> ACPI: thermal: fix units in debug output

http://bugzilla.kernel.org/show_bug.cgi?id=4972

Signed-off-by: Len Brown <len.brown@intel.com>
cd354f1ae75e6466a7e31b727faede57a1f89ca5 14-Feb-2007 Tim Schmielau <tim@physik3.uni-rostock.de> [PATCH] remove many unneeded #includes of sched.h

After Al Viro (finally) succeeded in removing the sched.h #include in module.h
recently, it makes sense again to remove other superfluous sched.h includes.
There are quite a lot of files which include it but don't actually need
anything defined in there. Presumably these includes were once needed for
macros that used to live in sched.h, but moved to other header files in the
course of cleaning it up.

To ease the pain, this time I did not fiddle with any header files and only
removed #includes from .c-files, which tend to cause less trouble.

Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
configs in arch/arm/configs on arm. I also checked that no new warnings were
introduced by the patch (actually, some warnings are removed that were emitted
by unnecessarily included header files).

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7cda93e008e1a477970adbf82dba81a5d4f0ae40 13-Feb-2007 Len Brown <len.brown@intel.com> ACPI: delete extra #defines in /drivers/acpi/ drivers

Cosmetic only.

Except in a single case, #define ACPI_*_DRIVER_NAME
were invoked 0 or 1 times.

Signed-off-by: Len Brown <len.brown@intel.com>
c2b6705b75d9c7aff98a4602a32230639e10891c 13-Feb-2007 Len Brown <len.brown@intel.com> ACPI: fix acpi_driver.name usage

It was erroneously used as a description rather than a name.

ie. turn this:

lenb@se7525gp2:/sys> ls bus/acpi/drivers
ACPI AC Adapter Driver ACPI Embedded Controller Driver ACPI Power Resource Driver
ACPI Battery Driver ACPI Fan Driver ACPI Processor Driver
ACPI Button Driver ACPI PCI Interrupt Link Driver ACPI Thermal Zone Driver
ACPI container driver ACPI PCI Root Bridge Driver hpet

into this:

lenb@se7525gp2:~> ls /sys/bus/acpi/drivers
ac battery button container ec fan hpet pci_link pci_root power processor thermal

Signed-off-by: Len Brown <len.brown@intel.com>
f52fd66d2ea794010c2d7536cf8e6abed0ac4947 13-Feb-2007 Len Brown <len.brown@intel.com> ACPI: clean up ACPI_MODULE_NAME() use

cosmetic only

Make "module name" actually match the file name.
Invoke with ';' as leaving it off confuses Lindent and gcc doesn't care.
Fix indentation where Lindent did get confused.

Signed-off-by: Len Brown <len.brown@intel.com>
36bcbec7ce21e2e8b3143b11a05747330abeca70 19-Dec-2006 Burman Yan <yan_952@hotmail.com> ACPI: replace kmalloc+memset with kzalloc

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
5d9464a46918ced087c351a10f38cee95725f85b 07-Dec-2006 Patrick Mochel <mochel@linux.intel.com> ACPI: add ACPI bus_type for driver model

Add ACPI bus_type for Linux driver model.

1. .shutdown method is added into acpi_driver.ops
needed by bus_type operations.
2. remove useless parameter 'int state' in .resume method.
3. change parameter 'int state'
to 'pm_message_t state' in .suspend method.

Note: The new .uevent method mark ACPI drivers by PNPID instead of by name.
Udev script needs to look for "HWID=" or "COMPTID=" to load
ACPI drivers as a result.

Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
50dd096973f1d95aa03c6a6d9e148d706b62b68e 01-Oct-2006 Jan Engelhardt <jengelh@linux01.gwdg.de> ACPI: Remove unnecessary from/to-void* and to-void casts in drivers/acpi

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Len Brown <len.brown@intel.com>
bed936f7eab946c60170bc92a1aea597da158e02 10-Jul-2006 Konstantin Karasyov <konstantin.a.karasyov@intel.com> [PATCH] ACPI: fix fan/thermal resume

Daniel Ritz <daniel.ritz-ml@swissonline.ch> says:

The acpi driver suspend/resume patches that went in recently caused a regression
on my box (toshiba tecra 8000 laptop): after resume from swsusp the fan turns on
keeping blowing cold air out of my notebook. before the patches, the fan was off
and would only make noise when required. it's the same thing described in
bugzilla.kernel.org #5000. the acpi suspend/resume patches or at least parts of
them originate in this bug. now the last patch in the report (attach id 8438)
actually fixes the problem - for me and the reporter. this is a trimmed down
version of that patch.

Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Cc: Len Brown <len.brown@intel.com>
Cc: Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk>
Cc: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
d75080328affb4b268da430b7074cc8139cc662a 04-Jul-2006 Arjan van de Ven <arjan@infradead.org> ACPI: add 'const' to several ACPI file_operations

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
8a4444bf5a3fd890441e6cbd5022a3c24edbe69a 19-May-2006 Patrick Mochel <mochel@linux.intel.com> ACPI: thermal: Remove unneeded acpi_handle from driver.

Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
38ba7c9ed2e1a222103332031f76c28b726573f5 19-May-2006 Patrick Mochel <mochel@linux.intel.com> ACPI: thermal: Use acpi_device's handle instead of driver's

Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
8348e1b19a06b1932f65e84e1d59be29e1626c2b 19-May-2006 Patrick Mochel <mochel@linux.intel.com> ACPI: thermal: add struct acpi_device to struct acpi_thermal.

- Use it instead of acpi_bus_get_device() where we can..

Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
d550d98d3317378d93a4869db204725d270ec812 27-Jun-2006 Patrick Mochel <mochel@linux.intel.com> ACPI: delete tracing macros from drivers/acpi/*.c

Signed-off-by: Len Brown <len.brown@intel.com>
6468463abd7051fcc29f3ee7c931f9bbbb26f5a4 27-Jun-2006 Len Brown <len.brown@intel.com> ACPI: un-export ACPI_ERROR() -- use printk(KERN_ERR...)

Signed-off-by: Len Brown <len.brown@intel.com>
cece92969762b8ed7930d4e23008b76b06411dee 27-Jun-2006 Len Brown <len.brown@intel.com> ACPI: un-export ACPI_WARNING() -- use printk(KERN_WARNING...)

Signed-off-by: Len Brown <len.brown@intel.com>
a6fc67202e0224e6c9d1d285cc0b444bce887ed5 27-Jun-2006 Thomas Renninger <trenn@suse.de> ACPI: Enable ACPI error messages w/o CONFIG_ACPI_DEBUG

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
b8d35192c55fb055792ff0641408eaaec7c88988 05-May-2006 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> ACPI: execute Notify() handlers on new thread

http://bugzilla.kernel.org/show_bug.cgi?id=5534

Thanks to Peter Wainwright for isolating the issue.
Thanks to Andi Kleen and Bob Moore for feedback.
Thanks to Richard Mace and others for testing.
Updates by Konstantin Karasyov.

Signed-off-by: Konstantin Karasyov <konstantin.a.karasyov@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
74ce1468128e299fe6a85e7e78e528e45e72d6d9 08-May-2006 Konstantin Karasyov <konstantin.a.karasyov@intel.com> ACPI: create acpi_thermal_resume()

http://bugzilla.kernel.org/show_bug.cgi?id=4364

Signed-off-by: Konstantin Karasyov <konstantin.a.karasyov@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
09047e75f69428dcfa977b326256085154068b65 27-Apr-2006 Vasily Averin <vvs@sw.ru> ACPI: fix memory leak in acpi_thermal_add() error path

Signed-off-by: Vasily Averin <vvs@sw.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
fdc136ccd3332938e989439c025c363f8479f3e6 09-Mar-2006 Dave Jones <davej@redhat.com> [ACPI] fix possible acpi thermal leak in failure path

Coverity: #601

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
1cbf4c563c0eaaf11c552a88b374e213181c6ddd 16-Sep-2004 Thomas Renninger <trenn@suse.de> [ACPI] Allow return to active cooling mode once passive mode is entered

http://bugzilla.kernel.org/show_bug.cgi?id=3410
https://bugzilla.novell.com/show_bug.cgi?id=131543

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Konstantin Karasyov <konstantin.a.karasyov@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Yu Luming <luming.yu@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
4be44fcd3bf648b782f4460fd06dfae6c42ded4b 05-Aug-2005 Len Brown <len.brown@intel.com> [ACPI] Lindent all ACPI files

Signed-off-by: Len Brown <len.brown@intel.com>
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!