Re: [linux-pm] [RESEND PATCH v4 1/5] thermal: add generic cpufreq cooling implementation

2012-07-13 Thread amit kachhap
On Thu, Jul 12, 2012 at 8:40 PM, Valentin, Eduardo
eduardo.valen...@ti.com wrote:
 Amit,

 On Thu, Jul 12, 2012 at 4:41 PM, Amit Daniel Kachhap
 amit.kach...@linaro.org wrote:
 This patchset introduces a new generic cooling device based on cpufreq
 that can be used on non-ACPI platforms.  As a proof of concept, we have
 drivers for the following platforms using this mechanism now:

  * Samsung Exynos (Exynos4 and Exynos5) in the current patchset.
  * TI OMAP (git://git.linaro.org/people/amitdanielk/linux.git 
 omap4460_thermal)

 FYI, I have rewriten the OMAP BG driver and currently trying to push
 it to staging area. It should now support more omap versions. I will
 readapt the cpu cooling based on this patch.

 I am keeping the reworked driver here:
 g...@gitorious.org:thermal-framework/thermal-framework.git
 thermal_work/omap/bandgap_staging


Yes Eduardo, The link I have given here is slightly old. After your
implementation is done maybe this link can be updated.

Thanks,
Amit D
  * Freescale i.MX (git://git.linaro.org/people/amitdanielk/linux.git 
 imx6q_thermal)

 There is a small change in cpufreq cooling registration APIs, so a minor
 change is needed for OMAP and Freescale platforms.

 Brief Description:

 1) The generic cooling devices code is placed inside driver/thermal/*
as placing inside acpi folder will need un-necessary enabling of acpi
code.  This codes is architecture independent.

 2) This patchset adds generic cpu cooling low level implementation
through frequency clipping.  In future, other cpu related cooling
devices may be added here.  An ACPI version of this already exists
(drivers/acpi/processor_thermal.c) .  But this will be useful for
platforms like ARM using the generic thermal interface along with the
generic cpu cooling devices.  The cooling device registration API's
return cooling device pointers which can be easily binded with the
thermal zone trip points.  The important APIs exposed are,

a) struct thermal_cooling_device *cpufreq_cooling_register(
 struct freq_clip_table *tab_ptr, unsigned int tab_size)
b) void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)

 3) Samsung exynos platform thermal implementation is done using the
generic cpu cooling APIs and the new trip type.  The temperature sensor
driver present in the hwmon folder(registered as hwmon driver) is moved
to thermal folder and registered as a thermal driver.

 A simple data/control flow diagrams is shown below,

 Core Linux thermal -  Exynos thermal interface - Temperature 
 Sensor
   | |
  \|/|
   Cpufreq cooling device ---

 TODO:
 *Will send the DT enablement patches later after the driver is merged.

 This patch:

 Add support for generic cpu thermal cooling low level implementations
 using frequency scaling up/down based on the registration parameters.
 Different cpu related cooling devices can be registered by the user and
 the binding of these cooling devices to the corresponding trip points can
 be easily done as the registration APIs return the cooling device pointer.
 The user of these APIs are responsible for passing clipping frequency .
 The drivers can also register to recieve notification about any cooling
 action called.

 [a...@linux-foundation.org: fix comment layout]
 Signed-off-by: Amit Daniel Kachhap amit.kach...@linaro.org
 Cc: Donggeun Kim dg77@samsung.com
 Cc: Guenter Roeck guenter.ro...@ericsson.com
 Cc: SangWook Ju sw...@samsung.com
 Cc: Durgadoss durgados...@intel.com
 Cc: Len Brown l...@kernel.org
 Cc: Jean Delvare kh...@linux-fr.org
 Signed-off-by: Andrew Morton a...@linux-foundation.org
 ---
  Documentation/thermal/cpu-cooling-api.txt |   60 
  drivers/thermal/Kconfig   |   11 +
  drivers/thermal/Makefile  |3 +-
  drivers/thermal/cpu_cooling.c |  483 
 +
  include/linux/cpu_cooling.h   |   99 ++
  5 files changed, 655 insertions(+), 1 deletions(-)
  create mode 100644 Documentation/thermal/cpu-cooling-api.txt
  create mode 100644 drivers/thermal/cpu_cooling.c
  create mode 100644 include/linux/cpu_cooling.h

 diff --git a/Documentation/thermal/cpu-cooling-api.txt 
 b/Documentation/thermal/cpu-cooling-api.txt
 new file mode 100644
 index 000..557adb8
 --- /dev/null
 +++ b/Documentation/thermal/cpu-cooling-api.txt
 @@ -0,0 +1,60 @@
 +CPU cooling APIs How To
 +===
 +
 +Written by Amit Daniel Kachhap amit.kach...@linaro.org
 +
 +Updated: 12 May 2012
 +
 +Copyright (c)  2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
 +
 +0. Introduction
 +
 +The generic cpu cooling(freq clipping, cpuhotplug etc) provides
 +registration/unregistration APIs to the caller. The binding of the cooling
 +devices to the trip point is left for the user. The registration APIs 
 returns
 +the cooling 

Re: [linux-pm] [RESEND PATCH v4 1/5] thermal: add generic cpufreq cooling implementation

2012-07-13 Thread amit kachhap
On Fri, Jul 13, 2012 at 4:34 AM, Andrew Morton
a...@linux-foundation.org wrote:
 On Thu, 12 Jul 2012 19:11:04 +0530
 Amit Daniel Kachhap amit.kach...@linaro.org wrote:

 [a...@linux-foundation.org: fix comment layout]
 Signed-off-by: Amit Daniel Kachhap amit.kach...@linaro.org
 Cc: Donggeun Kim dg77@samsung.com
 Cc: Guenter Roeck guenter.ro...@ericsson.com
 Cc: SangWook Ju sw...@samsung.com
 Cc: Durgadoss durgados...@intel.com
 Cc: Len Brown l...@kernel.org
 Cc: Jean Delvare kh...@linux-fr.org
 Signed-off-by: Andrew Morton a...@linux-foundation.org

 Something strange appears to have happened here?  At a guess it seems
 that the patches were in my tree, I sent them to someone (Len?), then
 they were merged into linux-next by someone and then they fell
 out of linux-next again?

 If so, they will hopefully come back soon.  If not, something failed
 fairly seriously.

Hi Andrew,

Yes you are right that this patches first came into your tree and then
Len applied into his next tree for 3.5 merge. so they got into
linux-next tree. After some last minute pull issues they could not be
merged in 3.5 and Len dropped this series from his -next branch. I
hope to get it accepted in 3.6 merge.
I am aware that some work is going on for thermal framework
improvement but that will have minimal changes on cpufreq cooling APIs
and I hope to fix them as bug fix patches.



 I took a look at re-merging these patches into my tree, but there are
 significant conflicts with other work which has gone into linux-next.

Its my fault that I didn't check the hwmon-next branch. I will repost
them after merging with hwmon-next branch.

Thanks,
Amit Daniel
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 1/5] thermal: Add generic cpufreq cooling implementation

2012-07-13 Thread amit kachhap
On Fri, Jul 13, 2012 at 3:39 PM, Hongbo Zhang hongbo.zh...@linaro.org wrote:


 On 12 May 2012 17:40, Amit Daniel Kachhap amit.kach...@linaro.org wrote:

 This patch adds support for generic cpu thermal cooling low level
 implementations using frequency scaling up/down based on the registration
 parameters. Different cpu related cooling devices can be registered by the
 user and the binding of these cooling devices to the corresponding
 trip points can be easily done as the registration APIs return the
 cooling device pointer. The user of these APIs are responsible for
 passing clipping frequency . The drivers can also register to recieve
 notification about any cooling action called.

 Signed-off-by: Amit Daniel Kachhap amit.kach...@linaro.org
 ---
  Documentation/thermal/cpu-cooling-api.txt |   60 
  drivers/thermal/Kconfig   |   11 +
  drivers/thermal/Makefile  |3 +-
  drivers/thermal/cpu_cooling.c |  483
 +
  include/linux/cpu_cooling.h   |   99 ++
  5 files changed, 655 insertions(+), 1 deletions(-)
  create mode 100644 Documentation/thermal/cpu-cooling-api.txt
  create mode 100644 drivers/thermal/cpu_cooling.c
  create mode 100644 include/linux/cpu_cooling.h

 diff --git a/Documentation/thermal/cpu-cooling-api.txt
 b/Documentation/thermal/cpu-cooling-api.txt
 new file mode 100644
 index 000..557adb8
 --- /dev/null
 +++ b/Documentation/thermal/cpu-cooling-api.txt
 @@ -0,0 +1,60 @@
 +CPU cooling APIs How To
 +===
 +
 +Written by Amit Daniel Kachhap amit.kach...@linaro.org
 +
 +Updated: 12 May 2012
 +
 +Copyright (c)  2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
 +
 +0. Introduction
 +
 +The generic cpu cooling(freq clipping, cpuhotplug etc) provides
 +registration/unregistration APIs to the caller. The binding of the
 cooling
 +devices to the trip point is left for the user. The registration APIs
 returns
 +the cooling device pointer.
 +
 +1. cpu cooling APIs
 +
 +1.1 cpufreq registration/unregistration APIs
 +1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
 +   struct freq_clip_table *tab_ptr, unsigned int tab_size)
 +
 +This interface function registers the cpufreq cooling device with the
 name
 +thermal-cpufreq-%x. This api can support multiple instances of
 cpufreq
 +cooling devices.
 +
 +tab_ptr: The table containing the maximum value of frequency to be
 clipped
 +for each cooling state.
 +   .freq_clip_max: Value of frequency to be clipped for each allowed
 +cpus.
 +   .temp_level: Temperature level at which the frequency clamping
 will
 +   happen.
 +   .mask_val: cpumask of the allowed cpu's
 +tab_size: the total number of cpufreq cooling states.
 +
 +1.1.2 void cpufreq_cooling_unregister(struct thermal_cooling_device
 *cdev)
 +
 +This interface function unregisters the thermal-cpufreq-%x cooling
 device.
 +
 +cdev: Cooling device pointer which has to be unregistered.
 +
 +
 +1.2 CPU cooling action notifier register/unregister interface
 +1.2.1 int cputherm_register_notifier(struct notifier_block *nb,
 +   unsigned int list)
 +
 +This interface registers a driver with cpu cooling layer. The driver
 will
 +be notified when any cpu cooling action is called.
 +
 +nb: notifier function to register
 +list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
 +
 +1.2.2 int cputherm_unregister_notifier(struct notifier_block *nb,
 +   unsigned int list)
 +
 +This interface registers a driver with cpu cooling layer. The driver
 will
 +be notified when any cpu cooling action is called.
 +
 +nb: notifier function to register
 +list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
 diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
 index 514a691..d9c529f 100644
 --- a/drivers/thermal/Kconfig
 +++ b/drivers/thermal/Kconfig
 @@ -19,6 +19,17 @@ config THERMAL_HWMON
 depends on HWMON=y || HWMON=THERMAL
 default y

 +config CPU_THERMAL
 +   bool generic cpu cooling support
 +   depends on THERMAL  CPU_FREQ
 +   help
 + This implements the generic cpu cooling mechanism through
 frequency
 + reduction, cpu hotplug and any other ways of reducing
 temperature. An
 + ACPI version of this already
 exists(drivers/acpi/processor_thermal.c).
 + This will be useful for platforms using the generic thermal
 interface
 + and not the ACPI interface.
 + If you want this support, you should say Y or M here.

 No M value for bool item, should be N ?
Yes I will include this change.

 +
  config SPEAR_THERMAL
 bool SPEAr thermal sensor driver
 depends on THERMAL
 diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile
 index a9fff0b..30c456c 100644
 --- a/drivers/thermal/Makefile
 +++ b/drivers/thermal/Makefile
 @@ -3,4 +3,5 @@
  #

  obj-$(CONFIG_THERMAL)  += 

Re: [linux-pm] [RESEND PATCH v4 1/5] thermal: add generic cpufreq cooling implementation

2012-07-13 Thread rakesh singh
Hello everyone,

I am new to linux and i also want to contribute in linux community.
I am running Ubuntu 11.04 and i have downloaded linux-2.6.35.13 for
learning. so kindly tell me how to set up and starting kernel
development.
I did tried some books and websites but i am still unable to do some
productive work. So,, its my request that kindly help me in setting up
the environment and start learning.

Regards
Rakesh kumar
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RESEND PATCH v4 1/5] thermal: add generic cpufreq cooling implementation

2012-07-12 Thread Amit Daniel Kachhap
This patchset introduces a new generic cooling device based on cpufreq
that can be used on non-ACPI platforms.  As a proof of concept, we have
drivers for the following platforms using this mechanism now:

 * Samsung Exynos (Exynos4 and Exynos5) in the current patchset.
 * TI OMAP (git://git.linaro.org/people/amitdanielk/linux.git omap4460_thermal)
 * Freescale i.MX (git://git.linaro.org/people/amitdanielk/linux.git 
imx6q_thermal)

There is a small change in cpufreq cooling registration APIs, so a minor
change is needed for OMAP and Freescale platforms.

Brief Description:

1) The generic cooling devices code is placed inside driver/thermal/*
   as placing inside acpi folder will need un-necessary enabling of acpi
   code.  This codes is architecture independent.

2) This patchset adds generic cpu cooling low level implementation
   through frequency clipping.  In future, other cpu related cooling
   devices may be added here.  An ACPI version of this already exists
   (drivers/acpi/processor_thermal.c) .  But this will be useful for
   platforms like ARM using the generic thermal interface along with the
   generic cpu cooling devices.  The cooling device registration API's
   return cooling device pointers which can be easily binded with the
   thermal zone trip points.  The important APIs exposed are,

   a) struct thermal_cooling_device *cpufreq_cooling_register(
struct freq_clip_table *tab_ptr, unsigned int tab_size)
   b) void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)

3) Samsung exynos platform thermal implementation is done using the
   generic cpu cooling APIs and the new trip type.  The temperature sensor
   driver present in the hwmon folder(registered as hwmon driver) is moved
   to thermal folder and registered as a thermal driver.

A simple data/control flow diagrams is shown below,

Core Linux thermal -  Exynos thermal interface - Temperature Sensor
  | |
 \|/|
  Cpufreq cooling device ---

TODO:
*Will send the DT enablement patches later after the driver is merged.

This patch:

Add support for generic cpu thermal cooling low level implementations
using frequency scaling up/down based on the registration parameters.
Different cpu related cooling devices can be registered by the user and
the binding of these cooling devices to the corresponding trip points can
be easily done as the registration APIs return the cooling device pointer.
The user of these APIs are responsible for passing clipping frequency .
The drivers can also register to recieve notification about any cooling
action called.

[a...@linux-foundation.org: fix comment layout]
Signed-off-by: Amit Daniel Kachhap amit.kach...@linaro.org
Cc: Donggeun Kim dg77@samsung.com
Cc: Guenter Roeck guenter.ro...@ericsson.com
Cc: SangWook Ju sw...@samsung.com
Cc: Durgadoss durgados...@intel.com
Cc: Len Brown l...@kernel.org
Cc: Jean Delvare kh...@linux-fr.org
Signed-off-by: Andrew Morton a...@linux-foundation.org
---
 Documentation/thermal/cpu-cooling-api.txt |   60 
 drivers/thermal/Kconfig   |   11 +
 drivers/thermal/Makefile  |3 +-
 drivers/thermal/cpu_cooling.c |  483 +
 include/linux/cpu_cooling.h   |   99 ++
 5 files changed, 655 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/thermal/cpu-cooling-api.txt
 create mode 100644 drivers/thermal/cpu_cooling.c
 create mode 100644 include/linux/cpu_cooling.h

diff --git a/Documentation/thermal/cpu-cooling-api.txt 
b/Documentation/thermal/cpu-cooling-api.txt
new file mode 100644
index 000..557adb8
--- /dev/null
+++ b/Documentation/thermal/cpu-cooling-api.txt
@@ -0,0 +1,60 @@
+CPU cooling APIs How To
+===
+
+Written by Amit Daniel Kachhap amit.kach...@linaro.org
+
+Updated: 12 May 2012
+
+Copyright (c)  2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
+
+0. Introduction
+
+The generic cpu cooling(freq clipping, cpuhotplug etc) provides
+registration/unregistration APIs to the caller. The binding of the cooling
+devices to the trip point is left for the user. The registration APIs returns
+the cooling device pointer.
+
+1. cpu cooling APIs
+
+1.1 cpufreq registration/unregistration APIs
+1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
+   struct freq_clip_table *tab_ptr, unsigned int tab_size)
+
+This interface function registers the cpufreq cooling device with the name
+thermal-cpufreq-%x. This api can support multiple instances of cpufreq
+cooling devices.
+
+tab_ptr: The table containing the maximum value of frequency to be clipped
+for each cooling state.
+   .freq_clip_max: Value of frequency to be clipped for each allowed
+cpus.
+   .temp_level: Temperature level at which the frequency clamping will
+   happen.
+   .mask_val: cpumask of the allowed 

Re: [linux-pm] [RESEND PATCH v4 1/5] thermal: add generic cpufreq cooling implementation

2012-07-12 Thread Valentin, Eduardo
Amit,

On Thu, Jul 12, 2012 at 4:41 PM, Amit Daniel Kachhap
amit.kach...@linaro.org wrote:
 This patchset introduces a new generic cooling device based on cpufreq
 that can be used on non-ACPI platforms.  As a proof of concept, we have
 drivers for the following platforms using this mechanism now:

  * Samsung Exynos (Exynos4 and Exynos5) in the current patchset.
  * TI OMAP (git://git.linaro.org/people/amitdanielk/linux.git 
 omap4460_thermal)

FYI, I have rewriten the OMAP BG driver and currently trying to push
it to staging area. It should now support more omap versions. I will
readapt the cpu cooling based on this patch.

I am keeping the reworked driver here:
g...@gitorious.org:thermal-framework/thermal-framework.git
thermal_work/omap/bandgap_staging

  * Freescale i.MX (git://git.linaro.org/people/amitdanielk/linux.git 
 imx6q_thermal)

 There is a small change in cpufreq cooling registration APIs, so a minor
 change is needed for OMAP and Freescale platforms.

 Brief Description:

 1) The generic cooling devices code is placed inside driver/thermal/*
as placing inside acpi folder will need un-necessary enabling of acpi
code.  This codes is architecture independent.

 2) This patchset adds generic cpu cooling low level implementation
through frequency clipping.  In future, other cpu related cooling
devices may be added here.  An ACPI version of this already exists
(drivers/acpi/processor_thermal.c) .  But this will be useful for
platforms like ARM using the generic thermal interface along with the
generic cpu cooling devices.  The cooling device registration API's
return cooling device pointers which can be easily binded with the
thermal zone trip points.  The important APIs exposed are,

a) struct thermal_cooling_device *cpufreq_cooling_register(
 struct freq_clip_table *tab_ptr, unsigned int tab_size)
b) void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)

 3) Samsung exynos platform thermal implementation is done using the
generic cpu cooling APIs and the new trip type.  The temperature sensor
driver present in the hwmon folder(registered as hwmon driver) is moved
to thermal folder and registered as a thermal driver.

 A simple data/control flow diagrams is shown below,

 Core Linux thermal -  Exynos thermal interface - Temperature Sensor
   | |
  \|/|
   Cpufreq cooling device ---

 TODO:
 *Will send the DT enablement patches later after the driver is merged.

 This patch:

 Add support for generic cpu thermal cooling low level implementations
 using frequency scaling up/down based on the registration parameters.
 Different cpu related cooling devices can be registered by the user and
 the binding of these cooling devices to the corresponding trip points can
 be easily done as the registration APIs return the cooling device pointer.
 The user of these APIs are responsible for passing clipping frequency .
 The drivers can also register to recieve notification about any cooling
 action called.

 [a...@linux-foundation.org: fix comment layout]
 Signed-off-by: Amit Daniel Kachhap amit.kach...@linaro.org
 Cc: Donggeun Kim dg77@samsung.com
 Cc: Guenter Roeck guenter.ro...@ericsson.com
 Cc: SangWook Ju sw...@samsung.com
 Cc: Durgadoss durgados...@intel.com
 Cc: Len Brown l...@kernel.org
 Cc: Jean Delvare kh...@linux-fr.org
 Signed-off-by: Andrew Morton a...@linux-foundation.org
 ---
  Documentation/thermal/cpu-cooling-api.txt |   60 
  drivers/thermal/Kconfig   |   11 +
  drivers/thermal/Makefile  |3 +-
  drivers/thermal/cpu_cooling.c |  483 
 +
  include/linux/cpu_cooling.h   |   99 ++
  5 files changed, 655 insertions(+), 1 deletions(-)
  create mode 100644 Documentation/thermal/cpu-cooling-api.txt
  create mode 100644 drivers/thermal/cpu_cooling.c
  create mode 100644 include/linux/cpu_cooling.h

 diff --git a/Documentation/thermal/cpu-cooling-api.txt 
 b/Documentation/thermal/cpu-cooling-api.txt
 new file mode 100644
 index 000..557adb8
 --- /dev/null
 +++ b/Documentation/thermal/cpu-cooling-api.txt
 @@ -0,0 +1,60 @@
 +CPU cooling APIs How To
 +===
 +
 +Written by Amit Daniel Kachhap amit.kach...@linaro.org
 +
 +Updated: 12 May 2012
 +
 +Copyright (c)  2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
 +
 +0. Introduction
 +
 +The generic cpu cooling(freq clipping, cpuhotplug etc) provides
 +registration/unregistration APIs to the caller. The binding of the cooling
 +devices to the trip point is left for the user. The registration APIs returns
 +the cooling device pointer.
 +
 +1. cpu cooling APIs
 +
 +1.1 cpufreq registration/unregistration APIs
 +1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
 +   struct freq_clip_table *tab_ptr, unsigned int tab_size)
 +
 +This 

Re: [RESEND PATCH v4 1/5] thermal: add generic cpufreq cooling implementation

2012-07-12 Thread Andrew Morton
On Thu, 12 Jul 2012 19:11:04 +0530
Amit Daniel Kachhap amit.kach...@linaro.org wrote:

 [a...@linux-foundation.org: fix comment layout]
 Signed-off-by: Amit Daniel Kachhap amit.kach...@linaro.org
 Cc: Donggeun Kim dg77@samsung.com
 Cc: Guenter Roeck guenter.ro...@ericsson.com
 Cc: SangWook Ju sw...@samsung.com
 Cc: Durgadoss durgados...@intel.com
 Cc: Len Brown l...@kernel.org
 Cc: Jean Delvare kh...@linux-fr.org
 Signed-off-by: Andrew Morton a...@linux-foundation.org

Something strange appears to have happened here?  At a guess it seems
that the patches were in my tree, I sent them to someone (Len?), then
they were merged into linux-next by someone and then they fell
out of linux-next again?

If so, they will hopefully come back soon.  If not, something failed
fairly seriously.


I took a look at re-merging these patches into my tree, but there are
significant conflicts with other work which has gone into linux-next.

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 1/5] thermal: Add generic cpufreq cooling implementation

2012-07-11 Thread amit kachhap
On Tue, Jul 10, 2012 at 12:31 PM, Hongbo Zhang hongbo.zh...@linaro.org wrote:


 On 12 May 2012 17:40, Amit Daniel Kachhap amit.kach...@linaro.org wrote:

 This patch adds support for generic cpu thermal cooling low level
 implementations using frequency scaling up/down based on the registration
 parameters. Different cpu related cooling devices can be registered by the
 user and the binding of these cooling devices to the corresponding
 trip points can be easily done as the registration APIs return the
 cooling device pointer. The user of these APIs are responsible for
 passing clipping frequency . The drivers can also register to recieve
 notification about any cooling action called.

 Signed-off-by: Amit Daniel Kachhap amit.kach...@linaro.org
 ---
  Documentation/thermal/cpu-cooling-api.txt |   60 
  drivers/thermal/Kconfig   |   11 +
  drivers/thermal/Makefile  |3 +-
  drivers/thermal/cpu_cooling.c |  483
 +
  include/linux/cpu_cooling.h   |   99 ++
  5 files changed, 655 insertions(+), 1 deletions(-)
  create mode 100644 Documentation/thermal/cpu-cooling-api.txt
  create mode 100644 drivers/thermal/cpu_cooling.c
  create mode 100644 include/linux/cpu_cooling.h

 diff --git a/Documentation/thermal/cpu-cooling-api.txt
 b/Documentation/thermal/cpu-cooling-api.txt
 new file mode 100644
 index 000..557adb8
 --- /dev/null
 +++ b/Documentation/thermal/cpu-cooling-api.txt
 @@ -0,0 +1,60 @@
 +CPU cooling APIs How To
 +===
 +
 +Written by Amit Daniel Kachhap amit.kach...@linaro.org
 +
 +Updated: 12 May 2012
 +
 +Copyright (c)  2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
 +
 +0. Introduction
 +
 +The generic cpu cooling(freq clipping, cpuhotplug etc) provides
 +registration/unregistration APIs to the caller. The binding of the
 cooling
 +devices to the trip point is left for the user. The registration APIs
 returns
 +the cooling device pointer.
 +
 +1. cpu cooling APIs
 +
 +1.1 cpufreq registration/unregistration APIs
 +1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
 +   struct freq_clip_table *tab_ptr, unsigned int tab_size)
 +
 +This interface function registers the cpufreq cooling device with the
 name
 +thermal-cpufreq-%x. This api can support multiple instances of
 cpufreq
 +cooling devices.
 +
 +tab_ptr: The table containing the maximum value of frequency to be
 clipped
 +for each cooling state.
 +   .freq_clip_max: Value of frequency to be clipped for each allowed
 +cpus.
 +   .temp_level: Temperature level at which the frequency clamping
 will
 +   happen.
 +   .mask_val: cpumask of the allowed cpu's
 +tab_size: the total number of cpufreq cooling states.
 +
 +1.1.2 void cpufreq_cooling_unregister(struct thermal_cooling_device
 *cdev)
 +
 +This interface function unregisters the thermal-cpufreq-%x cooling
 device.
 +
 +cdev: Cooling device pointer which has to be unregistered.
 +
 +
 +1.2 CPU cooling action notifier register/unregister interface
 +1.2.1 int cputherm_register_notifier(struct notifier_block *nb,
 +   unsigned int list)
 +
 +This interface registers a driver with cpu cooling layer. The driver
 will
 +be notified when any cpu cooling action is called.
 +
 +nb: notifier function to register
 +list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
 +
 +1.2.2 int cputherm_unregister_notifier(struct notifier_block *nb,
 +   unsigned int list)
 +
 +This interface registers a driver with cpu cooling layer. The driver
 will
 +be notified when any cpu cooling action is called.
 +
 +nb: notifier function to register
 +list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
 diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
 index 514a691..d9c529f 100644
 --- a/drivers/thermal/Kconfig
 +++ b/drivers/thermal/Kconfig
 @@ -19,6 +19,17 @@ config THERMAL_HWMON
 depends on HWMON=y || HWMON=THERMAL
 default y

 +config CPU_THERMAL
 +   bool generic cpu cooling support
 +   depends on THERMAL  CPU_FREQ
 +   help
 + This implements the generic cpu cooling mechanism through
 frequency
 + reduction, cpu hotplug and any other ways of reducing
 temperature. An
 + ACPI version of this already
 exists(drivers/acpi/processor_thermal.c).
 + This will be useful for platforms using the generic thermal
 interface
 + and not the ACPI interface.
 + If you want this support, you should say Y or M here.
 +
  config SPEAR_THERMAL
 bool SPEAr thermal sensor driver
 depends on THERMAL
 diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile
 index a9fff0b..30c456c 100644
 --- a/drivers/thermal/Makefile
 +++ b/drivers/thermal/Makefile
 @@ -3,4 +3,5 @@
  #

  obj-$(CONFIG_THERMAL)  += thermal_sys.o
 -obj-$(CONFIG_SPEAR_THERMAL)+= spear_thermal.o
 

Re: [PATCH v4 1/5] thermal: Add generic cpufreq cooling implementation

2012-07-09 Thread amit kachhap
Hi Rob/Eduardo,

As these patches have still not made into mainline. I will rebase the
whole set along with your suggestion and send them shortly.
Sorry for late reply.

Thanks,
Amit Daniel

On Tue, Jun 26, 2012 at 1:12 PM, Valentin, Eduardo
eduardo.valen...@ti.com wrote:
 Hey Rob and Amit,

 On Tue, Jun 26, 2012 at 6:12 AM, Rob Lee rob@linaro.org wrote:
 Hey Amit,

 I was just re-organizing the imx thermal driver that uses this cpu
 cooling interface and noticed a couple of small issues here.   If

 While rewriting the OMAP BG driver on top of this series I noticed
 similar issues. Apart from those pointed by Rob, I have another minor
 fix.

 these suggestions are agreed upon and if it's too late for these
 issues be changed with this patchset, I can submit them separately
 unless you'd prefer to.

 On Sat, May 12, 2012 at 4:40 AM, Amit Daniel Kachhap
 amit.kach...@linaro.org wrote:
 This patch adds support for generic cpu thermal cooling low level
 implementations using frequency scaling up/down based on the registration
 parameters. Different cpu related cooling devices can be registered by the
 user and the binding of these cooling devices to the corresponding
 trip points can be easily done as the registration APIs return the
 cooling device pointer. The user of these APIs are responsible for
 passing clipping frequency . The drivers can also register to recieve
 notification about any cooling action called.

 Signed-off-by: Amit Daniel Kachhap amit.kach...@linaro.org
 ---
  Documentation/thermal/cpu-cooling-api.txt |   60 
  drivers/thermal/Kconfig   |   11 +
  drivers/thermal/Makefile  |3 +-
  drivers/thermal/cpu_cooling.c |  483 
 +
  include/linux/cpu_cooling.h   |   99 ++
  5 files changed, 655 insertions(+), 1 deletions(-)
  create mode 100644 Documentation/thermal/cpu-cooling-api.txt
  create mode 100644 drivers/thermal/cpu_cooling.c
  create mode 100644 include/linux/cpu_cooling.h

 diff --git a/Documentation/thermal/cpu-cooling-api.txt 
 b/Documentation/thermal/cpu-cooling-api.txt
 new file mode 100644
 index 000..557adb8
 --- /dev/null
 +++ b/Documentation/thermal/cpu-cooling-api.txt
 @@ -0,0 +1,60 @@
 +CPU cooling APIs How To
 +===
 +
 +Written by Amit Daniel Kachhap amit.kach...@linaro.org
 +
 +Updated: 12 May 2012
 +
 +Copyright (c)  2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
 +
 +0. Introduction
 +
 +The generic cpu cooling(freq clipping, cpuhotplug etc) provides
 +registration/unregistration APIs to the caller. The binding of the cooling
 +devices to the trip point is left for the user. The registration APIs 
 returns
 +the cooling device pointer.
 +
 +1. cpu cooling APIs
 +
 +1.1 cpufreq registration/unregistration APIs
 +1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
 +   struct freq_clip_table *tab_ptr, unsigned int tab_size)
 +
 +This interface function registers the cpufreq cooling device with the 
 name
 +thermal-cpufreq-%x. This api can support multiple instances of 
 cpufreq
 +cooling devices.
 +
 +tab_ptr: The table containing the maximum value of frequency to be 
 clipped
 +for each cooling state.
 +   .freq_clip_max: Value of frequency to be clipped for each allowed
 +cpus.
 +   .temp_level: Temperature level at which the frequency clamping will
 +   happen.
 +   .mask_val: cpumask of the allowed cpu's
 +tab_size: the total number of cpufreq cooling states.
 +
 +1.1.2 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
 +
 +This interface function unregisters the thermal-cpufreq-%x cooling 
 device.
 +
 +cdev: Cooling device pointer which has to be unregistered.
 +
 +
 +1.2 CPU cooling action notifier register/unregister interface
 +1.2.1 int cputherm_register_notifier(struct notifier_block *nb,
 +   unsigned int list)
 +
 +This interface registers a driver with cpu cooling layer. The driver 
 will
 +be notified when any cpu cooling action is called.
 +
 +nb: notifier function to register
 +list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
 +
 +1.2.2 int cputherm_unregister_notifier(struct notifier_block *nb,
 +   unsigned int list)
 +
 +This interface registers a driver with cpu cooling layer. The driver 
 will
 +be notified when any cpu cooling action is called.
 +
 +nb: notifier function to register
 +list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
 diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
 index 514a691..d9c529f 100644
 --- a/drivers/thermal/Kconfig
 +++ b/drivers/thermal/Kconfig
 @@ -19,6 +19,17 @@ config THERMAL_HWMON
depends on HWMON=y || HWMON=THERMAL
default y

 +config CPU_THERMAL

 Perhaps the name CPU_COOLING or CPUFREQ_COOLING would more accurately
 describe this functionality?  I like the latter since now this
 mechanism only supports 

Re: [PATCH v4 1/5] thermal: Add generic cpufreq cooling implementation

2012-06-26 Thread Valentin, Eduardo
Hey Rob and Amit,

On Tue, Jun 26, 2012 at 6:12 AM, Rob Lee rob@linaro.org wrote:
 Hey Amit,

 I was just re-organizing the imx thermal driver that uses this cpu
 cooling interface and noticed a couple of small issues here.   If

While rewriting the OMAP BG driver on top of this series I noticed
similar issues. Apart from those pointed by Rob, I have another minor
fix.

 these suggestions are agreed upon and if it's too late for these
 issues be changed with this patchset, I can submit them separately
 unless you'd prefer to.

 On Sat, May 12, 2012 at 4:40 AM, Amit Daniel Kachhap
 amit.kach...@linaro.org wrote:
 This patch adds support for generic cpu thermal cooling low level
 implementations using frequency scaling up/down based on the registration
 parameters. Different cpu related cooling devices can be registered by the
 user and the binding of these cooling devices to the corresponding
 trip points can be easily done as the registration APIs return the
 cooling device pointer. The user of these APIs are responsible for
 passing clipping frequency . The drivers can also register to recieve
 notification about any cooling action called.

 Signed-off-by: Amit Daniel Kachhap amit.kach...@linaro.org
 ---
  Documentation/thermal/cpu-cooling-api.txt |   60 
  drivers/thermal/Kconfig                   |   11 +
  drivers/thermal/Makefile                  |    3 +-
  drivers/thermal/cpu_cooling.c             |  483 
 +
  include/linux/cpu_cooling.h               |   99 ++
  5 files changed, 655 insertions(+), 1 deletions(-)
  create mode 100644 Documentation/thermal/cpu-cooling-api.txt
  create mode 100644 drivers/thermal/cpu_cooling.c
  create mode 100644 include/linux/cpu_cooling.h

 diff --git a/Documentation/thermal/cpu-cooling-api.txt 
 b/Documentation/thermal/cpu-cooling-api.txt
 new file mode 100644
 index 000..557adb8
 --- /dev/null
 +++ b/Documentation/thermal/cpu-cooling-api.txt
 @@ -0,0 +1,60 @@
 +CPU cooling APIs How To
 +===
 +
 +Written by Amit Daniel Kachhap amit.kach...@linaro.org
 +
 +Updated: 12 May 2012
 +
 +Copyright (c)  2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
 +
 +0. Introduction
 +
 +The generic cpu cooling(freq clipping, cpuhotplug etc) provides
 +registration/unregistration APIs to the caller. The binding of the cooling
 +devices to the trip point is left for the user. The registration APIs 
 returns
 +the cooling device pointer.
 +
 +1. cpu cooling APIs
 +
 +1.1 cpufreq registration/unregistration APIs
 +1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
 +       struct freq_clip_table *tab_ptr, unsigned int tab_size)
 +
 +    This interface function registers the cpufreq cooling device with the 
 name
 +    thermal-cpufreq-%x. This api can support multiple instances of cpufreq
 +    cooling devices.
 +
 +    tab_ptr: The table containing the maximum value of frequency to be 
 clipped
 +    for each cooling state.
 +       .freq_clip_max: Value of frequency to be clipped for each allowed
 +        cpus.
 +       .temp_level: Temperature level at which the frequency clamping will
 +       happen.
 +       .mask_val: cpumask of the allowed cpu's
 +    tab_size: the total number of cpufreq cooling states.
 +
 +1.1.2 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
 +
 +    This interface function unregisters the thermal-cpufreq-%x cooling 
 device.
 +
 +    cdev: Cooling device pointer which has to be unregistered.
 +
 +
 +1.2 CPU cooling action notifier register/unregister interface
 +1.2.1 int cputherm_register_notifier(struct notifier_block *nb,
 +       unsigned int list)
 +
 +    This interface registers a driver with cpu cooling layer. The driver 
 will
 +    be notified when any cpu cooling action is called.
 +
 +    nb: notifier function to register
 +    list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
 +
 +1.2.2 int cputherm_unregister_notifier(struct notifier_block *nb,
 +       unsigned int list)
 +
 +    This interface registers a driver with cpu cooling layer. The driver 
 will
 +    be notified when any cpu cooling action is called.
 +
 +    nb: notifier function to register
 +    list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
 diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
 index 514a691..d9c529f 100644
 --- a/drivers/thermal/Kconfig
 +++ b/drivers/thermal/Kconfig
 @@ -19,6 +19,17 @@ config THERMAL_HWMON
        depends on HWMON=y || HWMON=THERMAL
        default y

 +config CPU_THERMAL

 Perhaps the name CPU_COOLING or CPUFREQ_COOLING would more accurately
 describe this functionality?  I like the latter since now this
 mechanism only supports cooling by using cpufreq.

 +       bool generic cpu cooling support

 If we use CPUFREQ_COOLING, then perhaps this could say:

 bool cpu cooling through cpufreq frequency limiting

 +       depends on THERMAL  CPU_FREQ
 +       help
 +         This implements the generic cpu cooling 

Re: [PATCH v4 1/5] thermal: Add generic cpufreq cooling implementation

2012-06-25 Thread Rob Lee
Hey Amit,

I was just re-organizing the imx thermal driver that uses this cpu
cooling interface and noticed a couple of small issues here.   If
these suggestions are agreed upon and if it's too late for these
issues be changed with this patchset, I can submit them separately
unless you'd prefer to.

On Sat, May 12, 2012 at 4:40 AM, Amit Daniel Kachhap
amit.kach...@linaro.org wrote:
 This patch adds support for generic cpu thermal cooling low level
 implementations using frequency scaling up/down based on the registration
 parameters. Different cpu related cooling devices can be registered by the
 user and the binding of these cooling devices to the corresponding
 trip points can be easily done as the registration APIs return the
 cooling device pointer. The user of these APIs are responsible for
 passing clipping frequency . The drivers can also register to recieve
 notification about any cooling action called.

 Signed-off-by: Amit Daniel Kachhap amit.kach...@linaro.org
 ---
  Documentation/thermal/cpu-cooling-api.txt |   60 
  drivers/thermal/Kconfig                   |   11 +
  drivers/thermal/Makefile                  |    3 +-
  drivers/thermal/cpu_cooling.c             |  483 
 +
  include/linux/cpu_cooling.h               |   99 ++
  5 files changed, 655 insertions(+), 1 deletions(-)
  create mode 100644 Documentation/thermal/cpu-cooling-api.txt
  create mode 100644 drivers/thermal/cpu_cooling.c
  create mode 100644 include/linux/cpu_cooling.h

 diff --git a/Documentation/thermal/cpu-cooling-api.txt 
 b/Documentation/thermal/cpu-cooling-api.txt
 new file mode 100644
 index 000..557adb8
 --- /dev/null
 +++ b/Documentation/thermal/cpu-cooling-api.txt
 @@ -0,0 +1,60 @@
 +CPU cooling APIs How To
 +===
 +
 +Written by Amit Daniel Kachhap amit.kach...@linaro.org
 +
 +Updated: 12 May 2012
 +
 +Copyright (c)  2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
 +
 +0. Introduction
 +
 +The generic cpu cooling(freq clipping, cpuhotplug etc) provides
 +registration/unregistration APIs to the caller. The binding of the cooling
 +devices to the trip point is left for the user. The registration APIs returns
 +the cooling device pointer.
 +
 +1. cpu cooling APIs
 +
 +1.1 cpufreq registration/unregistration APIs
 +1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
 +       struct freq_clip_table *tab_ptr, unsigned int tab_size)
 +
 +    This interface function registers the cpufreq cooling device with the 
 name
 +    thermal-cpufreq-%x. This api can support multiple instances of cpufreq
 +    cooling devices.
 +
 +    tab_ptr: The table containing the maximum value of frequency to be 
 clipped
 +    for each cooling state.
 +       .freq_clip_max: Value of frequency to be clipped for each allowed
 +        cpus.
 +       .temp_level: Temperature level at which the frequency clamping will
 +       happen.
 +       .mask_val: cpumask of the allowed cpu's
 +    tab_size: the total number of cpufreq cooling states.
 +
 +1.1.2 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
 +
 +    This interface function unregisters the thermal-cpufreq-%x cooling 
 device.
 +
 +    cdev: Cooling device pointer which has to be unregistered.
 +
 +
 +1.2 CPU cooling action notifier register/unregister interface
 +1.2.1 int cputherm_register_notifier(struct notifier_block *nb,
 +       unsigned int list)
 +
 +    This interface registers a driver with cpu cooling layer. The driver will
 +    be notified when any cpu cooling action is called.
 +
 +    nb: notifier function to register
 +    list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
 +
 +1.2.2 int cputherm_unregister_notifier(struct notifier_block *nb,
 +       unsigned int list)
 +
 +    This interface registers a driver with cpu cooling layer. The driver will
 +    be notified when any cpu cooling action is called.
 +
 +    nb: notifier function to register
 +    list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
 diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
 index 514a691..d9c529f 100644
 --- a/drivers/thermal/Kconfig
 +++ b/drivers/thermal/Kconfig
 @@ -19,6 +19,17 @@ config THERMAL_HWMON
        depends on HWMON=y || HWMON=THERMAL
        default y

 +config CPU_THERMAL

Perhaps the name CPU_COOLING or CPUFREQ_COOLING would more accurately
describe this functionality?  I like the latter since now this
mechanism only supports cooling by using cpufreq.

 +       bool generic cpu cooling support

If we use CPUFREQ_COOLING, then perhaps this could say:

bool cpu cooling through cpufreq frequency limiting

 +       depends on THERMAL  CPU_FREQ
 +       help
 +         This implements the generic cpu cooling mechanism through frequency
 +         reduction, cpu hotplug and any other ways of reducing temperature. 
 An
 +         ACPI version of this already 
 exists(drivers/acpi/processor_thermal.c).
 +         This will be useful for platforms using 

[PATCH v4 1/5] thermal: Add generic cpufreq cooling implementation

2012-05-12 Thread Amit Daniel Kachhap
This patch adds support for generic cpu thermal cooling low level
implementations using frequency scaling up/down based on the registration
parameters. Different cpu related cooling devices can be registered by the
user and the binding of these cooling devices to the corresponding
trip points can be easily done as the registration APIs return the
cooling device pointer. The user of these APIs are responsible for
passing clipping frequency . The drivers can also register to recieve
notification about any cooling action called.

Signed-off-by: Amit Daniel Kachhap amit.kach...@linaro.org
---
 Documentation/thermal/cpu-cooling-api.txt |   60 
 drivers/thermal/Kconfig   |   11 +
 drivers/thermal/Makefile  |3 +-
 drivers/thermal/cpu_cooling.c |  483 +
 include/linux/cpu_cooling.h   |   99 ++
 5 files changed, 655 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/thermal/cpu-cooling-api.txt
 create mode 100644 drivers/thermal/cpu_cooling.c
 create mode 100644 include/linux/cpu_cooling.h

diff --git a/Documentation/thermal/cpu-cooling-api.txt 
b/Documentation/thermal/cpu-cooling-api.txt
new file mode 100644
index 000..557adb8
--- /dev/null
+++ b/Documentation/thermal/cpu-cooling-api.txt
@@ -0,0 +1,60 @@
+CPU cooling APIs How To
+===
+
+Written by Amit Daniel Kachhap amit.kach...@linaro.org
+
+Updated: 12 May 2012
+
+Copyright (c)  2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
+
+0. Introduction
+
+The generic cpu cooling(freq clipping, cpuhotplug etc) provides
+registration/unregistration APIs to the caller. The binding of the cooling
+devices to the trip point is left for the user. The registration APIs returns
+the cooling device pointer.
+
+1. cpu cooling APIs
+
+1.1 cpufreq registration/unregistration APIs
+1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
+   struct freq_clip_table *tab_ptr, unsigned int tab_size)
+
+This interface function registers the cpufreq cooling device with the name
+thermal-cpufreq-%x. This api can support multiple instances of cpufreq
+cooling devices.
+
+tab_ptr: The table containing the maximum value of frequency to be clipped
+for each cooling state.
+   .freq_clip_max: Value of frequency to be clipped for each allowed
+cpus.
+   .temp_level: Temperature level at which the frequency clamping will
+   happen.
+   .mask_val: cpumask of the allowed cpu's
+tab_size: the total number of cpufreq cooling states.
+
+1.1.2 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
+
+This interface function unregisters the thermal-cpufreq-%x cooling 
device.
+
+cdev: Cooling device pointer which has to be unregistered.
+
+
+1.2 CPU cooling action notifier register/unregister interface
+1.2.1 int cputherm_register_notifier(struct notifier_block *nb,
+   unsigned int list)
+
+This interface registers a driver with cpu cooling layer. The driver will
+be notified when any cpu cooling action is called.
+
+nb: notifier function to register
+list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
+
+1.2.2 int cputherm_unregister_notifier(struct notifier_block *nb,
+   unsigned int list)
+
+This interface registers a driver with cpu cooling layer. The driver will
+be notified when any cpu cooling action is called.
+
+nb: notifier function to register
+list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 514a691..d9c529f 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -19,6 +19,17 @@ config THERMAL_HWMON
depends on HWMON=y || HWMON=THERMAL
default y
 
+config CPU_THERMAL
+   bool generic cpu cooling support
+   depends on THERMAL  CPU_FREQ
+   help
+ This implements the generic cpu cooling mechanism through frequency
+ reduction, cpu hotplug and any other ways of reducing temperature. An
+ ACPI version of this already exists(drivers/acpi/processor_thermal.c).
+ This will be useful for platforms using the generic thermal interface
+ and not the ACPI interface.
+ If you want this support, you should say Y or M here.
+
 config SPEAR_THERMAL
bool SPEAr thermal sensor driver
depends on THERMAL
diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile
index a9fff0b..30c456c 100644
--- a/drivers/thermal/Makefile
+++ b/drivers/thermal/Makefile
@@ -3,4 +3,5 @@
 #
 
 obj-$(CONFIG_THERMAL)  += thermal_sys.o
-obj-$(CONFIG_SPEAR_THERMAL)+= spear_thermal.o
\ No newline at end of file
+obj-$(CONFIG_CPU_THERMAL)   += cpu_cooling.o
+obj-$(CONFIG_SPEAR_THERMAL)+= spear_thermal.o
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
new file mode 100644
index 000..c40d9a0
--- /dev/null
+++