Re: [PATCHv7 03/18] thermal: introduce device tree parser

2013-09-30 Thread Eduardo Valentin
Hi Mark

Thanks for another good review round. I am following up your concerns
inline.

On 30-09-2013 11:36, Mark Rutland wrote:
> Hi Eduardo,
> 
> On Fri, Sep 27, 2013 at 04:13:10AM +0100, Eduardo Valentin wrote:
>> This patch introduces a device tree bindings for
>> describing the hardware thermal behavior and limits.
>> Also a parser to read and interpret the data and feed
>> it in the thermal framework is presented.
>>
>> This patch introduces a thermal data parser for device
>> tree. The parsed data is used to build thermal zones
>> and thermal binding parameters. The output data
>> can then be used to deploy thermal policies.
>>
>> This patch adds also documentation regarding this
>> API and how to define tree nodes to use
>> this infrastructure.
>>
>> Note that, in order to be able to have control
>> on the sensor registration on the DT thermal zone,
>> it was required to allow changing the thermal zone
>> .get_temp callback. For this reason, this patch
>> also removes the 'const' modifier from the .ops
>> field of thermal zone devices.
>>
>> Cc: Zhang Rui 
>> Cc: linux...@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> Signed-off-by: Eduardo Valentin 
>> ---
>>
>> Hello folks,
>>
>> For those interested on this work, here is a short changelog from v6:
>> - Reviewed binding documentation and added type and size on all properties
>> - Described 'thermal-zones' node in binding documentation
>> - Using now cooling state terminology instead of cooling level
>> - Renamed milliCelsius to millicelsius
>> - Renamed cooling-attachments to 'cooling-maps'
>> - Renamed sensor to thermal sensor
>> - Renamed #sensor-cells to #thermal-sensor-cells
>> - #thermal-sensor-cells now is allowed to be 0
>> - Renamed 'sensors' property to 'thermal-sensors'
>> - Changed trip type property to be now string and documented possible values
>> - Described better the cooling properties
>> - Now parses 'contribution' instead of 'usage'
>> - Renamed cdev to cooling device
>> - Renamed 'passive-delay' property to 'polling-delay-passive'
>> - Fixed a couple of error messages to match the property name
>> - Fixed a binding issue while using cpufreq as module
>> - Reworked thermal_of_build_thermal_zone function so that it frees
>> requested memory if something goes wrong and checks for sub-nodes
>> with zero children.
>>
>> ---
>>  .../devicetree/bindings/thermal/thermal.txt| 537 +
>>  drivers/thermal/Kconfig|  13 +
>>  drivers/thermal/Makefile   |   1 +
>>  drivers/thermal/of-thermal.c   | 845 
>> +
>>  drivers/thermal/thermal_core.c |   9 +-
>>  drivers/thermal/thermal_core.h |   9 +
>>  include/dt-bindings/thermal/thermal.h  |  27 +
>>  include/linux/thermal.h|  28 +-
>>  8 files changed, 1466 insertions(+), 3 deletions(-)
>>  create mode 100644 Documentation/devicetree/bindings/thermal/thermal.txt
>>  create mode 100644 drivers/thermal/of-thermal.c
>>  create mode 100644 include/dt-bindings/thermal/thermal.h
>>
>> diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt 
>> b/Documentation/devicetree/bindings/thermal/thermal.txt
>> new file mode 100644
>> index 000..3dbc017
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/thermal/thermal.txt
>> @@ -0,0 +1,537 @@
>> +* Thermal Framework Device Tree descriptor
>> +
>> +Generic binding to provide a way of defining hardware thermal
>> +structure using device tree. A thermal structure includes thermal
>> +zones and their components, such as trip points, polling intervals,
>> +sensors and cooling devices binding descriptors.
>> +
>> +The target of device tree thermal descriptors is to describe only
>> +the hardware thermal aspects, not how the system must control or which
>> +algorithm or policy must be taken in place.
>> +
>> +There are five types of nodes involved to describe thermal bindings:
>> +- sensors: used to describe the device source of temperature sensing;
>> +- cooling devices: used to describe devices source of power dissipation 
>> control;
>> +- trip points: used to describe points in temperature domain defined to
>> +make the system aware of hardware limits;
>> +- cooling maps: used to describe links between trip points and
>> +cooling devices;
>> +- thermal zones: used to describe thermal data within the hardware;
>> +
>> +It follows a description of each type of these device tree nodes.
>> +
>> +Note: This binding is a working in progress.
> 
> What does this mean? Is the binding expected to change in incompatible
> ways?

Well, no. The note was more to say we still don't have a final
agreement. But for merging this patch, once we have agreed to get it
merged, I believe this comment can be left out.

> 
> I see we have similar wording at the top of the clock bindings, which
> should probably go -- it's ABI now...

OK.

> 
>> +
>> +* Thermal sensor 

Re: [PATCHv7 03/18] thermal: introduce device tree parser

2013-09-30 Thread Mark Rutland
Hi Eduardo,

On Fri, Sep 27, 2013 at 04:13:10AM +0100, Eduardo Valentin wrote:
> This patch introduces a device tree bindings for
> describing the hardware thermal behavior and limits.
> Also a parser to read and interpret the data and feed
> it in the thermal framework is presented.
>
> This patch introduces a thermal data parser for device
> tree. The parsed data is used to build thermal zones
> and thermal binding parameters. The output data
> can then be used to deploy thermal policies.
>
> This patch adds also documentation regarding this
> API and how to define tree nodes to use
> this infrastructure.
>
> Note that, in order to be able to have control
> on the sensor registration on the DT thermal zone,
> it was required to allow changing the thermal zone
> .get_temp callback. For this reason, this patch
> also removes the 'const' modifier from the .ops
> field of thermal zone devices.
>
> Cc: Zhang Rui 
> Cc: linux...@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Eduardo Valentin 
> ---
>
> Hello folks,
>
> For those interested on this work, here is a short changelog from v6:
> - Reviewed binding documentation and added type and size on all properties
> - Described 'thermal-zones' node in binding documentation
> - Using now cooling state terminology instead of cooling level
> - Renamed milliCelsius to millicelsius
> - Renamed cooling-attachments to 'cooling-maps'
> - Renamed sensor to thermal sensor
> - Renamed #sensor-cells to #thermal-sensor-cells
> - #thermal-sensor-cells now is allowed to be 0
> - Renamed 'sensors' property to 'thermal-sensors'
> - Changed trip type property to be now string and documented possible values
> - Described better the cooling properties
> - Now parses 'contribution' instead of 'usage'
> - Renamed cdev to cooling device
> - Renamed 'passive-delay' property to 'polling-delay-passive'
> - Fixed a couple of error messages to match the property name
> - Fixed a binding issue while using cpufreq as module
> - Reworked thermal_of_build_thermal_zone function so that it frees
> requested memory if something goes wrong and checks for sub-nodes
> with zero children.
>
> ---
>  .../devicetree/bindings/thermal/thermal.txt| 537 +
>  drivers/thermal/Kconfig|  13 +
>  drivers/thermal/Makefile   |   1 +
>  drivers/thermal/of-thermal.c   | 845 
> +
>  drivers/thermal/thermal_core.c |   9 +-
>  drivers/thermal/thermal_core.h |   9 +
>  include/dt-bindings/thermal/thermal.h  |  27 +
>  include/linux/thermal.h|  28 +-
>  8 files changed, 1466 insertions(+), 3 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/thermal/thermal.txt
>  create mode 100644 drivers/thermal/of-thermal.c
>  create mode 100644 include/dt-bindings/thermal/thermal.h
>
> diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt 
> b/Documentation/devicetree/bindings/thermal/thermal.txt
> new file mode 100644
> index 000..3dbc017
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/thermal.txt
> @@ -0,0 +1,537 @@
> +* Thermal Framework Device Tree descriptor
> +
> +Generic binding to provide a way of defining hardware thermal
> +structure using device tree. A thermal structure includes thermal
> +zones and their components, such as trip points, polling intervals,
> +sensors and cooling devices binding descriptors.
> +
> +The target of device tree thermal descriptors is to describe only
> +the hardware thermal aspects, not how the system must control or which
> +algorithm or policy must be taken in place.
> +
> +There are five types of nodes involved to describe thermal bindings:
> +- sensors: used to describe the device source of temperature sensing;
> +- cooling devices: used to describe devices source of power dissipation 
> control;
> +- trip points: used to describe points in temperature domain defined to
> +make the system aware of hardware limits;
> +- cooling maps: used to describe links between trip points and
> +cooling devices;
> +- thermal zones: used to describe thermal data within the hardware;
> +
> +It follows a description of each type of these device tree nodes.
> +
> +Note: This binding is a working in progress.

What does this mean? Is the binding expected to change in incompatible
ways?

I see we have similar wording at the top of the clock bindings, which
should probably go -- it's ABI now...

> +
> +* Thermal sensor devices
> +
> +Thermal sensor devices are nodes providing temperature sensing capabilities 
> on
> +thermal zones. Typical devices are I2C ADC converters and bandgaps. Theses 
> are
> +nodes providing temperature data to thermal zones. Thermal sensor devices may
> +control one or more internal sensors.
> +
> +Required property:
> +- #thermal-sensor-cells: Used to provide sensor device specific information
> +  Type: unsigned   

Re: [PATCHv7 03/18] thermal: introduce device tree parser

2013-09-30 Thread Mark Rutland
Hi Eduardo,

On Fri, Sep 27, 2013 at 04:13:10AM +0100, Eduardo Valentin wrote:
 This patch introduces a device tree bindings for
 describing the hardware thermal behavior and limits.
 Also a parser to read and interpret the data and feed
 it in the thermal framework is presented.

 This patch introduces a thermal data parser for device
 tree. The parsed data is used to build thermal zones
 and thermal binding parameters. The output data
 can then be used to deploy thermal policies.

 This patch adds also documentation regarding this
 API and how to define tree nodes to use
 this infrastructure.

 Note that, in order to be able to have control
 on the sensor registration on the DT thermal zone,
 it was required to allow changing the thermal zone
 .get_temp callback. For this reason, this patch
 also removes the 'const' modifier from the .ops
 field of thermal zone devices.

 Cc: Zhang Rui rui.zh...@intel.com
 Cc: linux...@vger.kernel.org
 Cc: linux-kernel@vger.kernel.org
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
 ---

 Hello folks,

 For those interested on this work, here is a short changelog from v6:
 - Reviewed binding documentation and added type and size on all properties
 - Described 'thermal-zones' node in binding documentation
 - Using now cooling state terminology instead of cooling level
 - Renamed milliCelsius to millicelsius
 - Renamed cooling-attachments to 'cooling-maps'
 - Renamed sensor to thermal sensor
 - Renamed #sensor-cells to #thermal-sensor-cells
 - #thermal-sensor-cells now is allowed to be 0
 - Renamed 'sensors' property to 'thermal-sensors'
 - Changed trip type property to be now string and documented possible values
 - Described better the cooling properties
 - Now parses 'contribution' instead of 'usage'
 - Renamed cdev to cooling device
 - Renamed 'passive-delay' property to 'polling-delay-passive'
 - Fixed a couple of error messages to match the property name
 - Fixed a binding issue while using cpufreq as module
 - Reworked thermal_of_build_thermal_zone function so that it frees
 requested memory if something goes wrong and checks for sub-nodes
 with zero children.

 ---
  .../devicetree/bindings/thermal/thermal.txt| 537 +
  drivers/thermal/Kconfig|  13 +
  drivers/thermal/Makefile   |   1 +
  drivers/thermal/of-thermal.c   | 845 
 +
  drivers/thermal/thermal_core.c |   9 +-
  drivers/thermal/thermal_core.h |   9 +
  include/dt-bindings/thermal/thermal.h  |  27 +
  include/linux/thermal.h|  28 +-
  8 files changed, 1466 insertions(+), 3 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/thermal/thermal.txt
  create mode 100644 drivers/thermal/of-thermal.c
  create mode 100644 include/dt-bindings/thermal/thermal.h

 diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt 
 b/Documentation/devicetree/bindings/thermal/thermal.txt
 new file mode 100644
 index 000..3dbc017
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/thermal/thermal.txt
 @@ -0,0 +1,537 @@
 +* Thermal Framework Device Tree descriptor
 +
 +Generic binding to provide a way of defining hardware thermal
 +structure using device tree. A thermal structure includes thermal
 +zones and their components, such as trip points, polling intervals,
 +sensors and cooling devices binding descriptors.
 +
 +The target of device tree thermal descriptors is to describe only
 +the hardware thermal aspects, not how the system must control or which
 +algorithm or policy must be taken in place.
 +
 +There are five types of nodes involved to describe thermal bindings:
 +- sensors: used to describe the device source of temperature sensing;
 +- cooling devices: used to describe devices source of power dissipation 
 control;
 +- trip points: used to describe points in temperature domain defined to
 +make the system aware of hardware limits;
 +- cooling maps: used to describe links between trip points and
 +cooling devices;
 +- thermal zones: used to describe thermal data within the hardware;
 +
 +It follows a description of each type of these device tree nodes.
 +
 +Note: This binding is a working in progress.

What does this mean? Is the binding expected to change in incompatible
ways?

I see we have similar wording at the top of the clock bindings, which
should probably go -- it's ABI now...

 +
 +* Thermal sensor devices
 +
 +Thermal sensor devices are nodes providing temperature sensing capabilities 
 on
 +thermal zones. Typical devices are I2C ADC converters and bandgaps. Theses 
 are
 +nodes providing temperature data to thermal zones. Thermal sensor devices may
 +control one or more internal sensors.
 +
 +Required property:
 +- #thermal-sensor-cells: Used to provide sensor device specific information
 +  Type: unsignedwhile referring to it. Typically 0, on thermal sensor
 +  Size: 

Re: [PATCHv7 03/18] thermal: introduce device tree parser

2013-09-30 Thread Eduardo Valentin
Hi Mark

Thanks for another good review round. I am following up your concerns
inline.

On 30-09-2013 11:36, Mark Rutland wrote:
 Hi Eduardo,
 
 On Fri, Sep 27, 2013 at 04:13:10AM +0100, Eduardo Valentin wrote:
 This patch introduces a device tree bindings for
 describing the hardware thermal behavior and limits.
 Also a parser to read and interpret the data and feed
 it in the thermal framework is presented.

 This patch introduces a thermal data parser for device
 tree. The parsed data is used to build thermal zones
 and thermal binding parameters. The output data
 can then be used to deploy thermal policies.

 This patch adds also documentation regarding this
 API and how to define tree nodes to use
 this infrastructure.

 Note that, in order to be able to have control
 on the sensor registration on the DT thermal zone,
 it was required to allow changing the thermal zone
 .get_temp callback. For this reason, this patch
 also removes the 'const' modifier from the .ops
 field of thermal zone devices.

 Cc: Zhang Rui rui.zh...@intel.com
 Cc: linux...@vger.kernel.org
 Cc: linux-kernel@vger.kernel.org
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
 ---

 Hello folks,

 For those interested on this work, here is a short changelog from v6:
 - Reviewed binding documentation and added type and size on all properties
 - Described 'thermal-zones' node in binding documentation
 - Using now cooling state terminology instead of cooling level
 - Renamed milliCelsius to millicelsius
 - Renamed cooling-attachments to 'cooling-maps'
 - Renamed sensor to thermal sensor
 - Renamed #sensor-cells to #thermal-sensor-cells
 - #thermal-sensor-cells now is allowed to be 0
 - Renamed 'sensors' property to 'thermal-sensors'
 - Changed trip type property to be now string and documented possible values
 - Described better the cooling properties
 - Now parses 'contribution' instead of 'usage'
 - Renamed cdev to cooling device
 - Renamed 'passive-delay' property to 'polling-delay-passive'
 - Fixed a couple of error messages to match the property name
 - Fixed a binding issue while using cpufreq as module
 - Reworked thermal_of_build_thermal_zone function so that it frees
 requested memory if something goes wrong and checks for sub-nodes
 with zero children.

 ---
  .../devicetree/bindings/thermal/thermal.txt| 537 +
  drivers/thermal/Kconfig|  13 +
  drivers/thermal/Makefile   |   1 +
  drivers/thermal/of-thermal.c   | 845 
 +
  drivers/thermal/thermal_core.c |   9 +-
  drivers/thermal/thermal_core.h |   9 +
  include/dt-bindings/thermal/thermal.h  |  27 +
  include/linux/thermal.h|  28 +-
  8 files changed, 1466 insertions(+), 3 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/thermal/thermal.txt
  create mode 100644 drivers/thermal/of-thermal.c
  create mode 100644 include/dt-bindings/thermal/thermal.h

 diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt 
 b/Documentation/devicetree/bindings/thermal/thermal.txt
 new file mode 100644
 index 000..3dbc017
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/thermal/thermal.txt
 @@ -0,0 +1,537 @@
 +* Thermal Framework Device Tree descriptor
 +
 +Generic binding to provide a way of defining hardware thermal
 +structure using device tree. A thermal structure includes thermal
 +zones and their components, such as trip points, polling intervals,
 +sensors and cooling devices binding descriptors.
 +
 +The target of device tree thermal descriptors is to describe only
 +the hardware thermal aspects, not how the system must control or which
 +algorithm or policy must be taken in place.
 +
 +There are five types of nodes involved to describe thermal bindings:
 +- sensors: used to describe the device source of temperature sensing;
 +- cooling devices: used to describe devices source of power dissipation 
 control;
 +- trip points: used to describe points in temperature domain defined to
 +make the system aware of hardware limits;
 +- cooling maps: used to describe links between trip points and
 +cooling devices;
 +- thermal zones: used to describe thermal data within the hardware;
 +
 +It follows a description of each type of these device tree nodes.
 +
 +Note: This binding is a working in progress.
 
 What does this mean? Is the binding expected to change in incompatible
 ways?

Well, no. The note was more to say we still don't have a final
agreement. But for merging this patch, once we have agreed to get it
merged, I believe this comment can be left out.

 
 I see we have similar wording at the top of the clock bindings, which
 should probably go -- it's ABI now...

OK.

 
 +
 +* Thermal sensor devices
 +
 +Thermal sensor devices are nodes providing temperature sensing capabilities 
 on
 +thermal zones. Typical devices are I2C ADC converters and bandgaps. 

[PATCHv7 03/18] thermal: introduce device tree parser

2013-09-26 Thread Eduardo Valentin
This patch introduces a device tree bindings for
describing the hardware thermal behavior and limits.
Also a parser to read and interpret the data and feed
it in the thermal framework is presented.

This patch introduces a thermal data parser for device
tree. The parsed data is used to build thermal zones
and thermal binding parameters. The output data
can then be used to deploy thermal policies.

This patch adds also documentation regarding this
API and how to define tree nodes to use
this infrastructure.

Note that, in order to be able to have control
on the sensor registration on the DT thermal zone,
it was required to allow changing the thermal zone
.get_temp callback. For this reason, this patch
also removes the 'const' modifier from the .ops
field of thermal zone devices.

Cc: Zhang Rui 
Cc: linux...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin 
---

Hello folks,

For those interested on this work, here is a short changelog from v6:
- Reviewed binding documentation and added type and size on all properties
- Described 'thermal-zones' node in binding documentation
- Using now cooling state terminology instead of cooling level
- Renamed milliCelsius to millicelsius
- Renamed cooling-attachments to 'cooling-maps'
- Renamed sensor to thermal sensor
- Renamed #sensor-cells to #thermal-sensor-cells
- #thermal-sensor-cells now is allowed to be 0
- Renamed 'sensors' property to 'thermal-sensors'
- Changed trip type property to be now string and documented possible values
- Described better the cooling properties
- Now parses 'contribution' instead of 'usage'
- Renamed cdev to cooling device
- Renamed 'passive-delay' property to 'polling-delay-passive'
- Fixed a couple of error messages to match the property name
- Fixed a binding issue while using cpufreq as module
- Reworked thermal_of_build_thermal_zone function so that it frees
requested memory if something goes wrong and checks for sub-nodes
with zero children.

---
 .../devicetree/bindings/thermal/thermal.txt| 537 +
 drivers/thermal/Kconfig|  13 +
 drivers/thermal/Makefile   |   1 +
 drivers/thermal/of-thermal.c   | 845 +
 drivers/thermal/thermal_core.c |   9 +-
 drivers/thermal/thermal_core.h |   9 +
 include/dt-bindings/thermal/thermal.h  |  27 +
 include/linux/thermal.h|  28 +-
 8 files changed, 1466 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/thermal/thermal.txt
 create mode 100644 drivers/thermal/of-thermal.c
 create mode 100644 include/dt-bindings/thermal/thermal.h

diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt 
b/Documentation/devicetree/bindings/thermal/thermal.txt
new file mode 100644
index 000..3dbc017
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/thermal.txt
@@ -0,0 +1,537 @@
+* Thermal Framework Device Tree descriptor
+
+Generic binding to provide a way of defining hardware thermal
+structure using device tree. A thermal structure includes thermal
+zones and their components, such as trip points, polling intervals,
+sensors and cooling devices binding descriptors.
+
+The target of device tree thermal descriptors is to describe only
+the hardware thermal aspects, not how the system must control or which
+algorithm or policy must be taken in place.
+
+There are five types of nodes involved to describe thermal bindings:
+- sensors: used to describe the device source of temperature sensing;
+- cooling devices: used to describe devices source of power dissipation 
control;
+- trip points: used to describe points in temperature domain defined to
+make the system aware of hardware limits;
+- cooling maps: used to describe links between trip points and
+cooling devices;
+- thermal zones: used to describe thermal data within the hardware;
+
+It follows a description of each type of these device tree nodes.
+
+Note: This binding is a working in progress.
+
+* Thermal sensor devices
+
+Thermal sensor devices are nodes providing temperature sensing capabilities on
+thermal zones. Typical devices are I2C ADC converters and bandgaps. Theses are
+nodes providing temperature data to thermal zones. Thermal sensor devices may
+control one or more internal sensors.
+
+Required property:
+- #thermal-sensor-cells: Used to provide sensor device specific information
+  Type: unsignedwhile referring to it. Typically 0, on thermal sensor
+  Size: one cellnodes with only one sensor, and at least 1 on nodes
+with several internal sensors, in order
+to identify uniquely the sensor instances within
+the IC. See thermal zone binding for more details
+on how consumers refer to sensor devices.
+
+* Cooling device nodes
+
+Cooling devices are nodes providing 

[PATCHv7 03/18] thermal: introduce device tree parser

2013-09-26 Thread Eduardo Valentin
This patch introduces a device tree bindings for
describing the hardware thermal behavior and limits.
Also a parser to read and interpret the data and feed
it in the thermal framework is presented.

This patch introduces a thermal data parser for device
tree. The parsed data is used to build thermal zones
and thermal binding parameters. The output data
can then be used to deploy thermal policies.

This patch adds also documentation regarding this
API and how to define tree nodes to use
this infrastructure.

Note that, in order to be able to have control
on the sensor registration on the DT thermal zone,
it was required to allow changing the thermal zone
.get_temp callback. For this reason, this patch
also removes the 'const' modifier from the .ops
field of thermal zone devices.

Cc: Zhang Rui rui.zh...@intel.com
Cc: linux...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---

Hello folks,

For those interested on this work, here is a short changelog from v6:
- Reviewed binding documentation and added type and size on all properties
- Described 'thermal-zones' node in binding documentation
- Using now cooling state terminology instead of cooling level
- Renamed milliCelsius to millicelsius
- Renamed cooling-attachments to 'cooling-maps'
- Renamed sensor to thermal sensor
- Renamed #sensor-cells to #thermal-sensor-cells
- #thermal-sensor-cells now is allowed to be 0
- Renamed 'sensors' property to 'thermal-sensors'
- Changed trip type property to be now string and documented possible values
- Described better the cooling properties
- Now parses 'contribution' instead of 'usage'
- Renamed cdev to cooling device
- Renamed 'passive-delay' property to 'polling-delay-passive'
- Fixed a couple of error messages to match the property name
- Fixed a binding issue while using cpufreq as module
- Reworked thermal_of_build_thermal_zone function so that it frees
requested memory if something goes wrong and checks for sub-nodes
with zero children.

---
 .../devicetree/bindings/thermal/thermal.txt| 537 +
 drivers/thermal/Kconfig|  13 +
 drivers/thermal/Makefile   |   1 +
 drivers/thermal/of-thermal.c   | 845 +
 drivers/thermal/thermal_core.c |   9 +-
 drivers/thermal/thermal_core.h |   9 +
 include/dt-bindings/thermal/thermal.h  |  27 +
 include/linux/thermal.h|  28 +-
 8 files changed, 1466 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/thermal/thermal.txt
 create mode 100644 drivers/thermal/of-thermal.c
 create mode 100644 include/dt-bindings/thermal/thermal.h

diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt 
b/Documentation/devicetree/bindings/thermal/thermal.txt
new file mode 100644
index 000..3dbc017
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/thermal.txt
@@ -0,0 +1,537 @@
+* Thermal Framework Device Tree descriptor
+
+Generic binding to provide a way of defining hardware thermal
+structure using device tree. A thermal structure includes thermal
+zones and their components, such as trip points, polling intervals,
+sensors and cooling devices binding descriptors.
+
+The target of device tree thermal descriptors is to describe only
+the hardware thermal aspects, not how the system must control or which
+algorithm or policy must be taken in place.
+
+There are five types of nodes involved to describe thermal bindings:
+- sensors: used to describe the device source of temperature sensing;
+- cooling devices: used to describe devices source of power dissipation 
control;
+- trip points: used to describe points in temperature domain defined to
+make the system aware of hardware limits;
+- cooling maps: used to describe links between trip points and
+cooling devices;
+- thermal zones: used to describe thermal data within the hardware;
+
+It follows a description of each type of these device tree nodes.
+
+Note: This binding is a working in progress.
+
+* Thermal sensor devices
+
+Thermal sensor devices are nodes providing temperature sensing capabilities on
+thermal zones. Typical devices are I2C ADC converters and bandgaps. Theses are
+nodes providing temperature data to thermal zones. Thermal sensor devices may
+control one or more internal sensors.
+
+Required property:
+- #thermal-sensor-cells: Used to provide sensor device specific information
+  Type: unsignedwhile referring to it. Typically 0, on thermal sensor
+  Size: one cellnodes with only one sensor, and at least 1 on nodes
+with several internal sensors, in order
+to identify uniquely the sensor instances within
+the IC. See thermal zone binding for more details
+on how consumers refer to sensor devices.
+
+* Cooling device