Re: [RFC PATCH] thermal: Schedule a backup thermal shutdown workqueue after a known period of time to tackle failed poweroff

2015-12-31 Thread Eduardo Valentin
can we have a shorter title?

On Tue, Dec 29, 2015 at 02:46:49PM +0530, Keerthy wrote:
> Hi Nishanth,
> 

 
> >
> >I am not sure if this #ifdeffery is even needed.
> >
> >
> >Eduardo, Rui: If this is not the suggested technique, maybe you guys
> >could suggest how we could handle a case where userspace might be
> >hungup due to some reason and a case where a critical temperature
> >event in the middle of device probe was triggered?

Orderly power off is supposed to take care of this. Looking at the code,
it will force a shutdown in case execution of userland command fails:

static int __orderly_poweroff(bool force)
{
int ret;

ret = run_cmd(poweroff_cmd);

if (ret && force) {
pr_warn("Failed to start orderly shutdown: forcing the 
issue\n");

/*
 * I guess this should try to kick off some daemon to sync and
 * poweroff asap.  Or not even bother syncing if we're doing an
 * emergency shutdown?
 */
emergency_sync();
kernel_power_off();
}

> >
> >Obviously, we'd like to take into consideration userspace latencies as
> >well- but that is very specific to fs being run.. not really a simple
> >problem, IMHO..
> >
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH] thermal: Schedule a backup thermal shutdown workqueue after a known period of time to tackle failed poweroff

2015-12-31 Thread Eduardo Valentin
On Mon, Dec 21, 2015 at 11:16:18AM +0530, Keerthy wrote:
> In few rare conditions like during boot up the orderly_poweroff
> function might not be able to complete fully leaving the device
> running at dangerously high temperatures. Hence adding a backup
> workqueue to act after a known period of time and poweroff the device.

I really wish a better description of what is going on. I am not really
sure why thermal subsystem must deal with the case of a failing kernel
API. If orderly power off is failing, why don't we fix it instead?
What are the failing conditions? few rare conditions seams very odd.
How does it fail? Why fixing it in thermal? Other users of it don't
deserver the same fix?

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


Re: [RFC PATCH] thermal: Schedule a backup thermal shutdown workqueue after a known period of time to tackle failed poweroff

2015-12-31 Thread Eduardo Valentin
On Thu, Dec 31, 2015 at 11:47:57AM -0600, Nishanth Menon wrote:
> On 12/31/2015 11:29 AM, Eduardo Valentin wrote:
> > can we have a shorter title?
> > 
> > 
> > Orderly power off is supposed to take care of this. Looking at the code,
> > it will force a shutdown in case execution of userland command fails:
> > 
> > static int __orderly_poweroff(bool force)
> > {
> > int ret;
> > 
> > ret = run_cmd(poweroff_cmd);
> > 
> > if (ret && force) {
> > pr_warn("Failed to start orderly shutdown: forcing the 
> > issue\n");
> > 
> > /*
> >  * I guess this should try to kick off some daemon to sync 
> > and
> >  * poweroff asap.  Or not even bother syncing if we're 
> > doing an
> >  * emergency shutdown?
> >  */
> > emergency_sync();
> > kernel_power_off();
> > }
> 
> Yes, it will *IF* userspace fails. the condition that I had tracked
> was before identifying the following fix[1] - Example fail is here[2]
> 

OK. But still, why other users of orderly_poweroff do not
deserve to be fixed, then?

> 
> I hope this explains the problem.
> 
> [1]
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=00917b5c55aeb01322d5ab51af8c025b82959224
> [2] http://pastebin.ubuntu.com/14326688/
> 
> [3]
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/am57xx-beagle-x15.dts#n738
> 
> -- 
> Regards,
> Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: dts: omap3: Include missing bandgap data for ti-soc-thermal driver

2015-12-31 Thread Eduardo Valentin
Hello,

On Sat, Dec 26, 2015 at 12:32:25AM +0100, Pali Rohár wrote:
> Driver for omap3 with documentation is there since v4.4-rc1.
> 
> Signed-off-by: Pali Rohár 


> ---
>  arch/arm/boot/dts/omap34xx.dtsi |5 +
>  arch/arm/boot/dts/omap36xx.dtsi |5 +
>  2 files changed, 10 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/omap34xx.dtsi b/arch/arm/boot/dts/omap34xx.dtsi
> index 4f6b2d5..c3f488f 100644
> --- a/arch/arm/boot/dts/omap34xx.dtsi
> +++ b/arch/arm/boot/dts/omap34xx.dtsi
> @@ -54,6 +54,11 @@
>   #size-cells = <0>;
>   };
>   };
> +
> + bandgap {
> + reg = <0x48002524 0x4>;
> + compatible = "ti,omap34xx-bandgap";
> + };
>   };
>  };
>  
> diff --git a/arch/arm/boot/dts/omap36xx.dtsi b/arch/arm/boot/dts/omap36xx.dtsi
> index 86253de..00f98c1 100644
> --- a/arch/arm/boot/dts/omap36xx.dtsi
> +++ b/arch/arm/boot/dts/omap36xx.dtsi
> @@ -86,6 +86,11 @@
>   #size-cells = <0>;
>   };
>   };
> +
> + bandgap {
> + reg = <0x48002524 0x4>;
> + compatible = "ti,omap36xx-bandgap";

Can you please already add on both cases

#thermal-sensor-cells = <0>;
?

This way we can already use them to define thermal zones. Of course,
that alone won't add the thermal zones. A separated patch would be
needed to add the thermal zone for OMAP3.

> + };
>   };
>  };
>  
> -- 
> 1.7.9.5
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] ti-soc-thermal: implement omap3 support

2015-09-29 Thread Eduardo Valentin
From: Pavel Machek <pa...@ucw.cz>

This adds support for OMAP3 chips to ti-soc-thermal. As requested by
TI people, it is marked unreliable and warning is printed.

Signed-off-by: Pavel Machek <pa...@ucw.cz>
Signed-off-by: Eduardo Valentin <edubez...@gmail.com>
---
 .../devicetree/bindings/thermal/ti_soc_thermal.txt |   7 ++
 drivers/thermal/ti-soc-thermal/Kconfig |  15 +++
 drivers/thermal/ti-soc-thermal/Makefile|   1 +
 .../thermal/ti-soc-thermal/omap3-thermal-data.c| 103 +
 drivers/thermal/ti-soc-thermal/ti-bandgap.c|  10 ++
 drivers/thermal/ti-soc-thermal/ti-bandgap.h|   9 ++
 6 files changed, 145 insertions(+)
 create mode 100644 drivers/thermal/ti-soc-thermal/omap3-thermal-data.c

diff --git a/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt 
b/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
index 0c9222d..d9a1b54 100644
--- a/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
@@ -10,6 +10,7 @@ to the silicon temperature.
 
 Required properties:
 - compatible : Should be:
+  - "ti,omap34xx-bandgap" : for OMAP34xx bandgap
   - "ti,omap4430-bandgap" : for OMAP4430 bandgap
   - "ti,omap4460-bandgap" : for OMAP4460 bandgap
   - "ti,omap4470-bandgap" : for OMAP4470 bandgap
@@ -25,6 +26,12 @@ to each bandgap version, because the mapping may change from
 soc to soc, apart of depending on available features.
 
 Example:
+OMAP34xx:
+bandgap {
+   reg = <0x48002524 0x4>;
+   compatible = "ti,omap34xx-bandgap";
+};
+
 OMAP4430:
 bandgap {
reg = <0x4a002260 0x4 0x4a00232C 0x4>;
diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
b/drivers/thermal/ti-soc-thermal/Kconfig
index cb6686f..ea8283f 100644
--- a/drivers/thermal/ti-soc-thermal/Kconfig
+++ b/drivers/thermal/ti-soc-thermal/Kconfig
@@ -19,6 +19,21 @@ config TI_THERMAL
  This includes trip points definitions, extrapolation rules and
  CPU cooling device bindings.
 
+config OMAP3_THERMAL
+   bool "Texas Instruments OMAP3 thermal support"
+   depends on TI_SOC_THERMAL
+   depends on ARCH_OMAP3 || COMPILE_TEST
+   help
+ If you say yes here you get thermal support for the Texas Instruments
+ OMAP3 SoC family. The current chips supported are:
+  - OMAP3430
+
+ OMAP3 chips normally don't need thermal management, and sensors in
+ this generation are not accurate, nor they are very close to
+ the important hotspots.
+
+ Say 'N' here.
+
 config OMAP4_THERMAL
bool "Texas Instruments OMAP4 thermal support"
depends on TI_SOC_THERMAL
diff --git a/drivers/thermal/ti-soc-thermal/Makefile 
b/drivers/thermal/ti-soc-thermal/Makefile
index 1226b24..0f89bdf 100644
--- a/drivers/thermal/ti-soc-thermal/Makefile
+++ b/drivers/thermal/ti-soc-thermal/Makefile
@@ -2,5 +2,6 @@ obj-$(CONFIG_TI_SOC_THERMAL)+= ti-soc-thermal.o
 ti-soc-thermal-y   := ti-bandgap.o
 ti-soc-thermal-$(CONFIG_TI_THERMAL)+= ti-thermal-common.o
 ti-soc-thermal-$(CONFIG_DRA752_THERMAL)+= dra752-thermal-data.o
+ti-soc-thermal-$(CONFIG_OMAP3_THERMAL) += omap3-thermal-data.o
 ti-soc-thermal-$(CONFIG_OMAP4_THERMAL) += omap4-thermal-data.o
 ti-soc-thermal-$(CONFIG_OMAP5_THERMAL) += omap5-thermal-data.o
diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c 
b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
new file mode 100644
index 000..8470225
--- /dev/null
+++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
@@ -0,0 +1,103 @@
+/*
+ * OMAP3 thermal driver.
+ *
+ * Copyright (C) 2011-2012 Texas Instruments Inc.
+ * Copyright (C) 2014 Pavel Machek <pa...@ucw.cz>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Note
+ * http://www.ti.com/lit/er/sprz278f/sprz278f.pdf "Advisory
+ * 3.1.1.186 MMC OCP Clock Not Gated When Thermal Sensor Is Used"
+ *
+ * Also TI says:
+ * Just be careful when you try to make thermal policy like decisions
+ * based on this sensor. Placement of the sensor w.r.t the actual logic
+ * generating heat has to be a factor as well. If you are just looking
+ * for an approximation temperature (thermometerish kind), you might be
+ * ok with this. I am not sure we'd find any TI data around this.. just a
+ * heads up.
+ */
+
+#include "ti-thermal.h"
+#include "ti-bandgap.h"
+
+/*
+ * OMAP

[PATCH 0/2] thermal: omap3 support

2015-09-29 Thread Eduardo Valentin
Folks,

I am add these two patches for next merge window. Pavels patch
was idling for some time in the mailing list and I found it
and gave it a try. In the process, added 36xx support too.

DTS part is not done though.

Anyways, they are in linux-next now. Have fun.

BR,

Eduardo Valentin (1):
  thermal: ti-soc-thermal: add OMAP36xx support

Pavel Machek (1):
  ti-soc-thermal: implement omap3 support

 .../devicetree/bindings/thermal/ti_soc_thermal.txt |  14 ++
 drivers/thermal/ti-soc-thermal/Kconfig |  15 ++
 drivers/thermal/ti-soc-thermal/Makefile|   1 +
 .../thermal/ti-soc-thermal/omap3-thermal-data.c| 176 +
 drivers/thermal/ti-soc-thermal/ti-bandgap.c|  14 ++
 drivers/thermal/ti-soc-thermal/ti-bandgap.h|  11 ++
 6 files changed, 231 insertions(+)
 create mode 100644 drivers/thermal/ti-soc-thermal/omap3-thermal-data.c

-- 
2.5.0

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


[PATCH 2/2] thermal: ti-soc-thermal: add OMAP36xx support

2015-09-29 Thread Eduardo Valentin
Add OMAP36xx support to ti-soc-thermal driver. This
chip is also unreliable. The data provided here is
based on OMAP36xx TRM:
http://www.ti.com/lit/ug/swpu177aa/swpu177aa.pdf

Signed-off-by: Eduardo Valentin <edube...@gmail.com>
Signed-off-by: Eduardo Valentin <edubez...@gmail.com>
---
 .../devicetree/bindings/thermal/ti_soc_thermal.txt |  7 +++
 .../thermal/ti-soc-thermal/omap3-thermal-data.c| 73 ++
 drivers/thermal/ti-soc-thermal/ti-bandgap.c|  4 ++
 drivers/thermal/ti-soc-thermal/ti-bandgap.h|  2 +
 4 files changed, 86 insertions(+)

diff --git a/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt 
b/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
index d9a1b54..6299dd8 100644
--- a/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
@@ -11,6 +11,7 @@ to the silicon temperature.
 Required properties:
 - compatible : Should be:
   - "ti,omap34xx-bandgap" : for OMAP34xx bandgap
+  - "ti,omap36xx-bandgap" : for OMAP36xx bandgap
   - "ti,omap4430-bandgap" : for OMAP4430 bandgap
   - "ti,omap4460-bandgap" : for OMAP4460 bandgap
   - "ti,omap4470-bandgap" : for OMAP4470 bandgap
@@ -32,6 +33,12 @@ bandgap {
compatible = "ti,omap34xx-bandgap";
 };
 
+OMAP36xx:
+bandgap {
+   reg = <0x48002524 0x4>;
+   compatible = "ti,omap36xx-bandgap";
+};
+
 OMAP4430:
 bandgap {
reg = <0x4a002260 0x4 0x4a00232C 0x4>;
diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c 
b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
index 8470225..3ee3434 100644
--- a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
@@ -101,3 +101,76 @@ const struct ti_bandgap_data omap34xx_data = {
},
.sensor_count = 1,
 };
+
+/*
+ * OMAP36XX has one instance of thermal sensor for MPU
+ * need to describe the individual bit fields
+ */
+static struct temp_sensor_registers
+omap36xx_mpu_temp_sensor_registers = {
+   .temp_sensor_ctrl = 0,
+   .bgap_soc_mask = BIT(9),
+   .bgap_eocz_mask = BIT(8),
+   .bgap_dtemp_mask = 0xFF,
+
+   .bgap_mode_ctrl = 0,
+   .mode_ctrl_mask = BIT(10),
+};
+
+/* Thresholds and limits for OMAP36XX MPU temperature sensor */
+static struct temp_sensor_data omap36xx_mpu_temp_sensor_data = {
+   .min_freq = 32768,
+   .max_freq = 32768,
+   .max_temp = 125000,
+   .min_temp = -4,
+   .hyst_val = 5000,
+};
+
+/*
+ * Temperature values in milli degree celsius
+ */
+static const int
+omap36xx_adc_to_temp[128] = {
+   -4, -4, -4, -4, -4, -4, -4, -4,
+   -4, -4, -4, -4, -4, -38000, -35000, -34000,
+   -32000, -3, -28000, -26000, -24000, -22000, -2, -18500,
+   -17000, -15000, -13500, -12000, -1, -8000, -6500, -5000, -3500,
+   -1500, 0, 2000, 3500, 5000, 6500, 8500, 1, 12000, 13500,
+   15000, 17000, 19000, 21000, 23000, 25000, 27000, 28500, 3,
+   32000, 33500, 35000, 37000, 38500, 4, 42000, 43500, 45000,
+   47000, 48500, 5, 52000, 53500, 55000, 57000, 58500, 6,
+   62000, 64000, 66000, 68000, 7, 71500, 73500, 75000, 77000,
+   78500, 8, 82000, 83500, 85000, 87000, 88500, 9, 92000,
+   93500, 95000, 97000, 98500, 10, 102000, 103500, 105000, 107000,
+   109000, 111000, 113000, 115000, 117000, 118500, 12, 122000,
+   123500, 125000, 125000, 125000, 125000, 125000, 125000, 125000,
+   125000, 125000, 125000, 125000, 125000, 125000, 125000, 125000,
+   125000, 125000, 125000, 125000, 125000, 125000, 125000
+};
+
+/* OMAP36XX data */
+const struct ti_bandgap_data omap36xx_data = {
+   .features = TI_BANDGAP_FEATURE_CLK_CTRL | TI_BANDGAP_FEATURE_UNRELIABLE,
+   .fclock_name = "ts_fck",
+   .div_ck_name = "ts_fck",
+   .conv_table = omap36xx_adc_to_temp,
+   .adc_start_val = 0,
+   .adc_end_val = 127,
+   .expose_sensor = ti_thermal_expose_sensor,
+   .remove_sensor = ti_thermal_remove_sensor,
+
+   .sensors = {
+   {
+   .registers = _mpu_temp_sensor_registers,
+   .ts_data = _mpu_temp_sensor_data,
+   .domain = "cpu",
+   .slope = 0,
+   .constant = 2,
+   .slope_pcb = 0,
+   .constant_pcb = 2,
+   .register_cooling = NULL,
+   .unregister_cooling = NULL,
+   },
+   },
+   .sensor_count = 1,
+};
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c 
b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 9f9ed72..1e34a1e 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -1588,6 +1588,10 @@ static const struct of_dev

Re: [PATCHv3 1/1] ti-soc-thermal: implement omap3 support

2015-09-29 Thread Eduardo Valentin
On Tue, Sep 15, 2015 at 01:24:16PM +0200, Pavel Machek wrote:
> On Wed 2015-09-09 21:58:09, Eduardo Valentin wrote:
> > From: Pavel Machek <pa...@ucw.cz>
> > 
> > This adds support for OMAP3 chips to ti-soc-thermal. As requested by
> > TI people, it is marked unreliable and warning is printed.
> > 
> > Cc: Zhang Rui <rui.zh...@intel.com>
> > Cc: linux...@vger.kernel.org
> > Cc: linux-omap@vger.kernel.org
> > Cc: linux-ker...@vger.kernel.org
> > Signed-off-by: Pavel Machek <pa...@ucw.cz>
> > Signed-off-by: Eduardo Valentin <edubez...@gmail.com>
> > ---
> >  .../devicetree/bindings/thermal/ti_soc_thermal.txt |   7 ++
> >  drivers/thermal/ti-soc-thermal/Kconfig |  15 +++
> >  drivers/thermal/ti-soc-thermal/Makefile|   1 +
> >  .../thermal/ti-soc-thermal/omap3-thermal-data.c| 103 
> > +
> >  drivers/thermal/ti-soc-thermal/ti-bandgap.c|  10 ++
> >  drivers/thermal/ti-soc-thermal/ti-bandgap.h|   9 ++
> >  6 files changed, 145 insertions(+)
> >  create mode 100644 drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
> > ---
> > 
> > Just not leave Pavels work behind, I took his patch and amended a couple
> > of things:
> > (1) added the omap3 DT example
> > (2) improved the dev_warn message
> > (3) improved the code documentation
> 
> Thanks!
> 
> Is it on its way to mainline or is there something more to do?


Nothing else to do. I am applying to my next branch.

> 
>   Pavel
> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) 
> http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv2 09/10] thermal: ti-soc: allow compile test

2015-09-13 Thread Eduardo Valentin
Adding COMPILE_TEST flag to ti-soc driver to facilitate
maintenance.

Cc: Zhang Rui <rui.zh...@intel.com>
Cc: linux...@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin <edubez...@gmail.com>
---
 drivers/thermal/ti-soc-thermal/Kconfig | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
b/drivers/thermal/ti-soc-thermal/Kconfig
index bd4c7be..7a24018 100644
--- a/drivers/thermal/ti-soc-thermal/Kconfig
+++ b/drivers/thermal/ti-soc-thermal/Kconfig
@@ -1,7 +1,7 @@
 config TI_SOC_THERMAL
tristate "Texas Instruments SoCs temperature sensor driver"
depends on THERMAL
-   depends on ARCH_HAS_BANDGAP
+   depends on ARCH_HAS_BANDGAP || COMPILE_TEST
help
  If you say yes here you get support for the Texas Instruments
  OMAP4460+ on die bandgap temperature sensor support. The register
@@ -24,7 +24,7 @@ config TI_THERMAL
 config OMAP4_THERMAL
bool "Texas Instruments OMAP4 thermal support"
depends on TI_SOC_THERMAL
-   depends on ARCH_OMAP4
+   depends on ARCH_OMAP4 || COMPILE_TEST
help
  If you say yes here you get thermal support for the Texas Instruments
  OMAP4 SoC family. The current chip supported are:
@@ -38,7 +38,7 @@ config OMAP4_THERMAL
 config OMAP5_THERMAL
bool "Texas Instruments OMAP5 thermal support"
depends on TI_SOC_THERMAL
-   depends on SOC_OMAP5
+   depends on SOC_OMAP5 || COMPILE_TEST
help
  If you say yes here you get thermal support for the Texas Instruments
  OMAP5 SoC family. The current chip supported are:
@@ -50,7 +50,7 @@ config OMAP5_THERMAL
 config DRA752_THERMAL
bool "Texas Instruments DRA752 thermal support"
depends on TI_SOC_THERMAL
-   depends on SOC_DRA7XX
+   depends on SOC_DRA7XX || COMPILE_TEST
help
  If you say yes here you get thermal support for the Texas Instruments
  DRA752 SoC family. The current chip supported are:
-- 
2.5.0

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


[PATCHv2 10/10] thermal: ti-soc: Kconfig fix to avoid menu showing wrongly

2015-09-13 Thread Eduardo Valentin
Move the dependencies to menu, so we avoid showing it wrongly.

Cc: Zhang Rui <rui.zh...@intel.com>
Cc: linux...@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin <edubez...@gmail.com>
---
 drivers/thermal/Kconfig| 1 +
 drivers/thermal/ti-soc-thermal/Kconfig | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 63b46c0..9453553 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -341,6 +341,7 @@ config ACPI_THERMAL_REL
depends on ACPI
 
 menu "Texas Instruments thermal drivers"
+depends on ARCH_HAS_BANDGAP || COMPILE_TEST
 source "drivers/thermal/ti-soc-thermal/Kconfig"
 endmenu
 
diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
b/drivers/thermal/ti-soc-thermal/Kconfig
index 7a24018..cb6686f 100644
--- a/drivers/thermal/ti-soc-thermal/Kconfig
+++ b/drivers/thermal/ti-soc-thermal/Kconfig
@@ -1,7 +1,5 @@
 config TI_SOC_THERMAL
tristate "Texas Instruments SoCs temperature sensor driver"
-   depends on THERMAL
-   depends on ARCH_HAS_BANDGAP || COMPILE_TEST
help
  If you say yes here you get support for the Texas Instruments
  OMAP4460+ on die bandgap temperature sensor support. The register
-- 
2.5.0

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


[PATCH 1/1] thermal: ti-soc: Kconfig fix to avoid menu showing wrongly

2015-09-09 Thread Eduardo Valentin
Move the dependencies to menu, so we avoid showing it wrongly.

Cc: Zhang Rui <rui.zh...@intel.com>
Cc: linux...@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin <edubez...@gmail.com>
---
 drivers/thermal/Kconfig| 1 +
 drivers/thermal/ti-soc-thermal/Kconfig | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)
---

This depends on the compile test series.

diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index a752bef..c5eb142 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -341,6 +341,7 @@ config ACPI_THERMAL_REL
depends on ACPI
 
 menu "Texas Instruments thermal drivers"
+depends on ARCH_HAS_BANDGAP || COMPILE_TEST
 source "drivers/thermal/ti-soc-thermal/Kconfig"
 endmenu
 
diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
b/drivers/thermal/ti-soc-thermal/Kconfig
index 7a24018..cb6686f 100644
--- a/drivers/thermal/ti-soc-thermal/Kconfig
+++ b/drivers/thermal/ti-soc-thermal/Kconfig
@@ -1,7 +1,5 @@
 config TI_SOC_THERMAL
tristate "Texas Instruments SoCs temperature sensor driver"
-   depends on THERMAL
-   depends on ARCH_HAS_BANDGAP || COMPILE_TEST
help
  If you say yes here you get support for the Texas Instruments
  OMAP4460+ on die bandgap temperature sensor support. The register
-- 
2.5.0

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


[PATCHv3 1/1] ti-soc-thermal: implement omap3 support

2015-09-09 Thread Eduardo Valentin
From: Pavel Machek <pa...@ucw.cz>

This adds support for OMAP3 chips to ti-soc-thermal. As requested by
TI people, it is marked unreliable and warning is printed.

Cc: Zhang Rui <rui.zh...@intel.com>
Cc: linux...@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Pavel Machek <pa...@ucw.cz>
Signed-off-by: Eduardo Valentin <edubez...@gmail.com>
---
 .../devicetree/bindings/thermal/ti_soc_thermal.txt |   7 ++
 drivers/thermal/ti-soc-thermal/Kconfig |  15 +++
 drivers/thermal/ti-soc-thermal/Makefile|   1 +
 .../thermal/ti-soc-thermal/omap3-thermal-data.c| 103 +
 drivers/thermal/ti-soc-thermal/ti-bandgap.c|  10 ++
 drivers/thermal/ti-soc-thermal/ti-bandgap.h|   9 ++
 6 files changed, 145 insertions(+)
 create mode 100644 drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
---

Just not leave Pavels work behind, I took his patch and amended a couple
of things:
(1) added the omap3 DT example
(2) improved the dev_warn message
(3) improved the code documentation

diff --git a/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt 
b/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
index 0c9222d..d9a1b54 100644
--- a/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
@@ -10,6 +10,7 @@ to the silicon temperature.
 
 Required properties:
 - compatible : Should be:
+  - "ti,omap34xx-bandgap" : for OMAP34xx bandgap
   - "ti,omap4430-bandgap" : for OMAP4430 bandgap
   - "ti,omap4460-bandgap" : for OMAP4460 bandgap
   - "ti,omap4470-bandgap" : for OMAP4470 bandgap
@@ -25,6 +26,12 @@ to each bandgap version, because the mapping may change from
 soc to soc, apart of depending on available features.
 
 Example:
+OMAP34xx:
+bandgap {
+   reg = <0x48002524 0x4>;
+   compatible = "ti,omap34xx-bandgap";
+};
+
 OMAP4430:
 bandgap {
reg = <0x4a002260 0x4 0x4a00232C 0x4>;
diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
b/drivers/thermal/ti-soc-thermal/Kconfig
index cb6686f..ea8283f 100644
--- a/drivers/thermal/ti-soc-thermal/Kconfig
+++ b/drivers/thermal/ti-soc-thermal/Kconfig
@@ -19,6 +19,21 @@ config TI_THERMAL
  This includes trip points definitions, extrapolation rules and
  CPU cooling device bindings.
 
+config OMAP3_THERMAL
+   bool "Texas Instruments OMAP3 thermal support"
+   depends on TI_SOC_THERMAL
+   depends on ARCH_OMAP3 || COMPILE_TEST
+   help
+ If you say yes here you get thermal support for the Texas Instruments
+ OMAP3 SoC family. The current chips supported are:
+  - OMAP3430
+
+ OMAP3 chips normally don't need thermal management, and sensors in
+ this generation are not accurate, nor they are very close to
+ the important hotspots.
+
+ Say 'N' here.
+
 config OMAP4_THERMAL
bool "Texas Instruments OMAP4 thermal support"
depends on TI_SOC_THERMAL
diff --git a/drivers/thermal/ti-soc-thermal/Makefile 
b/drivers/thermal/ti-soc-thermal/Makefile
index 1226b24..0f89bdf 100644
--- a/drivers/thermal/ti-soc-thermal/Makefile
+++ b/drivers/thermal/ti-soc-thermal/Makefile
@@ -2,5 +2,6 @@ obj-$(CONFIG_TI_SOC_THERMAL)+= ti-soc-thermal.o
 ti-soc-thermal-y   := ti-bandgap.o
 ti-soc-thermal-$(CONFIG_TI_THERMAL)+= ti-thermal-common.o
 ti-soc-thermal-$(CONFIG_DRA752_THERMAL)+= dra752-thermal-data.o
+ti-soc-thermal-$(CONFIG_OMAP3_THERMAL) += omap3-thermal-data.o
 ti-soc-thermal-$(CONFIG_OMAP4_THERMAL) += omap4-thermal-data.o
 ti-soc-thermal-$(CONFIG_OMAP5_THERMAL) += omap5-thermal-data.o
diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c 
b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
new file mode 100644
index 000..8470225
--- /dev/null
+++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
@@ -0,0 +1,103 @@
+/*
+ * OMAP3 thermal driver.
+ *
+ * Copyright (C) 2011-2012 Texas Instruments Inc.
+ * Copyright (C) 2014 Pavel Machek <pa...@ucw.cz>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Note
+ * http://www.ti.com/lit/er/sprz278f/sprz278f.pdf "Advisory
+ * 3.1.1.186 MMC OCP Clock Not Gated When Thermal Sensor Is Used"
+ *
+ * Also TI says:
+ * Just be careful when you try to make thermal policy like decisions
+ * based on this sensor. Placement of the sensor w.r.t the actual logic
+ * generatin

[PATCH 17/17] thermal: ti-soc: allow compile test

2015-09-09 Thread Eduardo Valentin
Adding COMPILE_TEST flag to ti-soc driver to facilitate
maintenance.

Cc: Zhang Rui <rui.zh...@intel.com>
Cc: linux...@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin <edubez...@gmail.com>
---
 drivers/thermal/ti-soc-thermal/Kconfig | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
b/drivers/thermal/ti-soc-thermal/Kconfig
index bd4c7be..7a24018 100644
--- a/drivers/thermal/ti-soc-thermal/Kconfig
+++ b/drivers/thermal/ti-soc-thermal/Kconfig
@@ -1,7 +1,7 @@
 config TI_SOC_THERMAL
tristate "Texas Instruments SoCs temperature sensor driver"
depends on THERMAL
-   depends on ARCH_HAS_BANDGAP
+   depends on ARCH_HAS_BANDGAP || COMPILE_TEST
help
  If you say yes here you get support for the Texas Instruments
  OMAP4460+ on die bandgap temperature sensor support. The register
@@ -24,7 +24,7 @@ config TI_THERMAL
 config OMAP4_THERMAL
bool "Texas Instruments OMAP4 thermal support"
depends on TI_SOC_THERMAL
-   depends on ARCH_OMAP4
+   depends on ARCH_OMAP4 || COMPILE_TEST
help
  If you say yes here you get thermal support for the Texas Instruments
  OMAP4 SoC family. The current chip supported are:
@@ -38,7 +38,7 @@ config OMAP4_THERMAL
 config OMAP5_THERMAL
bool "Texas Instruments OMAP5 thermal support"
depends on TI_SOC_THERMAL
-   depends on SOC_OMAP5
+   depends on SOC_OMAP5 || COMPILE_TEST
help
  If you say yes here you get thermal support for the Texas Instruments
  OMAP5 SoC family. The current chip supported are:
@@ -50,7 +50,7 @@ config OMAP5_THERMAL
 config DRA752_THERMAL
bool "Texas Instruments DRA752 thermal support"
depends on TI_SOC_THERMAL
-   depends on SOC_DRA7XX
+   depends on SOC_DRA7XX || COMPILE_TEST
help
  If you say yes here you get thermal support for the Texas Instruments
  DRA752 SoC family. The current chip supported are:
-- 
2.5.0

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


Re: [PATCHv2] ti-soc-thermal: implement omap3 support

2015-04-07 Thread Eduardo Valentin
Hi Pavel,

On Thu, Apr 02, 2015 at 04:49:07PM +0200, Pavel Machek wrote:
 
 
 This adds support for OMAP3 chips to ti-soc-thermal. As requested by
 TI people, it is marked unreliable and warning is printed.
 
 Signed-off-by: Pavel Machek pa...@ucw.cz
 
 ---
 
 Patch is against thermal linus tree, please apply so that it has
 chance for 4.1.

I thought of accepting this one the way it and amending the message
myself, but you missed the DT example. 

Actually it is bests, as I already mention, that you send the patch
together with the DT changes too. 

Can you please resend this one with the following (minor) changes:

 
 v2: fixed min/max temp
 
 diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
 b/drivers/thermal/ti-soc-thermal/Kconfig
 index bd4c7be..d414c2d 100644
 --- a/drivers/thermal/ti-soc-thermal/Kconfig
 +++ b/drivers/thermal/ti-soc-thermal/Kconfig
 @@ -21,6 +21,21 @@ config TI_THERMAL
 This includes trip points definitions, extrapolation rules and
 CPU cooling device bindings.
  
 +config OMAP3_THERMAL
 + bool Texas Instruments OMAP3 thermal support
 + depends on TI_SOC_THERMAL
 + depends on ARCH_OMAP3
 + help
 +   If you say yes here you get thermal support for the Texas Instruments
 +   OMAP3 SoC family. The current chips supported are:
 +- OMAP3430
 +
 +   OMAP3 chips normally don't need thermal management, and sensors in
 +   this generation are not accurate, nor they are very close to
 +   the important hotspots.
 +
 +   Say 'N' here.
 +
  config OMAP4_THERMAL
   bool Texas Instruments OMAP4 thermal support
   depends on TI_SOC_THERMAL
 diff --git a/drivers/thermal/ti-soc-thermal/Makefile 
 b/drivers/thermal/ti-soc-thermal/Makefile
 index 1226b24..0f89bdf 100644
 --- a/drivers/thermal/ti-soc-thermal/Makefile
 +++ b/drivers/thermal/ti-soc-thermal/Makefile
 @@ -2,5 +2,6 @@ obj-$(CONFIG_TI_SOC_THERMAL)  += ti-soc-thermal.o
  ti-soc-thermal-y := ti-bandgap.o
  ti-soc-thermal-$(CONFIG_TI_THERMAL)  += ti-thermal-common.o
  ti-soc-thermal-$(CONFIG_DRA752_THERMAL)  += dra752-thermal-data.o
 +ti-soc-thermal-$(CONFIG_OMAP3_THERMAL)   += omap3-thermal-data.o
  ti-soc-thermal-$(CONFIG_OMAP4_THERMAL)   += omap4-thermal-data.o
  ti-soc-thermal-$(CONFIG_OMAP5_THERMAL)   += omap5-thermal-data.o
 diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c 
 b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
 new file mode 100644
 index 000..86a4e2d
 --- /dev/null
 +++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
 @@ -0,0 +1,103 @@
 +/*
 + * OMAP3 thermal driver.
 + *
 + * Copyright (C) 2011-2012 Texas Instruments Inc.
 + * Copyright (C) 2014 Pavel Machek pa...@ucw.cz
 + *
 + * This software is licensed under the terms of the GNU General Public
 + * License version 2, as published by the Free Software Foundation, and
 + * may be copied, distributed, and modified under those terms.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 + * GNU General Public License for more details.
 + *
 + * Note
 + * http://www.ti.com/lit/er/sprz278f/sprz278f.pdf Advisory
 + * 3.1.1.186 MMC OCP Clock Not Gated When Thermal Sensor Is Used
 + *
 + * Also TI says:
 + * Just be careful when you try to make thermal policy like decisions
 + * based on this sensor. Placement of the sensor w.r.t the actual logic
 + * generating heat has to be a factor as well. If you are just looking
 + * for an approximation temperature (thermometerish kind), you might be
 + * ok with this. I am not sure we'd find any TI data around this.. just a
 + * heads up.
 + */
 +
 +#include ti-thermal.h
 +#include ti-bandgap.h
 +
 +/*
 + * OMAP34XX has one instance of thermal sensor for MPU
 + * need to describe the individual bit fields
 + */
 +static struct temp_sensor_registers
 +omap34xx_mpu_temp_sensor_registers = {
 + .temp_sensor_ctrl = 0,
 + .bgap_soc_mask = BIT(8),
 + .bgap_eocz_mask = BIT(7),
 + .bgap_dtemp_mask = 0x7f,
 +
 + .bgap_mode_ctrl = 0,
 + .mode_ctrl_mask = BIT(9),
 +};
 +
 +/* Thresholds and limits for OMAP34XX MPU temperature sensor */
 +static struct temp_sensor_data omap34xx_mpu_temp_sensor_data = {
 + .min_freq = 32768,
 + .max_freq = 32768,
 + .max_temp = 125000,
 + .min_temp = -4,
 + .hyst_val = 5000,
 +};
 +
 +/*
 + * Temperature values in milli degree celsius
 + */
 +static const int
 +omap34xx_adc_to_temp[128] = {
 + -4, -4, -4, -4, -4, -39000, -38000, -36000,
 + -34000, -32000, -31000, -29000, -28000, -26000, -25000, -24000,
 + -22000, -21000, -19000, -18000, -17000, -15000, -14000, -12000,
 + -11000, -9000, -8000, -7000, -5000, -4000, -2000, -1000, ,
 + 1000, 3000, 4000, 5000, 7000, 8000, 1, 11000, 13000, 14000,
 + 15000, 17000, 18000, 

Re: [PATCHv2] ti-soc-thermal: implement omap3 support

2015-04-07 Thread Eduardo Valentin
On Thu, Apr 02, 2015 at 04:49:07PM +0200, Pavel Machek wrote:
 
 
 This adds support for OMAP3 chips to ti-soc-thermal. As requested by
 TI people, it is marked unreliable and warning is printed.
 
 Signed-off-by: Pavel Machek pa...@ucw.cz
 
 ---
 
 Patch is against thermal linus tree, please apply so that it has
 chance for 4.1.
 
 v2: fixed min/max temp
 
 diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
 b/drivers/thermal/ti-soc-thermal/Kconfig
 index bd4c7be..d414c2d 100644
 --- a/drivers/thermal/ti-soc-thermal/Kconfig
 +++ b/drivers/thermal/ti-soc-thermal/Kconfig
 @@ -21,6 +21,21 @@ config TI_THERMAL
 This includes trip points definitions, extrapolation rules and
 CPU cooling device bindings.
  
 +config OMAP3_THERMAL
 + bool Texas Instruments OMAP3 thermal support
 + depends on TI_SOC_THERMAL
 + depends on ARCH_OMAP3
 + help
 +   If you say yes here you get thermal support for the Texas Instruments
 +   OMAP3 SoC family. The current chips supported are:
 +- OMAP3430
 +
 +   OMAP3 chips normally don't need thermal management, and sensors in
 +   this generation are not accurate, nor they are very close to
 +   the important hotspots.
 +
 +   Say 'N' here.
 +
  config OMAP4_THERMAL
   bool Texas Instruments OMAP4 thermal support
   depends on TI_SOC_THERMAL
 diff --git a/drivers/thermal/ti-soc-thermal/Makefile 
 b/drivers/thermal/ti-soc-thermal/Makefile
 index 1226b24..0f89bdf 100644
 --- a/drivers/thermal/ti-soc-thermal/Makefile
 +++ b/drivers/thermal/ti-soc-thermal/Makefile
 @@ -2,5 +2,6 @@ obj-$(CONFIG_TI_SOC_THERMAL)  += ti-soc-thermal.o
  ti-soc-thermal-y := ti-bandgap.o
  ti-soc-thermal-$(CONFIG_TI_THERMAL)  += ti-thermal-common.o
  ti-soc-thermal-$(CONFIG_DRA752_THERMAL)  += dra752-thermal-data.o
 +ti-soc-thermal-$(CONFIG_OMAP3_THERMAL)   += omap3-thermal-data.o
  ti-soc-thermal-$(CONFIG_OMAP4_THERMAL)   += omap4-thermal-data.o
  ti-soc-thermal-$(CONFIG_OMAP5_THERMAL)   += omap5-thermal-data.o
 diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c 
 b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
 new file mode 100644
 index 000..86a4e2d
 --- /dev/null
 +++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
 @@ -0,0 +1,103 @@
 +/*
 + * OMAP3 thermal driver.
 + *
 + * Copyright (C) 2011-2012 Texas Instruments Inc.
 + * Copyright (C) 2014 Pavel Machek pa...@ucw.cz
 + *
 + * This software is licensed under the terms of the GNU General Public
 + * License version 2, as published by the Free Software Foundation, and
 + * may be copied, distributed, and modified under those terms.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 + * GNU General Public License for more details.
 + *
 + * Note
 + * http://www.ti.com/lit/er/sprz278f/sprz278f.pdf Advisory
 + * 3.1.1.186 MMC OCP Clock Not Gated When Thermal Sensor Is Used
 + *
 + * Also TI says:
 + * Just be careful when you try to make thermal policy like decisions
 + * based on this sensor. Placement of the sensor w.r.t the actual logic
 + * generating heat has to be a factor as well. If you are just looking
 + * for an approximation temperature (thermometerish kind), you might be
 + * ok with this. I am not sure we'd find any TI data around this.. just a
 + * heads up.
 + */
 +
 +#include ti-thermal.h
 +#include ti-bandgap.h
 +
 +/*
 + * OMAP34XX has one instance of thermal sensor for MPU
 + * need to describe the individual bit fields
 + */
 +static struct temp_sensor_registers
 +omap34xx_mpu_temp_sensor_registers = {
 + .temp_sensor_ctrl = 0,
 + .bgap_soc_mask = BIT(8),
 + .bgap_eocz_mask = BIT(7),
 + .bgap_dtemp_mask = 0x7f,
 +
 + .bgap_mode_ctrl = 0,
 + .mode_ctrl_mask = BIT(9),
 +};
 +
 +/* Thresholds and limits for OMAP34XX MPU temperature sensor */
 +static struct temp_sensor_data omap34xx_mpu_temp_sensor_data = {
 + .min_freq = 32768,
 + .max_freq = 32768,
 + .max_temp = 125000,
 + .min_temp = -4,
 + .hyst_val = 5000,
 +};
 +
 +/*
 + * Temperature values in milli degree celsius
 + */
 +static const int
 +omap34xx_adc_to_temp[128] = {
 + -4, -4, -4, -4, -4, -39000, -38000, -36000,
 + -34000, -32000, -31000, -29000, -28000, -26000, -25000, -24000,
 + -22000, -21000, -19000, -18000, -17000, -15000, -14000, -12000,
 + -11000, -9000, -8000, -7000, -5000, -4000, -2000, -1000, ,
 + 1000, 3000, 4000, 5000, 7000, 8000, 1, 11000, 13000, 14000,
 + 15000, 17000, 18000, 2, 21000, 22000, 24000, 25000, 27000,
 + 28000, 3, 31000, 32000, 34000, 35000, 37000, 38000, 39000,
 + 41000, 42000, 44000, 45000, 47000, 48000, 49000, 51000, 52000,
 + 53000, 55000, 56000, 58000, 59000, 6, 62000, 63000, 65000,
 + 66000, 67000, 69000, 7, 72000, 

Re: [PATCH v2] thermal: ti-soc-thermal: dra7: Implement Workaround for Errata i814 - Bandgap Temperature read Dtemp can be corrupted

2015-04-07 Thread Eduardo Valentin
Hello K,

On Tue, Apr 07, 2015 at 08:50:04AM +0530, Keerthy wrote:
 Hi Eduardo,
 
 On Friday 27 March 2015 02:15 PM, Keerthy wrote:
 Bandgap Temperature read Dtemp can be corrupted
 
 DESCRIPTION
  Read accesses to registers listed below can be corrupted due to 
  incorrect resynchronization between
  clock domains.
 
  Read access to registers below can be corrupted :
  • CTRL_CORE_DTEMP_MPU/GPU/CORE/DSPEVE/IVA_n (n = 0 to 4)
  • CTRL_CORE_TEMP_SENSOR_MPU/GPU/CORE/DSPEVE/IVA_n
 
 WORKAROUND
  Multiple reads to 
  CTRL_CORE_TEMP_SENSOR_MPU/GPU/CORE/DSPEVE/IVA[9:0]:
  BGAP_DTEMPMPU/GPU/CORE/DSPEVE/IVA is needed to discard false value 
  and read right value:
  1. Perform two successive reads to BGAP_DTEMP bit field.
  (a) If read1 returns Val1 and read2 returns Val1, 
  then right value is Val1.
  (b) If read1 returns Val1, read 2 returns Val2, a 
  third read is needed.
  2. Perform third read
  (a) If read3 returns Val2 then right value is Val2.
  (b) If read3 returns Val3, then right value is Val3.

The third read description (b) is misleading/confusing. Does it mean
third read value is always correct or do we need to compare against val1
and val2? if val3 != val2  val3 != val1, which one is correct? none?

 
 

Thanks for the detailed errata description.

 A gentle ping on this.
 

Sorry for the late answer. (minor) Comment below:

 Signed-off-by: Keerthy j-keer...@ti.com
 ---
 
 Read all the temperatures from the 5 sensors and saw that
 they were sane with time.
 
 Ran cpuloadgen and saw that temperatures rising on all the sensors
 and cooled down as soon as the load was reduced.
 
   .../thermal/ti-soc-thermal/dra752-thermal-data.c   |  3 +-
   drivers/thermal/ti-soc-thermal/ti-bandgap.c| 37 
  +-
   drivers/thermal/ti-soc-thermal/ti-bandgap.h|  4 +++
   3 files changed, 42 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c 
 b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
 index a492927..58b5c66 100644
 --- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
 +++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
 @@ -420,7 +420,8 @@ const struct ti_bandgap_data dra752_data = {
  TI_BANDGAP_FEATURE_FREEZE_BIT |
  TI_BANDGAP_FEATURE_TALERT |
  TI_BANDGAP_FEATURE_COUNTER_DELAY |
 -TI_BANDGAP_FEATURE_HISTORY_BUFFER,
 +TI_BANDGAP_FEATURE_HISTORY_BUFFER |
 +TI_BANDGAP_FEATURE_ERRATA_814,
  .fclock_name = l3instr_ts_gclk_div,
  .div_ck_name = l3instr_ts_gclk_div,
  .conv_table = dra752_adc_to_temp,
 diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c 
 b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
 index 74c0e34..baf822e 100644
 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
 +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
 @@ -119,6 +119,37 @@ exit:
   }
 
   /**
 + * ti_dra7_bandgap_read_temp() - helper function to read dra7 sensor 
 temperature
 + * @bgp: pointer to ti_bandgap structure
 + * @reg: desired register (offset) to be read
 + *
 + * Function to read dra7 bandgap sensor temperature. This is done separately
 + * so as to workaround the errata Bandgap Temperature read Dtemp can be
 + * corrupted - Errata ID: i814.
 + * Read accesses to registers listed below can be corrupted due to incorrect
 + * resynchronization between clock domains.
 + * Read access to registers below can be corrupted :
 + * CTRL_CORE_DTEMP_MPU/GPU/CORE/DSPEVE/IVA_n (n = 0 to 4)
 + * CTRL_CORE_TEMP_SENSOR_MPU/GPU/CORE/DSPEVE/IVA_n
 + *
 + * Return: the register value.
 + */
 +static u32 ti_dra7_bandgap_read_temp(struct ti_bandgap *bgp,  u32 reg)

Are you sure this bug affects only DRA7? I would prefer you name this
not specific to soc version. Maybe bind it to the errata:

+static u32 ti_i814_bandgap_read_temp(struct ti_bandgap *bgp,  u32 reg)

 +{
 +u32 val1, val2;
 +
 +val1 = ti_bandgap_readl(bgp, reg);
 +val2 = ti_bandgap_readl(bgp, reg);
 +
 +/* If both times we read the same value then that is right */

Please, indent the comments too.

 +if (val1 == val2)
 +return val1;
 +
 +/* if val1 and val2 are different read it third time */

ditto.

 +return ti_bandgap_readl(bgp, reg);

Actually, if I understood the errata description correctly, you need to:
1. read a third time (val3)
2. compare val3 against val2, and return val2 if they are same

If they are different, the errata is not clear. Can you please clarify?

 +}
 +
 +/**
* ti_bandgap_read_temp() - helper function to read sensor temperature
* @bgp: pointer to ti_bandgap structure
* @id: bandgap sensor id
 @@ -148,7 +179,11 @@ static u32 ti_bandgap_read_temp(struct ti_bandgap *bgp, 
 int id)
  }
 
 

Re: [PATCHv2] ti-soc-thermal: request temperature periodically if hw can't do that itself

2015-03-24 Thread Eduardo Valentin
On Sun, Jan 18, 2015 at 09:24:47PM +0100, Pavel Machek wrote:
 
 When periodic mode is not enabled, it is neccessary to force reads.
 
 Signed-off-by: Pavel Machek pa...@ucw.cz

This is a malformed patch. here is patch output (or git am)
patching file drivers/thermal/ti-soc-thermal/ti-bandgap.c
patch:  malformed patch at line 68: (english)
http://www.livejournal.com/~pavelmachek


I would really recommend you to use git to send your patches to avoid
such problems. Can you please resend this patch in its proper format?


 
 diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c 
 b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
 index 634b6ce..2fde78c 100644
 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
 +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
 @@ -43,6 +43,8 @@
  
  #include ti-bandgap.h
  
 +static int ti_bandgap_force_single_read(struct ti_bandgap *bgp, int id);
 +
  /***   Helper functions to access registers and their bitfields   ***/
  
  /**
 @@ -852,14 +831,21 @@ int ti_bandgap_read_temperature(struct ti_bandgap *bgp, 
 int id,
   if (ret)
   return ret;
  
 + if (!TI_BANDGAP_HAS(bgp, MODE_CONFIG)) {
 + ret = ti_bandgap_force_single_read(bgp, id);
 + if (ret)
 + return ret;
 + }
 +
   spin_lock(bgp-lock);
   temp = ti_bandgap_read_temp(bgp, id);
 
 -- 
 (english) http://www.livejournal.com/~pavelmachek
 (cesky, pictures) 
 http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCH V2 2/2] ARM: dts: am57xx-beagle-x15: Add thermal map to include fan and tmp102

2015-03-24 Thread Eduardo Valentin
On Mon, Mar 23, 2015 at 02:39:39PM -0500, Nishanth Menon wrote:
 BeagleBoard-X15 has capability for a fan and has an onboard TMP102
 temperature sensor as well. This allows us to create a new thermal
 zone (called, un-imaginatively board), and allows us to use some
 active cooling as temperatures start edge upward in the system by
 creating a new alert temperature (emperically 50C) for cpu.
 
 NOTE: Fan is NOT mounted by default on the platform, in such a case,
 all we end up doing is switch on a regulator and leak very minimal
 current.
 
 Signed-off-by: Nishanth Menon n...@ti.com

Acked-by: Eduardo Valentin edubez...@gmail.com

 ---
 Changes since V1:
   - slight change in omap4-cpu-thermal for usage in am57xx-dtsi
   - Not carrying forward ack due to change
 
 V1: http://marc.info/?t=14268810274r=1w=2
 
  arch/arm/boot/dts/am57xx-beagle-x15.dts  |   49 
 ++
  arch/arm/boot/dts/omap4-cpu-thermal.dtsi |4 +--
  2 files changed, 51 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/boot/dts/am57xx-beagle-x15.dts 
 b/arch/arm/boot/dts/am57xx-beagle-x15.dts
 index 41642fe770a1..6a3621c23017 100644
 --- a/arch/arm/boot/dts/am57xx-beagle-x15.dts
 +++ b/arch/arm/boot/dts/am57xx-beagle-x15.dts
 @@ -86,6 +86,7 @@
   gpios =  tps659038_gpio 1 GPIO_ACTIVE_HIGH;
   gpio-fan,speed-map = 0 0,
13000 1;
 + #cooling-cells = 2;
   };
  
   extcon_usb1: extcon_usb1 {
 @@ -441,6 +442,7 @@
   pinctrl-0 = tmp102_pins_default;
   interrupt-parent = gpio7;
   interrupts = 16 IRQ_TYPE_LEVEL_LOW;
 + #thermal-sensor-cells = 1;
   };
  };
  
 @@ -559,3 +561,50 @@
  usb2 {
   dr_mode = peripheral;
  };
 +
 +cpu_trips {
 + cpu_alert1: cpu_alert1 {
 + temperature = 5; /* millicelsius */
 + hysteresis = 2000; /* millicelsius */
 + type = active;
 + };
 +};
 +
 +cpu_cooling_maps {
 + map1 {
 + trip = cpu_alert1;
 + cooling-device = gpio_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT;
 + };
 +};
 +
 +thermal_zones {
 + board_thermal: board_thermal {
 + polling-delay-passive = 1250; /* milliseconds */
 + polling-delay = 1500; /* milliseconds */
 +
 + /* sensor   ID */
 + thermal-sensors = tmp102 0;
 +
 + board_trips: trips {
 + board_alert0: board_alert {
 + temperature = 4; /* millicelsius */
 + hysteresis = 2000; /* millicelsius */
 + type = active;
 + };
 +
 + board_crit: board_crit {
 + temperature = 105000; /* millicelsius */
 + hysteresis = 0; /* millicelsius */
 + type = critical;
 + };
 + };
 +
 + board_cooling_maps: cooling-maps {
 + map0 {
 + trip = board_alert0;
 + cooling-device =
 +   gpio_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT;
 + };
 + };
 +   };
 +};
 diff --git a/arch/arm/boot/dts/omap4-cpu-thermal.dtsi 
 b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
 index cb9458feb2e3..ab7f87ae96f0 100644
 --- a/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
 +++ b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
 @@ -18,7 +18,7 @@ cpu_thermal: cpu_thermal {
   /* sensor   ID */
  thermal-sensors = bandgap 0;
  
 -trips {
 + cpu_trips: trips {
  cpu_alert0: cpu_alert {
  temperature = 10; /* millicelsius */
  hysteresis = 2000; /* millicelsius */
 @@ -31,7 +31,7 @@ cpu_thermal: cpu_thermal {
  };
  };
  
 - cooling-maps {
 + cpu_cooling_maps: cooling-maps {
   map0 {
   trip = cpu_alert0;
   cooling-device =
 -- 
 1.7.9.5
 


signature.asc
Description: Digital signature


Re: [PATCHv2] thermal: add omap3 support

2015-03-23 Thread Eduardo Valentin
On Sun, Jan 18, 2015 at 09:28:24PM +0100, Pavel Machek wrote:
 
 Add support for omap3430 sensor. Tested on Nokia N900.
 
 Fix help text to be closer to english.
 
 Ifdefs in ti-bandgap.h are not neccessary, as users have #ifdefs,
 already.
 
 Signed-off-by: Pavel Machek pa...@ucw.cz

You need to update the driver device tree binding documentation. Please
include an example of its usage there.


Also, a separate patch with the required DT changes is always welcome.

 
 diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
 b/drivers/thermal/ti-soc-thermal/Kconfig
 index bd4c7be..65c478e 100644
 --- a/drivers/thermal/ti-soc-thermal/Kconfig
 +++ b/drivers/thermal/ti-soc-thermal/Kconfig
 @@ -21,13 +21,28 @@ config TI_THERMAL
 This includes trip points definitions, extrapolation rules and
 CPU cooling device bindings.
  
 +config OMAP3_THERMAL
 + bool Texas Instruments OMAP3 thermal support
 + depends on TI_SOC_THERMAL
 + depends on ARCH_OMAP3
 + help
 +   If you say yes here you get thermal support for the Texas Instruments
 +   OMAP3 SoC family. The current chips supported are:
 +- OMAP3430
 +
 +   OMAP3 chips normally don't need thermal management, and sensors in
 +   this generation are not very accurate, nor they are very close to
 +   the important hotspots.
 +
 +   Say 'N' here.
 +
  config OMAP4_THERMAL
   bool Texas Instruments OMAP4 thermal support
   depends on TI_SOC_THERMAL
   depends on ARCH_OMAP4
   help
 If you say yes here you get thermal support for the Texas Instruments
 -   OMAP4 SoC family. The current chip supported are:
 +   OMAP4 SoC family. The current chips supported are:
  - OMAP4430
  - OMAP4460
  - OMAP4470
 @@ -41,7 +56,7 @@ config OMAP5_THERMAL
   depends on SOC_OMAP5
   help
 If you say yes here you get thermal support for the Texas Instruments
 -   OMAP5 SoC family. The current chip supported are:
 +   OMAP5 SoC family. The current chips supported are:
  - OMAP5430
  
 This includes alert interrupts generation and also the TSHUT
 @@ -53,7 +68,7 @@ config DRA752_THERMAL
   depends on SOC_DRA7XX
   help
 If you say yes here you get thermal support for the Texas Instruments
 -   DRA752 SoC family. The current chip supported are:
 +   DRA752 SoC family. The current chips supported are:

minor: I would prefer you fix this in a separate patch.

  - DRA752
  
 This includes alert interrupts generation and also the TSHUT
 diff --git a/drivers/thermal/ti-soc-thermal/Makefile 
 b/drivers/thermal/ti-soc-thermal/Makefile
 index 1226b24..0f89bdf 100644
 --- a/drivers/thermal/ti-soc-thermal/Makefile
 +++ b/drivers/thermal/ti-soc-thermal/Makefile
 @@ -2,5 +2,6 @@ obj-$(CONFIG_TI_SOC_THERMAL)  += ti-soc-thermal.o
  ti-soc-thermal-y := ti-bandgap.o
  ti-soc-thermal-$(CONFIG_TI_THERMAL)  += ti-thermal-common.o
  ti-soc-thermal-$(CONFIG_DRA752_THERMAL)  += dra752-thermal-data.o
 +ti-soc-thermal-$(CONFIG_OMAP3_THERMAL)   += omap3-thermal-data.o
  ti-soc-thermal-$(CONFIG_OMAP4_THERMAL)   += omap4-thermal-data.o
  ti-soc-thermal-$(CONFIG_OMAP5_THERMAL)   += omap5-thermal-data.o
 diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c 
 b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
 new file mode 100644
 index 000..5cee2a35
 --- /dev/null
 +++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
 @@ -0,0 +1,103 @@
 +/*
 + * OMAP3 thermal driver.
 + *
 + * Copyright (C) 2011-2012 Texas Instruments Inc.
 + * Copyright (C) 2014 Pavel Machek pa...@ucw.cz
 + *
 + * This software is licensed under the terms of the GNU General Public
 + * License version 2, as published by the Free Software Foundation, and
 + * may be copied, distributed, and modified under those terms.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 + * GNU General Public License for more details.
 + *
 + * Note
 + * http://www.ti.com/lit/er/sprz278f/sprz278f.pdf Advisory
 + * 3.1.1.186 MMC OCP Clock Not Gated When Thermal Sensor Is Used
 + *
 + * Also TI says:
 + * Just be careful when you try to make thermal policy like decisions
 + * based on this sensor. Placement of the sensor w.r.t the actual logic
 + * generating heat has to be a factor as well. If you are just looking
 + * for an approximation temperature (thermometerish kind), you might be
 + * ok with this. I am not sure we'd find any TI data around this.. just a
 + * heads up.
 + */
 +
 +#include ti-thermal.h
 +#include ti-bandgap.h
 +
 +/*
 + * OMAP34XX has one instance of thermal sensor for MPU
 + * need to describe the individual bit fields
 + */
 +static struct temp_sensor_registers
 +omap34xx_mpu_temp_sensor_registers = {
 + .temp_sensor_ctrl = 0,
 +  

Re: [PATCHv2] thermal: add omap3 support

2015-03-23 Thread Eduardo Valentin
On Mon, Mar 23, 2015 at 04:58:30PM +0100, Pavel Machek wrote:
 On Mon 2015-03-23 10:31:51, Eduardo Valentin wrote:
  On Sun, Jan 18, 2015 at 09:28:24PM +0100, Pavel Machek wrote:
   
   Add support for omap3430 sensor. Tested on Nokia N900.
   
   Fix help text to be closer to english.
   
   Ifdefs in ti-bandgap.h are not neccessary, as users have #ifdefs,
   already.
   
   Signed-off-by: Pavel Machek pa...@ucw.cz
  
  You need to update the driver device tree binding documentation. Please
  include an example of its usage there.
  
  Also, a separate patch with the required DT changes is always
  welcome.
 
 I can do it, but can you merge:
 
 Date: Sun, 18 Jan 2015 21:24:47 +0100
 From: Pavel Machek pa...@ucw.cz
 Subject: [PATCHv2] ti-soc-thermal: request temperature periodically if
 hw can't do that itself
 
 
 Date: Sun, 18 Jan 2015 21:20:51 +0100
 From: Pavel Machek pa...@ucw.cz
 Subject: [PATCHv2] ti-soc-thermal: implement eocz bit to make driver
 useful on omap3
 
 Date: Sun, 18 Jan 2015 21:17:10 +0100
 From: Pavel Machek pa...@ucw.cz
 Subject: [PATCHv2] cleanup ti-soc-thermal
 
 First? They are nicely split, as you requested, and I already have too
 many patches in flight.
 
 Thanks for the comments, I'll fix them in my local tree.
   Pavel

Somehow I really thought I already sent those above. I really apologize
for the inconvenience. It seams like they've fallen into the cracks.


I will check those and apply accordingly.

 
 -- 
 (english) http://www.livejournal.com/~pavelmachek
 (cesky, pictures) 
 http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCH 2/3] ARM: dts: DRA7: Add bandgap and related thermal nodes

2015-03-20 Thread Eduardo Valentin
On Fri, Mar 20, 2015 at 02:47:40PM -0500, Nishanth Menon wrote:
 From: Keerthy j-keer...@ti.com
 
 Add bandgap and related thermal nodes. The patch adds 5 thermal
 sensors. Only one cooling device for mpu as of now. The sensors are
 the exact same on both dra72 and dra7.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 Signed-off-by: Nishanth Menon n...@ti.com

Acked-by: Eduardo Valentin edubez...@gmail.com

 ---
  arch/arm/boot/dts/dra7.dtsi   |   12 
  arch/arm/boot/dts/dra72x.dtsi |9 +
  arch/arm/boot/dts/dra74x.dtsi |9 +
  3 files changed, 30 insertions(+)
 
 diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
 index eea4a54d6cb3..4b975cc377fd 100644
 --- a/arch/arm/boot/dts/dra7.dtsi
 +++ b/arch/arm/boot/dts/dra7.dtsi
 @@ -177,6 +177,18 @@
   };
   };
  
 + bandgap: bandgap@4a0021e0 {
 + reg = 0x4a0021e0 0xc
 + 0x4a00232c 0xc
 + 0x4a002380 0x2c
 + 0x4a0023C0 0x3c
 + 0x4a002564 0x8
 + 0x4a002574 0x50;
 + compatible = ti,dra752-bandgap;
 + interrupts = GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH;
 + #thermal-sensor-cells = 1;
 + };
 +
   cm_core_aon: cm_core_aon@4a005000 {
   compatible = ti,dra7-cm-core-aon;
   reg = 0x4a005000 0x2000;
 diff --git a/arch/arm/boot/dts/dra72x.dtsi b/arch/arm/boot/dts/dra72x.dtsi
 index e5a3d23a3df1..43bd0709bde9 100644
 --- a/arch/arm/boot/dts/dra72x.dtsi
 +++ b/arch/arm/boot/dts/dra72x.dtsi
 @@ -20,6 +20,11 @@
   device_type = cpu;
   compatible = arm,cortex-a15;
   reg = 0;
 +
 + /* cooling options */
 + cooling-min-level = 0;
 + cooling-max-level = 2;
 + #cooling-cells = 2; /* min followed by max */
   };
   };
  
 @@ -27,4 +32,8 @@
   compatible = arm,cortex-a15-pmu;
   interrupts = GIC_SPI DIRECT_IRQ(131) IRQ_TYPE_LEVEL_HIGH;
   };
 +
 + thermal_zones: thermal-zones {
 + #include omap5-cpu-thermal.dtsi
 + };
  };
 diff --git a/arch/arm/boot/dts/dra74x.dtsi b/arch/arm/boot/dts/dra74x.dtsi
 index 10173fab1a15..4f2c870836fe 100644
 --- a/arch/arm/boot/dts/dra74x.dtsi
 +++ b/arch/arm/boot/dts/dra74x.dtsi
 @@ -31,6 +31,11 @@
   clock-names = cpu;
  
   clock-latency = 30; /* From omap-cpufreq driver */
 +
 + /* cooling options */
 + cooling-min-level = 0;
 + cooling-max-level = 2;
 + #cooling-cells = 2; /* min followed by max */
   };
   cpu@1 {
   device_type = cpu;
 @@ -45,6 +50,10 @@
GIC_SPI DIRECT_IRQ(132) IRQ_TYPE_LEVEL_HIGH;
   };
  
 + thermal_zones: thermal-zones {
 + #include omap5-cpu-thermal.dtsi
 + };
 +
   ocp {
   omap_dwc3_4: omap_dwc3_4@4894 {
   compatible = ti,dwc3;
 -- 
 1.7.9.5
 


signature.asc
Description: Digital signature


Re: [PATCH 3/3] ARM: dts: am57xx-beagle-x15: Add thermal map

2015-03-20 Thread Eduardo Valentin
On Fri, Mar 20, 2015 at 02:47:41PM -0500, Nishanth Menon wrote:
 BeagleBoard-X15 has capability for a fan and has an onboard TMP102
 temperature sensor as well. This allows us to create a new thermal
 zone (called, un-imaginatively board), and allows us to use some
 active cooling as temperatures start edge upward in the system by
 creating a new alert temperature (emperically 50C) for cpu.
 
 NOTE: Fan is NOT mounted by default on the platform, in such a case,
 all we end up doing is switch on a regulator and leak very minimal
 current.
 
 Signed-off-by: Nishanth Menon n...@ti.com

Acked-by: Eduardo Valentin edubez...@gmail.com

 ---
  arch/arm/boot/dts/am57xx-beagle-x15.dts |   49 
 +++
  1 file changed, 49 insertions(+)
 
 diff --git a/arch/arm/boot/dts/am57xx-beagle-x15.dts 
 b/arch/arm/boot/dts/am57xx-beagle-x15.dts
 index 41642fe770a1..6a3621c23017 100644
 --- a/arch/arm/boot/dts/am57xx-beagle-x15.dts
 +++ b/arch/arm/boot/dts/am57xx-beagle-x15.dts
 @@ -86,6 +86,7 @@
   gpios =  tps659038_gpio 1 GPIO_ACTIVE_HIGH;
   gpio-fan,speed-map = 0 0,
13000 1;
 + #cooling-cells = 2;
   };
  
   extcon_usb1: extcon_usb1 {
 @@ -441,6 +442,7 @@
   pinctrl-0 = tmp102_pins_default;
   interrupt-parent = gpio7;
   interrupts = 16 IRQ_TYPE_LEVEL_LOW;
 + #thermal-sensor-cells = 1;
   };
  };
  
 @@ -559,3 +561,50 @@
  usb2 {
   dr_mode = peripheral;
  };
 +
 +cpu_trips {
 + cpu_alert1: cpu_alert1 {
 + temperature = 5; /* millicelsius */
 + hysteresis = 2000; /* millicelsius */
 + type = active;
 + };
 +};
 +
 +cpu_cooling_maps {
 + map1 {
 + trip = cpu_alert1;
 + cooling-device = gpio_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT;
 + };
 +};
 +
 +thermal_zones {
 + board_thermal: board_thermal {
 + polling-delay-passive = 1250; /* milliseconds */
 + polling-delay = 1500; /* milliseconds */
 +
 + /* sensor   ID */
 + thermal-sensors = tmp102 0;
 +
 + board_trips: trips {
 + board_alert0: board_alert {
 + temperature = 4; /* millicelsius */
 + hysteresis = 2000; /* millicelsius */
 + type = active;
 + };
 +
 + board_crit: board_crit {
 + temperature = 105000; /* millicelsius */
 + hysteresis = 0; /* millicelsius */
 + type = critical;
 + };
 + };
 +
 + board_cooling_maps: cooling-maps {
 + map0 {
 + trip = board_alert0;
 + cooling-device =
 +   gpio_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT;
 + };
 + };
 +   };
 +};
 -- 
 1.7.9.5
 


signature.asc
Description: Digital signature


Re: [PATCH 1/3] ARM: dts: OMAP5+: separate the cpu thermal zone definition from omap4

2015-03-20 Thread Eduardo Valentin
On Fri, Mar 20, 2015 at 02:47:39PM -0500, Nishanth Menon wrote:
 From: Tero Kristo t-kri...@ti.com
 
 OMAP4 has a finer counter granularity, which allows for a delay of 1000ms
 in the thermal zone polling intervals. OMAP5/DRA7 have different counter
 mechanism, which allows at maximum a 500ms timer. Adjust the cpu thermal
 zone accordingly for OMAP5/DRA7.
 
 Signed-off-by: Tero Kristo t-kri...@ti.com
 Signed-off-by: Nishanth Menon n...@ti.com


 ---
  arch/arm/boot/dts/omap5-cpu-thermal.dtsi |   41 
 ++
  arch/arm/boot/dts/omap5.dtsi |2 +-
  2 files changed, 42 insertions(+), 1 deletion(-)
  create mode 100644 arch/arm/boot/dts/omap5-cpu-thermal.dtsi
 
 diff --git a/arch/arm/boot/dts/omap5-cpu-thermal.dtsi 
 b/arch/arm/boot/dts/omap5-cpu-thermal.dtsi
 new file mode 100644
 index ..4a6427c1e47e
 --- /dev/null
 +++ b/arch/arm/boot/dts/omap5-cpu-thermal.dtsi
 @@ -0,0 +1,41 @@
 +/*
 + * Device Tree Source for OMAP4/5 SoC CPU thermal
 + *
 + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
 + * Contact: Tero Kristo t-kri...@ti.com
 + *
 + * This file is licensed under the terms of the GNU General Public License
 + * version 2.  This program is licensed as is without any warranty of any
 + * kind, whether express or implied.
 + */
 +
 +#include dt-bindings/thermal/thermal.h
 +
 +cpu_thermal: cpu_thermal {
 + polling-delay-passive = 250; /* milliseconds */
 + polling-delay = 500; /* milliseconds */
 +
 + /* sensor   ID */
 + thermal-sensors = bandgap 0;
 +
 + cpu_trips: trips {
 + cpu_alert0: cpu_alert {
 + temperature = 10; /* millicelsius */
 + hysteresis = 2000; /* millicelsius */
 + type = passive;
 + };
 + cpu_crit: cpu_crit {
 + temperature = 125000; /* millicelsius */
 + hysteresis = 2000; /* millicelsius */
 + type = critical;
 + };
 + };
 +
 + cpu_cooling_maps: cooling-maps {
 + map0 {
 + trip = cpu_alert0;
 + cooling-device =
 + cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT;
 + };
 + };
 +};
 diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
 index ddff674bd05e..e650d4eb59dd 100644
 --- a/arch/arm/boot/dts/omap5.dtsi
 +++ b/arch/arm/boot/dts/omap5.dtsi
 @@ -67,7 +67,7 @@
   };
  
   thermal-zones {
 - #include omap4-cpu-thermal.dtsi
 + #include omap5-cpu-thermal.dtsi

Can't we simple change the polling value for the omap5 case and reuse
the omap4 file?

   #include omap5-gpu-thermal.dtsi
   #include omap5-core-thermal.dtsi
   };
 -- 
 1.7.9.5
 


signature.asc
Description: Digital signature


Re: [PATCHv2] thermal: add omap3 support

2015-03-13 Thread Eduardo Valentin
On Sun, Jan 18, 2015 at 09:28:24PM +0100, Pavel Machek wrote:
 
 Add support for omap3430 sensor. Tested on Nokia N900.
 
 Fix help text to be closer to english.
 
 Ifdefs in ti-bandgap.h are not neccessary, as users have #ifdefs,
 already.
 
 Signed-off-by: Pavel Machek pa...@ucw.cz
 
 diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
 b/drivers/thermal/ti-soc-thermal/Kconfig
 index bd4c7be..65c478e 100644
 --- a/drivers/thermal/ti-soc-thermal/Kconfig
 +++ b/drivers/thermal/ti-soc-thermal/Kconfig
 @@ -21,13 +21,28 @@ config TI_THERMAL
 This includes trip points definitions, extrapolation rules and
 CPU cooling device bindings.
  
 +config OMAP3_THERMAL
 + bool Texas Instruments OMAP3 thermal support
 + depends on TI_SOC_THERMAL
 + depends on ARCH_OMAP3
 + help
 +   If you say yes here you get thermal support for the Texas Instruments
 +   OMAP3 SoC family. The current chips supported are:
 +- OMAP3430
 +
 +   OMAP3 chips normally don't need thermal management, and sensors in
 +   this generation are not very accurate, nor they are very close to
 +   the important hotspots.
 +
 +   Say 'N' here.
 +
  config OMAP4_THERMAL
   bool Texas Instruments OMAP4 thermal support
   depends on TI_SOC_THERMAL
   depends on ARCH_OMAP4
   help
 If you say yes here you get thermal support for the Texas Instruments
 -   OMAP4 SoC family. The current chip supported are:
 +   OMAP4 SoC family. The current chips supported are:
  - OMAP4430
  - OMAP4460
  - OMAP4470
 @@ -41,7 +56,7 @@ config OMAP5_THERMAL
   depends on SOC_OMAP5
   help
 If you say yes here you get thermal support for the Texas Instruments
 -   OMAP5 SoC family. The current chip supported are:
 +   OMAP5 SoC family. The current chips supported are:
  - OMAP5430
  
 This includes alert interrupts generation and also the TSHUT
 @@ -53,7 +68,7 @@ config DRA752_THERMAL
   depends on SOC_DRA7XX
   help
 If you say yes here you get thermal support for the Texas Instruments
 -   DRA752 SoC family. The current chip supported are:
 +   DRA752 SoC family. The current chips supported are:
  - DRA752
  
 This includes alert interrupts generation and also the TSHUT
 diff --git a/drivers/thermal/ti-soc-thermal/Makefile 
 b/drivers/thermal/ti-soc-thermal/Makefile
 index 1226b24..0f89bdf 100644
 --- a/drivers/thermal/ti-soc-thermal/Makefile
 +++ b/drivers/thermal/ti-soc-thermal/Makefile
 @@ -2,5 +2,6 @@ obj-$(CONFIG_TI_SOC_THERMAL)  += ti-soc-thermal.o
  ti-soc-thermal-y := ti-bandgap.o
  ti-soc-thermal-$(CONFIG_TI_THERMAL)  += ti-thermal-common.o
  ti-soc-thermal-$(CONFIG_DRA752_THERMAL)  += dra752-thermal-data.o
 +ti-soc-thermal-$(CONFIG_OMAP3_THERMAL)   += omap3-thermal-data.o
  ti-soc-thermal-$(CONFIG_OMAP4_THERMAL)   += omap4-thermal-data.o
  ti-soc-thermal-$(CONFIG_OMAP5_THERMAL)   += omap5-thermal-data.o
 diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c 
 b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
 new file mode 100644
 index 000..5cee2a35
 --- /dev/null
 +++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
 @@ -0,0 +1,103 @@
 +/*
 + * OMAP3 thermal driver.
 + *
 + * Copyright (C) 2011-2012 Texas Instruments Inc.
 + * Copyright (C) 2014 Pavel Machek pa...@ucw.cz
 + *
 + * This software is licensed under the terms of the GNU General Public
 + * License version 2, as published by the Free Software Foundation, and
 + * may be copied, distributed, and modified under those terms.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 + * GNU General Public License for more details.
 + *
 + * Note
 + * http://www.ti.com/lit/er/sprz278f/sprz278f.pdf Advisory
 + * 3.1.1.186 MMC OCP Clock Not Gated When Thermal Sensor Is Used
 + *
 + * Also TI says:
 + * Just be careful when you try to make thermal policy like decisions
 + * based on this sensor. Placement of the sensor w.r.t the actual logic
 + * generating heat has to be a factor as well. If you are just looking
 + * for an approximation temperature (thermometerish kind), you might be
 + * ok with this. I am not sure we'd find any TI data around this.. just a
 + * heads up.
 + */
 +
 +#include ti-thermal.h
 +#include ti-bandgap.h
 +
 +/*
 + * OMAP34XX has one instance of thermal sensor for MPU
 + * need to describe the individual bit fields
 + */
 +static struct temp_sensor_registers
 +omap34xx_mpu_temp_sensor_registers = {
 + .temp_sensor_ctrl = 0,
 + .bgap_soc_mask = BIT(8),
 + .bgap_eocz_mask = BIT(7),
 + .bgap_dtemp_mask = 0x7f,
 +
 + .bgap_mode_ctrl = 0,
 + .mode_ctrl_mask = BIT(9),
 +};
 +
 +/* Thresholds and limits for OMAP34XX MPU temperature sensor */
 +static 

Re: [PATCHv2] thermal: add omap3 support

2015-03-13 Thread Eduardo Valentin

Hey Pavel,

On Fri, Mar 13, 2015 at 01:09:35PM +0100, Pavel Machek wrote:
 Hi!
 
 I checked 4.0-rc3 and linux-next as of today, and can not see omap3
 thermal support. Can you apply the patches?

Yeah, it should be possible. Apologize, it really fell into the cracks.

There is a comment on it though. Please check my concern in you v2.

BR,

Eduardo


 
 Thanks,
   Pavel
 -- 
 (english) http://www.livejournal.com/~pavelmachek
 (cesky, pictures) 
 http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCH] ARM: dts: OMAP5: fix polling intervals for thermal zones

2015-02-27 Thread Eduardo Valentin
On Fri, Feb 27, 2015 at 03:59:03PM +0200, Tero Kristo wrote:
 OMAP4 has a finer counter granularity, which allows for a delay of 1000ms
 in the thermal zone polling intervals. OMAP5 has a different counter
 mechanism, which allows at maximum a 500ms timer. Adjust the cpu thermal
 zone polling interval accordingly.
 
 Without this patch, the polling interval information is simply ignored,
 and the following thermal warnings are printed during boot (assuming
 thermal is enabled);
 
 [1.545343] ti-soc-thermal 4a0021e0.bandgap: Delay 1000 ms is not supported
 [1.552691] ti-soc-thermal 4a0021e0.bandgap: Delay 1000 ms is not supported
 [1.560029] ti-soc-thermal 4a0021e0.bandgap: Delay 1000 ms is not supported
 
 Signed-off-by: Tero Kristo t-kri...@ti.com
 Cc: Tony Lindgren t...@atomide.com

Acked-by: Eduardo Valentin edubez...@gmail.com


 ---
  arch/arm/boot/dts/omap5-core-thermal.dtsi |2 +-
  arch/arm/boot/dts/omap5-gpu-thermal.dtsi  |2 +-
  arch/arm/boot/dts/omap5.dtsi  |4 
  3 files changed, 6 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/boot/dts/omap5-core-thermal.dtsi 
 b/arch/arm/boot/dts/omap5-core-thermal.dtsi
 index 19212ac..de8a3d4 100644
 --- a/arch/arm/boot/dts/omap5-core-thermal.dtsi
 +++ b/arch/arm/boot/dts/omap5-core-thermal.dtsi
 @@ -13,7 +13,7 @@
  
  core_thermal: core_thermal {
   polling-delay-passive = 250; /* milliseconds */
 - polling-delay = 1000; /* milliseconds */
 + polling-delay = 500; /* milliseconds */
  
   /* sensor   ID */
   thermal-sensors = bandgap 2;
 diff --git a/arch/arm/boot/dts/omap5-gpu-thermal.dtsi 
 b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
 index 1b87aca..bc3090f 100644
 --- a/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
 +++ b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
 @@ -13,7 +13,7 @@
  
  gpu_thermal: gpu_thermal {
   polling-delay-passive = 250; /* milliseconds */
 - polling-delay = 1000; /* milliseconds */
 + polling-delay = 500; /* milliseconds */
  
   /* sensor   ID */
   thermal-sensors = bandgap 1;
 diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
 index b321fdf..fee1580 100644
 --- a/arch/arm/boot/dts/omap5.dtsi
 +++ b/arch/arm/boot/dts/omap5.dtsi
 @@ -1079,4 +1079,8 @@
   };
  };
  
 +cpu_thermal {
 + polling-delay = 500; /* milliseconds */
 +};
 +
  /include/ omap54xx-clocks.dtsi
 -- 
 1.7.9.5
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


signature.asc
Description: Digital signature


Re: [PATCH] thermal: ti-soc-thermal: bandgap: Fix build warning if !CONFIG_PM_SLEEP

2015-02-24 Thread Eduardo Valentin
On Tue, Feb 24, 2015 at 06:01:23PM +0200, grygorii.stras...@linaro.org wrote:
 Hi Rui,
 
 On 02/09/2015 05:01 PM, Nishanth Menon wrote:
  On 16:55-20150206, grygorii.stras...@linaro.org wrote:
  From: Grygorii Strashko grygorii.stras...@linaro.org
 
  Fix following build warning if CONFIG_PM_SLEEP is not set:
 
  drivers/thermal/ti-soc-thermal/ti-bandgap.c:1478:12: warning: 
  'ti_bandgap_suspend' defined but not used [-Wunused-function]
static int ti_bandgap_suspend(struct device *dev)
   ^
  drivers/thermal/ti-soc-thermal/ti-bandgap.c:1492:12: warning: 
  'ti_bandgap_resume' defined but not used [-Wunused-function]
static int ti_bandgap_resume(struct device *dev)
   ^
  Signed-off-by: Grygorii Strashko grygorii.stras...@linaro.org
  ---
drivers/thermal/ti-soc-thermal/ti-bandgap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
 
  diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c 
  b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
  index 74c0e34..5d46660 100644
  --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
  +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
  @@ -1402,7 +1402,7 @@ int ti_bandgap_remove(struct platform_device *pdev)
 return 0;
}

  -#ifdef CONFIG_PM
  +#ifdef CONFIG_PM_SLEEP
static int ti_bandgap_save_ctxt(struct ti_bandgap *bgp)
{
 int i;
  -- 
  1.9.1
 
  
  Suggest aligning with Paul as well:
  https://patchwork.kernel.org/patch/5795391/
 
 ^Paul Walmsley wrote: Oh, nothing to be confused by, I just missed the
  earlier patch. I withdraw mine.
 
  
  Otherwise:
  Acked-by: Nishanth Menon n...@ti.com
  
 
 It looks like this patch is missed in 4.0-rc1, so could it be merged
 during rc cycle or you'd like me to resend it?
 (I've rechecked - it can be applied on top of Linux 4.0-rc1 without any 
 issues)


No need to resend. I will add to my -fixes queue.

BR,

Eduardo Valentin

 
 
 -- 
 regards,
 -grygorii


signature.asc
Description: Digital signature


Re: [PATCH] ti-soc-thermal: implement eocz bit to make driver useful on omap3

2015-01-21 Thread Eduardo Valentin
On Sun, Jan 18, 2015 at 09:18:21PM +0100, Pavel Machek wrote:
 Hi!
 
   Ok, what do you suggest? AFAICT, without MODE_CONFIG, continuous ADC
   mode is not available, so we have to force it periodically, so this
   should be correct.
  
  I will have a better look and let you know. for now, adding a single
  read should not hurt ( but I will double check)
 
 Any news there?

I believe it is OK to keep your code the way you posted.

Thanks.

 
 + if (ret)
 + return ret;
 + }
 +
   spin_lock(bgp-lock);
   temp = ti_bandgap_read_temp(bgp, id);
   spin_unlock(bgp-lock);
  
 - ret |= ti_bandgap_adc_to_mcelsius(bgp, temp, temp);
 + ret = ti_bandgap_adc_to_mcelsius(bgp, temp, temp);

this one should be part of your clean up patch
   
   Ok, can you apply the cleanup patch and I'll prepare one on the top of
   it?
  
  I mean, you should resend the cleanup patch including the above '|=' 
  removal, as you are already doing in the cleanup patch.
  
 
 Ok, little patch-editing can not hurt :-).
 
   Pavel
 -- 
 (english) http://www.livejournal.com/~pavelmachek
 (cesky, pictures) 
 http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCH] ti-soc-thermal: implement eocz bit to make driver useful on omap3

2015-01-05 Thread Eduardo Valentin
On Sat, Jan 03, 2015 at 05:22:42PM +0100, Pavel Machek wrote:
 Hi!
 
   When periodic mode is not enabled, it is neccessary to force reads.
   
   Signed-off-by: Pavel Machek pa...@ucw.cz
   
 
   --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
   +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
   @@ -43,6 +43,8 @@

#include ti-bandgap.h

   +static int ti_bandgap_force_single_read(struct ti_bandgap *bgp, int id);
   +
/***   Helper functions to access registers and their bitfields   ***/

/**
   @@ -852,14 +831,20 @@ int ti_bandgap_read_temperature(struct ti_bandgap 
   *bgp, int id,
 if (ret)
 return ret;

   + if (!TI_BANDGAP_HAS(bgp, MODE_CONFIG)) {
   + ret = ti_bandgap_force_single_read(bgp, id);
  
  not sure MODE_CONFIG is sufficient condition for single read on all OMAP
  versions.
 
 Ok, what do you suggest? AFAICT, without MODE_CONFIG, continuous ADC
 mode is not available, so we have to force it periodically, so this
 should be correct.

I will have a better look and let you know. for now, adding a single
read should not hurt ( but I will double check)

 
   + if (ret)
   + return ret;
   + }
   +
 spin_lock(bgp-lock);
 temp = ti_bandgap_read_temp(bgp, id);
 spin_unlock(bgp-lock);

   - ret |= ti_bandgap_adc_to_mcelsius(bgp, temp, temp);
   + ret = ti_bandgap_adc_to_mcelsius(bgp, temp, temp);
  
  this one should be part of your clean up patch
 
 Ok, can you apply the cleanup patch and I'll prepare one on the top of
 it?

I mean, you should resend the cleanup patch including the above '|=' removal, 
as you are already doing in the cleanup patch.

 
   Pavel
 -- 
 (english) http://www.livejournal.com/~pavelmachek
 (cesky, pictures) 
 http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCH] thermal: add omap3 support

2015-01-05 Thread Eduardo Valentin
On Sat, Jan 03, 2015 at 11:02:19PM +0100, Pavel Machek wrote:
 Hi!
 
  Thanks for sending your code.
 
 You are welcome.
 
   Add support for omap3430 sensor. Tested on Nokia N900.
  
  To my understanding, and as already mentioned by Nishanth Menon
  (currently TIer), TI has intentionally avoided adding this support.
 
 Well, Nokia had similar code in their kernel.
 
  There is a hardware accuracy limitation in this sensor, and therefore it
  is not advisable to use it, specially in Dynamic Thermal Management,
  such as the thermal framework.
 
 We are talking cellphone here. Yes, sensor may be inacurate (but it
 seems to work pretty well; perhaps TI can point us to some docs that
 explains the details?), but it provides useful information (mostly

sure! you should demand TI the proper data pointers.

 room temperature). I don't think we'll ever run anywhere close to
 thermal limits where inacuracy would matter. (Battery can't really
 take  60C. AFAICT CPU limit is 120C. Battery is close to the CPU.)

Well, when the sensor's accuracy is +-15C and there is variance across
the sample distribution, well, that means you are gonna see products
behaving way different from each other, even if you are attempting to
find a threshold to shutdown a device. 

BTW, I am not a TIer anymore, and I don't have the exact data to provide
you.

 
   Signed-off-by: Pavel Machek pa...@ucw.cz
   
   diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
   b/drivers/thermal/ti-soc-thermal/Kconfig
   index bd4c7be..a49495f 100644
   --- a/drivers/thermal/ti-soc-thermal/Kconfig
   +++ b/drivers/thermal/ti-soc-thermal/Kconfig
   @@ -21,6 +21,15 @@ config TI_THERMAL
   This includes trip points definitions, extrapolation rules and
   CPU cooling device bindings.

   +config OMAP3_THERMAL
   + bool Texas Instruments OMAP3 thermal support
   + depends on TI_SOC_THERMAL
   + depends on ARCH_OMAP3
   + help
   +   If you say yes here you get thermal support for the Texas Instruments
   +   OMAP3 SoC family. The current chip supported are:
   +- OMAP3430
  
  But if you insist :-), I believe the user deserves at least a fair
  message saying this is on his / her own risk.
 
 Something like this?
 
   If you say yes here you get thermal support for the Texas 
 Instruments
 OMAP3 SoC family. The current chip supported are:
 - OMAP3430
 
   OMAP3 chips normally don't need thermal management, and sensors in
 this generation are not very accurate, nor they are very close to
   the important hotspots.

I would be stronger and rephrase with s/very//g. 


 
   Say 'N' here.
 
 
   +static struct temp_sensor_registers
   +omap34xx_mpu_temp_sensor_registers = {
   + .temp_sensor_ctrl = 0,
   + .bgap_tempsoff_mask = 0, /* Unused, we don't have POWER_SWITCH */
   + .bgap_soc_mask = BIT(8),
   + .bgap_eocz_mask = BIT(7),
   + .bgap_dtemp_mask = 0x7f,
   +
   + .bgap_mode_ctrl = 0,
   + .mode_ctrl_mask = BIT(9),
   +
   + .bgap_efuse = 0,
  
  The 0'ed filed may be removed here.
 
 Ok; I'll keep temp_sensors_ctrl / bgap_mode_ctrl, because it is actually used.
 
 
   diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c 
   b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
   index 634b6ce..3b4e72f 100644
   --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
   +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
   @@ -1509,6 +1531,12 @@ static SIMPLE_DEV_PM_OPS(ti_bandgap_dev_pm_ops, 
   ti_bandgap_suspend,
#endif

static const struct of_device_id of_ti_bandgap_match[] = {
   +#ifdef CONFIG_OMAP3_THERMAL
   + {
   + .compatible = ti,omap34xx-bandgap,
  
  This needs to be updated in the binding documentation.
  Documentation/devicetree/bindings/thermal/ti_soc_thermal.txt
 
 Ok.
 
   + .data = (void *)omap34xx_data,
  
  
  Having a run time message intentionally advising users of the risk of
  using this sensor is also required.
 
 Ok, what about?
 
 if (TI_BANDGAP_HAS(bgp, UNRELIABLE))
   dev_warn(pdev-dev,
  OMAP3 thermal sensor is unreliable and normally 
 unneccessary\n);
 

works for me.

 Will not fit in 80 columns, but keeping message on one line is more important.
   Pavel
 -- 
 (english) http://www.livejournal.com/~pavelmachek
 (cesky, pictures) 
 http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCH] MAINTAINERS: Add linux-omap to list of reviewers for TI Thermal

2015-01-05 Thread Eduardo Valentin
On Mon, Jan 05, 2015 at 05:44:38PM -0400, Eduardo Valentin wrote:
 On Sat, Jan 03, 2015 at 01:13:30PM -0600, Nishanth Menon wrote:
  Add linux-omap mailing list to the TI THERMAL list for wider review.
  
  Reported-by: Pavel Machek pa...@ucw.cz
  Signed-off-by: Nishanth Menon n...@ti.com
  ---
   MAINTAINERS |1 +
   1 file changed, 1 insertion(+)
  
  diff --git a/MAINTAINERS b/MAINTAINERS
  index ddb9ac8..dc9efd5 100644
  --- a/MAINTAINERS
  +++ b/MAINTAINERS
  @@ -9533,6 +9533,7 @@ F:drivers/platform/x86/thinkpad_acpi.c
   TI BANDGAP AND THERMAL DRIVER
   M: Eduardo Valentin edubez...@gmail.com
   L: linux...@vger.kernel.org
  +L: linux-omap@vger.kernel.org
 
 OK. I will queue this one.
 
   S: Supported
 
 I will also change this to random fixes too..

changed to 'Maintained'.

Cheers,

 
   F: drivers/thermal/ti-soc-thermal/
   
  -- 
  1.7.9.5
  




signature.asc
Description: Digital signature


Re: [PATCH] thermal: ti-soc-thermal: ti-bandgap.c: Remove unused function

2015-01-05 Thread Eduardo Valentin
On Wed, Dec 24, 2014 at 08:57:14AM -0600, Nishanth Menon wrote:
 On 12/21/2014 11:43 AM, Rickard Strandqvist wrote:
  Remove the function ti_bandgap_write_thot() that is not used anywhere.
  
  This was partially found by using a static code analysis program called 
  cppcheck.
  
  Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
  ---
   drivers/thermal/ti-soc-thermal/ti-bandgap.c |   13 -
   drivers/thermal/ti-soc-thermal/ti-bandgap.h |1 -
   2 files changed, 14 deletions(-)
  
  diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c 
  b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
  index 634b6ce..cbb6a5f 100644
  --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
  +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
  @@ -611,19 +611,6 @@ int ti_bandgap_read_thot(struct ti_bandgap *bgp, int 
  id, int *thot)
   }
   
   /**
  - * ti_bandgap_write_thot() - sets sensor current thot
  - * @bgp: pointer to bandgap instance
  - * @id: sensor id
  - * @val: desired thot value
  - *
  - * Return: 0 on success or the proper error code
  - */
  -int ti_bandgap_write_thot(struct ti_bandgap *bgp, int id, int val)
  -{
  -   return _ti_bandgap_write_threshold(bgp, id, val, true);
  -}
  -
  -/**
* ti_bandgap_read_tcold() - reads sensor current tcold
* @bgp: pointer to bandgap instance
* @id: sensor id
  diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h 
  b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
  index b3adf72..976afc0 100644
  --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h
  +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
  @@ -371,7 +371,6 @@ struct ti_bandgap_data {
   };
   
   int ti_bandgap_read_thot(struct ti_bandgap *bgp, int id, int *thot);
  -int ti_bandgap_write_thot(struct ti_bandgap *bgp, int id, int val);
   int ti_bandgap_read_tcold(struct ti_bandgap *bgp, int id, int *tcold);
   int ti_bandgap_write_tcold(struct ti_bandgap *bgp, int id, int val);
   int ti_bandgap_read_update_interval(struct ti_bandgap *bgp, int id,
  
 
 Not sure if removing support for programming of hot threshold is a
 good idea. how about ti_bandgap_write_tcold then?


Agreed here. I believe the right thing to do is to use those functions
to update the thresholds when necessary.

 
 
 -- 
 Regards,
 Nishanth Menon


signature.asc
Description: Digital signature


Re: [PATCH] MAINTAINERS: Add linux-omap to list of reviewers for TI Thermal

2015-01-05 Thread Eduardo Valentin
On Sat, Jan 03, 2015 at 01:13:30PM -0600, Nishanth Menon wrote:
 Add linux-omap mailing list to the TI THERMAL list for wider review.
 
 Reported-by: Pavel Machek pa...@ucw.cz
 Signed-off-by: Nishanth Menon n...@ti.com
 ---
  MAINTAINERS |1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/MAINTAINERS b/MAINTAINERS
 index ddb9ac8..dc9efd5 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -9533,6 +9533,7 @@ F:  drivers/platform/x86/thinkpad_acpi.c
  TI BANDGAP AND THERMAL DRIVER
  M:   Eduardo Valentin edubez...@gmail.com
  L:   linux...@vger.kernel.org
 +L:   linux-omap@vger.kernel.org

OK. I will queue this one.

  S:   Supported

I will also change this to random fixes too..

  F:   drivers/thermal/ti-soc-thermal/
  
 -- 
 1.7.9.5
 


signature.asc
Description: Digital signature


[PATCH 1/1] MAINTAINERS: update ti-soc-thermal status

2015-01-05 Thread Eduardo Valentin
Changing to Maintained.

Signed-off-by: Eduardo Valentin edubez...@gmail.com
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index dc9efd5..bc91817 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9534,7 +9534,7 @@ TI BANDGAP AND THERMAL DRIVER
 M: Eduardo Valentin edubez...@gmail.com
 L: linux...@vger.kernel.org
 L: linux-omap@vger.kernel.org
-S: Supported
+S: Maintained
 F: drivers/thermal/ti-soc-thermal/
 
 TI CLOCK DRIVER
-- 
2.1.3

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


Re: [PATCH] ti-soc-thermal: implement eocz bit to make driver useful on omap3

2015-01-03 Thread Eduardo Valentin
On Sat, Jan 03, 2015 at 12:46:32PM +0100, Pavel Machek wrote:
 For omap3, proper implementation of eocz bit is needed. It was
 actually a TODO in the driver.
 
 When periodic mode is not enabled, it is neccessary to force reads.
 
 Signed-off-by: Pavel Machek pa...@ucw.cz
 
 diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c 
 b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
 index 634b6ce..ee63d08 100644
 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
 +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
 @@ -43,6 +43,8 @@
  
  #include ti-bandgap.h
  
 +static int ti_bandgap_force_single_read(struct ti_bandgap *bgp, int id);
 +
  /***   Helper functions to access registers and their bitfields   ***/
  
  /**
 @@ -852,14 +831,20 @@ int ti_bandgap_read_temperature(struct ti_bandgap *bgp, 
 int id,
   if (ret)
   return ret;
  
 + if (!TI_BANDGAP_HAS(bgp, MODE_CONFIG)) {
 + ret = ti_bandgap_force_single_read(bgp, id);

not sure MODE_CONFIG is sufficient condition for single read on all OMAP
versions.

 + if (ret)
 + return ret;
 + }
 +
   spin_lock(bgp-lock);
   temp = ti_bandgap_read_temp(bgp, id);
   spin_unlock(bgp-lock);
  
 - ret |= ti_bandgap_adc_to_mcelsius(bgp, temp, temp);
 + ret = ti_bandgap_adc_to_mcelsius(bgp, temp, temp);

this one should be part of your clean up patch

   if (ret)
   return -EIO;
  
   *temperature = temp;
  
   return 0;
 @@ -917,7 +903,8 @@ void *ti_bandgap_get_sensor_data(struct ti_bandgap *bgp, 
 int id)
  static int
  ti_bandgap_force_single_read(struct ti_bandgap *bgp, int id)
  {
 - u32 temp = 0, counter = 1000;
 + u32 counter = 1000;
 + struct temp_sensor_registers *tsr;
  
   /* Select single conversion mode */
   if (TI_BANDGAP_HAS(bgp, MODE_CONFIG))
 @@ -925,16 +912,27 @@ ti_bandgap_force_single_read(struct ti_bandgap *bgp, 
 int id)
  
   /* Start of Conversion = 1 */
   RMW_BITS(bgp, id, temp_sensor_ctrl, bgap_soc_mask, 1);
 - /* Wait until DTEMP is updated */
 - temp = ti_bandgap_read_temp(bgp, id);
  
 - while ((temp == 0)  --counter)
 - temp = ti_bandgap_read_temp(bgp, id);
 - /* REVISIT: Check correct condition for end of conversion */
 + /* Wait for EOCZ going up */
 + tsr = bgp-conf-sensors[id].registers;
 +
 + while (--counter) {
 + if (ti_bandgap_readl(bgp, tsr-temp_sensor_ctrl) 
 + tsr-bgap_eocz_mask)
 + break;
 + }
  
   /* Start of Conversion = 0 */
   RMW_BITS(bgp, id, temp_sensor_ctrl, bgap_soc_mask, 0);
  
 + /* Wait for EOCZ going down */
 + counter = 1000;
 + while (--counter) {
 + if (!(ti_bandgap_readl(bgp, tsr-temp_sensor_ctrl) 
 +   tsr-bgap_eocz_mask))
 + break;
 + }
 +
   return 0;
  }
  
 
 -- 
 (english) http://www.livejournal.com/~pavelmachek
 (cesky, pictures) 
 http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCH] thermal: add omap3 support

2015-01-03 Thread Eduardo Valentin
Hello Pavel,

Thanks for sending your code.

On Sat, Jan 03, 2015 at 12:11:46PM +0100, Pavel Machek wrote:
 Add support for omap3430 sensor. Tested on Nokia N900.

To my understanding, and as already mentioned by Nishanth Menon
(currently TIer), TI has intentionally avoided adding this support.

There is a hardware accuracy limitation in this sensor, and therefore it
is not advisable to use it, specially in Dynamic Thermal Management,
such as the thermal framework. 
 
 Signed-off-by: Pavel Machek pa...@ucw.cz
 
 diff --git a/drivers/thermal/ti-soc-thermal/Kconfig 
 b/drivers/thermal/ti-soc-thermal/Kconfig
 index bd4c7be..a49495f 100644
 --- a/drivers/thermal/ti-soc-thermal/Kconfig
 +++ b/drivers/thermal/ti-soc-thermal/Kconfig
 @@ -21,6 +21,15 @@ config TI_THERMAL
 This includes trip points definitions, extrapolation rules and
 CPU cooling device bindings.
  
 +config OMAP3_THERMAL
 + bool Texas Instruments OMAP3 thermal support
 + depends on TI_SOC_THERMAL
 + depends on ARCH_OMAP3
 + help
 +   If you say yes here you get thermal support for the Texas Instruments
 +   OMAP3 SoC family. The current chip supported are:
 +- OMAP3430

But if you insist :-), I believe the user deserves at least a fair
message saying this is on his / her own risk.

 +
  config OMAP4_THERMAL
   bool Texas Instruments OMAP4 thermal support
   depends on TI_SOC_THERMAL
 diff --git a/drivers/thermal/ti-soc-thermal/Makefile 
 b/drivers/thermal/ti-soc-thermal/Makefile
 index 1226b24..2b5b220 100644
 --- a/drivers/thermal/ti-soc-thermal/Makefile
 +++ b/drivers/thermal/ti-soc-thermal/Makefile
 @@ -2,5 +2,6 @@ obj-$(CONFIG_TI_SOC_THERMAL)  += ti-soc-thermal.o
  ti-soc-thermal-y := ti-bandgap.o
  ti-soc-thermal-$(CONFIG_TI_THERMAL)  += ti-thermal-common.o
  ti-soc-thermal-$(CONFIG_DRA752_THERMAL)  += dra752-thermal-data.o
 +ti-soc-thermal-$(CONFIG_OMAP3_THERMAL)   += omap3-thermal-data.o
  ti-soc-thermal-$(CONFIG_OMAP4_THERMAL)   += omap4-thermal-data.o
  ti-soc-thermal-$(CONFIG_OMAP5_THERMAL)   += omap5-thermal-data.o
 diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c 
 b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
 new file mode 100644
 index 000..7c18766
 --- /dev/null
 +++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
 @@ -0,0 +1,95 @@
 +/*
 + * OMAP3 thermal driver.
 + *
 + * Copyright (C) 2011-2012 Texas Instruments Inc.
 + * Copyright (C) 2014 Pavel Machek pa...@ucw.cz
 + *
 + * This software is licensed under the terms of the GNU General Public
 + * License version 2, as published by the Free Software Foundation, and
 + * may be copied, distributed, and modified under those terms.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 + * GNU General Public License for more details.
 + *
 + */
 +
 +#include ti-thermal.h
 +#include ti-bandgap.h
 +
 +/*
 + * OMAP34XX has one instance of thermal sensor for MPU
 + * need to describe the individual bit fields
 + */
 +static struct temp_sensor_registers
 +omap34xx_mpu_temp_sensor_registers = {
 + .temp_sensor_ctrl = 0,
 + .bgap_tempsoff_mask = 0, /* Unused, we don't have POWER_SWITCH */
 + .bgap_soc_mask = BIT(8),
 + .bgap_eocz_mask = BIT(7),
 + .bgap_dtemp_mask = 0x7f,
 +
 + .bgap_mode_ctrl = 0,
 + .mode_ctrl_mask = BIT(9),
 +
 + .bgap_efuse = 0,

The 0'ed filed may be removed here.

 +};
 +
 +/* Thresholds and limits for OMAP34XX MPU temperature sensor */
 +static struct temp_sensor_data omap34xx_mpu_temp_sensor_data = {
 + .min_freq = 32768,
 + .max_freq = 32768,
 + .max_temp = -99000,
 + .min_temp = 99000,
 + .hyst_val = 5000,
 +};
 +
 +/*
 + * Temperature values in milli degree celsius
 + */
 +static const int
 +omap34xx_adc_to_temp[128] = {
 + -4, -4, -4, -4, -4, -39000, -38000, -36000,
 + -34000, -32000, -31000, -29000, -28000, -26000, -25000, -24000,
 + -22000, -21000, -19000, -18000, -17000, -15000, -14000, -12000,
 + -11000, -9000, -8000, -7000, -5000, -4000, -2000, -1000, ,
 + 1000, 3000, 4000, 5000, 7000, 8000, 1, 11000, 13000, 14000,
 + 15000, 17000, 18000, 2, 21000, 22000, 24000, 25000, 27000,
 + 28000, 3, 31000, 32000, 34000, 35000, 37000, 38000, 39000,
 + 41000, 42000, 44000, 45000, 47000, 48000, 49000, 51000, 52000,
 + 53000, 55000, 56000, 58000, 59000, 6, 62000, 63000, 65000,
 + 66000, 67000, 69000, 7, 72000, 73000, 74000, 76000, 77000,
 + 79000, 8, 81000, 83000, 84000, 85000, 87000, 88000, 89000,
 + 91000, 92000, 94000, 95000, 96000, 98000, 99000, 10,
 + 102000, 103000, 105000, 106000, 107000, 109000, 11, 111000,
 + 113000, 114000, 116000, 117000, 118000, 12, 121000, 122000,
 + 124000, 124000, 125000, 125000, 

Re: [PATCHv5 10/20] arm: dts: add omap4430 thermal data

2013-11-21 Thread Eduardo Valentin
On 20-11-2013 08:32, Pavel Machek wrote:
 HI!
 
 This patch changes the dtsi entry on omap4430 to contain
 the thermal data. This data will enable the passive
 cooling with CPUfreq cooling device at 100C and the
 system will do a thermal shutdown at 125C.

 Cc: Benoît Cousson bcous...@baylibre.com
 Cc: Tony Lindgren t...@atomide.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: linux-omap@vger.kernel.org
 Cc: devicetree-disc...@lists.ozlabs.org
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-ker...@vger.kernel.org
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
 ---
  arch/arm/boot/dts/omap443x.dtsi | 10 --
  1 file changed, 8 insertions(+), 2 deletions(-)

 diff --git a/arch/arm/boot/dts/omap443x.dtsi 
 b/arch/arm/boot/dts/omap443x.dtsi
 index bcf455e..e9c97d6 100644
 --- a/arch/arm/boot/dts/omap443x.dtsi
 +++ b/arch/arm/boot/dts/omap443x.dtsi
 @@ -12,7 +12,7 @@
  
  / {
  cpus {
 -cpu@0 {
 +cpu0: cpu@0 {
  /* OMAP443x variants OPP50-OPPNT */
  operating-points = 
  /* kHzuV */
 
 I see you also add labels to various other entries...

I think I didn't quite get your point here. Can you please elaborate?

This label has been added because it will be used in thermal zone while
referencing the cooling device.

 
 @@ -25,9 +25,15 @@
  };
  };
  
 -bandgap {
 +thermal-zones{
 
 You may want to include space here.

OK.

 
 +#include omap4-cpu-thermal.dtsi
 +};
 +
 +bandgap: bandgap {
  reg = 0x4a002260 0x4
 0x4a00232C 0x4;
  compatible = ti,omap4430-bandgap;
 +
 +#thermal-sensor-cells = 0;
  };
  };
 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin



signature.asc
Description: OpenPGP digital signature


[PATCHv5 19/20] arm: dts: make OMAP4460 bandgap node to belong to OCP

2013-11-12 Thread Eduardo Valentin
Small fix on representation. Bandgap node belongs to OCP.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ijc+devicet...@hellion.org.uk
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Suggested-by: Nishanth Menon n...@ti.com
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4460.dtsi | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index dc22719..def8183 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -39,14 +39,16 @@
#include omap4-cpu-thermal.dtsi
};
 
-   bandgap: bandgap {
-   reg = 0x4a002260 0x4
-  0x4a00232C 0x4
-  0x4a002378 0x18;
-   compatible = ti,omap4460-bandgap;
-   interrupts = 0 126 IRQ_TYPE_LEVEL_HIGH; /* talert */
-   gpios = gpio3 22 0; /* tshut */
+   ocp {
+   bandgap: bandgap {
+   reg = 0x4a002260 0x4
+  0x4a00232C 0x4
+  0x4a002378 0x18;
+   compatible = ti,omap4460-bandgap;
+   interrupts = 0 126 IRQ_TYPE_LEVEL_HIGH; /* talert */
+   gpios = gpio3 22 0; /* tshut */
 
-   #thermal-sensor-cells = 0;
+   #thermal-sensor-cells = 0;
+   };
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv5 17/20] arm: dts: add cooling properties on omap5 cpu node

2013-11-12 Thread Eduardo Valentin
OMAP5 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the required cooling device properties
so that cpufreq-cpu0 driver loads the cooling device.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 187cb71..a35cd61 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -37,6 +37,9 @@
device_type = cpu;
compatible = arm,cortex-a15;
reg = 0x0;
+
+   /* cooling options */
+   #cooling-cells = 2; /* min followed by max */
};
cpu@1 {
device_type = cpu;
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv5 18/20] arm: dts: make OMAP443x bandgap node to belong to OCP

2013-11-12 Thread Eduardo Valentin
Small fix on representation. Bandgap node belongs to OCP.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ijc+devicet...@hellion.org.uk
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Suggested-by: Nishanth Menon n...@ti.com
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index 930ab47..2fca4e5 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -34,11 +34,13 @@
#include omap4-cpu-thermal.dtsi
};
 
-   bandgap: bandgap {
-   reg = 0x4a002260 0x4
-  0x4a00232C 0x4;
-   compatible = ti,omap4430-bandgap;
+   ocp {
+   bandgap: bandgap {
+   reg = 0x4a002260 0x4
+  0x4a00232C 0x4;
+   compatible = ti,omap4430-bandgap;
 
-   #thermal-sensor-cells = 0;
+   #thermal-sensor-cells = 0;
+   };
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv5 16/20] arm: dts: add omap5 thermal data

2013-11-12 Thread Eduardo Valentin
This patch changes the dtsi entry on omap5 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C. The
system will do a thermal shutdown at 125C whenever
any of its sensors sees this level.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 7cdea1b..187cb71 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -33,7 +33,7 @@
#address-cells = 1;
#size-cells = 0;
 
-   cpu@0 {
+   cpu0: cpu@0 {
device_type = cpu;
compatible = arm,cortex-a15;
reg = 0x0;
@@ -45,6 +45,12 @@
};
};
 
+   thermal-zones {
+   #include omap4-cpu-thermal.dtsi
+   #include omap5-gpu-thermal.dtsi
+   #include omap5-core-thermal.dtsi
+   };
+
timer {
compatible = arm,armv7-timer;
/* PPI secure/nonsecure IRQ */
@@ -705,13 +711,15 @@
};
};
 
-   bandgap@4a0021e0 {
+   bandgap: bandgap@4a0021e0 {
reg = 0x4a0021e0 0xc
   0x4a00232c 0xc
   0x4a002380 0x2c
   0x4a0023C0 0x3c;
interrupts = GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH;
compatible = ti,omap5430-bandgap;
+
+   #thermal-sensor-cells = 1;
};
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv5 14/20] arm: dts: add omap5 GPU thermal data

2013-11-12 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for GPU domain on OMAP5 and later SoCs. This data will
enable a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
Change from v4:
- Using string constants instead of macros on trip types

 arch/arm/boot/dts/omap5-gpu-thermal.dtsi | 28 
 1 file changed, 28 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap5-gpu-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap5-gpu-thermal.dtsi 
b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
new file mode 100644
index 000..1b87aca
--- /dev/null
+++ b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
@@ -0,0 +1,28 @@
+/*
+ * Device Tree Source for OMAP543x SoC GPU thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+gpu_thermal: gpu_thermal {
+   polling-delay-passive = 250; /* milliseconds */
+   polling-delay = 1000; /* milliseconds */
+
+   /* sensor   ID */
+   thermal-sensors = bandgap 1;
+
+   trips {
+   gpu_crit: gpu_crit {
+   temperature = 125000; /* milliCelsius */
+   hysteresis = 2000; /* milliCelsius */
+   type = critical;
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv5 09/20] arm: dts: add omap4 CPU thermal data

2013-11-12 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for MPU domain on OMAP4 and later SoCs. This data will
enable the passive cooling with CPUfreq cooling device
at 100C and the system will do a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
Change from v4:
- Using string constants instead of macros on trip types

 arch/arm/boot/dts/omap4-cpu-thermal.dtsi | 41 
 1 file changed, 41 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap4-cpu-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap4-cpu-thermal.dtsi 
b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
new file mode 100644
index 000..cb9458f
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
@@ -0,0 +1,41 @@
+/*
+ * Device Tree Source for OMAP4/5 SoC CPU thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+cpu_thermal: cpu_thermal {
+   polling-delay-passive = 250; /* milliseconds */
+   polling-delay = 1000; /* milliseconds */
+
+   /* sensor   ID */
+thermal-sensors = bandgap 0;
+
+trips {
+cpu_alert0: cpu_alert {
+temperature = 10; /* millicelsius */
+hysteresis = 2000; /* millicelsius */
+type = passive;
+};
+cpu_crit: cpu_crit {
+temperature = 125000; /* millicelsius */
+hysteresis = 2000; /* millicelsius */
+type = critical;
+};
+};
+
+   cooling-maps {
+   map0 {
+   trip = cpu_alert0;
+   cooling-device =
+   cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT;
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv5 11/20] arm: dts: add omap4460 thermal data

2013-11-12 Thread Eduardo Valentin
This patch changes the dtsi entry on omap4460 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C and the
system will do a thermal shutdown at 125C.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4460.dtsi | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index c2f0f39..4d93aba 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -12,7 +12,7 @@
 / {
cpus {
/* OMAP446x 'standard device' variants OPP50 to OPPTurbo */
-   cpu@0 {
+   cpu0: cpu@0 {
operating-points = 
/* kHzuV */
35  1025000
@@ -30,12 +30,18 @@
ti,hwmods = debugss;
};
 
-   bandgap {
+   thermal-zones{
+   #include omap4-cpu-thermal.dtsi
+   };
+
+   bandgap: bandgap {
reg = 0x4a002260 0x4
   0x4a00232C 0x4
   0x4a002378 0x18;
compatible = ti,omap4460-bandgap;
interrupts = 0 126 IRQ_TYPE_LEVEL_HIGH; /* talert */
gpios = gpio3 22 0; /* tshut */
+
+   #thermal-sensor-cells = 0;
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv5 10/20] arm: dts: add omap4430 thermal data

2013-11-12 Thread Eduardo Valentin
This patch changes the dtsi entry on omap4430 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C and the
system will do a thermal shutdown at 125C.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index bcf455e..e9c97d6 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -12,7 +12,7 @@
 
 / {
cpus {
-   cpu@0 {
+   cpu0: cpu@0 {
/* OMAP443x variants OPP50-OPPNT */
operating-points = 
/* kHzuV */
@@ -25,9 +25,15 @@
};
};
 
-   bandgap {
+   thermal-zones{
+   #include omap4-cpu-thermal.dtsi
+   };
+
+   bandgap: bandgap {
reg = 0x4a002260 0x4
   0x4a00232C 0x4;
compatible = ti,omap4430-bandgap;
+
+   #thermal-sensor-cells = 0;
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv5 12/20] arm: dts: add cooling properties on omap4430 cpu node

2013-11-12 Thread Eduardo Valentin
OMAP4430 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the required cooling device properties
so that cpufreq-cpu0 driver loads the cooling device.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index e9c97d6..930ab47 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -22,6 +22,11 @@
1008000 1375000
;
clock-latency = 30; /* From legacy driver */
+
+   /* cooling options */
+   cooling-min-level = 0;
+   cooling-max-level = 3;
+   #cooling-cells = 2; /* min followed by max */
};
};
 
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv5 13/20] arm: dts: add cooling properties on omap4460 cpu node

2013-11-12 Thread Eduardo Valentin
OMAP4460 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the required cooling device properties
so that cpufreq-cpu0 driver loads the cooling device.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4460.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index 4d93aba..dc22719 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -20,6 +20,11 @@
92  1313000
;
clock-latency = 30; /* From legacy driver */
+
+   /* cooling options */
+   cooling-min-level = 0;
+   cooling-max-level = 2;
+   #cooling-cells = 2; /* min followed by max */
};
};
 
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv5 15/20] arm: dts: add omap5 CORE thermal data

2013-11-12 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for CORE domain on OMAP5 and later SoCs. This data will
enable a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
Change from v4:
- Using string constants instead of macros on trip types

 arch/arm/boot/dts/omap5-core-thermal.dtsi | 28 
 1 file changed, 28 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap5-core-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap5-core-thermal.dtsi 
b/arch/arm/boot/dts/omap5-core-thermal.dtsi
new file mode 100644
index 000..19212ac
--- /dev/null
+++ b/arch/arm/boot/dts/omap5-core-thermal.dtsi
@@ -0,0 +1,28 @@
+/*
+ * Device Tree Source for OMAP543x SoC CORE thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+core_thermal: core_thermal {
+   polling-delay-passive = 250; /* milliseconds */
+   polling-delay = 1000; /* milliseconds */
+
+   /* sensor   ID */
+   thermal-sensors = bandgap 2;
+
+   trips {
+   core_crit: core_crit {
+   temperature = 125000; /* milliCelsius */
+   hysteresis = 2000; /* milliCelsius */
+   type = critical;
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


Re: [PATCH 0/7] DRA7: DT thermal support

2013-10-01 Thread Eduardo Valentin
On 01-10-2013 18:58, Nishanth Menon wrote:
 On 14:32-20131001, Eduardo Valentin wrote:
 Hello all,

 This is a complementary patch series with themal DT support for DRA7.

 Although this work depends on the thermal dt parser work [1], I decided
 to share it before hand. It also depends on DRA7 DT base port support,
 which I fetched from Rajendra's tree [2].

 This patch series has been runtime tested on DRA7-evm.

 All best,

 [1] - https://lkml.org/lkml/2013/9/26/787
 [2] - git://github.com/rrnayak/linux.git out-of-tree/dra-integrated-v3

 Eduardo Valentin (7):
   arm: dts: add dra7 DSPEVE thermal data
   arm: dts: add dra7 IVA thermal data
   arm: dts: dra7: add bandgap entry
   arm: dts: add cooling properties on dra7 cpu node
   arm: dts: dra7: add thermal data
   arm: dts: add tmp102 i2c sensor node on dra7-evm
   arm: dts: add thermal zones info on tmp102 for DRA7-EVM

  arch/arm/boot/dts/dra7-dspeve-thermal.dtsi | 28 
  arch/arm/boot/dts/dra7-evm.dts | 23 +++
  arch/arm/boot/dts/dra7-iva-thermal.dtsi| 28 
  arch/arm/boot/dts/dra7.dtsi| 27 ++-
  4 files changed, 105 insertions(+), 1 deletion(-)
  create mode 100644 arch/arm/boot/dts/dra7-dspeve-thermal.dtsi
  create mode 100644 arch/arm/boot/dts/dra7-iva-thermal.dtsi
 
 +Benoit, Tony, Linux-omap.
 Ref: http://marc.info/?l=linux-pmm=138065243027014w=2
 
 Tony, Benoit,
 The following diff[1] is probably needed to ensure that right audience
 is addressed.

Well, yeah. thinking of this series now I probably should have mentioned
clear that it is not ready for merge. Not only because it depends on a
working in progress I have referred at [1], but because we lack
completely dra7 files (at linus tree we have no files under
arch/arm/boot/dts/*dra7*).  Therefore, I mentioned in this cover letter
that I actually based this work on top of [2] and [1]. Apologies if it
was not clear enough for you.

Just to make clear, the intention of this patch set was to share and use
yet another example of the usage of the work at [1]. Thus the audience
was directed to the cc and to lists I used.

 
 Eduardo,
 could you send an updated series with Tony,
 Benoit and linux-omap in the loop?

Well sure, once it has the right dependency in place.

 
 [1]
 diff --git a/MAINTAINERS b/MAINTAINERS
 index 284969f..3442671 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -5969,6 +5969,7 @@ M:  Tony Lindgren t...@atomide.com
  L:   linux-omap@vger.kernel.org
  L:   devicet...@vger.kernel.org
  S:   Maintained
 +F:   arch/arm/boot/dts/*dra7*

I believe, once we have them merged, then I suppose this diff is applicable.

  F:   arch/arm/boot/dts/*omap*
  F:   arch/arm/boot/dts/*am3*
  
 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin



signature.asc
Description: OpenPGP digital signature


Re: [PATCHv4 11/18] arm: dts: add omap4430 thermal data

2013-09-27 Thread Eduardo Valentin
On 27-09-2013 08:24, Nishanth Menon wrote:
 On 23:13-20130926, Eduardo Valentin wrote:
 This patch changes the dtsi entry on omap4430 to contain
 the thermal data. This data will enable the passive
 cooling with CPUfreq cooling device at 100C and the
 system will do a thermal shutdown at 125C.

 Cc: Benoît Cousson bcous...@baylibre.com
 Cc: Tony Lindgren t...@atomide.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: linux-omap@vger.kernel.org
 Cc: devicetree-disc...@lists.ozlabs.org
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-ker...@vger.kernel.org
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
 ---
  arch/arm/boot/dts/omap443x.dtsi | 10 --
  1 file changed, 8 insertions(+), 2 deletions(-)

 diff --git a/arch/arm/boot/dts/omap443x.dtsi 
 b/arch/arm/boot/dts/omap443x.dtsi
 index bcf455e..e9c97d6 100644
 --- a/arch/arm/boot/dts/omap443x.dtsi
 +++ b/arch/arm/boot/dts/omap443x.dtsi
 @@ -12,7 +12,7 @@
  
  / {
  cpus {
 -cpu@0 {
 +cpu0: cpu@0 {
  /* OMAP443x variants OPP50-OPPNT */
  operating-points = 
  /* kHzuV */
 @@ -25,9 +25,15 @@
  };
  };
  
 -bandgap {
 +thermal-zones{
 +#include omap4-cpu-thermal.dtsi
 +};
 +
 +bandgap: bandgap {
  reg = 0x4a002260 0x4
 0x4a00232C 0x4;
  compatible = ti,omap4430-bandgap;
 +
 +#thermal-sensor-cells = 0;
 2 cents:
 we might want to move bandgap under ocp?
 

Yes, agreed. But I don't think this change is related to this patch or
to this series.

Tks Nishanth

  };
  };
 -- 
 1.8.2.1.342.gfa7285d


 ___
 linux-arm-kernel mailing list
 linux-arm-ker...@lists.infradead.org
 http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin



signature.asc
Description: OpenPGP digital signature


Re: [PATCHv4 11/18] arm: dts: add omap4430 thermal data

2013-09-27 Thread Eduardo Valentin
On 27-09-2013 09:26, Nishanth Menon wrote:
 On Fri, Sep 27, 2013 at 8:20 AM, Eduardo Valentin
 eduardo.valen...@ti.com wrote:
 On 27-09-2013 08:24, Nishanth Menon wrote:
 On 23:13-20130926, Eduardo Valentin wrote:
 This patch changes the dtsi entry on omap4430 to contain
 the thermal data. This data will enable the passive
 cooling with CPUfreq cooling device at 100C and the
 system will do a thermal shutdown at 125C.

 Cc: Benoît Cousson bcous...@baylibre.com
 Cc: Tony Lindgren t...@atomide.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: linux-omap@vger.kernel.org
 Cc: devicetree-disc...@lists.ozlabs.org
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-ker...@vger.kernel.org
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
 ---
  arch/arm/boot/dts/omap443x.dtsi | 10 --
  1 file changed, 8 insertions(+), 2 deletions(-)

 diff --git a/arch/arm/boot/dts/omap443x.dtsi 
 b/arch/arm/boot/dts/omap443x.dtsi
 index bcf455e..e9c97d6 100644
 --- a/arch/arm/boot/dts/omap443x.dtsi
 +++ b/arch/arm/boot/dts/omap443x.dtsi
 @@ -12,7 +12,7 @@

  / {
  cpus {
 -cpu@0 {
 +cpu0: cpu@0 {
  /* OMAP443x variants OPP50-OPPNT */
  operating-points = 
  /* kHzuV */
 @@ -25,9 +25,15 @@
  };
  };

 -bandgap {
 +thermal-zones{
 +#include omap4-cpu-thermal.dtsi
 +};
 +
 +bandgap: bandgap {
  reg = 0x4a002260 0x4
 0x4a00232C 0x4;
  compatible = ti,omap4430-bandgap;
 +
 +#thermal-sensor-cells = 0;
 2 cents:
 we might want to move bandgap under ocp?


 Yes, agreed. But I don't think this change is related to this patch or
 to this series.
 
 Correct - this comment is not related to the current patch, hence my 2
 cents ;) - will be nice to have it cleaned up though..

Yes, it will be cleaned. ;-) Tks.

 
 Regards,
 Nishanth Menon
 
 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin



signature.asc
Description: OpenPGP digital signature


[PATCHv4 16/18] arm: dts: add omap5 CORE thermal data

2013-09-26 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for CORE domain on OMAP5 and later SoCs. This data will
enable a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5-core-thermal.dtsi | 28 
 1 file changed, 28 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap5-core-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap5-core-thermal.dtsi 
b/arch/arm/boot/dts/omap5-core-thermal.dtsi
new file mode 100644
index 000..3e9dc00
--- /dev/null
+++ b/arch/arm/boot/dts/omap5-core-thermal.dtsi
@@ -0,0 +1,28 @@
+/*
+ * Device Tree Source for OMAP543x SoC CORE thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+core_thermal: core_thermal {
+   polling-delay-passive = 250; /* milliseconds */
+   polling-delay = 1000; /* milliseconds */
+
+   /* sensor   ID */
+   thermal-sensors = bandgap 2;
+
+   trips {
+   core_crit: core_crit {
+   temperature = 125000; /* milliCelsius */
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_CRITICAL;
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv4 13/18] arm: dts: add cooling properties on omap4430 cpu node

2013-09-26 Thread Eduardo Valentin
OMAP4430 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the required cooling device properties
so that cpufreq-cpu0 driver loads the cooling device.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index e9c97d6..930ab47 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -22,6 +22,11 @@
1008000 1375000
;
clock-latency = 30; /* From legacy driver */
+
+   /* cooling options */
+   cooling-min-level = 0;
+   cooling-max-level = 3;
+   #cooling-cells = 2; /* min followed by max */
};
};
 
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv4 18/18] arm: dts: add cooling properties on omap5 cpu node

2013-09-26 Thread Eduardo Valentin
OMAP5 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the required cooling device properties
so that cpufreq-cpu0 driver loads the cooling device.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 187cb71..a35cd61 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -37,6 +37,9 @@
device_type = cpu;
compatible = arm,cortex-a15;
reg = 0x0;
+
+   /* cooling options */
+   #cooling-cells = 2; /* min followed by max */
};
cpu@1 {
device_type = cpu;
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv4 11/18] arm: dts: add omap4430 thermal data

2013-09-26 Thread Eduardo Valentin
This patch changes the dtsi entry on omap4430 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C and the
system will do a thermal shutdown at 125C.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index bcf455e..e9c97d6 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -12,7 +12,7 @@
 
 / {
cpus {
-   cpu@0 {
+   cpu0: cpu@0 {
/* OMAP443x variants OPP50-OPPNT */
operating-points = 
/* kHzuV */
@@ -25,9 +25,15 @@
};
};
 
-   bandgap {
+   thermal-zones{
+   #include omap4-cpu-thermal.dtsi
+   };
+
+   bandgap: bandgap {
reg = 0x4a002260 0x4
   0x4a00232C 0x4;
compatible = ti,omap4430-bandgap;
+
+   #thermal-sensor-cells = 0;
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv4 17/18] arm: dts: add omap5 thermal data

2013-09-26 Thread Eduardo Valentin
This patch changes the dtsi entry on omap5 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C. The
system will do a thermal shutdown at 125C whenever
any of its sensors sees this level.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 7cdea1b..187cb71 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -33,7 +33,7 @@
#address-cells = 1;
#size-cells = 0;
 
-   cpu@0 {
+   cpu0: cpu@0 {
device_type = cpu;
compatible = arm,cortex-a15;
reg = 0x0;
@@ -45,6 +45,12 @@
};
};
 
+   thermal-zones {
+   #include omap4-cpu-thermal.dtsi
+   #include omap5-gpu-thermal.dtsi
+   #include omap5-core-thermal.dtsi
+   };
+
timer {
compatible = arm,armv7-timer;
/* PPI secure/nonsecure IRQ */
@@ -705,13 +711,15 @@
};
};
 
-   bandgap@4a0021e0 {
+   bandgap: bandgap@4a0021e0 {
reg = 0x4a0021e0 0xc
   0x4a00232c 0xc
   0x4a002380 0x2c
   0x4a0023C0 0x3c;
interrupts = GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH;
compatible = ti,omap5430-bandgap;
+
+   #thermal-sensor-cells = 1;
};
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv4 14/18] arm: dts: add cooling properties on omap4460 cpu node

2013-09-26 Thread Eduardo Valentin
OMAP4460 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the required cooling device properties
so that cpufreq-cpu0 driver loads the cooling device.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4460.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index 4d93aba..dc22719 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -20,6 +20,11 @@
92  1313000
;
clock-latency = 30; /* From legacy driver */
+
+   /* cooling options */
+   cooling-min-level = 0;
+   cooling-max-level = 2;
+   #cooling-cells = 2; /* min followed by max */
};
};
 
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv4 15/18] arm: dts: add omap5 GPU thermal data

2013-09-26 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for GPU domain on OMAP5 and later SoCs. This data will
enable a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5-gpu-thermal.dtsi | 28 
 1 file changed, 28 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap5-gpu-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap5-gpu-thermal.dtsi 
b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
new file mode 100644
index 000..8941c8e
--- /dev/null
+++ b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
@@ -0,0 +1,28 @@
+/*
+ * Device Tree Source for OMAP543x SoC GPU thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+gpu_thermal: gpu_thermal {
+   polling-delay-passive = 250; /* milliseconds */
+   polling-delay = 1000; /* milliseconds */
+
+   /* sensor   ID */
+   thermal-sensors = bandgap 1;
+
+   trips {
+   gpu_crit: gpu_crit {
+   temperature = 125000; /* milliCelsius */
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_CRITICAL;
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv4 10/18] arm: dts: add omap4 CPU thermal data

2013-09-26 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for MPU domain on OMAP4 and later SoCs. This data will
enable the passive cooling with CPUfreq cooling device
at 100C and the system will do a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4-cpu-thermal.dtsi | 41 
 1 file changed, 41 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap4-cpu-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap4-cpu-thermal.dtsi 
b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
new file mode 100644
index 000..65a6deb
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
@@ -0,0 +1,41 @@
+/*
+ * Device Tree Source for OMAP4/5 SoC CPU thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+cpu_thermal: cpu_thermal {
+   polling-delay-passive = 250; /* milliseconds */
+   polling-delay = 1000; /* milliseconds */
+
+   /* sensor   ID */
+thermal-sensors = bandgap 0;
+
+trips {
+cpu_alert0: cpu_alert {
+temperature = 10; /* millicelsius */
+hysteresis = 2000; /* millicelsius */
+type = THERMAL_TRIP_PASSIVE;
+};
+cpu_crit: cpu_crit {
+temperature = 125000; /* millicelsius */
+hysteresis = 2000; /* millicelsius */
+type = THERMAL_TRIP_CRITICAL;
+};
+};
+
+   cooling-maps {
+   map0 {
+   trip = cpu_alert0;
+   cooling-device =
+   cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT;
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv4 12/18] arm: dts: add omap4460 thermal data

2013-09-26 Thread Eduardo Valentin
This patch changes the dtsi entry on omap4460 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C and the
system will do a thermal shutdown at 125C.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4460.dtsi | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index c2f0f39..4d93aba 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -12,7 +12,7 @@
 / {
cpus {
/* OMAP446x 'standard device' variants OPP50 to OPPTurbo */
-   cpu@0 {
+   cpu0: cpu@0 {
operating-points = 
/* kHzuV */
35  1025000
@@ -30,12 +30,18 @@
ti,hwmods = debugss;
};
 
-   bandgap {
+   thermal-zones{
+   #include omap4-cpu-thermal.dtsi
+   };
+
+   bandgap: bandgap {
reg = 0x4a002260 0x4
   0x4a00232C 0x4
   0x4a002378 0x18;
compatible = ti,omap4460-bandgap;
interrupts = 0 126 IRQ_TYPE_LEVEL_HIGH; /* talert */
gpios = gpio3 22 0; /* tshut */
+
+   #thermal-sensor-cells = 0;
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 15/16] arm: dts: add omap5 thermal data

2013-09-15 Thread Eduardo Valentin
This patch changes the dtsi entry on omap5 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C. The
system will do a thermal shutdown at 125C whenever
any of its sensors sees this level.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 07be2cd..b2ca0cf 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -33,7 +33,7 @@
#address-cells = 1;
#size-cells = 0;
 
-   cpu@0 {
+   cpu0: cpu@0 {
device_type = cpu;
compatible = arm,cortex-a15;
reg = 0x0;
@@ -45,6 +45,12 @@
};
};
 
+   thermal-zones {
+   #include omap4-cpu-thermal.dtsi
+   #include omap5-gpu-thermal.dtsi
+   #include omap5-core-thermal.dtsi
+   };
+
timer {
compatible = arm,armv7-timer;
/* PPI secure/nonsecure IRQ */
@@ -704,13 +710,15 @@
};
};
 
-   bandgap@4a0021e0 {
+   bandgap: bandgap@4a0021e0 {
reg = 0x4a0021e0 0xc
   0x4a00232c 0xc
   0x4a002380 0x2c
   0x4a0023C0 0x3c;
interrupts = GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH;
compatible = ti,omap5430-bandgap;
+
+   #sensor-cells = 1;
};
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 16/16] arm: dts: add cooling properties on omap5 cpu node

2013-09-15 Thread Eduardo Valentin
OMAP5 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the required cooling device properties
so that cpufreq-cpu0 driver loads the cooling device.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index b2ca0cf..9eb95b7 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -37,6 +37,9 @@
device_type = cpu;
compatible = arm,cortex-a15;
reg = 0x0;
+
+   /* cooling options */
+   #cooling-cells = 2; /* min followed by max */
};
cpu@1 {
device_type = cpu;
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 10/16] arm: dts: add omap4460 thermal data

2013-09-15 Thread Eduardo Valentin
This patch changes the dtsi entry on omap4460 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C and the
system will do a thermal shutdown at 125C.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4460.dtsi | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index c2f0f39..b6b9b83 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -12,7 +12,7 @@
 / {
cpus {
/* OMAP446x 'standard device' variants OPP50 to OPPTurbo */
-   cpu@0 {
+   cpu0: cpu@0 {
operating-points = 
/* kHzuV */
35  1025000
@@ -30,12 +30,18 @@
ti,hwmods = debugss;
};
 
-   bandgap {
+   thermal-zones{
+   #include omap4-cpu-thermal.dtsi
+   };
+
+   bandgap: bandgap {
reg = 0x4a002260 0x4
   0x4a00232C 0x4
   0x4a002378 0x18;
compatible = ti,omap4460-bandgap;
interrupts = 0 126 IRQ_TYPE_LEVEL_HIGH; /* talert */
gpios = gpio3 22 0; /* tshut */
+
+   #sensor-cells = 1;
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 14/16] arm: dts: add omap5 CORE thermal data

2013-09-15 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for CORE domain on OMAP5 and later SoCs. This data will
enable a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5-core-thermal.dtsi | 28 
 1 file changed, 28 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap5-core-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap5-core-thermal.dtsi 
b/arch/arm/boot/dts/omap5-core-thermal.dtsi
new file mode 100644
index 000..1fdd32e
--- /dev/null
+++ b/arch/arm/boot/dts/omap5-core-thermal.dtsi
@@ -0,0 +1,28 @@
+/*
+ * Device Tree Source for OMAP543x SoC CORE thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+core_thermal: core_thermal {
+   passive-delay = 250; /* milliseconds */
+   polling-delay = 1000; /* milliseconds */
+
+   /* sensor   ID */
+   sensors = bandgap 2;
+
+   trips {
+   core_crit: core_crit {
+   temperature = 125000; /* milliCelsius */
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_CRITICAL;
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 13/16] arm: dts: add omap5 GPU thermal data

2013-09-15 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for GPU domain on OMAP5 and later SoCs. This data will
enable a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5-gpu-thermal.dtsi | 28 
 1 file changed, 28 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap5-gpu-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap5-gpu-thermal.dtsi 
b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
new file mode 100644
index 000..08a1290
--- /dev/null
+++ b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
@@ -0,0 +1,28 @@
+/*
+ * Device Tree Source for OMAP543x SoC GPU thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+gpu_thermal: gpu_thermal {
+   passive-delay = 250; /* milliseconds */
+   polling-delay = 1000; /* milliseconds */
+
+   /* sensor   ID */
+   sensors = bandgap 1;
+
+   trips {
+   gpu_crit: gpu_crit {
+   temperature = 125000; /* milliCelsius */
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_CRITICAL;
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 12/16] arm: dts: add cooling properties on omap4460 cpu node

2013-09-15 Thread Eduardo Valentin
OMAP4460 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the required cooling device properties
so that cpufreq-cpu0 driver loads the cooling device.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4460.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index b6b9b83..0806f03 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -20,6 +20,11 @@
92  1313000
;
clock-latency = 30; /* From legacy driver */
+
+   /* cooling options */
+   cooling-min-level = 0;
+   cooling-max-level = 2;
+   #cooling-cells = 2; /* min followed by max */
};
};
 
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 09/16] arm: dts: add omap4430 thermal data

2013-09-15 Thread Eduardo Valentin
This patch changes the dtsi entry on omap4430 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C and the
system will do a thermal shutdown at 125C.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index bcf455e..6987df9 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -12,7 +12,7 @@
 
 / {
cpus {
-   cpu@0 {
+   cpu0: cpu@0 {
/* OMAP443x variants OPP50-OPPNT */
operating-points = 
/* kHzuV */
@@ -25,9 +25,15 @@
};
};
 
-   bandgap {
+   thermal-zones{
+   #include omap4-cpu-thermal.dtsi
+   };
+
+   bandgap: bandgap {
reg = 0x4a002260 0x4
   0x4a00232C 0x4;
compatible = ti,omap4430-bandgap;
+
+   #sensor-cells = 1;
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 08/16] arm: dts: add omap4 CPU thermal data

2013-09-15 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for MPU domain on OMAP4 and later SoCs. This data will
enable the passive cooling with CPUfreq cooling device
at 100C and the system will do a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson bcous...@baylibre.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4-cpu-thermal.dtsi | 41 
 1 file changed, 41 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap4-cpu-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap4-cpu-thermal.dtsi 
b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
new file mode 100644
index 000..dd69788
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
@@ -0,0 +1,41 @@
+/*
+ * Device Tree Source for OMAP4/5 SoC CPU thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+cpu_thermal: cpu_thermal {
+   passive-delay = 250; /* milliseconds */
+   polling-delay = 1000; /* milliseconds */
+
+   /* sensor   ID */
+sensors = bandgap 0;
+
+trips {
+cpu_alert0: cpu_alert {
+temperature = 10; /* milliCelsius */
+hysteresis = 2000; /* milliCelsius */
+type = THERMAL_TRIP_PASSIVE;
+};
+cpu_crit: cpu_crit {
+temperature = 125000; /* milliCelsius */
+hysteresis = 2000; /* milliCelsius */
+type = THERMAL_TRIP_CRITICAL;
+};
+};
+
+   cooling-attachments {
+   attach0 {
+   trip = cpu_alert0;
+   cooling-device =
+   cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT;
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


[RFC PATCH 11/14] arm: dts: add omap5 GPU thermal data

2013-08-23 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for GPU domain on OMAP5 and later SoCs. This data will
enable a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson b-cous...@linaro.org
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5-gpu-thermal.dtsi | 27 +++
 1 file changed, 27 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap5-gpu-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap5-gpu-thermal.dtsi 
b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
new file mode 100644
index 000..f421492
--- /dev/null
+++ b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
@@ -0,0 +1,27 @@
+
+/*
+ * Device Tree Source for OMAP543x SoC GPU thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+gpu_thermal: gpu_thermal {
+   #thermal-cells = 1;
+   mask = 0x01; /* trips writability */
+   passive_delay = 250; /* milliseconds */
+   polling_delay = 1000; /* milliseconds */
+   trips {
+   crit@125000{
+   temperature = 125000; /* milliCelsius */
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_CRITICAL;
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


[RFC PATCH 10/14] arm: dts: point to cooling-zones on omap4460 cpu node

2013-08-23 Thread Eduardo Valentin
OMAP4460 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch links the cpu node to its thermal-zone
so that cpufreq-cpu0 driver loads the cooling device.

Cc: Benoît Cousson b-cous...@linaro.org
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4460.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index 9855f29..991bd1b 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -20,6 +20,7 @@
92  1313000
;
clock-latency = 30; /* From legacy driver */
+   cooling-zones = cpu_thermal;
};
};
 
-- 
1.8.2.1.342.gfa7285d

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


[RFC PATCH 12/14] arm: dts: add omap5 CORE thermal data

2013-08-23 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for CORE domain on OMAP5 and later SoCs. This data will
enable a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5-core-thermal.dtsi | 27 +++
 1 file changed, 27 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap5-core-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap5-core-thermal.dtsi 
b/arch/arm/boot/dts/omap5-core-thermal.dtsi
new file mode 100644
index 000..3d9fa09
--- /dev/null
+++ b/arch/arm/boot/dts/omap5-core-thermal.dtsi
@@ -0,0 +1,27 @@
+
+/*
+ * Device Tree Source for OMAP543x SoC CORE thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+core_thermal: core_thermal {
+   #thermal-cells = 1;
+   mask = 0x01; /* trips writability */
+   passive_delay = 250; /* milliseconds */
+   polling_delay = 1000; /* milliseconds */
+   trips {
+   crit@125000{
+   temperature = 125000; /* milliCelsius */
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_CRITICAL;
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


[RFC PATCH 14/14] arm: dts: point to cooling-zones on omap5 cpu node

2013-08-23 Thread Eduardo Valentin
OMAP5 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch links the cpu node to its thermal-zone
so that cpufreq-cpu0 driver loads the cooling device.

Cc: Benoît Cousson b-cous...@linaro.org
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 4a33fe0..335fcea 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -37,6 +37,7 @@
device_type = cpu;
compatible = arm,cortex-a15;
reg = 0x0;
+   cooling-zones = cpu_thermal;
};
cpu@1 {
device_type = cpu;
-- 
1.8.2.1.342.gfa7285d

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


[RFC PATCH 08/14] arm: dts: add omap4460 thermal data

2013-08-23 Thread Eduardo Valentin
This patch changes the dtsi entry on omap4460 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C and the
system will do a thermal shutdown at 125C.

Cc: Benoît Cousson b-cous...@linaro.org
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4460.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index c2f0f39..9855f29 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -30,6 +30,10 @@
ti,hwmods = debugss;
};
 
+   thermal_zones{
+   #include omap4-cpu-thermal.dtsi
+   };
+
bandgap {
reg = 0x4a002260 0x4
   0x4a00232C 0x4
@@ -37,5 +41,6 @@
compatible = ti,omap4460-bandgap;
interrupts = 0 126 IRQ_TYPE_LEVEL_HIGH; /* talert */
gpios = gpio3 22 0; /* tshut */
+   monitored-zones = cpu_thermal 0;
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[RFC PATCH 06/14] arm: dts: add omap4 CPU thermal data

2013-08-23 Thread Eduardo Valentin
This patch changes a dtsi file to contain the thermal data
for MPU domain on OMAP4 and later SoCs. This data will
enable the passive cooling with CPUfreq cooling device
at 100C and the system will do a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: Benoît Cousson b-cous...@linaro.org
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4-cpu-thermal.dtsi | 40 
 1 file changed, 40 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap4-cpu-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap4-cpu-thermal.dtsi 
b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
new file mode 100644
index 000..d74c565
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
@@ -0,0 +1,40 @@
+
+/*
+ * Device Tree Source for OMAP4/5 SoC CPU thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin eduardo.valen...@ti.com
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include dt-bindings/thermal/thermal.h
+
+cpu_thermal: cpu_thermal {
+   #thermal-cells = 1;
+   mask = 0x03; /* trips writability */
+   passive_delay = 250; /* milliseconds */
+   polling_delay = 1000; /* milliseconds */
+   trips {
+   alert@10{
+   temperature = 10; /* milliCelsius */
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_PASSIVE;
+   };
+   crit@125000{
+   temperature = 125000; /* milliCelsius */
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_CRITICAL;
+   };
+   };
+   bind_params {
+   action@0{
+   cooling_device = thermal-cpufreq;
+   weight = 100; /* percentage */
+   mask = 0x01;
+   /* no limits, using defaults */
+   };
+   };
+};
-- 
1.8.2.1.342.gfa7285d

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


[RFC PATCH 09/14] arm: dts: point to cooling-zones on omap4430 cpu node

2013-08-23 Thread Eduardo Valentin
OMAP4430 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch links the cpu node to its thermal-zone
so that cpufreq-cpu0 driver loads the cooling device.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index 91a3a5d..e4eea43 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -22,6 +22,7 @@
1008000 1375000
;
clock-latency = 30; /* From legacy driver */
+   cooling-zones = cpu_thermal;
};
};
 
-- 
1.8.2.1.342.gfa7285d

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


[RFC PATCH 13/14] arm: dts: add omap5 thermal data

2013-08-23 Thread Eduardo Valentin
This patch changes the dtsi entry on omap5 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C. The
system will do a thermal shutdown at 125C whenever
any of its sensors sees this level.

Cc: Benoît Cousson b-cous...@linaro.org
Cc: Tony Lindgren t...@atomide.com
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index e643620..4a33fe0 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -45,6 +45,12 @@
};
};
 
+   thermal_zones {
+   #include omap4-cpu-thermal.dtsi
+   #include omap5-gpu-thermal.dtsi
+   #include omap5-core-thermal.dtsi
+   };
+
timer {
compatible = arm,armv7-timer;
/* PPI secure/nonsecure IRQ */
@@ -711,6 +717,9 @@
   0x4a0023C0 0x3c;
interrupts = GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH;
compatible = ti,omap5430-bandgap;
+   monitored-zones = cpu_thermal 0,
+ gpu_thermal 1,
+ core_thermal 2;
};
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[RFC PATCH 07/14] arm: dts: add omap4430 thermal data

2013-08-23 Thread Eduardo Valentin
This patch changes the dtsi entry on omap4430 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C and the
system will do a thermal shutdown at 125C.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index bcf455e..91a3a5d 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -25,9 +25,14 @@
};
};
 
+   thermal_zones{
+   #include omap4-cpu-thermal.dtsi
+   };
+
bandgap {
reg = 0x4a002260 0x4
   0x4a00232C 0x4;
compatible = ti,omap4430-bandgap;
+   monitored-zones = cpu_thermal 0;
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 7/9] arm: dts: add omap4430 thermal data

2013-07-17 Thread Eduardo Valentin
This patch changes the dtsi entry on omap4430 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C and the
system will do a thermal shutdown at 125C.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 31 +--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index 4a4dcc3..27f0e0f 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -8,6 +8,7 @@
  * kind, whether express or implied.
  */
 
+#include dt-bindings/thermal/thermal.h
 #include omap4.dtsi
 
 / {
@@ -27,8 +28,34 @@
};
 
bandgap {
-   reg = 0x4a002260 0x4
-  0x4a00232C 0x4;
+   reg = 0x4a002260 0x4 0x4a00232C 0x4;
compatible = ti,omap4430-bandgap;
+   thermal_zone {
+   type = CPU;
+   mask = 0x03; /* trips writability */
+   passive_delay = 250; /* milliseconds */
+   polling_delay = 1000; /* milliseconds */
+   governor = step_wise;
+   trips {
+   alert@10{
+   temperature = 10; /* milliCelsius 
*/
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_PASSIVE;
+   };
+   crit@125000{
+   temperature = 125000; /* milliCelsius 
*/
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_CRITICAL;
+   };
+   };
+   bind_params {
+   action@0{
+   cooling_device = thermal-cpufreq;
+   weight = 100; /* percentage */
+   mask = 0x01;
+   /* no limits, using defaults */
+   };
+   };
+   };
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 5/8] arm: dts: add omap4430 thermal data

2013-07-17 Thread Eduardo Valentin
This patch changes the dtsi entry on omap4430 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C and the
system will do a thermal shutdown at 125C.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 31 +--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index bcf455e..c9a1c89 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -8,6 +8,7 @@
  * kind, whether express or implied.
  */
 
+#include dt-bindings/thermal/thermal.h
 #include omap4.dtsi
 
 / {
@@ -26,8 +27,34 @@
};
 
bandgap {
-   reg = 0x4a002260 0x4
-  0x4a00232C 0x4;
+   reg = 0x4a002260 0x4 0x4a00232C 0x4;
compatible = ti,omap4430-bandgap;
+   thermal_zone {
+   type = CPU;
+   mask = 0x03; /* trips writability */
+   passive_delay = 250; /* milliseconds */
+   polling_delay = 1000; /* milliseconds */
+   governor = step_wise;
+   trips {
+   alert@10{
+   temperature = 10; /* milliCelsius 
*/
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_PASSIVE;
+   };
+   crit@125000{
+   temperature = 125000; /* milliCelsius 
*/
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_CRITICAL;
+   };
+   };
+   bind_params {
+   action@0{
+   cooling_device = thermal-cpufreq;
+   weight = 100; /* percentage */
+   mask = 0x01;
+   /* no limits, using defaults */
+   };
+   };
+   };
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 6/8] arm: dts: flag omap4430 with needs-cooling for cpu node

2013-07-17 Thread Eduardo Valentin
OMAP4430 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the flag so that cpufreq-cpu0 driver
loads the cooling device to use cpufreq on OMAP4430.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index c9a1c89..27f0e0f 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -23,6 +23,7 @@
1008000 1375000
;
clock-latency = 30; /* From legacy driver */
+   needs-cooling; /* make sure we have cpufreq-cooling */
};
};
 
-- 
1.8.2.1.342.gfa7285d

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


[PATCH 4/9] arm: dts: flag omap4430 with needs-cooling for cpu node

2013-07-17 Thread Eduardo Valentin
OMAP4430 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the flag so that cpufreq-cpu0 driver
loads the cooling device to use cpufreq on OMAP4430.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index bcf455e..4a4dcc3 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -22,6 +22,7 @@
1008000 1375000
;
clock-latency = 30; /* From legacy driver */
+   needs-cooling; /* make sure we have cpufreq-cooling */
};
};
 
-- 
1.8.2.1.342.gfa7285d

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


[RESEND PATCH V1 7/9] arm: dts: add omap4430 thermal data

2013-07-17 Thread Eduardo Valentin
This patch changes the dtsi entry on omap4430 to contain
the thermal data. This data will enable the passive
cooling with CPUfreq cooling device at 100C and the
system will do a thermal shutdown at 125C.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 31 +--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index 4a4dcc3..27f0e0f 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -8,6 +8,7 @@
  * kind, whether express or implied.
  */
 
+#include dt-bindings/thermal/thermal.h
 #include omap4.dtsi
 
 / {
@@ -27,8 +28,34 @@
};
 
bandgap {
-   reg = 0x4a002260 0x4
-  0x4a00232C 0x4;
+   reg = 0x4a002260 0x4 0x4a00232C 0x4;
compatible = ti,omap4430-bandgap;
+   thermal_zone {
+   type = CPU;
+   mask = 0x03; /* trips writability */
+   passive_delay = 250; /* milliseconds */
+   polling_delay = 1000; /* milliseconds */
+   governor = step_wise;
+   trips {
+   alert@10{
+   temperature = 10; /* milliCelsius 
*/
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_PASSIVE;
+   };
+   crit@125000{
+   temperature = 125000; /* milliCelsius 
*/
+   hysteresis = 2000; /* milliCelsius */
+   type = THERMAL_TRIP_CRITICAL;
+   };
+   };
+   bind_params {
+   action@0{
+   cooling_device = thermal-cpufreq;
+   weight = 100; /* percentage */
+   mask = 0x01;
+   /* no limits, using defaults */
+   };
+   };
+   };
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[RESEND PATCH V1 4/9] arm: dts: flag omap4430 with needs-cooling for cpu node

2013-07-17 Thread Eduardo Valentin
OMAP4430 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the flag so that cpufreq-cpu0 driver
loads the cooling device to use cpufreq on OMAP4430.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index bcf455e..4a4dcc3 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -22,6 +22,7 @@
1008000 1375000
;
clock-latency = 30; /* From legacy driver */
+   needs-cooling; /* make sure we have cpufreq-cooling */
};
};
 
-- 
1.8.2.1.342.gfa7285d

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


Re: Division by zero caused by CCF

2013-07-16 Thread Eduardo Valentin
] [c0369f44] (really_probe+0x70/0x1f4) from [c036a1dc] 
 (driver_probe_device+0x30/0x48)
 [   21.592901] [c036a1dc] (driver_probe_device+0x30/0x48) from [c036a288] 
 (__driver_attach+0x94/0x98)
 [   21.592911] [c036a288] (__driver_attach+0x94/0x98) from [c0368748] 
 (bus_for_each_dev+0x54/0x88)
 [   21.592921] [c0368748] (bus_for_each_dev+0x54/0x88) from [c036972c] 
 (bus_add_driver+0xdc/0x29c)
 [   21.592930] [c036972c] (bus_add_driver+0xdc/0x29c) from [c036a760] 
 (driver_register+0x78/0x190)
 [   21.592941] [c036a760] (driver_register+0x78/0x190) from [c00087b0] 
 (do_one_initcall+0x34/0x164)
 [   21.592954] [c00087b0] (do_one_initcall+0x34/0x164) from [c07b18f4] 
 (do_basic_setup+0x90/0xc4)
 [   21.592966] [c07b18f4] (do_basic_setup+0x90/0xc4) from [c07b199c] 
 (kernel_init_freeable+0x74/0x110)
 [   21.592980] [c07b199c] (kernel_init_freeable+0x74/0x110) from 
 [c0567694] (kernel_init+0x8/0xe4)
 [   21.592992] [c0567694] (kernel_init+0x8/0xe4) from [c0014648] 
 (ret_from_fork+0x14/0x2c)
 
 even though driver passed 19.2MHz, best_parent_rate ends up being zero
 which triggers the division by zero above.
 
 cheers
 


- -- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlHlRl8ACgkQCXcVR3XQvP00XQEAtQgDEJLt8OFCJiIhUj46Zq1h
PvNq67RSFTRXcq/zHa8A/0IZSPitTXt1TqDfalTKof/DR6n9/W6md8/C2Ovqb59o
=AKnu
-END PGP SIGNATURE-
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv3 5/6] arm: omap2plus_defconfig: enable TI bandgap driver

2013-06-24 Thread Eduardo Valentin
Tony,

On 18-06-2013 16:27, Eduardo Valentin wrote:
 Tony,
 
 On 07-06-2013 16:46, Eduardo Valentin wrote:
 Enable the bandgap driver for TI SoCs thermal support.

 Cc: Russell King li...@arm.linux.org.uk
 Cc: Tony Lindgren t...@atomide.com
 Cc: Javier Martinez Canillas javier.marti...@collabora.co.uk
 Cc: AnilKumar Ch anilku...@ti.com
 Cc: Santosh Shilimkar santosh.shilim...@ti.com
 Cc: Tomi Valkeinen tomi.valkei...@ti.com
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-ker...@vger.kernel.org
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
 
 Is it possible for you to queue this one and patch 6 for 3.11?

Gentle reminder.

 
 Cheers,
 
 ---
  arch/arm/configs/omap2plus_defconfig | 11 +++
  1 file changed, 11 insertions(+)

 diff --git a/arch/arm/configs/omap2plus_defconfig 
 b/arch/arm/configs/omap2plus_defconfig
 index c1ef64b..6e6c494 100644
 --- a/arch/arm/configs/omap2plus_defconfig
 +++ b/arch/arm/configs/omap2plus_defconfig
 @@ -151,6 +151,13 @@ CONFIG_W1=y
  CONFIG_POWER_SUPPLY=y
  CONFIG_SENSORS_LM75=m
  CONFIG_WATCHDOG=y
 +CONFIG_THERMAL=y
 +CONFIG_THERMAL_HWMON=y
 +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
 +CONFIG_THERMAL_GOV_FAIR_SHARE=y
 +CONFIG_THERMAL_GOV_STEP_WISE=y
 +CONFIG_THERMAL_GOV_USER_SPACE=y
 +CONFIG_CPU_THERMAL=y
  CONFIG_OMAP_WATCHDOG=y
  CONFIG_TWL4030_WATCHDOG=y
  CONFIG_MFD_TPS65217=y
 @@ -237,6 +244,10 @@ CONFIG_RTC_DRV_TWL4030=y
  CONFIG_RTC_DRV_OMAP=y
  CONFIG_DMADEVICES=y
  CONFIG_DMA_OMAP=y
 +CONFIG_TI_SOC_THERMAL=y
 +CONFIG_TI_THERMAL=y
 +CONFIG_OMAP4_THERMAL=y
 +CONFIG_OMAP5_THERMAL=y
  CONFIG_EXT2_FS=y
  CONFIG_EXT3_FS=y
  # CONFIG_EXT3_FS_XATTR is not set

 
 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin



signature.asc
Description: OpenPGP digital signature


Re: [PATCH 1/1] arm: add bandgap DT entry for OMAP5

2013-06-19 Thread Eduardo Valentin
On 19-06-2013 06:36, Benoit Cousson wrote:
 Hi Eduardo,
 
 On 06/18/2013 09:36 PM, Eduardo Valentin wrote:
 Add bandgap device DT entry for OMAP5 dtsi.

 Cc: Benoît Cousson b-cous...@ti.com
 Cc: Tony Lindgren t...@atomide.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: linux-omap@vger.kernel.org
 Cc: devicetree-disc...@lists.ozlabs.org
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-ker...@vger.kernel.org
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
 Signed-off-by: J Keerthy j-keer...@ti.com
 ---
   arch/arm/boot/dts/omap5.dtsi | 8 
   1 file changed, 8 insertions(+)
 ---

 Benoit,

 Sorry for this very late request, but can you please consider
 these patches for 3.11 still?

 I completely forgot to send these on my Enable TI SoC thermal driver 
 series.

 All best,

 Eduardo

 diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
 index 2ad63c4..5ede6e1 100644
 --- a/arch/arm/boot/dts/omap5.dtsi
 +++ b/arch/arm/boot/dts/omap5.dtsi
 @@ -615,5 +615,13 @@
  interrupts = 0 80 0x4;
  ti,hwmods = wd_timer2;
  };
 
 missing blank line
 
 +bandgap {
 
 You must use the first address in that case. Otherwise DT will affect a 
 random number and provide a non-standard device name. That does not really 
 matter in theory, but it will looks ugly in the /sys/devices list.
 
 +reg = 0x4a0021e0 0xc
 +0x4a00232c 0xc
 +0x4a002380 0x2c
 +0x4a0023C0 0x3c;
 +interrupts = 0 126 4; /* talert */
 
 Not well aligned and should use the macros.
 
 +compatible = ti,omap5430-bandgap;
 +};
  };
   };

 
 I did the update for you :-)
 
 Here is the version I've just applied.
 
 Benoit
 
 
From f0160bb93467e22f2f8bc77591dcd7e35cdee999 Mon Sep 17 00:00:00 2001
 From: Eduardo Valentin eduardo.valen...@ti.com
 Date: Tue, 18 Jun 2013 22:36:38 -0400
 Subject: [PATCH] ARM: dts: Add bandgap DT entry for OMAP5
 
 Add bandgap device DT entry for OMAP5 dtsi.
 
 Cc: Tony Lindgren t...@atomide.com
 Cc: Russell King li...@arm.linux.org.uk
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
 Signed-off-by: J Keerthy j-keer...@ti.com
 Signed-off-by: Benoit Cousson benoit.cous...@linaro.org
 ---
  arch/arm/boot/dts/omap5.dtsi |9 +
  1 file changed, 9 insertions(+)
 
 diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
 index accab62..47693c9 100644
 --- a/arch/arm/boot/dts/omap5.dtsi
 +++ b/arch/arm/boot/dts/omap5.dtsi
 @@ -696,5 +696,14 @@
   interrupts = GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH;
   };
   };
 +
 + bandgap@4a0021e0 {
 + reg = 0x4a0021e0 0xc
 +0x4a00232c 0xc
 +0x4a002380 0x2c
 +0x4a0023C0 0x3c;
 + interrupts = GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH;
 + compatible = ti,omap5430-bandgap;
 + };
   };
  };
 

Looks good to me.

Tks Benoit!

-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin



signature.asc
Description: OpenPGP digital signature


Re: [PATCHv3 3/6] arm: dts: add bandgap entry for OMAP443x devices

2013-06-18 Thread Eduardo Valentin
Benoit,

On 07-06-2013 16:46, Eduardo Valentin wrote:
 This patch add the bandgap entry for OMAP4430 devices.
 
 Cc: Benoît Cousson b-cous...@ti.com
 Cc: Tony Lindgren t...@atomide.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: linux-omap@vger.kernel.org
 Cc: devicetree-disc...@lists.ozlabs.org
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-ker...@vger.kernel.org
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com

Could you please have a look on this one?

 ---
  arch/arm/boot/dts/omap443x.dtsi | 4 
  1 file changed, 4 insertions(+)
 
 diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
 index cccf39a..8d6c968 100644
 --- a/arch/arm/boot/dts/omap443x.dtsi
 +++ b/arch/arm/boot/dts/omap443x.dtsi
 @@ -24,4 +24,8 @@
   clock-latency = 30; /* From legacy driver */
   };
   };
 + bandgap {
 + reg = 0x4a002260 0x4 0x4a00232C 0x4;
 + compatible = ti,omap4430-bandgap;
 + };
  };
 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin



signature.asc
Description: OpenPGP digital signature


Re: [PATCHv3 4/6] arm: dts: add bandgap entry for OMAP4460 devices

2013-06-18 Thread Eduardo Valentin
Benoit

On 07-06-2013 16:46, Eduardo Valentin wrote:
 Include bandgap devices for OMAP4460 devices.
 
 Cc: Benoît Cousson b-cous...@ti.com
 Cc: Tony Lindgren t...@atomide.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: linux-omap@vger.kernel.org
 Cc: devicetree-disc...@lists.ozlabs.org
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-ker...@vger.kernel.org
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
 ---

Could you please have a look on patch 3 and 4 of this series? I have
changed this one accordingly to your recommendation on v2. If nothing
else, please let me know if they can still be queued for 3.11.

I would need to rebase patch 01 to refresh on top of the thermal tree.

Thanks.

  arch/arm/boot/dts/omap4460.dtsi | 9 +
  1 file changed, 9 insertions(+)
 
 diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
 index 2cf227c..ea97201 100644
 --- a/arch/arm/boot/dts/omap4460.dtsi
 +++ b/arch/arm/boot/dts/omap4460.dtsi
 @@ -29,4 +29,13 @@
0 55 0x4;
   ti,hwmods = debugss;
   };
 +
 + bandgap {
 + reg = 0x4a002260 0x4
 + 0x4a00232C 0x4
 + 0x4a002378 0x18;
 + compatible = ti,omap4460-bandgap;
 + interrupts = 0 126 4; /* talert */
 + gpios = gpio3 22 0; /* tshut */
 + };
  };
 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin



signature.asc
Description: OpenPGP digital signature


Re: [PATCHv3 2/6] arm: introduce config HAS_BANDGAP

2013-06-18 Thread Eduardo Valentin
On 12-06-2013 13:07, Tony Lindgren wrote:
 * Eduardo Valentin eduardo.valen...@ti.com [130607 13:53]:
 Bandgap is a device used to measure temperature on
 electronic equipments. It is widely used in digital
 integrated circuits. It is based on the dependency
 between silicon voltage and temperature.

 This patch introduce HAS_BANDGAP config entry.
 This config is a boolean value so that arch
 code can flag if they feature a bandgap device.

 This config entry follows the same idea behind
 ARCH_HAS_CPUFREQ.
 
 I suggest you add this to Russell's patch system:
 
 Acked-by: Tony Lindgren t...@atomide.com

Thanks!

I have add it to Russell's patch system and it has been accepted and
applied.

  
 Cc: Russell King li...@arm.linux.org.uk
 Cc: Tony Lindgren t...@atomide.com
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-omap@vger.kernel.org
 Cc: linux-ker...@vger.kernel.org
 Cc: Fabio Stevam feste...@gmail.com
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
 ---
  arch/arm/Kconfig| 3 +++
  arch/arm/mach-omap2/Kconfig | 1 +
  2 files changed, 4 insertions(+)

 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
 index d423d58..bcbdec9 100644
 --- a/arch/arm/Kconfig
 +++ b/arch/arm/Kconfig
 @@ -174,6 +174,9 @@ config ARCH_HAS_CPUFREQ
and that the relevant menu configurations are displayed for
it.
  
 +config ARCH_HAS_BANDGAP
 +bool
 +
  config GENERIC_HWEIGHT
  bool
  default y
 diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
 index f49cd51..8620ab5 100644
 --- a/arch/arm/mach-omap2/Kconfig
 +++ b/arch/arm/mach-omap2/Kconfig
 @@ -4,6 +4,7 @@ config ARCH_OMAP
  config ARCH_OMAP2PLUS
  bool TI OMAP2/3/4/5 SoCs with device tree support if (ARCH_MULTI_V6 
 || ARCH_MULTI_V7)
  select ARCH_HAS_CPUFREQ
 +select ARCH_HAS_BANDGAP
  select ARCH_HAS_HOLES_MEMORYMODEL
  select ARCH_OMAP
  select ARCH_REQUIRE_GPIOLIB
 -- 
 1.8.2.1.342.gfa7285d

 
 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin



signature.asc
Description: OpenPGP digital signature


Re: [PATCHv3 5/6] arm: omap2plus_defconfig: enable TI bandgap driver

2013-06-18 Thread Eduardo Valentin
Tony,

On 07-06-2013 16:46, Eduardo Valentin wrote:
 Enable the bandgap driver for TI SoCs thermal support.
 
 Cc: Russell King li...@arm.linux.org.uk
 Cc: Tony Lindgren t...@atomide.com
 Cc: Javier Martinez Canillas javier.marti...@collabora.co.uk
 Cc: AnilKumar Ch anilku...@ti.com
 Cc: Santosh Shilimkar santosh.shilim...@ti.com
 Cc: Tomi Valkeinen tomi.valkei...@ti.com
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-ker...@vger.kernel.org
 Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com

Is it possible for you to queue this one and patch 6 for 3.11?

Cheers,

 ---
  arch/arm/configs/omap2plus_defconfig | 11 +++
  1 file changed, 11 insertions(+)
 
 diff --git a/arch/arm/configs/omap2plus_defconfig 
 b/arch/arm/configs/omap2plus_defconfig
 index c1ef64b..6e6c494 100644
 --- a/arch/arm/configs/omap2plus_defconfig
 +++ b/arch/arm/configs/omap2plus_defconfig
 @@ -151,6 +151,13 @@ CONFIG_W1=y
  CONFIG_POWER_SUPPLY=y
  CONFIG_SENSORS_LM75=m
  CONFIG_WATCHDOG=y
 +CONFIG_THERMAL=y
 +CONFIG_THERMAL_HWMON=y
 +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
 +CONFIG_THERMAL_GOV_FAIR_SHARE=y
 +CONFIG_THERMAL_GOV_STEP_WISE=y
 +CONFIG_THERMAL_GOV_USER_SPACE=y
 +CONFIG_CPU_THERMAL=y
  CONFIG_OMAP_WATCHDOG=y
  CONFIG_TWL4030_WATCHDOG=y
  CONFIG_MFD_TPS65217=y
 @@ -237,6 +244,10 @@ CONFIG_RTC_DRV_TWL4030=y
  CONFIG_RTC_DRV_OMAP=y
  CONFIG_DMADEVICES=y
  CONFIG_DMA_OMAP=y
 +CONFIG_TI_SOC_THERMAL=y
 +CONFIG_TI_THERMAL=y
 +CONFIG_OMAP4_THERMAL=y
 +CONFIG_OMAP5_THERMAL=y
  CONFIG_EXT2_FS=y
  CONFIG_EXT3_FS=y
  # CONFIG_EXT3_FS_XATTR is not set
 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin



signature.asc
Description: OpenPGP digital signature


[PATCH 1/1] arm: add bandgap DT entry for OMAP5

2013-06-18 Thread Eduardo Valentin
Add bandgap device DT entry for OMAP5 dtsi.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
Signed-off-by: J Keerthy j-keer...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi | 8 
 1 file changed, 8 insertions(+)
---

Benoit,

Sorry for this very late request, but can you please consider
these patches for 3.11 still?

I completely forgot to send these on my Enable TI SoC thermal driver series.

All best,

Eduardo

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 2ad63c4..5ede6e1 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -615,5 +615,13 @@
interrupts = 0 80 0x4;
ti,hwmods = wd_timer2;
};
+   bandgap {
+   reg = 0x4a0021e0 0xc
+   0x4a00232c 0xc
+   0x4a002380 0x2c
+   0x4a0023C0 0x3c;
+   interrupts = 0 126 4; /* talert */
+   compatible = ti,omap5430-bandgap;
+   };
};
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv3 0/6] arm: enable TI SoC thermal driver

2013-06-07 Thread Eduardo Valentin
Hello,

Idea is to add the missing bits under arch/arm/*omap* required
to enable by default the ti-soc-thermal driver. I am planing to
move it out of staging tree. This has been scheduled to 3.11.

It would be interesting to get
feedback from other ppl. By enabling it by default we could reach
more ppl for testing it across the supported chips.

The difference from v2 is that now the driver is changed to use
GPIO bindings for Tshut as suggested by Benoit and I added
a simple description what is bandgap.

The difference from v1 is just that patch 01 doe snot include the
dts prefix, as it is not supposed to be DTS related.


Eduardo Valentin (6):
  thermal: ti-soc-thermal: use standard GPIO DT bindings
  arm: introduce config HAS_BANDGAP
  arm: dts: add bandgap entry for OMAP443x devices
  arm: dts: add bandgap entry for OMAP4460 devices
  arm: omap2plus_defconfig: enable TI bandgap driver
  arm: omap2plus_defconfig: enable DRA752 thermal support by default

 arch/arm/Kconfig  |  3 +++
 arch/arm/boot/dts/omap443x.dtsi   |  4 
 arch/arm/boot/dts/omap4460.dtsi   |  9 +
 arch/arm/configs/omap2plus_defconfig  | 12 
 arch/arm/mach-omap2/Kconfig   |  1 +
 drivers/staging/ti-soc-thermal/ti-bandgap.c   |  8 ++--
 drivers/staging/ti-soc-thermal/ti_soc_thermal.txt |  9 +
 7 files changed, 36 insertions(+), 10 deletions(-)

-- 
1.8.2.1.342.gfa7285d

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


[PATCHv3 1/6] thermal: ti-soc-thermal: use standard GPIO DT bindings

2013-06-07 Thread Eduardo Valentin
This change updates the ti-soc-thermal driver to use
standard GPIO DT bindings to read the GPIO number associated
to thermal shutdown IRQ, in case the device features it.

Previously, the code was using a specific DT bindings.
As now OMAP supports the standard way to model GPIOs,
there is no point in having a ti specific binding.

Cc: Zhang Rui rui.zh...@intel.com
Cc: Grant Likely grant.lik...@linaro.org
Cc: Rob Herring rob.herr...@calxeda.com
Cc: linux...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 drivers/staging/ti-soc-thermal/ti-bandgap.c   | 8 ++--
 drivers/staging/ti-soc-thermal/ti_soc_thermal.txt | 9 +
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/ti-soc-thermal/ti-bandgap.c 
b/drivers/staging/ti-soc-thermal/ti-bandgap.c
index f20c1cf..c7fc0d0 100644
--- a/drivers/staging/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/staging/ti-soc-thermal/ti-bandgap.c
@@ -38,6 +38,7 @@
 #include linux/of_device.h
 #include linux/of_platform.h
 #include linux/of_irq.h
+#include linux/of_gpio.h
 #include linux/io.h
 
 #include ti-bandgap.h
@@ -1123,7 +1124,6 @@ static struct ti_bandgap *ti_bandgap_build(struct 
platform_device *pdev)
const struct of_device_id *of_id;
struct ti_bandgap *bgp;
struct resource *res;
-   u32 prop;
int i;
 
/* just for the sake */
@@ -1167,11 +1167,7 @@ static struct ti_bandgap *ti_bandgap_build(struct 
platform_device *pdev)
} while (res);
 
if (TI_BANDGAP_HAS(bgp, TSHUT)) {
-   if (of_property_read_u32(node, ti,tshut-gpio, prop)  0) {
-   dev_err(pdev-dev, missing tshut gpio in device 
tree\n);
-   return ERR_PTR(-EINVAL);
-   }
-   bgp-tshut_gpio = prop;
+   bgp-tshut_gpio = of_get_gpio(node, 0);
if (!gpio_is_valid(bgp-tshut_gpio)) {
dev_err(pdev-dev, invalid gpio for tshut (%d)\n,
bgp-tshut_gpio);
diff --git a/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt 
b/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt
index a4a33d1..382bd98 100644
--- a/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt
+++ b/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt
@@ -17,8 +17,9 @@ Required properties:
 - interrupts : this entry should indicate which interrupt line
 the talert signal is routed to;
 Specific:
-- ti,tshut-gpio : this entry should be used to inform which GPIO
-line the tshut signal is routed to;
+- gpios : this entry should be used to inform which GPIO
+line the tshut signal is routed to. The informed GPIO will
+be treated as an IRQ;
 - regs : this entry must also be specified and it is specific
 to each bandgap version, because the mapping may change from
 soc to soc, apart of depending on available features.
@@ -37,7 +38,7 @@ bandgap {
0x4a002378 0x18;
compatible = ti,omap4460-bandgap;
interrupts = 0 126 4; /* talert */
-   ti,tshut-gpio = 86;
+   gpios = gpio3 22 0; /* tshut */
 };
 
 OMAP4470:
@@ -47,7 +48,7 @@ bandgap {
0x4a002378 0x18;
compatible = ti,omap4470-bandgap;
interrupts = 0 126 4; /* talert */
-   ti,tshut-gpio = 86;
+   gpios = gpio3 22 0; /* tshut */
 };
 
 OMAP5430:
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv3 2/6] arm: introduce config HAS_BANDGAP

2013-06-07 Thread Eduardo Valentin
Bandgap is a device used to measure temperature on
electronic equipments. It is widely used in digital
integrated circuits. It is based on the dependency
between silicon voltage and temperature.

This patch introduce HAS_BANDGAP config entry.
This config is a boolean value so that arch
code can flag if they feature a bandgap device.

This config entry follows the same idea behind
ARCH_HAS_CPUFREQ.

Cc: Russell King li...@arm.linux.org.uk
Cc: Tony Lindgren t...@atomide.com
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Cc: Fabio Stevam feste...@gmail.com
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/Kconfig| 3 +++
 arch/arm/mach-omap2/Kconfig | 1 +
 2 files changed, 4 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d423d58..bcbdec9 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -174,6 +174,9 @@ config ARCH_HAS_CPUFREQ
  and that the relevant menu configurations are displayed for
  it.
 
+config ARCH_HAS_BANDGAP
+   bool
+
 config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index f49cd51..8620ab5 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -4,6 +4,7 @@ config ARCH_OMAP
 config ARCH_OMAP2PLUS
bool TI OMAP2/3/4/5 SoCs with device tree support if (ARCH_MULTI_V6 
|| ARCH_MULTI_V7)
select ARCH_HAS_CPUFREQ
+   select ARCH_HAS_BANDGAP
select ARCH_HAS_HOLES_MEMORYMODEL
select ARCH_OMAP
select ARCH_REQUIRE_GPIOLIB
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv3 6/6] arm: omap2plus_defconfig: enable DRA752 thermal support by default

2013-06-07 Thread Eduardo Valentin
Make DRA752 thermal support enabled on omap2plus_defconfig

Cc: Russell King li...@arm.linux.org.uk
Cc: Tony Lindgren t...@atomide.com
Cc: Javier Martinez Canillas javier.marti...@collabora.co.uk
Cc: AnilKumar Ch anilku...@ti.com
Cc: Santosh Shilimkar santosh.shilim...@ti.com
Cc: Tomi Valkeinen tomi.valkei...@ti.com
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/configs/omap2plus_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 6e6c494..07aab0b 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -248,6 +248,7 @@ CONFIG_TI_SOC_THERMAL=y
 CONFIG_TI_THERMAL=y
 CONFIG_OMAP4_THERMAL=y
 CONFIG_OMAP5_THERMAL=y
+CONFIG_DRA752_THERMAL=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv3 5/6] arm: omap2plus_defconfig: enable TI bandgap driver

2013-06-07 Thread Eduardo Valentin
Enable the bandgap driver for TI SoCs thermal support.

Cc: Russell King li...@arm.linux.org.uk
Cc: Tony Lindgren t...@atomide.com
Cc: Javier Martinez Canillas javier.marti...@collabora.co.uk
Cc: AnilKumar Ch anilku...@ti.com
Cc: Santosh Shilimkar santosh.shilim...@ti.com
Cc: Tomi Valkeinen tomi.valkei...@ti.com
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/configs/omap2plus_defconfig | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index c1ef64b..6e6c494 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -151,6 +151,13 @@ CONFIG_W1=y
 CONFIG_POWER_SUPPLY=y
 CONFIG_SENSORS_LM75=m
 CONFIG_WATCHDOG=y
+CONFIG_THERMAL=y
+CONFIG_THERMAL_HWMON=y
+CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
+CONFIG_THERMAL_GOV_FAIR_SHARE=y
+CONFIG_THERMAL_GOV_STEP_WISE=y
+CONFIG_THERMAL_GOV_USER_SPACE=y
+CONFIG_CPU_THERMAL=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
 CONFIG_MFD_TPS65217=y
@@ -237,6 +244,10 @@ CONFIG_RTC_DRV_TWL4030=y
 CONFIG_RTC_DRV_OMAP=y
 CONFIG_DMADEVICES=y
 CONFIG_DMA_OMAP=y
+CONFIG_TI_SOC_THERMAL=y
+CONFIG_TI_THERMAL=y
+CONFIG_OMAP4_THERMAL=y
+CONFIG_OMAP5_THERMAL=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv3 4/6] arm: dts: add bandgap entry for OMAP4460 devices

2013-06-07 Thread Eduardo Valentin
Include bandgap devices for OMAP4460 devices.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap4460.dtsi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index 2cf227c..ea97201 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -29,4 +29,13 @@
 0 55 0x4;
ti,hwmods = debugss;
};
+
+   bandgap {
+   reg = 0x4a002260 0x4
+   0x4a00232C 0x4
+   0x4a002378 0x18;
+   compatible = ti,omap4460-bandgap;
+   interrupts = 0 126 4; /* talert */
+   gpios = gpio3 22 0; /* tshut */
+   };
 };
-- 
1.8.2.1.342.gfa7285d

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


[PATCHv3 3/6] arm: dts: add bandgap entry for OMAP443x devices

2013-06-07 Thread Eduardo Valentin
This patch add the bandgap entry for OMAP4430 devices.

Cc: Benoît Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Russell King li...@arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/boot/dts/omap443x.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index cccf39a..8d6c968 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -24,4 +24,8 @@
clock-latency = 30; /* From legacy driver */
};
};
+   bandgap {
+   reg = 0x4a002260 0x4 0x4a00232C 0x4;
+   compatible = ti,omap4430-bandgap;
+   };
 };
-- 
1.8.2.1.342.gfa7285d

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


Re: [PATCHv2 1/3] arm: introduce config HAS_BANDGAP

2013-06-04 Thread Eduardo Valentin
Fabio,

On 31-05-2013 11:12, Fabio Estevam wrote:
 On Wed, May 15, 2013 at 11:58 AM, Eduardo Valentin
 eduardo.valen...@ti.com wrote:
 Introduce HAS_BANDGAP config entry. This config is a
 boolean value so that arch code can flag is they
 feature a bandgap device.

 This config entry follows the same idea behind
 ARCH_HAS_CPUFREQ.
 
 It would be nice if you explain what BANDGAP means here, since you
 introduce this option in this patch.
 
 

Yeah, I didnt do it because bandgap is a common term used in digital
circuits [1,2]. Also, as in this patch we do not add term different from
the common used bandgap term, I believe it is self explanatory.

I any case, I am resending with minor explanation.

[1] - http://en.wikipedia.org/wiki/Bandgap_voltage_reference
[2] - http://en.wikipedia.org/wiki/Silicon_bandgap_temperature_sensor

-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin



signature.asc
Description: OpenPGP digital signature


[PATCHv3 1/3] arm: introduce config HAS_BANDGAP

2013-06-04 Thread Eduardo Valentin
Bandgap is a device used to measure temperature on
electronic equipments. It is widely used in digital
integrated circuits. It is based on the dependency
between silicon voltage and temperature.

This patch introduce HAS_BANDGAP config entry.
This config is a boolean value so that arch
code can flag if they feature a bandgap device.

This config entry follows the same idea behind
ARCH_HAS_CPUFREQ.

Cc: Russell King li...@arm.linux.org.uk
Cc: Tony Lindgren t...@atomide.com
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Cc: Fabio Stevam feste...@gmail.com
Signed-off-by: Eduardo Valentin eduardo.valen...@ti.com
---
 arch/arm/Kconfig| 3 +++
 arch/arm/mach-omap2/Kconfig | 1 +
 2 files changed, 4 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d423d58..bcbdec9 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -174,6 +174,9 @@ config ARCH_HAS_CPUFREQ
  and that the relevant menu configurations are displayed for
  it.
 
+config ARCH_HAS_BANDGAP
+   bool
+
 config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index f49cd51..8620ab5 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -4,6 +4,7 @@ config ARCH_OMAP
 config ARCH_OMAP2PLUS
bool TI OMAP2/3/4/5 SoCs with device tree support if (ARCH_MULTI_V6 
|| ARCH_MULTI_V7)
select ARCH_HAS_CPUFREQ
+   select ARCH_HAS_BANDGAP
select ARCH_HAS_HOLES_MEMORYMODEL
select ARCH_OMAP
select ARCH_REQUIRE_GPIOLIB
-- 
1.8.2.1.342.gfa7285d

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


  1   2   3   4   5   6   7   >