All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree
@ 2017-03-01 10:29 ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: rui.zhang, linux-omap, linux-arm-kernel, linux-kernel, linux-pm,
	robh+dt, t-kristo, j-keerthy

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Tested for the slope and constant values on DRA7-EVM.

Keerthy (7):
  ARM: DRA7: Thermal: Add slope and offset values
  ARM: OMAP5: Thermal: Add slope and offset values
  ARM: OMAP443x: Thermal: Add slope and offset values
  ARM: OMAP4460: Thermal: Add slope and offset values
  thermal: ti-soc-thermal: Fetch slope and offset from DT
  thermal: ti-soc-thermal: Remove redundant constants
  thermal: ti-soc-thermal: Remove redundant code

 arch/arm/boot/dts/dra7.dtsi                        |  17 +++
 arch/arm/boot/dts/omap443x.dtsi                    |   4 +
 arch/arm/boot/dts/omap4460.dtsi                    |   4 +
 arch/arm/boot/dts/omap5.dtsi                       |   9 ++
 .../thermal/ti-soc-thermal/dra752-thermal-data.c   |  10 --
 .../thermal/ti-soc-thermal/omap4-thermal-data.c    |   4 -
 .../thermal/ti-soc-thermal/omap5-thermal-data.c    |   4 -
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 164 ++-------------------
 8 files changed, 45 insertions(+), 171 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree
@ 2017-03-01 10:29 ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: linux-pm, j-keerthy, linux-kernel, t-kristo, robh+dt, rui.zhang,
	linux-omap, linux-arm-kernel

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Tested for the slope and constant values on DRA7-EVM.

Keerthy (7):
  ARM: DRA7: Thermal: Add slope and offset values
  ARM: OMAP5: Thermal: Add slope and offset values
  ARM: OMAP443x: Thermal: Add slope and offset values
  ARM: OMAP4460: Thermal: Add slope and offset values
  thermal: ti-soc-thermal: Fetch slope and offset from DT
  thermal: ti-soc-thermal: Remove redundant constants
  thermal: ti-soc-thermal: Remove redundant code

 arch/arm/boot/dts/dra7.dtsi                        |  17 +++
 arch/arm/boot/dts/omap443x.dtsi                    |   4 +
 arch/arm/boot/dts/omap4460.dtsi                    |   4 +
 arch/arm/boot/dts/omap5.dtsi                       |   9 ++
 .../thermal/ti-soc-thermal/dra752-thermal-data.c   |  10 --
 .../thermal/ti-soc-thermal/omap4-thermal-data.c    |   4 -
 .../thermal/ti-soc-thermal/omap5-thermal-data.c    |   4 -
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 164 ++-------------------
 8 files changed, 45 insertions(+), 171 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree
@ 2017-03-01 10:29 ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Tested for the slope and constant values on DRA7-EVM.

Keerthy (7):
  ARM: DRA7: Thermal: Add slope and offset values
  ARM: OMAP5: Thermal: Add slope and offset values
  ARM: OMAP443x: Thermal: Add slope and offset values
  ARM: OMAP4460: Thermal: Add slope and offset values
  thermal: ti-soc-thermal: Fetch slope and offset from DT
  thermal: ti-soc-thermal: Remove redundant constants
  thermal: ti-soc-thermal: Remove redundant code

 arch/arm/boot/dts/dra7.dtsi                        |  17 +++
 arch/arm/boot/dts/omap443x.dtsi                    |   4 +
 arch/arm/boot/dts/omap4460.dtsi                    |   4 +
 arch/arm/boot/dts/omap5.dtsi                       |   9 ++
 .../thermal/ti-soc-thermal/dra752-thermal-data.c   |  10 --
 .../thermal/ti-soc-thermal/omap4-thermal-data.c    |   4 -
 .../thermal/ti-soc-thermal/omap5-thermal-data.c    |   4 -
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 164 ++-------------------
 8 files changed, 45 insertions(+), 171 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 1/7] ARM: DRA7: Thermal: Add slope and offset values
  2017-03-01 10:29 ` Keerthy
  (?)
@ 2017-03-01 10:29   ` Keerthy
  -1 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: rui.zhang, linux-omap, linux-arm-kernel, linux-kernel, linux-pm,
	robh+dt, t-kristo, j-keerthy

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/boot/dts/dra7.dtsi | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 2c9e56f..10e09dc 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -1982,6 +1982,23 @@
 
 &cpu_thermal {
 	polling-delay = <500>; /* milliseconds */
+	coefficients = <0 2000>;
+};
+
+&gpu_thermal {
+	coefficients = <0 2000>;
+};
+
+&core_thermal {
+	coefficients = <0 2000>;
+};
+
+&dspeve_thermal {
+	coefficients = <0 2000>;
+};
+
+&iva_thermal {
+	coefficients = <0 2000>;
 };
 
 /include/ "dra7xx-clocks.dtsi"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 1/7] ARM: DRA7: Thermal: Add slope and offset values
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: linux-pm, j-keerthy, linux-kernel, t-kristo, robh+dt, rui.zhang,
	linux-omap, linux-arm-kernel

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/boot/dts/dra7.dtsi | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 2c9e56f..10e09dc 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -1982,6 +1982,23 @@
 
 &cpu_thermal {
 	polling-delay = <500>; /* milliseconds */
+	coefficients = <0 2000>;
+};
+
+&gpu_thermal {
+	coefficients = <0 2000>;
+};
+
+&core_thermal {
+	coefficients = <0 2000>;
+};
+
+&dspeve_thermal {
+	coefficients = <0 2000>;
+};
+
+&iva_thermal {
+	coefficients = <0 2000>;
 };
 
 /include/ "dra7xx-clocks.dtsi"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 1/7] ARM: DRA7: Thermal: Add slope and offset values
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/boot/dts/dra7.dtsi | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 2c9e56f..10e09dc 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -1982,6 +1982,23 @@
 
 &cpu_thermal {
 	polling-delay = <500>; /* milliseconds */
+	coefficients = <0 2000>;
+};
+
+&gpu_thermal {
+	coefficients = <0 2000>;
+};
+
+&core_thermal {
+	coefficients = <0 2000>;
+};
+
+&dspeve_thermal {
+	coefficients = <0 2000>;
+};
+
+&iva_thermal {
+	coefficients = <0 2000>;
 };
 
 /include/ "dra7xx-clocks.dtsi"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 2/7] ARM: OMAP5: Thermal: Add slope and offset values
  2017-03-01 10:29 ` Keerthy
  (?)
@ 2017-03-01 10:29   ` Keerthy
  -1 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: rui.zhang, linux-omap, linux-arm-kernel, linux-kernel, linux-pm,
	robh+dt, t-kristo, j-keerthy

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@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 222155c..eaff2a5 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -1127,6 +1127,15 @@
 
 &cpu_thermal {
 	polling-delay = <500>; /* milliseconds */
+	coefficients = <65 (-1791)>;
 };
 
 /include/ "omap54xx-clocks.dtsi"
+
+&gpu_thermal {
+	coefficients = <117 (-2992)>;
+};
+
+&core_thermal {
+	coefficients = <0 2000>;
+};
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 2/7] ARM: OMAP5: Thermal: Add slope and offset values
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: linux-pm, j-keerthy, linux-kernel, t-kristo, robh+dt, rui.zhang,
	linux-omap, linux-arm-kernel

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@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 222155c..eaff2a5 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -1127,6 +1127,15 @@
 
 &cpu_thermal {
 	polling-delay = <500>; /* milliseconds */
+	coefficients = <65 (-1791)>;
 };
 
 /include/ "omap54xx-clocks.dtsi"
+
+&gpu_thermal {
+	coefficients = <117 (-2992)>;
+};
+
+&core_thermal {
+	coefficients = <0 2000>;
+};
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 2/7] ARM: OMAP5: Thermal: Add slope and offset values
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@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 222155c..eaff2a5 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -1127,6 +1127,15 @@
 
 &cpu_thermal {
 	polling-delay = <500>; /* milliseconds */
+	coefficients = <65 (-1791)>;
 };
 
 /include/ "omap54xx-clocks.dtsi"
+
+&gpu_thermal {
+	coefficients = <117 (-2992)>;
+};
+
+&core_thermal {
+	coefficients = <0 2000>;
+};
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 3/7] ARM: OMAP443x: Thermal: Add slope and offset values
  2017-03-01 10:29 ` Keerthy
  (?)
@ 2017-03-01 10:29   ` Keerthy
  -1 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: rui.zhang, linux-omap, linux-arm-kernel, linux-kernel, linux-pm,
	robh+dt, t-kristo, j-keerthy

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@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 fc6a861..03c8ad9 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -71,4 +71,8 @@
 
 };
 
+&cpu_thermal {
+	coefficients = <0 20000>;
+};
+
 /include/ "omap443x-clocks.dtsi"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 3/7] ARM: OMAP443x: Thermal: Add slope and offset values
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: linux-pm, j-keerthy, linux-kernel, t-kristo, robh+dt, rui.zhang,
	linux-omap, linux-arm-kernel

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@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 fc6a861..03c8ad9 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -71,4 +71,8 @@
 
 };
 
+&cpu_thermal {
+	coefficients = <0 20000>;
+};
+
 /include/ "omap443x-clocks.dtsi"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 3/7] ARM: OMAP443x: Thermal: Add slope and offset values
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@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 fc6a861..03c8ad9 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -71,4 +71,8 @@
 
 };
 
+&cpu_thermal {
+	coefficients = <0 20000>;
+};
+
 /include/ "omap443x-clocks.dtsi"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 4/7] ARM: OMAP4460: Thermal: Add slope and offset values
  2017-03-01 10:29 ` Keerthy
  (?)
@ 2017-03-01 10:29   ` Keerthy
  -1 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: rui.zhang, linux-omap, linux-arm-kernel, linux-kernel, linux-pm,
	robh+dt, t-kristo, j-keerthy

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/boot/dts/omap4460.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index ef66e12..c43f2a2 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -90,4 +90,8 @@
 
 };
 
+&cpu_thermal {
+	coefficients = <348 (-9301)>;
+};
+
 /include/ "omap446x-clocks.dtsi"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 4/7] ARM: OMAP4460: Thermal: Add slope and offset values
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: linux-pm, j-keerthy, linux-kernel, t-kristo, robh+dt, rui.zhang,
	linux-omap, linux-arm-kernel

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/boot/dts/omap4460.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index ef66e12..c43f2a2 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -90,4 +90,8 @@
 
 };
 
+&cpu_thermal {
+	coefficients = <348 (-9301)>;
+};
+
 /include/ "omap446x-clocks.dtsi"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 4/7] ARM: OMAP4460: Thermal: Add slope and offset values
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the slope and offset values for calculating the
hot spot temperature of a particular thermal zone is part
of driver data. Pass them here instead and obtain the values
while of node parsing.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/boot/dts/omap4460.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index ef66e12..c43f2a2 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -90,4 +90,8 @@
 
 };
 
+&cpu_thermal {
+	coefficients = <348 (-9301)>;
+};
+
 /include/ "omap446x-clocks.dtsi"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 5/7] thermal: ti-soc-thermal: Fetch slope and offset from DT
  2017-03-01 10:29 ` Keerthy
  (?)
@ 2017-03-01 10:29   ` Keerthy
  -1 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: rui.zhang, linux-omap, linux-arm-kernel, linux-kernel, linux-pm,
	robh+dt, t-kristo, j-keerthy

Currently slope and offset values for calculating the hot spot
temperature of a thermal zone is being taken directly from driver
data. So try fetching it from device tree if not present only then
take it from driver data.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 0586bd0..6d9399f 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -96,8 +96,14 @@ static inline int __ti_thermal_get_temp(void *devdata, int *temp)
 		return ret;
 
 	/* Default constants */
-	slope = s->slope;
-	constant = s->constant;
+	slope = thermal_zone_get_slope(data->ti_thermal);
+	constant = thermal_zone_get_offset(data->ti_thermal);
+
+	if (slope == 1 && constant == 0) {
+		/* In case of default values fallback to driver data */
+		slope = s->slope;
+		constant = s->constant;
+	}
 
 	pcb_tz = data->pcb_tz;
 	/* In case pcb zone is available, use the extrapolation rule with it */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 5/7] thermal: ti-soc-thermal: Fetch slope and offset from DT
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: linux-pm, j-keerthy, linux-kernel, t-kristo, robh+dt, rui.zhang,
	linux-omap, linux-arm-kernel

Currently slope and offset values for calculating the hot spot
temperature of a thermal zone is being taken directly from driver
data. So try fetching it from device tree if not present only then
take it from driver data.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 0586bd0..6d9399f 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -96,8 +96,14 @@ static inline int __ti_thermal_get_temp(void *devdata, int *temp)
 		return ret;
 
 	/* Default constants */
-	slope = s->slope;
-	constant = s->constant;
+	slope = thermal_zone_get_slope(data->ti_thermal);
+	constant = thermal_zone_get_offset(data->ti_thermal);
+
+	if (slope == 1 && constant == 0) {
+		/* In case of default values fallback to driver data */
+		slope = s->slope;
+		constant = s->constant;
+	}
 
 	pcb_tz = data->pcb_tz;
 	/* In case pcb zone is available, use the extrapolation rule with it */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 5/7] thermal: ti-soc-thermal: Fetch slope and offset from DT
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: linux-arm-kernel

Currently slope and offset values for calculating the hot spot
temperature of a thermal zone is being taken directly from driver
data. So try fetching it from device tree if not present only then
take it from driver data.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 0586bd0..6d9399f 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -96,8 +96,14 @@ static inline int __ti_thermal_get_temp(void *devdata, int *temp)
 		return ret;
 
 	/* Default constants */
-	slope = s->slope;
-	constant = s->constant;
+	slope = thermal_zone_get_slope(data->ti_thermal);
+	constant = thermal_zone_get_offset(data->ti_thermal);
+
+	if (slope == 1 && constant == 0) {
+		/* In case of default values fallback to driver data */
+		slope = s->slope;
+		constant = s->constant;
+	}
 
 	pcb_tz = data->pcb_tz;
 	/* In case pcb zone is available, use the extrapolation rule with it */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 6/7] thermal: ti-soc-thermal: Remove redundant constants
  2017-03-01 10:29 ` Keerthy
  (?)
@ 2017-03-01 10:29   ` Keerthy
  -1 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: rui.zhang, linux-omap, linux-arm-kernel, linux-kernel, linux-pm,
	robh+dt, t-kristo, j-keerthy

Now that slope and offset data are being passed from
device tree no need to populate in driver data.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/thermal/ti-soc-thermal/dra752-thermal-data.c | 10 ----------
 drivers/thermal/ti-soc-thermal/omap4-thermal-data.c  |  4 ----
 drivers/thermal/ti-soc-thermal/omap5-thermal-data.c  |  4 ----
 3 files changed, 18 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
index 118d7d8..4167373 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
@@ -410,8 +410,6 @@
 		.domain = "cpu",
 		.register_cooling = ti_thermal_register_cpu_cooling,
 		.unregister_cooling = ti_thermal_unregister_cpu_cooling,
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -419,8 +417,6 @@
 		.registers = &dra752_gpu_temp_sensor_registers,
 		.ts_data = &dra752_gpu_temp_sensor_data,
 		.domain = "gpu",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -428,8 +424,6 @@
 		.registers = &dra752_core_temp_sensor_registers,
 		.ts_data = &dra752_core_temp_sensor_data,
 		.domain = "core",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -437,8 +431,6 @@
 		.registers = &dra752_dspeve_temp_sensor_registers,
 		.ts_data = &dra752_dspeve_temp_sensor_data,
 		.domain = "dspeve",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -446,8 +438,6 @@
 		.registers = &dra752_iva_temp_sensor_registers,
 		.ts_data = &dra752_iva_temp_sensor_data,
 		.domain = "iva",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
diff --git a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
index d255d33..965de0e 100644
--- a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
@@ -82,8 +82,6 @@
 		.registers = &omap4430_mpu_temp_sensor_registers,
 		.ts_data = &omap4430_mpu_temp_sensor_data,
 		.domain = "cpu",
-		.slope = OMAP_GRADIENT_SLOPE_4430,
-		.constant = OMAP_GRADIENT_CONST_4430,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_4430,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_4430,
 		.register_cooling = ti_thermal_register_cpu_cooling,
@@ -222,8 +220,6 @@
 		.registers = &omap4460_mpu_temp_sensor_registers,
 		.ts_data = &omap4460_mpu_temp_sensor_data,
 		.domain = "cpu",
-		.slope = OMAP_GRADIENT_SLOPE_4460,
-		.constant = OMAP_GRADIENT_CONST_4460,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_4460,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_4460,
 		.register_cooling = ti_thermal_register_cpu_cooling,
diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index 79ff70c..cd9a304 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -336,8 +336,6 @@
 		.domain = "cpu",
 		.register_cooling = ti_thermal_register_cpu_cooling,
 		.unregister_cooling = ti_thermal_unregister_cpu_cooling,
-		.slope = OMAP_GRADIENT_SLOPE_5430_CPU,
-		.constant = OMAP_GRADIENT_CONST_5430_CPU,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_5430_CPU,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_5430_CPU,
 		},
@@ -345,8 +343,6 @@
 		.registers = &omap5430_gpu_temp_sensor_registers,
 		.ts_data = &omap5430_gpu_temp_sensor_data,
 		.domain = "gpu",
-		.slope = OMAP_GRADIENT_SLOPE_5430_GPU,
-		.constant = OMAP_GRADIENT_CONST_5430_GPU,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_5430_GPU,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_5430_GPU,
 		},
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 6/7] thermal: ti-soc-thermal: Remove redundant constants
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: linux-pm, j-keerthy, linux-kernel, t-kristo, robh+dt, rui.zhang,
	linux-omap, linux-arm-kernel

Now that slope and offset data are being passed from
device tree no need to populate in driver data.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/thermal/ti-soc-thermal/dra752-thermal-data.c | 10 ----------
 drivers/thermal/ti-soc-thermal/omap4-thermal-data.c  |  4 ----
 drivers/thermal/ti-soc-thermal/omap5-thermal-data.c  |  4 ----
 3 files changed, 18 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
index 118d7d8..4167373 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
@@ -410,8 +410,6 @@
 		.domain = "cpu",
 		.register_cooling = ti_thermal_register_cpu_cooling,
 		.unregister_cooling = ti_thermal_unregister_cpu_cooling,
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -419,8 +417,6 @@
 		.registers = &dra752_gpu_temp_sensor_registers,
 		.ts_data = &dra752_gpu_temp_sensor_data,
 		.domain = "gpu",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -428,8 +424,6 @@
 		.registers = &dra752_core_temp_sensor_registers,
 		.ts_data = &dra752_core_temp_sensor_data,
 		.domain = "core",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -437,8 +431,6 @@
 		.registers = &dra752_dspeve_temp_sensor_registers,
 		.ts_data = &dra752_dspeve_temp_sensor_data,
 		.domain = "dspeve",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -446,8 +438,6 @@
 		.registers = &dra752_iva_temp_sensor_registers,
 		.ts_data = &dra752_iva_temp_sensor_data,
 		.domain = "iva",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
diff --git a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
index d255d33..965de0e 100644
--- a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
@@ -82,8 +82,6 @@
 		.registers = &omap4430_mpu_temp_sensor_registers,
 		.ts_data = &omap4430_mpu_temp_sensor_data,
 		.domain = "cpu",
-		.slope = OMAP_GRADIENT_SLOPE_4430,
-		.constant = OMAP_GRADIENT_CONST_4430,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_4430,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_4430,
 		.register_cooling = ti_thermal_register_cpu_cooling,
@@ -222,8 +220,6 @@
 		.registers = &omap4460_mpu_temp_sensor_registers,
 		.ts_data = &omap4460_mpu_temp_sensor_data,
 		.domain = "cpu",
-		.slope = OMAP_GRADIENT_SLOPE_4460,
-		.constant = OMAP_GRADIENT_CONST_4460,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_4460,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_4460,
 		.register_cooling = ti_thermal_register_cpu_cooling,
diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index 79ff70c..cd9a304 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -336,8 +336,6 @@
 		.domain = "cpu",
 		.register_cooling = ti_thermal_register_cpu_cooling,
 		.unregister_cooling = ti_thermal_unregister_cpu_cooling,
-		.slope = OMAP_GRADIENT_SLOPE_5430_CPU,
-		.constant = OMAP_GRADIENT_CONST_5430_CPU,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_5430_CPU,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_5430_CPU,
 		},
@@ -345,8 +343,6 @@
 		.registers = &omap5430_gpu_temp_sensor_registers,
 		.ts_data = &omap5430_gpu_temp_sensor_data,
 		.domain = "gpu",
-		.slope = OMAP_GRADIENT_SLOPE_5430_GPU,
-		.constant = OMAP_GRADIENT_CONST_5430_GPU,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_5430_GPU,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_5430_GPU,
 		},
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 6/7] thermal: ti-soc-thermal: Remove redundant constants
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: linux-arm-kernel

Now that slope and offset data are being passed from
device tree no need to populate in driver data.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/thermal/ti-soc-thermal/dra752-thermal-data.c | 10 ----------
 drivers/thermal/ti-soc-thermal/omap4-thermal-data.c  |  4 ----
 drivers/thermal/ti-soc-thermal/omap5-thermal-data.c  |  4 ----
 3 files changed, 18 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
index 118d7d8..4167373 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
@@ -410,8 +410,6 @@
 		.domain = "cpu",
 		.register_cooling = ti_thermal_register_cpu_cooling,
 		.unregister_cooling = ti_thermal_unregister_cpu_cooling,
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -419,8 +417,6 @@
 		.registers = &dra752_gpu_temp_sensor_registers,
 		.ts_data = &dra752_gpu_temp_sensor_data,
 		.domain = "gpu",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -428,8 +424,6 @@
 		.registers = &dra752_core_temp_sensor_registers,
 		.ts_data = &dra752_core_temp_sensor_data,
 		.domain = "core",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -437,8 +431,6 @@
 		.registers = &dra752_dspeve_temp_sensor_registers,
 		.ts_data = &dra752_dspeve_temp_sensor_data,
 		.domain = "dspeve",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
@@ -446,8 +438,6 @@
 		.registers = &dra752_iva_temp_sensor_registers,
 		.ts_data = &dra752_iva_temp_sensor_data,
 		.domain = "iva",
-		.slope = DRA752_GRADIENT_SLOPE,
-		.constant = DRA752_GRADIENT_CONST,
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
diff --git a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
index d255d33..965de0e 100644
--- a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
@@ -82,8 +82,6 @@
 		.registers = &omap4430_mpu_temp_sensor_registers,
 		.ts_data = &omap4430_mpu_temp_sensor_data,
 		.domain = "cpu",
-		.slope = OMAP_GRADIENT_SLOPE_4430,
-		.constant = OMAP_GRADIENT_CONST_4430,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_4430,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_4430,
 		.register_cooling = ti_thermal_register_cpu_cooling,
@@ -222,8 +220,6 @@
 		.registers = &omap4460_mpu_temp_sensor_registers,
 		.ts_data = &omap4460_mpu_temp_sensor_data,
 		.domain = "cpu",
-		.slope = OMAP_GRADIENT_SLOPE_4460,
-		.constant = OMAP_GRADIENT_CONST_4460,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_4460,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_4460,
 		.register_cooling = ti_thermal_register_cpu_cooling,
diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index 79ff70c..cd9a304 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -336,8 +336,6 @@
 		.domain = "cpu",
 		.register_cooling = ti_thermal_register_cpu_cooling,
 		.unregister_cooling = ti_thermal_unregister_cpu_cooling,
-		.slope = OMAP_GRADIENT_SLOPE_5430_CPU,
-		.constant = OMAP_GRADIENT_CONST_5430_CPU,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_5430_CPU,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_5430_CPU,
 		},
@@ -345,8 +343,6 @@
 		.registers = &omap5430_gpu_temp_sensor_registers,
 		.ts_data = &omap5430_gpu_temp_sensor_data,
 		.domain = "gpu",
-		.slope = OMAP_GRADIENT_SLOPE_5430_GPU,
-		.constant = OMAP_GRADIENT_CONST_5430_GPU,
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_5430_GPU,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_5430_GPU,
 		},
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 7/7] thermal: ti-soc-thermal: Remove redundant code
  2017-03-01 10:29 ` Keerthy
  (?)
@ 2017-03-01 10:29   ` Keerthy
  -1 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: rui.zhang, linux-omap, linux-arm-kernel, linux-kernel, linux-pm,
	robh+dt, t-kristo, j-keerthy

ti_thermal_expose_sensor always takes the
devm_thermal_zone_of_sensor_register call for registration
with the device tree nodes present for all the bandgap sensors
for omap3/4/5 and dra7 family. There are large chunks of unused
code. Removing all of them.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 154 +--------------------
 1 file changed, 3 insertions(+), 151 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 6d9399f..59fd3a8 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -132,119 +132,6 @@ static inline int ti_thermal_get_temp(struct thermal_zone_device *thermal,
 	return __ti_thermal_get_temp(data, temp);
 }
 
-/* Bind callback functions for thermal zone */
-static int ti_thermal_bind(struct thermal_zone_device *thermal,
-			   struct thermal_cooling_device *cdev)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-	int id;
-
-	if (!data || IS_ERR(data))
-		return -ENODEV;
-
-	/* check if this is the cooling device we registered */
-	if (data->cool_dev != cdev)
-		return 0;
-
-	id = data->sensor_id;
-
-	/* Simple thing, two trips, one passive another critical */
-	return thermal_zone_bind_cooling_device(thermal, 0, cdev,
-	/* bind with min and max states defined by cpu_cooling */
-						THERMAL_NO_LIMIT,
-						THERMAL_NO_LIMIT,
-						THERMAL_WEIGHT_DEFAULT);
-}
-
-/* Unbind callback functions for thermal zone */
-static int ti_thermal_unbind(struct thermal_zone_device *thermal,
-			     struct thermal_cooling_device *cdev)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-
-	if (!data || IS_ERR(data))
-		return -ENODEV;
-
-	/* check if this is the cooling device we registered */
-	if (data->cool_dev != cdev)
-		return 0;
-
-	/* Simple thing, two trips, one passive another critical */
-	return thermal_zone_unbind_cooling_device(thermal, 0, cdev);
-}
-
-/* Get mode callback functions for thermal zone */
-static int ti_thermal_get_mode(struct thermal_zone_device *thermal,
-			       enum thermal_device_mode *mode)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-
-	if (data)
-		*mode = data->mode;
-
-	return 0;
-}
-
-/* Set mode callback functions for thermal zone */
-static int ti_thermal_set_mode(struct thermal_zone_device *thermal,
-			       enum thermal_device_mode mode)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-	struct ti_bandgap *bgp;
-
-	bgp = data->bgp;
-
-	if (!data->ti_thermal) {
-		dev_notice(&thermal->device, "thermal zone not registered\n");
-		return 0;
-	}
-
-	mutex_lock(&data->ti_thermal->lock);
-
-	if (mode == THERMAL_DEVICE_ENABLED)
-		data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE;
-	else
-		data->ti_thermal->polling_delay = 0;
-
-	mutex_unlock(&data->ti_thermal->lock);
-
-	data->mode = mode;
-	ti_bandgap_write_update_interval(bgp, data->sensor_id,
-					data->ti_thermal->polling_delay);
-	thermal_zone_device_update(data->ti_thermal, THERMAL_EVENT_UNSPECIFIED);
-	dev_dbg(&thermal->device, "thermal polling set for duration=%d msec\n",
-		data->ti_thermal->polling_delay);
-
-	return 0;
-}
-
-/* Get trip type callback functions for thermal zone */
-static int ti_thermal_get_trip_type(struct thermal_zone_device *thermal,
-				    int trip, enum thermal_trip_type *type)
-{
-	if (!ti_thermal_is_valid_trip(trip))
-		return -EINVAL;
-
-	if (trip + 1 == OMAP_TRIP_NUMBER)
-		*type = THERMAL_TRIP_CRITICAL;
-	else
-		*type = THERMAL_TRIP_PASSIVE;
-
-	return 0;
-}
-
-/* Get trip temperature callback functions for thermal zone */
-static int ti_thermal_get_trip_temp(struct thermal_zone_device *thermal,
-				    int trip, int *temp)
-{
-	if (!ti_thermal_is_valid_trip(trip))
-		return -EINVAL;
-
-	*temp = ti_thermal_get_trip_value(trip);
-
-	return 0;
-}
-
 static int __ti_thermal_get_trend(void *p, int trip, enum thermal_trend *trend)
 {
 	struct ti_thermal_data *data = p;
@@ -268,38 +155,11 @@ static int __ti_thermal_get_trend(void *p, int trip, enum thermal_trend *trend)
 	return 0;
 }
 
-/* Get the temperature trend callback functions for thermal zone */
-static int ti_thermal_get_trend(struct thermal_zone_device *thermal,
-				int trip, enum thermal_trend *trend)
-{
-	return __ti_thermal_get_trend(thermal->devdata, trip, trend);
-}
-
-/* Get critical temperature callback functions for thermal zone */
-static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
-				    int *temp)
-{
-	/* shutdown zone */
-	return ti_thermal_get_trip_temp(thermal, OMAP_TRIP_NUMBER - 1, temp);
-}
-
 static const struct thermal_zone_of_device_ops ti_of_thermal_ops = {
 	.get_temp = __ti_thermal_get_temp,
 	.get_trend = __ti_thermal_get_trend,
 };
 
-static struct thermal_zone_device_ops ti_thermal_ops = {
-	.get_temp = ti_thermal_get_temp,
-	.get_trend = ti_thermal_get_trend,
-	.bind = ti_thermal_bind,
-	.unbind = ti_thermal_unbind,
-	.get_mode = ti_thermal_get_mode,
-	.set_mode = ti_thermal_set_mode,
-	.get_trip_type = ti_thermal_get_trip_type,
-	.get_trip_temp = ti_thermal_get_trip_temp,
-	.get_crit_temp = ti_thermal_get_crit_temp,
-};
-
 static struct ti_thermal_data
 *ti_thermal_build_data(struct ti_bandgap *bgp, int id)
 {
@@ -337,18 +197,10 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
 	data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id,
 					data, &ti_of_thermal_ops);
 	if (IS_ERR(data->ti_thermal)) {
-		/* Create thermal zone */
-		data->ti_thermal = thermal_zone_device_register(domain,
-				OMAP_TRIP_NUMBER, 0, data, &ti_thermal_ops,
-				NULL, FAST_TEMP_MONITORING_RATE,
-				FAST_TEMP_MONITORING_RATE);
-		if (IS_ERR(data->ti_thermal)) {
-			dev_err(bgp->dev, "thermal zone device is NULL\n");
-			return PTR_ERR(data->ti_thermal);
-		}
-		data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE;
-		data->our_zone = true;
+		dev_err(bgp->dev, "thermal zone device is NULL\n");
+		return PTR_ERR(data->ti_thermal);
 	}
+
 	ti_bandgap_set_sensor_data(bgp, id, data);
 	ti_bandgap_write_update_interval(bgp, data->sensor_id,
 					data->ti_thermal->polling_delay);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 7/7] thermal: ti-soc-thermal: Remove redundant code
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: tony, edubezval
  Cc: rui.zhang, linux-omap, linux-arm-kernel, linux-kernel, linux-pm,
	robh+dt, t-kristo, j-keerthy

ti_thermal_expose_sensor always takes the
devm_thermal_zone_of_sensor_register call for registration
with the device tree nodes present for all the bandgap sensors
for omap3/4/5 and dra7 family. There are large chunks of unused
code. Removing all of them.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 154 +--------------------
 1 file changed, 3 insertions(+), 151 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 6d9399f..59fd3a8 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -132,119 +132,6 @@ static inline int ti_thermal_get_temp(struct thermal_zone_device *thermal,
 	return __ti_thermal_get_temp(data, temp);
 }
 
-/* Bind callback functions for thermal zone */
-static int ti_thermal_bind(struct thermal_zone_device *thermal,
-			   struct thermal_cooling_device *cdev)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-	int id;
-
-	if (!data || IS_ERR(data))
-		return -ENODEV;
-
-	/* check if this is the cooling device we registered */
-	if (data->cool_dev != cdev)
-		return 0;
-
-	id = data->sensor_id;
-
-	/* Simple thing, two trips, one passive another critical */
-	return thermal_zone_bind_cooling_device(thermal, 0, cdev,
-	/* bind with min and max states defined by cpu_cooling */
-						THERMAL_NO_LIMIT,
-						THERMAL_NO_LIMIT,
-						THERMAL_WEIGHT_DEFAULT);
-}
-
-/* Unbind callback functions for thermal zone */
-static int ti_thermal_unbind(struct thermal_zone_device *thermal,
-			     struct thermal_cooling_device *cdev)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-
-	if (!data || IS_ERR(data))
-		return -ENODEV;
-
-	/* check if this is the cooling device we registered */
-	if (data->cool_dev != cdev)
-		return 0;
-
-	/* Simple thing, two trips, one passive another critical */
-	return thermal_zone_unbind_cooling_device(thermal, 0, cdev);
-}
-
-/* Get mode callback functions for thermal zone */
-static int ti_thermal_get_mode(struct thermal_zone_device *thermal,
-			       enum thermal_device_mode *mode)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-
-	if (data)
-		*mode = data->mode;
-
-	return 0;
-}
-
-/* Set mode callback functions for thermal zone */
-static int ti_thermal_set_mode(struct thermal_zone_device *thermal,
-			       enum thermal_device_mode mode)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-	struct ti_bandgap *bgp;
-
-	bgp = data->bgp;
-
-	if (!data->ti_thermal) {
-		dev_notice(&thermal->device, "thermal zone not registered\n");
-		return 0;
-	}
-
-	mutex_lock(&data->ti_thermal->lock);
-
-	if (mode == THERMAL_DEVICE_ENABLED)
-		data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE;
-	else
-		data->ti_thermal->polling_delay = 0;
-
-	mutex_unlock(&data->ti_thermal->lock);
-
-	data->mode = mode;
-	ti_bandgap_write_update_interval(bgp, data->sensor_id,
-					data->ti_thermal->polling_delay);
-	thermal_zone_device_update(data->ti_thermal, THERMAL_EVENT_UNSPECIFIED);
-	dev_dbg(&thermal->device, "thermal polling set for duration=%d msec\n",
-		data->ti_thermal->polling_delay);
-
-	return 0;
-}
-
-/* Get trip type callback functions for thermal zone */
-static int ti_thermal_get_trip_type(struct thermal_zone_device *thermal,
-				    int trip, enum thermal_trip_type *type)
-{
-	if (!ti_thermal_is_valid_trip(trip))
-		return -EINVAL;
-
-	if (trip + 1 == OMAP_TRIP_NUMBER)
-		*type = THERMAL_TRIP_CRITICAL;
-	else
-		*type = THERMAL_TRIP_PASSIVE;
-
-	return 0;
-}
-
-/* Get trip temperature callback functions for thermal zone */
-static int ti_thermal_get_trip_temp(struct thermal_zone_device *thermal,
-				    int trip, int *temp)
-{
-	if (!ti_thermal_is_valid_trip(trip))
-		return -EINVAL;
-
-	*temp = ti_thermal_get_trip_value(trip);
-
-	return 0;
-}
-
 static int __ti_thermal_get_trend(void *p, int trip, enum thermal_trend *trend)
 {
 	struct ti_thermal_data *data = p;
@@ -268,38 +155,11 @@ static int __ti_thermal_get_trend(void *p, int trip, enum thermal_trend *trend)
 	return 0;
 }
 
-/* Get the temperature trend callback functions for thermal zone */
-static int ti_thermal_get_trend(struct thermal_zone_device *thermal,
-				int trip, enum thermal_trend *trend)
-{
-	return __ti_thermal_get_trend(thermal->devdata, trip, trend);
-}
-
-/* Get critical temperature callback functions for thermal zone */
-static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
-				    int *temp)
-{
-	/* shutdown zone */
-	return ti_thermal_get_trip_temp(thermal, OMAP_TRIP_NUMBER - 1, temp);
-}
-
 static const struct thermal_zone_of_device_ops ti_of_thermal_ops = {
 	.get_temp = __ti_thermal_get_temp,
 	.get_trend = __ti_thermal_get_trend,
 };
 
-static struct thermal_zone_device_ops ti_thermal_ops = {
-	.get_temp = ti_thermal_get_temp,
-	.get_trend = ti_thermal_get_trend,
-	.bind = ti_thermal_bind,
-	.unbind = ti_thermal_unbind,
-	.get_mode = ti_thermal_get_mode,
-	.set_mode = ti_thermal_set_mode,
-	.get_trip_type = ti_thermal_get_trip_type,
-	.get_trip_temp = ti_thermal_get_trip_temp,
-	.get_crit_temp = ti_thermal_get_crit_temp,
-};
-
 static struct ti_thermal_data
 *ti_thermal_build_data(struct ti_bandgap *bgp, int id)
 {
@@ -337,18 +197,10 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
 	data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id,
 					data, &ti_of_thermal_ops);
 	if (IS_ERR(data->ti_thermal)) {
-		/* Create thermal zone */
-		data->ti_thermal = thermal_zone_device_register(domain,
-				OMAP_TRIP_NUMBER, 0, data, &ti_thermal_ops,
-				NULL, FAST_TEMP_MONITORING_RATE,
-				FAST_TEMP_MONITORING_RATE);
-		if (IS_ERR(data->ti_thermal)) {
-			dev_err(bgp->dev, "thermal zone device is NULL\n");
-			return PTR_ERR(data->ti_thermal);
-		}
-		data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE;
-		data->our_zone = true;
+		dev_err(bgp->dev, "thermal zone device is NULL\n");
+		return PTR_ERR(data->ti_thermal);
 	}
+
 	ti_bandgap_set_sensor_data(bgp, id, data);
 	ti_bandgap_write_update_interval(bgp, data->sensor_id,
 					data->ti_thermal->polling_delay);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 7/7] thermal: ti-soc-thermal: Remove redundant code
@ 2017-03-01 10:29   ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-01 10:29 UTC (permalink / raw)
  To: linux-arm-kernel

ti_thermal_expose_sensor always takes the
devm_thermal_zone_of_sensor_register call for registration
with the device tree nodes present for all the bandgap sensors
for omap3/4/5 and dra7 family. There are large chunks of unused
code. Removing all of them.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 154 +--------------------
 1 file changed, 3 insertions(+), 151 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 6d9399f..59fd3a8 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -132,119 +132,6 @@ static inline int ti_thermal_get_temp(struct thermal_zone_device *thermal,
 	return __ti_thermal_get_temp(data, temp);
 }
 
-/* Bind callback functions for thermal zone */
-static int ti_thermal_bind(struct thermal_zone_device *thermal,
-			   struct thermal_cooling_device *cdev)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-	int id;
-
-	if (!data || IS_ERR(data))
-		return -ENODEV;
-
-	/* check if this is the cooling device we registered */
-	if (data->cool_dev != cdev)
-		return 0;
-
-	id = data->sensor_id;
-
-	/* Simple thing, two trips, one passive another critical */
-	return thermal_zone_bind_cooling_device(thermal, 0, cdev,
-	/* bind with min and max states defined by cpu_cooling */
-						THERMAL_NO_LIMIT,
-						THERMAL_NO_LIMIT,
-						THERMAL_WEIGHT_DEFAULT);
-}
-
-/* Unbind callback functions for thermal zone */
-static int ti_thermal_unbind(struct thermal_zone_device *thermal,
-			     struct thermal_cooling_device *cdev)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-
-	if (!data || IS_ERR(data))
-		return -ENODEV;
-
-	/* check if this is the cooling device we registered */
-	if (data->cool_dev != cdev)
-		return 0;
-
-	/* Simple thing, two trips, one passive another critical */
-	return thermal_zone_unbind_cooling_device(thermal, 0, cdev);
-}
-
-/* Get mode callback functions for thermal zone */
-static int ti_thermal_get_mode(struct thermal_zone_device *thermal,
-			       enum thermal_device_mode *mode)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-
-	if (data)
-		*mode = data->mode;
-
-	return 0;
-}
-
-/* Set mode callback functions for thermal zone */
-static int ti_thermal_set_mode(struct thermal_zone_device *thermal,
-			       enum thermal_device_mode mode)
-{
-	struct ti_thermal_data *data = thermal->devdata;
-	struct ti_bandgap *bgp;
-
-	bgp = data->bgp;
-
-	if (!data->ti_thermal) {
-		dev_notice(&thermal->device, "thermal zone not registered\n");
-		return 0;
-	}
-
-	mutex_lock(&data->ti_thermal->lock);
-
-	if (mode == THERMAL_DEVICE_ENABLED)
-		data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE;
-	else
-		data->ti_thermal->polling_delay = 0;
-
-	mutex_unlock(&data->ti_thermal->lock);
-
-	data->mode = mode;
-	ti_bandgap_write_update_interval(bgp, data->sensor_id,
-					data->ti_thermal->polling_delay);
-	thermal_zone_device_update(data->ti_thermal, THERMAL_EVENT_UNSPECIFIED);
-	dev_dbg(&thermal->device, "thermal polling set for duration=%d msec\n",
-		data->ti_thermal->polling_delay);
-
-	return 0;
-}
-
-/* Get trip type callback functions for thermal zone */
-static int ti_thermal_get_trip_type(struct thermal_zone_device *thermal,
-				    int trip, enum thermal_trip_type *type)
-{
-	if (!ti_thermal_is_valid_trip(trip))
-		return -EINVAL;
-
-	if (trip + 1 == OMAP_TRIP_NUMBER)
-		*type = THERMAL_TRIP_CRITICAL;
-	else
-		*type = THERMAL_TRIP_PASSIVE;
-
-	return 0;
-}
-
-/* Get trip temperature callback functions for thermal zone */
-static int ti_thermal_get_trip_temp(struct thermal_zone_device *thermal,
-				    int trip, int *temp)
-{
-	if (!ti_thermal_is_valid_trip(trip))
-		return -EINVAL;
-
-	*temp = ti_thermal_get_trip_value(trip);
-
-	return 0;
-}
-
 static int __ti_thermal_get_trend(void *p, int trip, enum thermal_trend *trend)
 {
 	struct ti_thermal_data *data = p;
@@ -268,38 +155,11 @@ static int __ti_thermal_get_trend(void *p, int trip, enum thermal_trend *trend)
 	return 0;
 }
 
-/* Get the temperature trend callback functions for thermal zone */
-static int ti_thermal_get_trend(struct thermal_zone_device *thermal,
-				int trip, enum thermal_trend *trend)
-{
-	return __ti_thermal_get_trend(thermal->devdata, trip, trend);
-}
-
-/* Get critical temperature callback functions for thermal zone */
-static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
-				    int *temp)
-{
-	/* shutdown zone */
-	return ti_thermal_get_trip_temp(thermal, OMAP_TRIP_NUMBER - 1, temp);
-}
-
 static const struct thermal_zone_of_device_ops ti_of_thermal_ops = {
 	.get_temp = __ti_thermal_get_temp,
 	.get_trend = __ti_thermal_get_trend,
 };
 
-static struct thermal_zone_device_ops ti_thermal_ops = {
-	.get_temp = ti_thermal_get_temp,
-	.get_trend = ti_thermal_get_trend,
-	.bind = ti_thermal_bind,
-	.unbind = ti_thermal_unbind,
-	.get_mode = ti_thermal_get_mode,
-	.set_mode = ti_thermal_set_mode,
-	.get_trip_type = ti_thermal_get_trip_type,
-	.get_trip_temp = ti_thermal_get_trip_temp,
-	.get_crit_temp = ti_thermal_get_crit_temp,
-};
-
 static struct ti_thermal_data
 *ti_thermal_build_data(struct ti_bandgap *bgp, int id)
 {
@@ -337,18 +197,10 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
 	data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id,
 					data, &ti_of_thermal_ops);
 	if (IS_ERR(data->ti_thermal)) {
-		/* Create thermal zone */
-		data->ti_thermal = thermal_zone_device_register(domain,
-				OMAP_TRIP_NUMBER, 0, data, &ti_thermal_ops,
-				NULL, FAST_TEMP_MONITORING_RATE,
-				FAST_TEMP_MONITORING_RATE);
-		if (IS_ERR(data->ti_thermal)) {
-			dev_err(bgp->dev, "thermal zone device is NULL\n");
-			return PTR_ERR(data->ti_thermal);
-		}
-		data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE;
-		data->our_zone = true;
+		dev_err(bgp->dev, "thermal zone device is NULL\n");
+		return PTR_ERR(data->ti_thermal);
 	}
+
 	ti_bandgap_set_sensor_data(bgp, id, data);
 	ti_bandgap_write_update_interval(bgp, data->sensor_id,
 					data->ti_thermal->polling_delay);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree
  2017-03-01 10:29 ` Keerthy
  (?)
@ 2017-03-06 18:42   ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2017-03-06 18:42 UTC (permalink / raw)
  To: Keerthy
  Cc: edubezval, rui.zhang, linux-omap, linux-arm-kernel, linux-kernel,
	linux-pm, robh+dt, t-kristo

* Keerthy <j-keerthy@ti.com> [170301 02:31]:
> Currently the slope and offset values for calculating the
> hot spot temperature of a particular thermal zone is part
> of driver data. Pass them here instead and obtain the values
> while of node parsing.
> 
> Tested for the slope and constant values on DRA7-EVM.
> 
> Keerthy (7):
>   ARM: DRA7: Thermal: Add slope and offset values
>   ARM: OMAP5: Thermal: Add slope and offset values
>   ARM: OMAP443x: Thermal: Add slope and offset values
>   ARM: OMAP4460: Thermal: Add slope and offset values
>   thermal: ti-soc-thermal: Fetch slope and offset from DT
>   thermal: ti-soc-thermal: Remove redundant constants
>   thermal: ti-soc-thermal: Remove redundant code

Are the dts changes safe for me to pick separately into
omap-for-v4.12/dt?

Regards,

Tony

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree
@ 2017-03-06 18:42   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2017-03-06 18:42 UTC (permalink / raw)
  To: Keerthy
  Cc: t-kristo, linux-pm, linux-kernel, edubezval, robh+dt, rui.zhang,
	linux-omap, linux-arm-kernel

* Keerthy <j-keerthy@ti.com> [170301 02:31]:
> Currently the slope and offset values for calculating the
> hot spot temperature of a particular thermal zone is part
> of driver data. Pass them here instead and obtain the values
> while of node parsing.
> 
> Tested for the slope and constant values on DRA7-EVM.
> 
> Keerthy (7):
>   ARM: DRA7: Thermal: Add slope and offset values
>   ARM: OMAP5: Thermal: Add slope and offset values
>   ARM: OMAP443x: Thermal: Add slope and offset values
>   ARM: OMAP4460: Thermal: Add slope and offset values
>   thermal: ti-soc-thermal: Fetch slope and offset from DT
>   thermal: ti-soc-thermal: Remove redundant constants
>   thermal: ti-soc-thermal: Remove redundant code

Are the dts changes safe for me to pick separately into
omap-for-v4.12/dt?

Regards,

Tony

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree
@ 2017-03-06 18:42   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2017-03-06 18:42 UTC (permalink / raw)
  To: linux-arm-kernel

* Keerthy <j-keerthy@ti.com> [170301 02:31]:
> Currently the slope and offset values for calculating the
> hot spot temperature of a particular thermal zone is part
> of driver data. Pass them here instead and obtain the values
> while of node parsing.
> 
> Tested for the slope and constant values on DRA7-EVM.
> 
> Keerthy (7):
>   ARM: DRA7: Thermal: Add slope and offset values
>   ARM: OMAP5: Thermal: Add slope and offset values
>   ARM: OMAP443x: Thermal: Add slope and offset values
>   ARM: OMAP4460: Thermal: Add slope and offset values
>   thermal: ti-soc-thermal: Fetch slope and offset from DT
>   thermal: ti-soc-thermal: Remove redundant constants
>   thermal: ti-soc-thermal: Remove redundant code

Are the dts changes safe for me to pick separately into
omap-for-v4.12/dt?

Regards,

Tony

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree
  2017-03-06 18:42   ` Tony Lindgren
  (?)
@ 2017-03-07  7:13     ` Keerthy
  -1 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-07  7:13 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: edubezval, rui.zhang, linux-omap, linux-arm-kernel, linux-kernel,
	linux-pm, robh+dt, t-kristo



On Tuesday 07 March 2017 12:12 AM, Tony Lindgren wrote:
> * Keerthy <j-keerthy@ti.com> [170301 02:31]:
>> Currently the slope and offset values for calculating the
>> hot spot temperature of a particular thermal zone is part
>> of driver data. Pass them here instead and obtain the values
>> while of node parsing.
>>
>> Tested for the slope and constant values on DRA7-EVM.
>>
>> Keerthy (7):
>>   ARM: DRA7: Thermal: Add slope and offset values
>>   ARM: OMAP5: Thermal: Add slope and offset values
>>   ARM: OMAP443x: Thermal: Add slope and offset values
>>   ARM: OMAP4460: Thermal: Add slope and offset values
>>   thermal: ti-soc-thermal: Fetch slope and offset from DT
>>   thermal: ti-soc-thermal: Remove redundant constants
>>   thermal: ti-soc-thermal: Remove redundant code
>
> Are the dts changes safe for me to pick separately into
> omap-for-v4.12/dt?

Tony,

Seems like omap3 has no thermal_zone node defined in Device Tree.
It seems like it still uses driver data. I would need to add that as 
well. Can you confirm that? If yes i will send a new series with the 
omap3 device tree changes as well.

Thanks,
Keerthy

>
> Regards,
>
> Tony
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree
@ 2017-03-07  7:13     ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-07  7:13 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: t-kristo, linux-pm, linux-kernel, edubezval, robh+dt, rui.zhang,
	linux-omap, linux-arm-kernel



On Tuesday 07 March 2017 12:12 AM, Tony Lindgren wrote:
> * Keerthy <j-keerthy@ti.com> [170301 02:31]:
>> Currently the slope and offset values for calculating the
>> hot spot temperature of a particular thermal zone is part
>> of driver data. Pass them here instead and obtain the values
>> while of node parsing.
>>
>> Tested for the slope and constant values on DRA7-EVM.
>>
>> Keerthy (7):
>>   ARM: DRA7: Thermal: Add slope and offset values
>>   ARM: OMAP5: Thermal: Add slope and offset values
>>   ARM: OMAP443x: Thermal: Add slope and offset values
>>   ARM: OMAP4460: Thermal: Add slope and offset values
>>   thermal: ti-soc-thermal: Fetch slope and offset from DT
>>   thermal: ti-soc-thermal: Remove redundant constants
>>   thermal: ti-soc-thermal: Remove redundant code
>
> Are the dts changes safe for me to pick separately into
> omap-for-v4.12/dt?

Tony,

Seems like omap3 has no thermal_zone node defined in Device Tree.
It seems like it still uses driver data. I would need to add that as 
well. Can you confirm that? If yes i will send a new series with the 
omap3 device tree changes as well.

Thanks,
Keerthy

>
> Regards,
>
> Tony
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree
@ 2017-03-07  7:13     ` Keerthy
  0 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2017-03-07  7:13 UTC (permalink / raw)
  To: linux-arm-kernel



On Tuesday 07 March 2017 12:12 AM, Tony Lindgren wrote:
> * Keerthy <j-keerthy@ti.com> [170301 02:31]:
>> Currently the slope and offset values for calculating the
>> hot spot temperature of a particular thermal zone is part
>> of driver data. Pass them here instead and obtain the values
>> while of node parsing.
>>
>> Tested for the slope and constant values on DRA7-EVM.
>>
>> Keerthy (7):
>>   ARM: DRA7: Thermal: Add slope and offset values
>>   ARM: OMAP5: Thermal: Add slope and offset values
>>   ARM: OMAP443x: Thermal: Add slope and offset values
>>   ARM: OMAP4460: Thermal: Add slope and offset values
>>   thermal: ti-soc-thermal: Fetch slope and offset from DT
>>   thermal: ti-soc-thermal: Remove redundant constants
>>   thermal: ti-soc-thermal: Remove redundant code
>
> Are the dts changes safe for me to pick separately into
> omap-for-v4.12/dt?

Tony,

Seems like omap3 has no thermal_zone node defined in Device Tree.
It seems like it still uses driver data. I would need to add that as 
well. Can you confirm that? If yes i will send a new series with the 
omap3 device tree changes as well.

Thanks,
Keerthy

>
> Regards,
>
> Tony
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree
  2017-03-07  7:13     ` Keerthy
@ 2017-03-07 15:12       ` Tony Lindgren
  -1 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2017-03-07 15:12 UTC (permalink / raw)
  To: Keerthy
  Cc: edubezval, rui.zhang, linux-omap, linux-arm-kernel, linux-kernel,
	linux-pm, robh+dt, t-kristo

* Keerthy <j-keerthy@ti.com> [170306 23:15]:
> 
> 
> On Tuesday 07 March 2017 12:12 AM, Tony Lindgren wrote:
> > * Keerthy <j-keerthy@ti.com> [170301 02:31]:
> > > Currently the slope and offset values for calculating the
> > > hot spot temperature of a particular thermal zone is part
> > > of driver data. Pass them here instead and obtain the values
> > > while of node parsing.
> > > 
> > > Tested for the slope and constant values on DRA7-EVM.
> > > 
> > > Keerthy (7):
> > >   ARM: DRA7: Thermal: Add slope and offset values
> > >   ARM: OMAP5: Thermal: Add slope and offset values
> > >   ARM: OMAP443x: Thermal: Add slope and offset values
> > >   ARM: OMAP4460: Thermal: Add slope and offset values
> > >   thermal: ti-soc-thermal: Fetch slope and offset from DT
> > >   thermal: ti-soc-thermal: Remove redundant constants
> > >   thermal: ti-soc-thermal: Remove redundant code
> > 
> > Are the dts changes safe for me to pick separately into
> > omap-for-v4.12/dt?
> 
> Tony,
> 
> Seems like omap3 has no thermal_zone node defined in Device Tree.
> It seems like it still uses driver data. I would need to add that as well.
> Can you confirm that? If yes i will send a new series with the omap3 device
> tree changes as well.

OK cool. It might be worth checking how it was configured with
the legacy platform data.

Regards,

Tony

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree
@ 2017-03-07 15:12       ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2017-03-07 15:12 UTC (permalink / raw)
  To: linux-arm-kernel

* Keerthy <j-keerthy@ti.com> [170306 23:15]:
> 
> 
> On Tuesday 07 March 2017 12:12 AM, Tony Lindgren wrote:
> > * Keerthy <j-keerthy@ti.com> [170301 02:31]:
> > > Currently the slope and offset values for calculating the
> > > hot spot temperature of a particular thermal zone is part
> > > of driver data. Pass them here instead and obtain the values
> > > while of node parsing.
> > > 
> > > Tested for the slope and constant values on DRA7-EVM.
> > > 
> > > Keerthy (7):
> > >   ARM: DRA7: Thermal: Add slope and offset values
> > >   ARM: OMAP5: Thermal: Add slope and offset values
> > >   ARM: OMAP443x: Thermal: Add slope and offset values
> > >   ARM: OMAP4460: Thermal: Add slope and offset values
> > >   thermal: ti-soc-thermal: Fetch slope and offset from DT
> > >   thermal: ti-soc-thermal: Remove redundant constants
> > >   thermal: ti-soc-thermal: Remove redundant code
> > 
> > Are the dts changes safe for me to pick separately into
> > omap-for-v4.12/dt?
> 
> Tony,
> 
> Seems like omap3 has no thermal_zone node defined in Device Tree.
> It seems like it still uses driver data. I would need to add that as well.
> Can you confirm that? If yes i will send a new series with the omap3 device
> tree changes as well.

OK cool. It might be worth checking how it was configured with
the legacy platform data.

Regards,

Tony

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2017-03-07 20:29 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-01 10:29 [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree Keerthy
2017-03-01 10:29 ` Keerthy
2017-03-01 10:29 ` Keerthy
2017-03-01 10:29 ` [PATCH 1/7] ARM: DRA7: Thermal: Add slope and offset values Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29 ` [PATCH 2/7] ARM: OMAP5: " Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29 ` [PATCH 3/7] ARM: OMAP443x: " Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29 ` [PATCH 4/7] ARM: OMAP4460: " Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29 ` [PATCH 5/7] thermal: ti-soc-thermal: Fetch slope and offset from DT Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29 ` [PATCH 6/7] thermal: ti-soc-thermal: Remove redundant constants Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29 ` [PATCH 7/7] thermal: ti-soc-thermal: Remove redundant code Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-01 10:29   ` Keerthy
2017-03-06 18:42 ` [PATCH 0/7] thermal: ti-soc-thermal: Migrate slope/offset data to device tree Tony Lindgren
2017-03-06 18:42   ` Tony Lindgren
2017-03-06 18:42   ` Tony Lindgren
2017-03-07  7:13   ` Keerthy
2017-03-07  7:13     ` Keerthy
2017-03-07  7:13     ` Keerthy
2017-03-07 15:12     ` Tony Lindgren
2017-03-07 15:12       ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.