All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] thermal: ti-soc-thermal: simplify the driver a bit
       [not found] <CGME20180514114255epcas1p438ea8d32c2b7fd40b86afb25c9c8f2cf@epcas1p4.samsung.com>
@ 2018-05-14 11:42 ` Bartlomiej Zolnierkiewicz
       [not found]   ` <CGME20180514114302epcas1p1890ad3296302900a736262b5d67aa10e@epcas1p1.samsung.com>
                     ` (13 more replies)
  0 siblings, 14 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

Hi,

This patchset contains few fixups and cleanups for TI thermal driver
(this is the result of my attempt to understand the driver operation).

Highlights:
* Fix TALERT IRQ handling for DRA752 SoC.
* Reuse most of OMAP5 SoC code for DRA752 SoC.
* Reduce size of *_adc_to_temp[] conversion tables.
* Remove duplicated code.
* Remove SoC family config options.

The patchset is based on top of:
- "[PATCH v2] thermal: ti-soc-thermal: fix incorrect entry in
  omap5430_adc_to_temp[]" (https://lkml.org/lkml/2018/5/2/433)
- "[PATCH] thermal: ti-soc-thermal: remove dead code"
  (https://lkml.org/lkml/2018/5/2/367)

Please consider applying.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


Bartlomiej Zolnierkiewicz (14):
  thermal: ti-soc-thermal: fix TALERT IRQ handling for DRA752
  thermal: ti-soc-thermal: fix comment in omap5xxx-bandgap.h
  thermal: ti-soc-thermal: fix comments in omap4-thermal-data.c
  thermal: ti-soc-thermal: cleanup COUNTER feature handling for OMAP5
  thermal: ti-soc-thermal: remove redundant methods from struct
    ti_bandgap_data
  thermal: ti-soc-thermal: remove ->threshold_[thot,tcold]_mask fields
  thermal: ti-soc-thermal: remove ->tshut_[hot,cold]_mask fields
  thermal: ti-soc-thermal: use common struct temp_sensor_data for OMAP5
  thermal: ti-soc-thermal: use common struct temp_sensor_data for DRA752
  thermal: ti-soc-thermal: use OMAP5 defines for DRA752
  thermal: ti-soc-thermal: use OMAP5 register tables for DRA752
  thermal: ti-soc-thermal: add ->adc_to_mcelsius method
  thermal: ti-soc-thermal: use short int for *_adc_to_temp[] conversion
    tables
  thermal: ti-soc-thermal: remove SoC family config options

 drivers/thermal/ti-soc-thermal/Kconfig             |  63 +----
 drivers/thermal/ti-soc-thermal/Makefile            |   8 +-
 drivers/thermal/ti-soc-thermal/dra752-bandgap.h    | 109 +------
 .../thermal/ti-soc-thermal/dra752-thermal-data.c   | 313 ++++-----------------
 .../thermal/ti-soc-thermal/omap3-thermal-data.c    |  70 +++--
 .../thermal/ti-soc-thermal/omap4-thermal-data.c    | 132 ++++-----
 drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h  |   8 -
 .../thermal/ti-soc-thermal/omap5-thermal-data.c    | 171 ++++-------
 drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h  |  47 +---
 drivers/thermal/ti-soc-thermal/ti-bandgap.c        |  61 ++--
 drivers/thermal/ti-soc-thermal/ti-bandgap.h        |  45 +--
 11 files changed, 265 insertions(+), 762 deletions(-)

-- 
1.9.1

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

* [PATCH 01/14] thermal: ti-soc-thermal: fix TALERT IRQ handling for DRA752
       [not found]   ` <CGME20180514114302epcas1p1890ad3296302900a736262b5d67aa10e@epcas1p1.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  2018-07-11  2:19         ` J, KEERTHY
  0 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

.report_temperature is not set in dra752_data which
results in temperature updates not being propagated by
ti_bandgap_talert_irq_handler() (it doesn't make much
sense to handle TALERT IRQ without reporting temperature
updates to the thermal core). Fix it.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/dra752-thermal-data.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
index 33a3030..e8ab7e5 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
@@ -338,6 +338,7 @@
 	.adc_end_val = DRA752_ADC_END_VALUE,
 	.expose_sensor = ti_thermal_expose_sensor,
 	.remove_sensor = ti_thermal_remove_sensor,
+	.report_temperature = ti_thermal_report_sensor_temperature,
 	.sensors = {
 		{
 		.registers = &dra752_mpu_temp_sensor_registers,
-- 
1.9.1

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

* [PATCH 02/14] thermal: ti-soc-thermal: fix comment in omap5xxx-bandgap.h
       [not found]   ` <CGME20180514114308epcas2p3bba580c5500889f22d50549994b227db@epcas2p3.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  2018-07-11  2:21         ` J, KEERTHY
  0 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

The comment for OMAP5430.CORE register offsets is incorrect. Fix it.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
index 9096403..dcbf903 100644
--- a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
@@ -55,7 +55,7 @@
 #define OMAP5430_BGAP_DTEMP_MPU_1_OFFSET		0x1E4
 #define OMAP5430_BGAP_DTEMP_MPU_2_OFFSET		0x1E8
 
-/* OMAP5430.MPU register offsets */
+/* OMAP5430.CORE register offsets */
 #define OMAP5430_FUSE_OPP_BGAP_CORE			0x8
 #define OMAP5430_TEMP_SENSOR_CORE_OFFSET		0x154
 #define OMAP5430_BGAP_THRESHOLD_CORE_OFFSET		0x1AC
-- 
1.9.1

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

* [PATCH 03/14] thermal: ti-soc-thermal: fix comments in omap4-thermal-data.c
       [not found]   ` <CGME20180514114312epcas1p19fffd35baae3018f47df0fe31ca1b1b0@epcas1p1.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  2018-07-11  2:27         ` J, KEERTHY
  0 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

The comments about ADC code values are incorrect. Fix them.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/omap4-thermal-data.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
index c12211e..85ba9dc 100644
--- a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
@@ -46,7 +46,7 @@
 
 /*
  * Temperature values in milli degree celsius
- * ADC code values from 530 to 923
+ * ADC code values from 0 to 127
  */
 static const int
 omap4430_adc_to_temp[OMAP4430_ADC_END_VALUE - OMAP4430_ADC_START_VALUE + 1] = {
@@ -136,7 +136,7 @@
 
 /*
  * Temperature values in milli degree celsius
- * ADC code values from 530 to 923
+ * ADC code values from 530 to 932
  */
 static const int
 omap4460_adc_to_temp[OMAP4460_ADC_END_VALUE - OMAP4460_ADC_START_VALUE + 1] = {
-- 
1.9.1

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

* [PATCH 04/14] thermal: ti-soc-thermal: cleanup COUNTER feature handling for OMAP5
       [not found]   ` <CGME20180514114319epcas1p1921a83c1baaaf1e6f94283f462022dc5@epcas1p1.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  2018-07-11  3:38         ` J, KEERTHY
  0 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

OMAP5 sensors don't claim COUNTER feature support (they use
COUNTER_DELAY feature instead) so there is no need to set fields
of struct temp_sensor_registers which are only used for COUNTER
feature.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/omap5-thermal-data.c | 9 ---------
 drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h   | 3 ---
 2 files changed, 12 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index 8191bae..e384be1 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -41,9 +41,6 @@
 	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
 	.mask_freeze_mask = OMAP5430_MASK_FREEZE_MPU_MASK,
 
-	.bgap_counter = OMAP5430_BGAP_CTRL_OFFSET,
-	.counter_mask = OMAP5430_COUNTER_MASK,
-
 	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_MPU_OFFSET,
 	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
 	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
@@ -77,9 +74,6 @@
 	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
 	.mask_freeze_mask = OMAP5430_MASK_FREEZE_GPU_MASK,
 
-	.bgap_counter = OMAP5430_BGAP_CTRL_OFFSET,
-	.counter_mask = OMAP5430_COUNTER_MASK,
-
 	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_GPU_OFFSET,
 	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
 	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
@@ -114,9 +108,6 @@
 	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
 	.mask_freeze_mask = OMAP5430_MASK_FREEZE_CORE_MASK,
 
-	.bgap_counter = OMAP5430_BGAP_CTRL_OFFSET,
-	.counter_mask = OMAP5430_COUNTER_MASK,
-
 	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_CORE_OFFSET,
 	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
 	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
diff --git a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
index dcbf903..223c7a8 100644
--- a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
@@ -93,9 +93,6 @@
 #define OMAP5430_MASK_HOT_MPU_MASK			BIT(1)
 #define OMAP5430_MASK_COLD_MPU_MASK			BIT(0)
 
-/* OMAP5430.BANDGAP_COUNTER */
-#define OMAP5430_COUNTER_MASK				(0xffffff << 0)
-
 /* OMAP5430.BANDGAP_THRESHOLD */
 #define OMAP5430_T_HOT_MASK				(0x3ff << 16)
 #define OMAP5430_T_COLD_MASK				(0x3ff << 0)
-- 
1.9.1

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

* [PATCH 05/14] thermal: ti-soc-thermal: remove redundant methods from struct ti_bandgap_data
       [not found]   ` <CGME20180514114326epcas2p2e27987b5be7a1fe614114466c6cf30f8@epcas2p2.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

* Include ti-thermal.h header in ti-bandgap.c.

* ->expose_sensor and ->remove_sensor methods are always defined
  and set to ti_thermal_[expose,remove]_sensor() so we can use
  these functions directly (dummy functions will be provided in
  case of CONFIG_TI_THERMAL=n).

* ->report_temperature is defined only when TALERT feature is
  supported so it also redundant - it is only used when TALERT
  feature is enabled and the method is always defined to
  ti_thermal_report_sensor_temperature() (dummy function will
  be provided in case of CONFIG_TI_THERMAL=n).

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/dra752-thermal-data.c |  3 ---
 drivers/thermal/ti-soc-thermal/omap3-thermal-data.c  |  6 ------
 drivers/thermal/ti-soc-thermal/omap4-thermal-data.c  |  8 --------
 drivers/thermal/ti-soc-thermal/omap5-thermal-data.c  |  3 ---
 drivers/thermal/ti-soc-thermal/ti-bandgap.c          | 20 ++++++++------------
 drivers/thermal/ti-soc-thermal/ti-bandgap.h          |  6 ------
 6 files changed, 8 insertions(+), 38 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
index e8ab7e5..c854642 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
@@ -336,9 +336,6 @@
 	.conv_table = dra752_adc_to_temp,
 	.adc_start_val = DRA752_ADC_START_VALUE,
 	.adc_end_val = DRA752_ADC_END_VALUE,
-	.expose_sensor = ti_thermal_expose_sensor,
-	.remove_sensor = ti_thermal_remove_sensor,
-	.report_temperature = ti_thermal_report_sensor_temperature,
 	.sensors = {
 		{
 		.registers = &dra752_mpu_temp_sensor_registers,
diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
index f536680..cc6498e 100644
--- a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
@@ -80,9 +80,6 @@
 	.conv_table = omap34xx_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 = &omap34xx_mpu_temp_sensor_registers,
@@ -148,9 +145,6 @@
 	.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 = &omap36xx_mpu_temp_sensor_registers,
diff --git a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
index 85ba9dc..14d9fe2 100644
--- a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
@@ -72,8 +72,6 @@
 	.conv_table = omap4430_adc_to_temp,
 	.adc_start_val = OMAP4430_ADC_START_VALUE,
 	.adc_end_val = OMAP4430_ADC_END_VALUE,
-	.expose_sensor = ti_thermal_expose_sensor,
-	.remove_sensor = ti_thermal_remove_sensor,
 	.sensors = {
 		{
 		.registers = &omap4430_mpu_temp_sensor_registers,
@@ -202,9 +200,6 @@
 	.conv_table = omap4460_adc_to_temp,
 	.adc_start_val = OMAP4460_ADC_START_VALUE,
 	.adc_end_val = OMAP4460_ADC_END_VALUE,
-	.expose_sensor = ti_thermal_expose_sensor,
-	.remove_sensor = ti_thermal_remove_sensor,
-	.report_temperature = ti_thermal_report_sensor_temperature,
 	.sensors = {
 		{
 		.registers = &omap4460_mpu_temp_sensor_registers,
@@ -233,9 +228,6 @@
 	.conv_table = omap4460_adc_to_temp,
 	.adc_start_val = OMAP4460_ADC_START_VALUE,
 	.adc_end_val = OMAP4460_ADC_END_VALUE,
-	.expose_sensor = ti_thermal_expose_sensor,
-	.remove_sensor = ti_thermal_remove_sensor,
-	.report_temperature = ti_thermal_report_sensor_temperature,
 	.sensors = {
 		{
 		.registers = &omap4460_mpu_temp_sensor_registers,
diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index e384be1..843faa7 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -273,9 +273,6 @@
 	.conv_table = omap5430_adc_to_temp,
 	.adc_start_val = OMAP5430_ADC_START_VALUE,
 	.adc_end_val = OMAP5430_ADC_END_VALUE,
-	.expose_sensor = ti_thermal_expose_sensor,
-	.remove_sensor = ti_thermal_remove_sensor,
-	.report_temperature = ti_thermal_report_sensor_temperature,
 	.sensors = {
 		{
 		.registers = &omap5430_mpu_temp_sensor_registers,
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 097328d..3ac74fe 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -42,6 +42,7 @@
 #include <linux/io.h>
 
 #include "ti-bandgap.h"
+#include "ti-thermal.h"
 
 static int ti_bandgap_force_single_read(struct ti_bandgap *bgp, int id);
 
@@ -248,8 +249,7 @@ static irqreturn_t ti_bandgap_talert_irq_handler(int irq, void *data)
 			t_hot, t_cold);
 
 		/* report temperature to whom may concern */
-		if (bgp->conf->report_temperature)
-			bgp->conf->report_temperature(bgp, i);
+		ti_thermal_report_sensor_temperature(bgp, i);
 	}
 	spin_unlock(&bgp->lock);
 
@@ -1017,12 +1017,10 @@ int ti_bandgap_probe(struct platform_device *pdev)
 				goto remove_sensors;
 		}
 
-		if (bgp->conf->expose_sensor) {
-			domain = bgp->conf->sensors[i].domain;
-			ret = bgp->conf->expose_sensor(bgp, i, domain);
-			if (ret)
-				goto remove_last_cooling;
-		}
+		domain = bgp->conf->sensors[i].domain;
+		ret = ti_thermal_expose_sensor(bgp, i, domain);
+		if (ret)
+			goto remove_last_cooling;
 	}
 
 	/*
@@ -1048,8 +1046,7 @@ int ti_bandgap_probe(struct platform_device *pdev)
 	for (i--; i >= 0; i--) {
 		if (bgp->conf->sensors[i].unregister_cooling)
 			bgp->conf->sensors[i].unregister_cooling(bgp, i);
-		if (bgp->conf->remove_sensor)
-			bgp->conf->remove_sensor(bgp, i);
+		ti_thermal_remove_sensor(bgp, i);
 	}
 	ti_bandgap_power(bgp, false);
 disable_clk:
@@ -1079,8 +1076,7 @@ int ti_bandgap_remove(struct platform_device *pdev)
 		if (bgp->conf->sensors[i].unregister_cooling)
 			bgp->conf->sensors[i].unregister_cooling(bgp, i);
 
-		if (bgp->conf->remove_sensor)
-			bgp->conf->remove_sensor(bgp, i);
+		ti_thermal_remove_sensor(bgp, i);
 	}
 
 	ti_bandgap_power(bgp, false);
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
index 68d39ad..809dbdc 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
@@ -313,9 +313,6 @@ struct ti_temp_sensor {
  * @fclock_name: clock name of the functional clock
  * @div_ck_name: clock name of the clock divisor
  * @sensor_count: count of temperature sensor within this bandgap device
- * @report_temperature: callback to report thermal alert to thermal API
- * @expose_sensor: callback to export sensor to thermal API
- * @remove_sensor: callback to destroy sensor from thermal API
  * @sensors: array of sensors present in this bandgap instance
  *
  * This is a data structure which should hold most of the static configuration
@@ -332,9 +329,6 @@ struct ti_bandgap_data {
 	char				*fclock_name;
 	char				*div_ck_name;
 	int				sensor_count;
-	int (*report_temperature)(struct ti_bandgap *bgp, int id);
-	int (*expose_sensor)(struct ti_bandgap *bgp, int id, char *domain);
-	int (*remove_sensor)(struct ti_bandgap *bgp, int id);
 
 	/* this needs to be at the end */
 	struct ti_temp_sensor		sensors[];
-- 
1.9.1

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

* [PATCH 06/14] thermal: ti-soc-thermal: remove ->threshold_[thot,tcold]_mask fields
       [not found]   ` <CGME20180514114331epcas2p3d52dea1f2feda21ff2cce1548f3f5bd4@epcas2p3.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

.threshold_[thot,tcold]_mask fields are set to identical values for
all sensors supporting TALERT feature so remove them and use common
defines instead.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/dra752-bandgap.h      |  4 ----
 drivers/thermal/ti-soc-thermal/dra752-thermal-data.c | 10 ----------
 drivers/thermal/ti-soc-thermal/omap4-thermal-data.c  |  2 --
 drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h    |  4 ----
 drivers/thermal/ti-soc-thermal/omap5-thermal-data.c  |  6 ------
 drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h    |  4 ----
 drivers/thermal/ti-soc-thermal/ti-bandgap.c          | 20 ++++++++++++++++----
 drivers/thermal/ti-soc-thermal/ti-bandgap.h          |  8 ++++----
 8 files changed, 20 insertions(+), 38 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/dra752-bandgap.h b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
index 9490cd6..b7156bf 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
@@ -132,10 +132,6 @@
 #define DRA752_TEMP_SENSOR_EOCZ_MASK		BIT(10)
 #define DRA752_TEMP_SENSOR_DTEMP_MASK		(0x3ff << 0)
 
-/* DRA752.BANDGAP_THRESHOLD */
-#define DRA752_BANDGAP_THRESHOLD_HOT_MASK		(0x3ff << 16)
-#define DRA752_BANDGAP_THRESHOLD_COLD_MASK		(0x3ff << 0)
-
 /**
  * Temperature limits and thresholds for DRA752
  *
diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
index c854642..a88a0e5 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
@@ -44,8 +44,6 @@
 	.mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
 	.mask_freeze_mask = DRA752_BANDGAP_CTRL_1_FREEZE_CORE_MASK,
 	.bgap_threshold = DRA752_BANDGAP_THRESHOLD_CORE_OFFSET,
-	.threshold_thot_mask = DRA752_BANDGAP_THRESHOLD_HOT_MASK,
-	.threshold_tcold_mask = DRA752_BANDGAP_THRESHOLD_COLD_MASK,
 	.bgap_status = DRA752_BANDGAP_STATUS_1_OFFSET,
 	.status_hot_mask = DRA752_BANDGAP_STATUS_1_HOT_CORE_MASK,
 	.status_cold_mask = DRA752_BANDGAP_STATUS_1_COLD_CORE_MASK,
@@ -69,8 +67,6 @@
 	.mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
 	.mask_freeze_mask = DRA752_BANDGAP_CTRL_2_FREEZE_IVA_MASK,
 	.bgap_threshold = DRA752_BANDGAP_THRESHOLD_IVA_OFFSET,
-	.threshold_thot_mask = DRA752_BANDGAP_THRESHOLD_HOT_MASK,
-	.threshold_tcold_mask = DRA752_BANDGAP_THRESHOLD_COLD_MASK,
 	.bgap_status = DRA752_BANDGAP_STATUS_2_OFFSET,
 	.status_hot_mask = DRA752_BANDGAP_STATUS_2_HOT_IVA_MASK,
 	.status_cold_mask = DRA752_BANDGAP_STATUS_2_COLD_IVA_MASK,
@@ -94,8 +90,6 @@
 	.mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
 	.mask_freeze_mask = DRA752_BANDGAP_CTRL_1_FREEZE_MPU_MASK,
 	.bgap_threshold = DRA752_BANDGAP_THRESHOLD_MPU_OFFSET,
-	.threshold_thot_mask = DRA752_BANDGAP_THRESHOLD_HOT_MASK,
-	.threshold_tcold_mask = DRA752_BANDGAP_THRESHOLD_COLD_MASK,
 	.bgap_status = DRA752_BANDGAP_STATUS_1_OFFSET,
 	.status_hot_mask = DRA752_BANDGAP_STATUS_1_HOT_MPU_MASK,
 	.status_cold_mask = DRA752_BANDGAP_STATUS_1_COLD_MPU_MASK,
@@ -119,8 +113,6 @@
 	.mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
 	.mask_freeze_mask = DRA752_BANDGAP_CTRL_2_FREEZE_DSPEVE_MASK,
 	.bgap_threshold = DRA752_BANDGAP_THRESHOLD_DSPEVE_OFFSET,
-	.threshold_thot_mask = DRA752_BANDGAP_THRESHOLD_HOT_MASK,
-	.threshold_tcold_mask = DRA752_BANDGAP_THRESHOLD_COLD_MASK,
 	.bgap_status = DRA752_BANDGAP_STATUS_2_OFFSET,
 	.status_hot_mask = DRA752_BANDGAP_STATUS_2_HOT_DSPEVE_MASK,
 	.status_cold_mask = DRA752_BANDGAP_STATUS_2_COLD_DSPEVE_MASK,
@@ -144,8 +136,6 @@
 	.mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
 	.mask_freeze_mask = DRA752_BANDGAP_CTRL_1_FREEZE_GPU_MASK,
 	.bgap_threshold = DRA752_BANDGAP_THRESHOLD_GPU_OFFSET,
-	.threshold_thot_mask = DRA752_BANDGAP_THRESHOLD_HOT_MASK,
-	.threshold_tcold_mask = DRA752_BANDGAP_THRESHOLD_COLD_MASK,
 	.bgap_status = DRA752_BANDGAP_STATUS_1_OFFSET,
 	.status_hot_mask = DRA752_BANDGAP_STATUS_1_HOT_GPU_MASK,
 	.status_cold_mask = DRA752_BANDGAP_STATUS_1_COLD_GPU_MASK,
diff --git a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
index 14d9fe2..9545fe3 100644
--- a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
@@ -108,8 +108,6 @@
 	.counter_mask = OMAP4460_COUNTER_MASK,
 
 	.bgap_threshold = OMAP4460_BGAP_THRESHOLD_OFFSET,
-	.threshold_thot_mask = OMAP4460_T_HOT_MASK,
-	.threshold_tcold_mask = OMAP4460_T_COLD_MASK,
 
 	.tshut_threshold = OMAP4460_BGAP_TSHUT_OFFSET,
 	.tshut_hot_mask = OMAP4460_TSHUT_HOT_MASK,
diff --git a/drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h b/drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h
index b87c8659..c1da37d 100644
--- a/drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h
@@ -130,10 +130,6 @@
 /* OMAP4460.BANDGAP_COUNTER bits */
 #define OMAP4460_COUNTER_MASK				(0xffffff << 0)
 
-/* OMAP4460.BANDGAP_THRESHOLD bits */
-#define OMAP4460_T_HOT_MASK				(0x3ff << 16)
-#define OMAP4460_T_COLD_MASK				(0x3ff << 0)
-
 /* OMAP4460.TSHUT_THRESHOLD bits */
 #define OMAP4460_TSHUT_HOT_MASK				(0x3ff << 16)
 #define OMAP4460_TSHUT_COLD_MASK			(0x3ff << 0)
diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index 843faa7..51a6ab4 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -42,8 +42,6 @@
 	.mask_freeze_mask = OMAP5430_MASK_FREEZE_MPU_MASK,
 
 	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_MPU_OFFSET,
-	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
-	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
 
 	.tshut_threshold = OMAP5430_BGAP_TSHUT_MPU_OFFSET,
 	.tshut_hot_mask = OMAP5430_TSHUT_HOT_MASK,
@@ -75,8 +73,6 @@
 	.mask_freeze_mask = OMAP5430_MASK_FREEZE_GPU_MASK,
 
 	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_GPU_OFFSET,
-	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
-	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
 
 	.tshut_threshold = OMAP5430_BGAP_TSHUT_GPU_OFFSET,
 	.tshut_hot_mask = OMAP5430_TSHUT_HOT_MASK,
@@ -109,8 +105,6 @@
 	.mask_freeze_mask = OMAP5430_MASK_FREEZE_CORE_MASK,
 
 	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_CORE_OFFSET,
-	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
-	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
 
 	.tshut_threshold = OMAP5430_BGAP_TSHUT_CORE_OFFSET,
 	.tshut_hot_mask = OMAP5430_TSHUT_HOT_MASK,
diff --git a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
index 223c7a8..ec536d8 100644
--- a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
@@ -93,10 +93,6 @@
 #define OMAP5430_MASK_HOT_MPU_MASK			BIT(1)
 #define OMAP5430_MASK_COLD_MPU_MASK			BIT(0)
 
-/* OMAP5430.BANDGAP_THRESHOLD */
-#define OMAP5430_T_HOT_MASK				(0x3ff << 16)
-#define OMAP5430_T_COLD_MASK				(0x3ff << 0)
-
 /* OMAP5430.TSHUT_THRESHOLD */
 #define OMAP5430_TSHUT_HOT_MASK				(0x3ff << 16)
 #define OMAP5430_TSHUT_COLD_MASK			(0x3ff << 0)
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 3ac74fe..cb9a27e 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -92,6 +92,18 @@ static void ti_bandgap_writel(struct ti_bandgap *bgp, u32 val, u32 reg)
 	ti_bandgap_writel(bgp, r, t->reg);			\
 } while (0)
 
+#define RMW_BITS2(bgp, id, reg, mask, val)			\
+do {								\
+	struct temp_sensor_registers *t;			\
+	u32 r;							\
+								\
+	t = bgp->conf->sensors[(id)].registers;		\
+	r = ti_bandgap_readl(bgp, t->reg);			\
+	r &= ~mask;						\
+	r |= (val) << __ffs(mask);				\
+	ti_bandgap_writel(bgp, r, t->reg);			\
+} while (0)
+
 /***   Basic helper functions   ***/
 
 /**
@@ -980,10 +992,10 @@ int ti_bandgap_probe(struct platform_device *pdev)
 
 		if (TI_BANDGAP_HAS(bgp, TALERT)) {
 			/* Set initial Talert thresholds */
-			RMW_BITS(bgp, i, bgap_threshold,
-				 threshold_tcold_mask, ts_data->t_cold);
-			RMW_BITS(bgp, i, bgap_threshold,
-				 threshold_thot_mask, ts_data->t_hot);
+			RMW_BITS2(bgp, i, bgap_threshold,
+				 OMAP_T_COLD_MASK, ts_data->t_cold);
+			RMW_BITS2(bgp, i, bgap_threshold,
+				 OMAP_T_HOT_MASK, ts_data->t_hot);
 			/* Enable the alert events */
 			RMW_BITS(bgp, i, bgap_mask_ctrl, mask_hot_mask, 1);
 			RMW_BITS(bgp, i, bgap_mask_ctrl, mask_cold_mask, 1);
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
index 809dbdc..2e5b146 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
@@ -68,6 +68,10 @@
  * sensors, representing every sensor instance present in this bandgap.
  */
 
+/* BANDGAP_THRESHOLD */
+#define OMAP_T_HOT_MASK		(0x3ff << 16)
+#define OMAP_T_COLD_MASK	(0x3ff << 0)
+
 /**
  * struct temp_sensor_registers - descriptor to access registers and bitfields
  * @temp_sensor_ctrl: TEMP_SENSOR_CTRL register offset
@@ -85,8 +89,6 @@
  * @bgap_counter: BANDGAP_COUNTER register offset
  * @counter_mask: mask to bandgap_counter.counter
  * @bgap_threshold: BANDGAP_THRESHOLD register offset (TALERT thresholds)
- * @threshold_thot_mask: mask to bandgap_threhold.thot
- * @threshold_tcold_mask: mask to bandgap_threhold.tcold
  * @tshut_threshold: TSHUT_THRESHOLD register offset (TSHUT thresholds)
  * @tshut_hot_mask: mask to tshut_threhold.thot
  * @tshut_cold_mask: mask to tshut_threhold.thot
@@ -126,8 +128,6 @@ struct temp_sensor_registers {
 	u32	counter_mask;
 
 	u32	bgap_threshold;
-	u32	threshold_thot_mask;
-	u32	threshold_tcold_mask;
 
 	u32	tshut_threshold;
 	u32	tshut_hot_mask;
-- 
1.9.1

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

* [PATCH 07/14] thermal: ti-soc-thermal: remove ->tshut_[hot,cold]_mask fields
       [not found]   ` <CGME20180514114334epcas1p4c1b268d8253cda369826e67b06b4c28b@epcas1p4.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

.tshut_[hot,cold]_mask fields are set to identical values for
all sensors supporting TSHUT_CONFIG feature so remove them and
use common defines instead.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/omap4-thermal-data.c | 2 --
 drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h   | 4 ----
 drivers/thermal/ti-soc-thermal/omap5-thermal-data.c | 6 ------
 drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h   | 4 ----
 drivers/thermal/ti-soc-thermal/ti-bandgap.c         | 8 ++++----
 drivers/thermal/ti-soc-thermal/ti-bandgap.h         | 8 ++++----
 6 files changed, 8 insertions(+), 24 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
index 9545fe3..74d05cc 100644
--- a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
@@ -110,8 +110,6 @@
 	.bgap_threshold = OMAP4460_BGAP_THRESHOLD_OFFSET,
 
 	.tshut_threshold = OMAP4460_BGAP_TSHUT_OFFSET,
-	.tshut_hot_mask = OMAP4460_TSHUT_HOT_MASK,
-	.tshut_cold_mask = OMAP4460_TSHUT_COLD_MASK,
 
 	.bgap_status = OMAP4460_BGAP_STATUS_OFFSET,
 	.status_hot_mask = OMAP4460_HOT_FLAG_MASK,
diff --git a/drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h b/drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h
index c1da37d..5ba4c62 100644
--- a/drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/omap4xxx-bandgap.h
@@ -130,10 +130,6 @@
 /* OMAP4460.BANDGAP_COUNTER bits */
 #define OMAP4460_COUNTER_MASK				(0xffffff << 0)
 
-/* OMAP4460.TSHUT_THRESHOLD bits */
-#define OMAP4460_TSHUT_HOT_MASK				(0x3ff << 16)
-#define OMAP4460_TSHUT_COLD_MASK			(0x3ff << 0)
-
 /* OMAP4460.BANDGAP_STATUS bits */
 #define OMAP4460_HOT_FLAG_MASK				BIT(1)
 #define OMAP4460_COLD_FLAG_MASK				BIT(0)
diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index 51a6ab4..a7ca3b6 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -44,8 +44,6 @@
 	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_MPU_OFFSET,
 
 	.tshut_threshold = OMAP5430_BGAP_TSHUT_MPU_OFFSET,
-	.tshut_hot_mask = OMAP5430_TSHUT_HOT_MASK,
-	.tshut_cold_mask = OMAP5430_TSHUT_COLD_MASK,
 
 	.bgap_status = OMAP5430_BGAP_STATUS_OFFSET,
 	.status_hot_mask = OMAP5430_HOT_MPU_FLAG_MASK,
@@ -75,8 +73,6 @@
 	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_GPU_OFFSET,
 
 	.tshut_threshold = OMAP5430_BGAP_TSHUT_GPU_OFFSET,
-	.tshut_hot_mask = OMAP5430_TSHUT_HOT_MASK,
-	.tshut_cold_mask = OMAP5430_TSHUT_COLD_MASK,
 
 	.bgap_status = OMAP5430_BGAP_STATUS_OFFSET,
 	.status_hot_mask = OMAP5430_HOT_GPU_FLAG_MASK,
@@ -107,8 +103,6 @@
 	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_CORE_OFFSET,
 
 	.tshut_threshold = OMAP5430_BGAP_TSHUT_CORE_OFFSET,
-	.tshut_hot_mask = OMAP5430_TSHUT_HOT_MASK,
-	.tshut_cold_mask = OMAP5430_TSHUT_COLD_MASK,
 
 	.bgap_status = OMAP5430_BGAP_STATUS_OFFSET,
 	.status_hot_mask = OMAP5430_HOT_CORE_FLAG_MASK,
diff --git a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
index ec536d8..e931ae0 100644
--- a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
@@ -93,10 +93,6 @@
 #define OMAP5430_MASK_HOT_MPU_MASK			BIT(1)
 #define OMAP5430_MASK_COLD_MPU_MASK			BIT(0)
 
-/* OMAP5430.TSHUT_THRESHOLD */
-#define OMAP5430_TSHUT_HOT_MASK				(0x3ff << 16)
-#define OMAP5430_TSHUT_COLD_MASK			(0x3ff << 0)
-
 /* OMAP5430.BANDGAP_STATUS */
 #define OMAP5430_HOT_CORE_FLAG_MASK			BIT(5)
 #define OMAP5430_COLD_CORE_FLAG_MASK			BIT(4)
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index cb9a27e..4d45160 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -1003,10 +1003,10 @@ int ti_bandgap_probe(struct platform_device *pdev)
 
 		if (TI_BANDGAP_HAS(bgp, TSHUT_CONFIG)) {
 			/* Set initial Tshut thresholds */
-			RMW_BITS(bgp, i, tshut_threshold,
-				 tshut_hot_mask, ts_data->tshut_hot);
-			RMW_BITS(bgp, i, tshut_threshold,
-				 tshut_cold_mask, ts_data->tshut_cold);
+			RMW_BITS2(bgp, i, tshut_threshold,
+				 OMAP_TSHUT_HOT_MASK, ts_data->tshut_hot);
+			RMW_BITS2(bgp, i, tshut_threshold,
+				 OMAP_TSHUT_COLD_MASK, ts_data->tshut_cold);
 		}
 	}
 
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
index 2e5b146..4d5b54a 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
@@ -72,6 +72,10 @@
 #define OMAP_T_HOT_MASK		(0x3ff << 16)
 #define OMAP_T_COLD_MASK	(0x3ff << 0)
 
+/* TSHUT_THRESHOLD */
+#define OMAP_TSHUT_HOT_MASK	(0x3ff << 16)
+#define OMAP_TSHUT_COLD_MASK	(0x3ff << 0)
+
 /**
  * struct temp_sensor_registers - descriptor to access registers and bitfields
  * @temp_sensor_ctrl: TEMP_SENSOR_CTRL register offset
@@ -90,8 +94,6 @@
  * @counter_mask: mask to bandgap_counter.counter
  * @bgap_threshold: BANDGAP_THRESHOLD register offset (TALERT thresholds)
  * @tshut_threshold: TSHUT_THRESHOLD register offset (TSHUT thresholds)
- * @tshut_hot_mask: mask to tshut_threhold.thot
- * @tshut_cold_mask: mask to tshut_threhold.thot
  * @bgap_status: BANDGAP_STATUS register offset
  * @status_hot_mask: mask to bandgap_status.hot
  * @status_cold_mask: mask to bandgap_status.cold
@@ -130,8 +132,6 @@ struct temp_sensor_registers {
 	u32	bgap_threshold;
 
 	u32	tshut_threshold;
-	u32	tshut_hot_mask;
-	u32	tshut_cold_mask;
 
 	u32	bgap_status;
 	u32	status_hot_mask;
-- 
1.9.1

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

* [PATCH 08/14] thermal: ti-soc-thermal: use common struct temp_sensor_data for OMAP5
       [not found]   ` <CGME20180514114337epcas1p1ba67790ed771ab09c0be25712c8b385f@epcas1p1.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

Currently all struct temp_sensor_data instances for OMAP5 are
identical so just use one common structure to avoid duplication.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 .../thermal/ti-soc-thermal/omap5-thermal-data.c    | 42 ++++++----------------
 drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h  | 34 ++++--------------
 2 files changed, 18 insertions(+), 58 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index a7ca3b6..defa714 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -114,34 +114,14 @@
 	.bgap_efuse = OMAP5430_FUSE_OPP_BGAP_CORE,
 };
 
-/* Thresholds and limits for OMAP5430 MPU temperature sensor */
-static struct temp_sensor_data omap5430_mpu_temp_sensor_data = {
-	.tshut_hot = OMAP5430_MPU_TSHUT_HOT,
-	.tshut_cold = OMAP5430_MPU_TSHUT_COLD,
-	.t_hot = OMAP5430_MPU_T_HOT,
-	.t_cold = OMAP5430_MPU_T_COLD,
-	.min_freq = OMAP5430_MPU_MIN_FREQ,
-	.max_freq = OMAP5430_MPU_MAX_FREQ,
-};
-
-/* Thresholds and limits for OMAP5430 GPU temperature sensor */
-static struct temp_sensor_data omap5430_gpu_temp_sensor_data = {
-	.tshut_hot = OMAP5430_GPU_TSHUT_HOT,
-	.tshut_cold = OMAP5430_GPU_TSHUT_COLD,
-	.t_hot = OMAP5430_GPU_T_HOT,
-	.t_cold = OMAP5430_GPU_T_COLD,
-	.min_freq = OMAP5430_GPU_MIN_FREQ,
-	.max_freq = OMAP5430_GPU_MAX_FREQ,
-};
-
-/* Thresholds and limits for OMAP5430 CORE temperature sensor */
-static struct temp_sensor_data omap5430_core_temp_sensor_data = {
-	.tshut_hot = OMAP5430_CORE_TSHUT_HOT,
-	.tshut_cold = OMAP5430_CORE_TSHUT_COLD,
-	.t_hot = OMAP5430_CORE_T_HOT,
-	.t_cold = OMAP5430_CORE_T_COLD,
-	.min_freq = OMAP5430_CORE_MIN_FREQ,
-	.max_freq = OMAP5430_CORE_MAX_FREQ,
+/* Thresholds and limits for OMAP5430 MPU/GPU/CORE temperature sensor */
+static struct temp_sensor_data omap5430_temp_sensor_data = {
+	.tshut_hot = OMAP5430_TSHUT_HOT,
+	.tshut_cold = OMAP5430_TSHUT_COLD,
+	.t_hot = OMAP5430_T_HOT,
+	.t_cold = OMAP5430_T_COLD,
+	.min_freq = OMAP5430_MIN_FREQ,
+	.max_freq = OMAP5430_MAX_FREQ,
 };
 
 /*
@@ -264,7 +244,7 @@
 	.sensors = {
 		{
 		.registers = &omap5430_mpu_temp_sensor_registers,
-		.ts_data = &omap5430_mpu_temp_sensor_data,
+		.ts_data = &omap5430_temp_sensor_data,
 		.domain = "cpu",
 		.register_cooling = ti_thermal_register_cpu_cooling,
 		.unregister_cooling = ti_thermal_unregister_cpu_cooling,
@@ -273,14 +253,14 @@
 		},
 		{
 		.registers = &omap5430_gpu_temp_sensor_registers,
-		.ts_data = &omap5430_gpu_temp_sensor_data,
+		.ts_data = &omap5430_temp_sensor_data,
 		.domain = "gpu",
 		.slope_pcb = OMAP_GRADIENT_SLOPE_W_PCB_5430_GPU,
 		.constant_pcb = OMAP_GRADIENT_CONST_W_PCB_5430_GPU,
 		},
 		{
 		.registers = &omap5430_core_temp_sensor_registers,
-		.ts_data = &omap5430_core_temp_sensor_data,
+		.ts_data = &omap5430_temp_sensor_data,
 		.domain = "core",
 		},
 	},
diff --git a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
index e931ae0..98438cf 100644
--- a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
@@ -115,34 +115,14 @@
 #define OMAP5430_ADC_START_VALUE			540
 #define OMAP5430_ADC_END_VALUE				945
 
-/* OMAP5430.GPU temperature definitions */
+/* OMAP5430 sensor temperature definitions */
 /* bandgap clock limits */
-#define OMAP5430_GPU_MAX_FREQ				1500000
-#define OMAP5430_GPU_MIN_FREQ				1000000
+#define OMAP5430_MAX_FREQ				1500000
+#define OMAP5430_MIN_FREQ				1000000
 /* interrupts thresholds */
-#define OMAP5430_GPU_TSHUT_HOT				915
-#define OMAP5430_GPU_TSHUT_COLD				900
-#define OMAP5430_GPU_T_HOT				800
-#define OMAP5430_GPU_T_COLD				795
-
-/* OMAP5430.MPU temperature definitions */
-/* bandgap clock limits */
-#define OMAP5430_MPU_MAX_FREQ				1500000
-#define OMAP5430_MPU_MIN_FREQ				1000000
-/* interrupts thresholds */
-#define OMAP5430_MPU_TSHUT_HOT				915
-#define OMAP5430_MPU_TSHUT_COLD				900
-#define OMAP5430_MPU_T_HOT				800
-#define OMAP5430_MPU_T_COLD				795
-
-/* OMAP5430.CORE temperature definitions */
-/* bandgap clock limits */
-#define OMAP5430_CORE_MAX_FREQ				1500000
-#define OMAP5430_CORE_MIN_FREQ				1000000
-/* interrupts thresholds */
-#define OMAP5430_CORE_TSHUT_HOT				915
-#define OMAP5430_CORE_TSHUT_COLD			900
-#define OMAP5430_CORE_T_HOT				800
-#define OMAP5430_CORE_T_COLD				795
+#define OMAP5430_TSHUT_HOT				915
+#define OMAP5430_TSHUT_COLD				900
+#define OMAP5430_T_HOT					800
+#define OMAP5430_T_COLD					795
 
 #endif /* __OMAP5XXX_BANDGAP_H */
-- 
1.9.1

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

* [PATCH 09/14] thermal: ti-soc-thermal: use common struct temp_sensor_data for DRA752
       [not found]   ` <CGME20180514114340epcas2p10a9a4aad3064ad752cd2bea456581a98@epcas2p1.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

Currently all struct temp_sensor_data instances for DRA752 are
identical so just use one common structure to avoid duplication.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/dra752-bandgap.h    | 42 ++---------------
 .../thermal/ti-soc-thermal/dra752-thermal-data.c   | 54 +++++-----------------
 2 files changed, 16 insertions(+), 80 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/dra752-bandgap.h b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
index b7156bf..ac324b9 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
@@ -146,44 +146,12 @@
 #define DRA752_ADC_START_VALUE		540
 #define DRA752_ADC_END_VALUE		945
 
-/* DRA752.GPU temperature definitions */
+/* DRA752 GPU/MPU/CORE/DSPEVE/IVA temperature definitions */
 /* bandgap clock limits */
-#define DRA752_GPU_MAX_FREQ				1500000
-#define DRA752_GPU_MIN_FREQ				1000000
+#define DRA752_MAX_FREQ				1500000
+#define DRA752_MIN_FREQ				1000000
 /* interrupts thresholds */
-#define DRA752_GPU_T_HOT				800
-#define DRA752_GPU_T_COLD				795
-
-/* DRA752.MPU temperature definitions */
-/* bandgap clock limits */
-#define DRA752_MPU_MAX_FREQ				1500000
-#define DRA752_MPU_MIN_FREQ				1000000
-/* interrupts thresholds */
-#define DRA752_MPU_T_HOT				800
-#define DRA752_MPU_T_COLD				795
-
-/* DRA752.CORE temperature definitions */
-/* bandgap clock limits */
-#define DRA752_CORE_MAX_FREQ				1500000
-#define DRA752_CORE_MIN_FREQ				1000000
-/* interrupts thresholds */
-#define DRA752_CORE_T_HOT				800
-#define DRA752_CORE_T_COLD				795
-
-/* DRA752.DSPEVE temperature definitions */
-/* bandgap clock limits */
-#define DRA752_DSPEVE_MAX_FREQ				1500000
-#define DRA752_DSPEVE_MIN_FREQ				1000000
-/* interrupts thresholds */
-#define DRA752_DSPEVE_T_HOT				800
-#define DRA752_DSPEVE_T_COLD				795
-
-/* DRA752.IVA temperature definitions */
-/* bandgap clock limits */
-#define DRA752_IVA_MAX_FREQ				1500000
-#define DRA752_IVA_MIN_FREQ				1000000
-/* interrupts thresholds */
-#define DRA752_IVA_T_HOT				800
-#define DRA752_IVA_T_COLD				795
+#define DRA752_T_HOT				800
+#define DRA752_T_COLD				795
 
 #endif /* __DRA752_BANDGAP_H */
diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
index a88a0e5..3372cd7 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
@@ -144,44 +144,12 @@
 	.bgap_efuse = DRA752_STD_FUSE_OPP_BGAP_GPU_OFFSET,
 };
 
-/* Thresholds and limits for DRA752 MPU temperature sensor */
-static struct temp_sensor_data dra752_mpu_temp_sensor_data = {
-	.t_hot = DRA752_MPU_T_HOT,
-	.t_cold = DRA752_MPU_T_COLD,
-	.min_freq = DRA752_MPU_MIN_FREQ,
-	.max_freq = DRA752_MPU_MAX_FREQ,
-};
-
-/* Thresholds and limits for DRA752 GPU temperature sensor */
-static struct temp_sensor_data dra752_gpu_temp_sensor_data = {
-	.t_hot = DRA752_GPU_T_HOT,
-	.t_cold = DRA752_GPU_T_COLD,
-	.min_freq = DRA752_GPU_MIN_FREQ,
-	.max_freq = DRA752_GPU_MAX_FREQ,
-};
-
-/* Thresholds and limits for DRA752 CORE temperature sensor */
-static struct temp_sensor_data dra752_core_temp_sensor_data = {
-	.t_hot = DRA752_CORE_T_HOT,
-	.t_cold = DRA752_CORE_T_COLD,
-	.min_freq = DRA752_CORE_MIN_FREQ,
-	.max_freq = DRA752_CORE_MAX_FREQ,
-};
-
-/* Thresholds and limits for DRA752 DSPEVE temperature sensor */
-static struct temp_sensor_data dra752_dspeve_temp_sensor_data = {
-	.t_hot = DRA752_DSPEVE_T_HOT,
-	.t_cold = DRA752_DSPEVE_T_COLD,
-	.min_freq = DRA752_DSPEVE_MIN_FREQ,
-	.max_freq = DRA752_DSPEVE_MAX_FREQ,
-};
-
-/* Thresholds and limits for DRA752 IVA temperature sensor */
-static struct temp_sensor_data dra752_iva_temp_sensor_data = {
-	.t_hot = DRA752_IVA_T_HOT,
-	.t_cold = DRA752_IVA_T_COLD,
-	.min_freq = DRA752_IVA_MIN_FREQ,
-	.max_freq = DRA752_IVA_MAX_FREQ,
+/* Thresholds and limits for DRA752 temperature sensor */
+static struct temp_sensor_data dra752_temp_sensor_data = {
+	.t_hot = DRA752_T_HOT,
+	.t_cold = DRA752_T_COLD,
+	.min_freq = DRA752_MIN_FREQ,
+	.max_freq = DRA752_MAX_FREQ,
 };
 
 /*
@@ -329,7 +297,7 @@
 	.sensors = {
 		{
 		.registers = &dra752_mpu_temp_sensor_registers,
-		.ts_data = &dra752_mpu_temp_sensor_data,
+		.ts_data = &dra752_temp_sensor_data,
 		.domain = "cpu",
 		.register_cooling = ti_thermal_register_cpu_cooling,
 		.unregister_cooling = ti_thermal_unregister_cpu_cooling,
@@ -338,28 +306,28 @@
 		},
 		{
 		.registers = &dra752_gpu_temp_sensor_registers,
-		.ts_data = &dra752_gpu_temp_sensor_data,
+		.ts_data = &dra752_temp_sensor_data,
 		.domain = "gpu",
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
 		{
 		.registers = &dra752_core_temp_sensor_registers,
-		.ts_data = &dra752_core_temp_sensor_data,
+		.ts_data = &dra752_temp_sensor_data,
 		.domain = "core",
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
 		{
 		.registers = &dra752_dspeve_temp_sensor_registers,
-		.ts_data = &dra752_dspeve_temp_sensor_data,
+		.ts_data = &dra752_temp_sensor_data,
 		.domain = "dspeve",
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
 		{
 		.registers = &dra752_iva_temp_sensor_registers,
-		.ts_data = &dra752_iva_temp_sensor_data,
+		.ts_data = &dra752_temp_sensor_data,
 		.domain = "iva",
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
-- 
1.9.1

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

* [PATCH 10/14] thermal: ti-soc-thermal: use OMAP5 defines for DRA752
       [not found]   ` <CGME20180514114343epcas2p4280b4ff50611a223a1b3ae37dbe743ee@epcas2p4.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

Use defines from omap5xxx-bandgap.h in dra752-thermal-data.c
instead of defining duplicate ones in dra752-bandgap.h.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/dra752-bandgap.h    |  70 -----------
 .../thermal/ti-soc-thermal/dra752-thermal-data.c   | 129 +++++++++++----------
 2 files changed, 65 insertions(+), 134 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/dra752-bandgap.h b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
index ac324b9..b9d65b4 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
@@ -45,18 +45,9 @@
 
 
 /* DRA752.common register offsets */
-#define DRA752_BANDGAP_CTRL_1_OFFSET		0x1a0
-#define DRA752_BANDGAP_STATUS_1_OFFSET		0x1c8
 #define DRA752_BANDGAP_CTRL_2_OFFSET		0x39c
 #define DRA752_BANDGAP_STATUS_2_OFFSET		0x3b8
 
-/* DRA752.core register offsets */
-#define DRA752_STD_FUSE_OPP_BGAP_CORE_OFFSET		0x8
-#define DRA752_TEMP_SENSOR_CORE_OFFSET			0x154
-#define DRA752_BANDGAP_THRESHOLD_CORE_OFFSET		0x1ac
-#define DRA752_DTEMP_CORE_1_OFFSET			0x20c
-#define DRA752_DTEMP_CORE_2_OFFSET			0x210
-
 /* DRA752.iva register offsets */
 #define DRA752_STD_FUSE_OPP_BGAP_IVA_OFFSET		0x388
 #define DRA752_TEMP_SENSOR_IVA_OFFSET			0x398
@@ -64,13 +55,6 @@
 #define DRA752_DTEMP_IVA_1_OFFSET			0x3d4
 #define DRA752_DTEMP_IVA_2_OFFSET			0x3d8
 
-/* DRA752.mpu register offsets */
-#define DRA752_STD_FUSE_OPP_BGAP_MPU_OFFSET		0x4
-#define DRA752_TEMP_SENSOR_MPU_OFFSET			0x14c
-#define DRA752_BANDGAP_THRESHOLD_MPU_OFFSET		0x1a4
-#define DRA752_DTEMP_MPU_1_OFFSET			0x1e4
-#define DRA752_DTEMP_MPU_2_OFFSET			0x1e8
-
 /* DRA752.dspeve register offsets */
 #define DRA752_STD_FUSE_OPP_BGAP_DSPEVE_OFFSET			0x384
 #define DRA752_TEMP_SENSOR_DSPEVE_OFFSET			0x394
@@ -78,13 +62,6 @@
 #define DRA752_DTEMP_DSPEVE_1_OFFSET				0x3c0
 #define DRA752_DTEMP_DSPEVE_2_OFFSET				0x3c4
 
-/* DRA752.gpu register offsets */
-#define DRA752_STD_FUSE_OPP_BGAP_GPU_OFFSET		0x0
-#define DRA752_TEMP_SENSOR_GPU_OFFSET			0x150
-#define DRA752_BANDGAP_THRESHOLD_GPU_OFFSET		0x1a8
-#define DRA752_DTEMP_GPU_1_OFFSET			0x1f8
-#define DRA752_DTEMP_GPU_2_OFFSET			0x1fc
-
 /**
  * Register bitfields for DRA752
  *
@@ -93,14 +70,6 @@
  * grouped by register.
  */
 
-/* DRA752.BANDGAP_STATUS_1 */
-#define DRA752_BANDGAP_STATUS_1_HOT_CORE_MASK		BIT(5)
-#define DRA752_BANDGAP_STATUS_1_COLD_CORE_MASK		BIT(4)
-#define DRA752_BANDGAP_STATUS_1_HOT_GPU_MASK		BIT(3)
-#define DRA752_BANDGAP_STATUS_1_COLD_GPU_MASK		BIT(2)
-#define DRA752_BANDGAP_STATUS_1_HOT_MPU_MASK		BIT(1)
-#define DRA752_BANDGAP_STATUS_1_COLD_MPU_MASK		BIT(0)
-
 /* DRA752.BANDGAP_CTRL_2 */
 #define DRA752_BANDGAP_CTRL_2_FREEZE_IVA_MASK			BIT(22)
 #define DRA752_BANDGAP_CTRL_2_FREEZE_DSPEVE_MASK		BIT(21)
@@ -115,43 +84,4 @@
 #define DRA752_BANDGAP_STATUS_2_HOT_DSPEVE_MASK			BIT(1)
 #define DRA752_BANDGAP_STATUS_2_COLD_DSPEVE_MASK		BIT(0)
 
-/* DRA752.BANDGAP_CTRL_1 */
-#define DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK		(0x7 << 27)
-#define DRA752_BANDGAP_CTRL_1_FREEZE_CORE_MASK			BIT(23)
-#define DRA752_BANDGAP_CTRL_1_FREEZE_GPU_MASK			BIT(22)
-#define DRA752_BANDGAP_CTRL_1_FREEZE_MPU_MASK			BIT(21)
-#define DRA752_BANDGAP_CTRL_1_MASK_HOT_CORE_MASK		BIT(5)
-#define DRA752_BANDGAP_CTRL_1_MASK_COLD_CORE_MASK		BIT(4)
-#define DRA752_BANDGAP_CTRL_1_MASK_HOT_GPU_MASK			BIT(3)
-#define DRA752_BANDGAP_CTRL_1_MASK_COLD_GPU_MASK		BIT(2)
-#define DRA752_BANDGAP_CTRL_1_MASK_HOT_MPU_MASK			BIT(1)
-#define DRA752_BANDGAP_CTRL_1_MASK_COLD_MPU_MASK		BIT(0)
-
-/* DRA752.TEMP_SENSOR */
-#define DRA752_TEMP_SENSOR_TMPSOFF_MASK		BIT(11)
-#define DRA752_TEMP_SENSOR_EOCZ_MASK		BIT(10)
-#define DRA752_TEMP_SENSOR_DTEMP_MASK		(0x3ff << 0)
-
-/**
- * Temperature limits and thresholds for DRA752
- *
- * All the macros bellow are definitions for handling the
- * ADC conversions and representation of temperature limits
- * and thresholds for DRA752. Definitions are grouped
- * by temperature domain.
- */
-
-/* DRA752.common temperature definitions */
-/* ADC conversion table limits */
-#define DRA752_ADC_START_VALUE		540
-#define DRA752_ADC_END_VALUE		945
-
-/* DRA752 GPU/MPU/CORE/DSPEVE/IVA temperature definitions */
-/* bandgap clock limits */
-#define DRA752_MAX_FREQ				1500000
-#define DRA752_MIN_FREQ				1000000
-/* interrupts thresholds */
-#define DRA752_T_HOT				800
-#define DRA752_T_COLD				795
-
 #endif /* __DRA752_BANDGAP_H */
diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
index 3372cd7..de412a2 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
@@ -21,6 +21,7 @@
 
 #include "ti-thermal.h"
 #include "ti-bandgap.h"
+#include "omap5xxx-bandgap.h"
 #include "dra752-bandgap.h"
 
 /*
@@ -34,22 +35,22 @@
  */
 static struct temp_sensor_registers
 dra752_core_temp_sensor_registers = {
-	.temp_sensor_ctrl = DRA752_TEMP_SENSOR_CORE_OFFSET,
-	.bgap_tempsoff_mask = DRA752_TEMP_SENSOR_TMPSOFF_MASK,
-	.bgap_eocz_mask = DRA752_TEMP_SENSOR_EOCZ_MASK,
-	.bgap_dtemp_mask = DRA752_TEMP_SENSOR_DTEMP_MASK,
-	.bgap_mask_ctrl = DRA752_BANDGAP_CTRL_1_OFFSET,
-	.mask_hot_mask = DRA752_BANDGAP_CTRL_1_MASK_HOT_CORE_MASK,
-	.mask_cold_mask = DRA752_BANDGAP_CTRL_1_MASK_COLD_CORE_MASK,
-	.mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
-	.mask_freeze_mask = DRA752_BANDGAP_CTRL_1_FREEZE_CORE_MASK,
-	.bgap_threshold = DRA752_BANDGAP_THRESHOLD_CORE_OFFSET,
-	.bgap_status = DRA752_BANDGAP_STATUS_1_OFFSET,
-	.status_hot_mask = DRA752_BANDGAP_STATUS_1_HOT_CORE_MASK,
-	.status_cold_mask = DRA752_BANDGAP_STATUS_1_COLD_CORE_MASK,
-	.ctrl_dtemp_1 = DRA752_DTEMP_CORE_1_OFFSET,
-	.ctrl_dtemp_2 = DRA752_DTEMP_CORE_2_OFFSET,
-	.bgap_efuse = DRA752_STD_FUSE_OPP_BGAP_CORE_OFFSET,
+	.temp_sensor_ctrl = OMAP5430_TEMP_SENSOR_CORE_OFFSET,
+	.bgap_tempsoff_mask = OMAP5430_BGAP_TEMPSOFF_MASK,
+	.bgap_eocz_mask = OMAP5430_BGAP_TEMP_SENSOR_EOCZ_MASK,
+	.bgap_dtemp_mask = OMAP5430_BGAP_TEMP_SENSOR_DTEMP_MASK,
+	.bgap_mask_ctrl = OMAP5430_BGAP_CTRL_OFFSET,
+	.mask_hot_mask = OMAP5430_MASK_HOT_CORE_MASK,
+	.mask_cold_mask = OMAP5430_MASK_COLD_CORE_MASK,
+	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
+	.mask_freeze_mask = OMAP5430_MASK_FREEZE_CORE_MASK,
+	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_CORE_OFFSET,
+	.bgap_status = OMAP5430_BGAP_STATUS_OFFSET,
+	.status_hot_mask = OMAP5430_HOT_CORE_FLAG_MASK,
+	.status_cold_mask = OMAP5430_COLD_CORE_FLAG_MASK,
+	.ctrl_dtemp_1 = OMAP5430_BGAP_DTEMP_CORE_1_OFFSET,
+	.ctrl_dtemp_2 = OMAP5430_BGAP_DTEMP_CORE_2_OFFSET,
+	.bgap_efuse = OMAP5430_FUSE_OPP_BGAP_CORE,
 };
 
 /*
@@ -58,13 +59,13 @@
 static struct temp_sensor_registers
 dra752_iva_temp_sensor_registers = {
 	.temp_sensor_ctrl = DRA752_TEMP_SENSOR_IVA_OFFSET,
-	.bgap_tempsoff_mask = DRA752_TEMP_SENSOR_TMPSOFF_MASK,
-	.bgap_eocz_mask = DRA752_TEMP_SENSOR_EOCZ_MASK,
-	.bgap_dtemp_mask = DRA752_TEMP_SENSOR_DTEMP_MASK,
+	.bgap_tempsoff_mask = OMAP5430_BGAP_TEMPSOFF_MASK,
+	.bgap_eocz_mask = OMAP5430_BGAP_TEMP_SENSOR_EOCZ_MASK,
+	.bgap_dtemp_mask = OMAP5430_BGAP_TEMP_SENSOR_DTEMP_MASK,
 	.bgap_mask_ctrl = DRA752_BANDGAP_CTRL_2_OFFSET,
 	.mask_hot_mask = DRA752_BANDGAP_CTRL_2_MASK_HOT_IVA_MASK,
 	.mask_cold_mask = DRA752_BANDGAP_CTRL_2_MASK_COLD_IVA_MASK,
-	.mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
+	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
 	.mask_freeze_mask = DRA752_BANDGAP_CTRL_2_FREEZE_IVA_MASK,
 	.bgap_threshold = DRA752_BANDGAP_THRESHOLD_IVA_OFFSET,
 	.bgap_status = DRA752_BANDGAP_STATUS_2_OFFSET,
@@ -80,22 +81,22 @@
  */
 static struct temp_sensor_registers
 dra752_mpu_temp_sensor_registers = {
-	.temp_sensor_ctrl = DRA752_TEMP_SENSOR_MPU_OFFSET,
-	.bgap_tempsoff_mask = DRA752_TEMP_SENSOR_TMPSOFF_MASK,
-	.bgap_eocz_mask = DRA752_TEMP_SENSOR_EOCZ_MASK,
-	.bgap_dtemp_mask = DRA752_TEMP_SENSOR_DTEMP_MASK,
-	.bgap_mask_ctrl = DRA752_BANDGAP_CTRL_1_OFFSET,
-	.mask_hot_mask = DRA752_BANDGAP_CTRL_1_MASK_HOT_MPU_MASK,
-	.mask_cold_mask = DRA752_BANDGAP_CTRL_1_MASK_COLD_MPU_MASK,
-	.mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
-	.mask_freeze_mask = DRA752_BANDGAP_CTRL_1_FREEZE_MPU_MASK,
-	.bgap_threshold = DRA752_BANDGAP_THRESHOLD_MPU_OFFSET,
-	.bgap_status = DRA752_BANDGAP_STATUS_1_OFFSET,
-	.status_hot_mask = DRA752_BANDGAP_STATUS_1_HOT_MPU_MASK,
-	.status_cold_mask = DRA752_BANDGAP_STATUS_1_COLD_MPU_MASK,
-	.ctrl_dtemp_1 = DRA752_DTEMP_MPU_1_OFFSET,
-	.ctrl_dtemp_2 = DRA752_DTEMP_MPU_2_OFFSET,
-	.bgap_efuse = DRA752_STD_FUSE_OPP_BGAP_MPU_OFFSET,
+	.temp_sensor_ctrl = OMAP5430_TEMP_SENSOR_MPU_OFFSET,
+	.bgap_tempsoff_mask = OMAP5430_BGAP_TEMPSOFF_MASK,
+	.bgap_eocz_mask = OMAP5430_BGAP_TEMP_SENSOR_EOCZ_MASK,
+	.bgap_dtemp_mask = OMAP5430_BGAP_TEMP_SENSOR_DTEMP_MASK,
+	.bgap_mask_ctrl = OMAP5430_BGAP_CTRL_OFFSET,
+	.mask_hot_mask = OMAP5430_MASK_HOT_MPU_MASK,
+	.mask_cold_mask = OMAP5430_MASK_COLD_MPU_MASK,
+	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
+	.mask_freeze_mask = OMAP5430_MASK_FREEZE_MPU_MASK,
+	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_MPU_OFFSET,
+	.bgap_status = OMAP5430_BGAP_STATUS_OFFSET,
+	.status_hot_mask = OMAP5430_HOT_MPU_FLAG_MASK,
+	.status_cold_mask = OMAP5430_COLD_MPU_FLAG_MASK,
+	.ctrl_dtemp_1 = OMAP5430_BGAP_DTEMP_MPU_1_OFFSET,
+	.ctrl_dtemp_2 = OMAP5430_BGAP_DTEMP_MPU_2_OFFSET,
+	.bgap_efuse = OMAP5430_FUSE_OPP_BGAP_MPU,
 };
 
 /*
@@ -104,13 +105,13 @@
 static struct temp_sensor_registers
 dra752_dspeve_temp_sensor_registers = {
 	.temp_sensor_ctrl = DRA752_TEMP_SENSOR_DSPEVE_OFFSET,
-	.bgap_tempsoff_mask = DRA752_TEMP_SENSOR_TMPSOFF_MASK,
-	.bgap_eocz_mask = DRA752_TEMP_SENSOR_EOCZ_MASK,
-	.bgap_dtemp_mask = DRA752_TEMP_SENSOR_DTEMP_MASK,
+	.bgap_tempsoff_mask = OMAP5430_BGAP_TEMPSOFF_MASK,
+	.bgap_eocz_mask = OMAP5430_BGAP_TEMP_SENSOR_EOCZ_MASK,
+	.bgap_dtemp_mask = OMAP5430_BGAP_TEMP_SENSOR_DTEMP_MASK,
 	.bgap_mask_ctrl = DRA752_BANDGAP_CTRL_2_OFFSET,
 	.mask_hot_mask = DRA752_BANDGAP_CTRL_2_MASK_HOT_DSPEVE_MASK,
 	.mask_cold_mask = DRA752_BANDGAP_CTRL_2_MASK_COLD_DSPEVE_MASK,
-	.mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
+	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
 	.mask_freeze_mask = DRA752_BANDGAP_CTRL_2_FREEZE_DSPEVE_MASK,
 	.bgap_threshold = DRA752_BANDGAP_THRESHOLD_DSPEVE_OFFSET,
 	.bgap_status = DRA752_BANDGAP_STATUS_2_OFFSET,
@@ -126,38 +127,38 @@
  */
 static struct temp_sensor_registers
 dra752_gpu_temp_sensor_registers = {
-	.temp_sensor_ctrl = DRA752_TEMP_SENSOR_GPU_OFFSET,
-	.bgap_tempsoff_mask = DRA752_TEMP_SENSOR_TMPSOFF_MASK,
-	.bgap_eocz_mask = DRA752_TEMP_SENSOR_EOCZ_MASK,
-	.bgap_dtemp_mask = DRA752_TEMP_SENSOR_DTEMP_MASK,
-	.bgap_mask_ctrl = DRA752_BANDGAP_CTRL_1_OFFSET,
-	.mask_hot_mask = DRA752_BANDGAP_CTRL_1_MASK_HOT_GPU_MASK,
-	.mask_cold_mask = DRA752_BANDGAP_CTRL_1_MASK_COLD_GPU_MASK,
-	.mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
-	.mask_freeze_mask = DRA752_BANDGAP_CTRL_1_FREEZE_GPU_MASK,
-	.bgap_threshold = DRA752_BANDGAP_THRESHOLD_GPU_OFFSET,
-	.bgap_status = DRA752_BANDGAP_STATUS_1_OFFSET,
-	.status_hot_mask = DRA752_BANDGAP_STATUS_1_HOT_GPU_MASK,
-	.status_cold_mask = DRA752_BANDGAP_STATUS_1_COLD_GPU_MASK,
-	.ctrl_dtemp_1 = DRA752_DTEMP_GPU_1_OFFSET,
-	.ctrl_dtemp_2 = DRA752_DTEMP_GPU_2_OFFSET,
-	.bgap_efuse = DRA752_STD_FUSE_OPP_BGAP_GPU_OFFSET,
+	.temp_sensor_ctrl = OMAP5430_TEMP_SENSOR_GPU_OFFSET,
+	.bgap_tempsoff_mask = OMAP5430_BGAP_TEMPSOFF_MASK,
+	.bgap_eocz_mask = OMAP5430_BGAP_TEMP_SENSOR_EOCZ_MASK,
+	.bgap_dtemp_mask = OMAP5430_BGAP_TEMP_SENSOR_DTEMP_MASK,
+	.bgap_mask_ctrl = OMAP5430_BGAP_CTRL_OFFSET,
+	.mask_hot_mask = OMAP5430_MASK_HOT_GPU_MASK,
+	.mask_cold_mask = OMAP5430_MASK_COLD_GPU_MASK,
+	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
+	.mask_freeze_mask = OMAP5430_MASK_FREEZE_GPU_MASK,
+	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_GPU_OFFSET,
+	.bgap_status = OMAP5430_BGAP_STATUS_OFFSET,
+	.status_hot_mask = OMAP5430_HOT_GPU_FLAG_MASK,
+	.status_cold_mask = OMAP5430_COLD_GPU_FLAG_MASK,
+	.ctrl_dtemp_1 = OMAP5430_BGAP_DTEMP_GPU_1_OFFSET,
+	.ctrl_dtemp_2 = OMAP5430_BGAP_DTEMP_GPU_2_OFFSET,
+	.bgap_efuse = OMAP5430_FUSE_OPP_BGAP_GPU,
 };
 
 /* Thresholds and limits for DRA752 temperature sensor */
 static struct temp_sensor_data dra752_temp_sensor_data = {
-	.t_hot = DRA752_T_HOT,
-	.t_cold = DRA752_T_COLD,
-	.min_freq = DRA752_MIN_FREQ,
-	.max_freq = DRA752_MAX_FREQ,
+	.t_hot = OMAP5430_T_HOT,
+	.t_cold = OMAP5430_T_COLD,
+	.min_freq = OMAP5430_MIN_FREQ,
+	.max_freq = OMAP5430_MAX_FREQ,
 };
 
 /*
  * DRA752 : Temperature values in milli degree celsius
  * ADC code values from 540 to 945
  */
-static
-int dra752_adc_to_temp[DRA752_ADC_END_VALUE - DRA752_ADC_START_VALUE + 1] = {
+static int
+dra752_adc_to_temp[OMAP5430_ADC_END_VALUE - OMAP5430_ADC_START_VALUE + 1] = {
 	/* Index 540 - 549 */
 	-40000, -40000, -40000, -40000, -39800, -39400, -39000, -38600, -38200,
 	-37800,
@@ -292,8 +293,8 @@
 	.fclock_name = "l3instr_ts_gclk_div",
 	.div_ck_name = "l3instr_ts_gclk_div",
 	.conv_table = dra752_adc_to_temp,
-	.adc_start_val = DRA752_ADC_START_VALUE,
-	.adc_end_val = DRA752_ADC_END_VALUE,
+	.adc_start_val = OMAP5430_ADC_START_VALUE,
+	.adc_end_val = OMAP5430_ADC_END_VALUE,
 	.sensors = {
 		{
 		.registers = &dra752_mpu_temp_sensor_registers,
-- 
1.9.1

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

* [PATCH 11/14] thermal: ti-soc-thermal: use OMAP5 register tables for DRA752
       [not found]   ` <CGME20180514114346epcas1p4a59f6760861791ae53eac48975c9172a@epcas1p4.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

OMAP5 register tables for MPU, GPU & CORE sensors are almost
identical to these for DRA752 (OMAP5 ones also set value for
.tshut_threshold but it is used only when TSHUT_CONFIG feature
is enabled and DRA752 doesn't enable it) so just use them also
for DRA752 instead of duplicating them.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/Makefile            |  2 +-
 drivers/thermal/ti-soc-thermal/dra752-bandgap.h    |  4 ++
 .../thermal/ti-soc-thermal/dra752-thermal-data.c   | 75 +---------------------
 .../thermal/ti-soc-thermal/omap5-thermal-data.c    |  8 ++-
 4 files changed, 13 insertions(+), 76 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/Makefile b/drivers/thermal/ti-soc-thermal/Makefile
index f180ebe..aa1c38d 100644
--- a/drivers/thermal/ti-soc-thermal/Makefile
+++ b/drivers/thermal/ti-soc-thermal/Makefile
@@ -2,7 +2,7 @@
 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_DRA752_THERMAL)	+= dra752-thermal-data.o omap5-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/dra752-bandgap.h b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
index b9d65b4..c39af38 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
@@ -84,4 +84,8 @@
 #define DRA752_BANDGAP_STATUS_2_HOT_DSPEVE_MASK			BIT(1)
 #define DRA752_BANDGAP_STATUS_2_COLD_DSPEVE_MASK		BIT(0)
 
+extern struct temp_sensor_registers omap5430_mpu_temp_sensor_registers;
+extern struct temp_sensor_registers omap5430_gpu_temp_sensor_registers;
+extern struct temp_sensor_registers omap5430_core_temp_sensor_registers;
+
 #endif /* __DRA752_BANDGAP_H */
diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
index de412a2..dcc0b10 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
@@ -31,29 +31,6 @@
  */
 
 /*
- * DRA752 CORE thermal sensor register offsets and bit-fields
- */
-static struct temp_sensor_registers
-dra752_core_temp_sensor_registers = {
-	.temp_sensor_ctrl = OMAP5430_TEMP_SENSOR_CORE_OFFSET,
-	.bgap_tempsoff_mask = OMAP5430_BGAP_TEMPSOFF_MASK,
-	.bgap_eocz_mask = OMAP5430_BGAP_TEMP_SENSOR_EOCZ_MASK,
-	.bgap_dtemp_mask = OMAP5430_BGAP_TEMP_SENSOR_DTEMP_MASK,
-	.bgap_mask_ctrl = OMAP5430_BGAP_CTRL_OFFSET,
-	.mask_hot_mask = OMAP5430_MASK_HOT_CORE_MASK,
-	.mask_cold_mask = OMAP5430_MASK_COLD_CORE_MASK,
-	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
-	.mask_freeze_mask = OMAP5430_MASK_FREEZE_CORE_MASK,
-	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_CORE_OFFSET,
-	.bgap_status = OMAP5430_BGAP_STATUS_OFFSET,
-	.status_hot_mask = OMAP5430_HOT_CORE_FLAG_MASK,
-	.status_cold_mask = OMAP5430_COLD_CORE_FLAG_MASK,
-	.ctrl_dtemp_1 = OMAP5430_BGAP_DTEMP_CORE_1_OFFSET,
-	.ctrl_dtemp_2 = OMAP5430_BGAP_DTEMP_CORE_2_OFFSET,
-	.bgap_efuse = OMAP5430_FUSE_OPP_BGAP_CORE,
-};
-
-/*
  * DRA752 IVA thermal sensor register offsets and bit-fields
  */
 static struct temp_sensor_registers
@@ -77,29 +54,6 @@
 };
 
 /*
- * DRA752 MPU thermal sensor register offsets and bit-fields
- */
-static struct temp_sensor_registers
-dra752_mpu_temp_sensor_registers = {
-	.temp_sensor_ctrl = OMAP5430_TEMP_SENSOR_MPU_OFFSET,
-	.bgap_tempsoff_mask = OMAP5430_BGAP_TEMPSOFF_MASK,
-	.bgap_eocz_mask = OMAP5430_BGAP_TEMP_SENSOR_EOCZ_MASK,
-	.bgap_dtemp_mask = OMAP5430_BGAP_TEMP_SENSOR_DTEMP_MASK,
-	.bgap_mask_ctrl = OMAP5430_BGAP_CTRL_OFFSET,
-	.mask_hot_mask = OMAP5430_MASK_HOT_MPU_MASK,
-	.mask_cold_mask = OMAP5430_MASK_COLD_MPU_MASK,
-	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
-	.mask_freeze_mask = OMAP5430_MASK_FREEZE_MPU_MASK,
-	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_MPU_OFFSET,
-	.bgap_status = OMAP5430_BGAP_STATUS_OFFSET,
-	.status_hot_mask = OMAP5430_HOT_MPU_FLAG_MASK,
-	.status_cold_mask = OMAP5430_COLD_MPU_FLAG_MASK,
-	.ctrl_dtemp_1 = OMAP5430_BGAP_DTEMP_MPU_1_OFFSET,
-	.ctrl_dtemp_2 = OMAP5430_BGAP_DTEMP_MPU_2_OFFSET,
-	.bgap_efuse = OMAP5430_FUSE_OPP_BGAP_MPU,
-};
-
-/*
  * DRA752 DSPEVE thermal sensor register offsets and bit-fields
  */
 static struct temp_sensor_registers
@@ -122,29 +76,6 @@
 	.bgap_efuse = DRA752_STD_FUSE_OPP_BGAP_DSPEVE_OFFSET,
 };
 
-/*
- * DRA752 GPU thermal sensor register offsets and bit-fields
- */
-static struct temp_sensor_registers
-dra752_gpu_temp_sensor_registers = {
-	.temp_sensor_ctrl = OMAP5430_TEMP_SENSOR_GPU_OFFSET,
-	.bgap_tempsoff_mask = OMAP5430_BGAP_TEMPSOFF_MASK,
-	.bgap_eocz_mask = OMAP5430_BGAP_TEMP_SENSOR_EOCZ_MASK,
-	.bgap_dtemp_mask = OMAP5430_BGAP_TEMP_SENSOR_DTEMP_MASK,
-	.bgap_mask_ctrl = OMAP5430_BGAP_CTRL_OFFSET,
-	.mask_hot_mask = OMAP5430_MASK_HOT_GPU_MASK,
-	.mask_cold_mask = OMAP5430_MASK_COLD_GPU_MASK,
-	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
-	.mask_freeze_mask = OMAP5430_MASK_FREEZE_GPU_MASK,
-	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_GPU_OFFSET,
-	.bgap_status = OMAP5430_BGAP_STATUS_OFFSET,
-	.status_hot_mask = OMAP5430_HOT_GPU_FLAG_MASK,
-	.status_cold_mask = OMAP5430_COLD_GPU_FLAG_MASK,
-	.ctrl_dtemp_1 = OMAP5430_BGAP_DTEMP_GPU_1_OFFSET,
-	.ctrl_dtemp_2 = OMAP5430_BGAP_DTEMP_GPU_2_OFFSET,
-	.bgap_efuse = OMAP5430_FUSE_OPP_BGAP_GPU,
-};
-
 /* Thresholds and limits for DRA752 temperature sensor */
 static struct temp_sensor_data dra752_temp_sensor_data = {
 	.t_hot = OMAP5430_T_HOT,
@@ -297,7 +228,7 @@
 	.adc_end_val = OMAP5430_ADC_END_VALUE,
 	.sensors = {
 		{
-		.registers = &dra752_mpu_temp_sensor_registers,
+		.registers = &omap5430_mpu_temp_sensor_registers,
 		.ts_data = &dra752_temp_sensor_data,
 		.domain = "cpu",
 		.register_cooling = ti_thermal_register_cpu_cooling,
@@ -306,14 +237,14 @@
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
 		{
-		.registers = &dra752_gpu_temp_sensor_registers,
+		.registers = &omap5430_gpu_temp_sensor_registers,
 		.ts_data = &dra752_temp_sensor_data,
 		.domain = "gpu",
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
 		.constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
 		},
 		{
-		.registers = &dra752_core_temp_sensor_registers,
+		.registers = &omap5430_core_temp_sensor_registers,
 		.ts_data = &dra752_temp_sensor_data,
 		.domain = "core",
 		.slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index defa714..fce6e30 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -28,7 +28,7 @@
 /*
  * OMAP5430 MPU thermal sensor register offset and bit-fields
  */
-static struct temp_sensor_registers
+struct temp_sensor_registers
 omap5430_mpu_temp_sensor_registers = {
 	.temp_sensor_ctrl = OMAP5430_TEMP_SENSOR_MPU_OFFSET,
 	.bgap_tempsoff_mask = OMAP5430_BGAP_TEMPSOFF_MASK,
@@ -57,7 +57,7 @@
 /*
  * OMAP5430 GPU thermal sensor register offset and bit-fields
  */
-static struct temp_sensor_registers
+struct temp_sensor_registers
 omap5430_gpu_temp_sensor_registers = {
 	.temp_sensor_ctrl = OMAP5430_TEMP_SENSOR_GPU_OFFSET,
 	.bgap_tempsoff_mask = OMAP5430_BGAP_TEMPSOFF_MASK,
@@ -87,7 +87,7 @@
 /*
  * OMAP5430 CORE thermal sensor register offset and bit-fields
  */
-static struct temp_sensor_registers
+struct temp_sensor_registers
 omap5430_core_temp_sensor_registers = {
 	.temp_sensor_ctrl = OMAP5430_TEMP_SENSOR_CORE_OFFSET,
 	.bgap_tempsoff_mask = OMAP5430_BGAP_TEMPSOFF_MASK,
@@ -114,6 +114,7 @@
 	.bgap_efuse = OMAP5430_FUSE_OPP_BGAP_CORE,
 };
 
+#ifdef CONFIG_OMAP5_THERMAL
 /* Thresholds and limits for OMAP5430 MPU/GPU/CORE temperature sensor */
 static struct temp_sensor_data omap5430_temp_sensor_data = {
 	.tshut_hot = OMAP5430_TSHUT_HOT,
@@ -266,3 +267,4 @@
 	},
 	.sensor_count = 3,
 };
+#endif /* CONFIG_OMAP5_THERMAL */
-- 
1.9.1

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

* [PATCH 12/14] thermal: ti-soc-thermal: add ->adc_to_mcelsius method
       [not found]   ` <CGME20180514114350epcas1p2d29cfa8de6b19096d91362c91feb2dc5@epcas1p2.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

* Add ->adc_to_mcelsius method to struct ti_bandgap_data and
  use it if present in ti_bandgap_adc_to_mcelsius().

* Implement ->adc_to_mcelsius for DRA752 and remove no longer
  needed dra752_adc_to_temp[].

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/dra752-bandgap.h    |   3 +
 .../thermal/ti-soc-thermal/dra752-thermal-data.c   | 157 ++++-----------------
 .../thermal/ti-soc-thermal/omap5-thermal-data.c    |   5 +-
 drivers/thermal/ti-soc-thermal/ti-bandgap.c        |   3 +
 drivers/thermal/ti-soc-thermal/ti-bandgap.h        |   2 +
 5 files changed, 38 insertions(+), 132 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/dra752-bandgap.h b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
index c39af38..8eb155a 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
@@ -88,4 +88,7 @@
 extern struct temp_sensor_registers omap5430_gpu_temp_sensor_registers;
 extern struct temp_sensor_registers omap5430_core_temp_sensor_registers;
 
+extern int
+omap5430_adc_to_temp[OMAP5430_ADC_END_VALUE - OMAP5430_ADC_START_VALUE + 1];
+
 #endif /* __DRA752_BANDGAP_H */
diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
index dcc0b10..87b4d97 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
@@ -84,135 +84,31 @@
 	.max_freq = OMAP5430_MAX_FREQ,
 };
 
-/*
- * DRA752 : Temperature values in milli degree celsius
- * ADC code values from 540 to 945
- */
-static int
-dra752_adc_to_temp[OMAP5430_ADC_END_VALUE - OMAP5430_ADC_START_VALUE + 1] = {
-	/* Index 540 - 549 */
-	-40000, -40000, -40000, -40000, -39800, -39400, -39000, -38600, -38200,
-	-37800,
-	/* Index 550 - 559 */
-	-37400, -37000, -36600, -36200, -35800, -35300, -34700, -34200, -33800,
-	-33400,
-	/* Index 560 - 569 */
-	-33000, -32600, -32200, -31800, -31400, -31000, -30600, -30200, -29800,
-	-29400,
-	/* Index 570 - 579 */
-	-29000, -28600, -28200, -27700, -27100, -26600, -26200, -25800, -25400,
-	-25000,
-	/* Index 580 - 589 */
-	-24600, -24200, -23800, -23400, -23000, -22600, -22200, -21800, -21400,
-	-21000,
-	/* Index 590 - 599 */
-	-20500, -19900, -19400, -19000, -18600, -18200, -17800, -17400, -17000,
-	-16600,
-	/* Index 600 - 609 */
-	-16200, -15800, -15400, -15000, -14600, -14200, -13800, -13400, -13000,
-	-12500,
-	/* Index 610 - 619 */
-	-11900, -11400, -11000, -10600, -10200, -9800, -9400, -9000, -8600,
-	-8200,
-	/* Index 620 - 629 */
-	-7800, -7400, -7000, -6600, -6200, -5800, -5400, -5000, -4500,
-	-3900,
-	/* Index 630 - 639 */
-	-3400, -3000, -2600, -2200, -1800, -1400, -1000, -600, -200,
-	200,
-	/* Index 640 - 649 */
-	600, 1000, 1400, 1800, 2200, 2600, 3000, 3400, 3900,
-	4500,
-	/* Index 650 - 659 */
-	5000, 5400, 5800, 6200, 6600, 7000, 7400, 7800, 8200,
-	8600,
-	/* Index 660 - 669 */
-	9000, 9400, 9800, 10200, 10600, 11000, 11400, 11800, 12200,
-	12700,
-	/* Index 670 - 679 */
-	13300, 13800, 14200, 14600, 15000, 15400, 15800, 16200, 16600,
-	17000,
-	/* Index 680 - 689 */
-	17400, 17800, 18200, 18600, 19000, 19400, 19800, 20200, 20600,
-	21000,
-	/* Index 690 - 699 */
-	21400, 21900, 22500, 23000, 23400, 23800, 24200, 24600, 25000,
-	25400,
-	/* Index 700 - 709 */
-	25800, 26200, 26600, 27000, 27400, 27800, 28200, 28600, 29000,
-	29400,
-	/* Index 710 - 719 */
-	29800, 30200, 30600, 31000, 31400, 31900, 32500, 33000, 33400,
-	33800,
-	/* Index 720 - 729 */
-	34200, 34600, 35000, 35400, 35800, 36200, 36600, 37000, 37400,
-	37800,
-	/* Index 730 - 739 */
-	38200, 38600, 39000, 39400, 39800, 40200, 40600, 41000, 41400,
-	41800,
-	/* Index 740 - 749 */
-	42200, 42600, 43100, 43700, 44200, 44600, 45000, 45400, 45800,
-	46200,
-	/* Index 750 - 759 */
-	46600, 47000, 47400, 47800, 48200, 48600, 49000, 49400, 49800,
-	50200,
-	/* Index 760 - 769 */
-	50600, 51000, 51400, 51800, 52200, 52600, 53000, 53400, 53800,
-	54200,
-	/* Index 770 - 779 */
-	54600, 55000, 55400, 55900, 56500, 57000, 57400, 57800, 58200,
-	58600,
-	/* Index 780 - 789 */
-	59000, 59400, 59800, 60200, 60600, 61000, 61400, 61800, 62200,
-	62600,
-	/* Index 790 - 799 */
-	63000, 63400, 63800, 64200, 64600, 65000, 65400, 65800, 66200,
-	66600,
-	/* Index 800 - 809 */
-	67000, 67400, 67800, 68200, 68600, 69000, 69400, 69800, 70200,
-	70600,
-	/* Index 810 - 819 */
-	71000, 71500, 72100, 72600, 73000, 73400, 73800, 74200, 74600,
-	75000,
-	/* Index 820 - 829 */
-	75400, 75800, 76200, 76600, 77000, 77400, 77800, 78200, 78600,
-	79000,
-	/* Index 830 - 839 */
-	79400, 79800, 80200, 80600, 81000, 81400, 81800, 82200, 82600,
-	83000,
-	/* Index 840 - 849 */
-	83400, 83800, 84200, 84600, 85000, 85400, 85800, 86200, 86600,
-	87000,
-	/* Index 850 - 859 */
-	87400, 87800, 88200, 88600, 89000, 89400, 89800, 90200, 90600,
-	91000,
-	/* Index 860 - 869 */
-	91400, 91800, 92200, 92600, 93000, 93400, 93800, 94200, 94600,
-	95000,
-	/* Index 870 - 879 */
-	95400, 95800, 96200, 96600, 97000, 97500, 98100, 98600, 99000,
-	99400,
-	/* Index 880 - 889 */
-	99800, 100200, 100600, 101000, 101400, 101800, 102200, 102600, 103000,
-	103400,
-	/* Index 890 - 899 */
-	103800, 104200, 104600, 105000, 105400, 105800, 106200, 106600, 107000,
-	107400,
-	/* Index 900 - 909 */
-	107800, 108200, 108600, 109000, 109400, 109800, 110200, 110600, 111000,
-	111400,
-	/* Index 910 - 919 */
-	111800, 112200, 112600, 113000, 113400, 113800, 114200, 114600, 115000,
-	115400,
-	/* Index 920 - 929 */
-	115800, 116200, 116600, 117000, 117400, 117800, 118200, 118600, 119000,
-	119400,
-	/* Index 930 - 939 */
-	119800, 120200, 120600, 121000, 121400, 121800, 122200, 122600, 123000,
-	123400,
-	/* Index 940 - 945 */
-	123800, 124200, 124600, 124900, 125000, 125000,
-};
+static int dra752_adc_to_mcelsius(struct ti_bandgap *bgp, int adc_val, int *t)
+{
+	const struct ti_bandgap_data *conf = bgp->conf;
+
+	/* look up for temperature in the table and return the temperature */
+	if (adc_val < conf->adc_start_val || adc_val > conf->adc_end_val)
+		return -ERANGE;
+
+	switch (adc_val) {
+	case 588:
+		*t = -21800;	/* -21600 */
+		break;
+	case 689:
+		*t = 21000;	/* 21100 */
+		break;
+	case 937:
+		*t = 122200;	/* 122400 */
+		break;
+	default:
+		*t = bgp->conf->conv_table[adc_val - conf->adc_start_val];
+		break;
+	}
+
+	return 0;
+}
 
 /* DRA752 data */
 const struct ti_bandgap_data dra752_data = {
@@ -223,9 +119,10 @@
 			TI_BANDGAP_FEATURE_ERRATA_814,
 	.fclock_name = "l3instr_ts_gclk_div",
 	.div_ck_name = "l3instr_ts_gclk_div",
-	.conv_table = dra752_adc_to_temp,
+	.conv_table = omap5430_adc_to_temp,
 	.adc_start_val = OMAP5430_ADC_START_VALUE,
 	.adc_end_val = OMAP5430_ADC_END_VALUE,
+	.adc_to_mcelsius = dra752_adc_to_mcelsius,
 	.sensors = {
 		{
 		.registers = &omap5430_mpu_temp_sensor_registers,
diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index fce6e30..63e95df 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -124,13 +124,13 @@ struct temp_sensor_registers
 	.min_freq = OMAP5430_MIN_FREQ,
 	.max_freq = OMAP5430_MAX_FREQ,
 };
+#endif /* CONFIG_OMAP5_THERMAL */
 
 /*
  * OMAP54xx ES2.0 : Temperature values in milli degree celsius
  * ADC code values from 540 to 945
  */
-static int
-omap5430_adc_to_temp[
+int omap5430_adc_to_temp[
 	OMAP5430_ADC_END_VALUE - OMAP5430_ADC_START_VALUE + 1] = {
 	/* Index 540 - 549 */
 	-40000, -40000, -40000, -40000, -39800, -39400, -39000, -38600, -38200,
@@ -230,6 +230,7 @@ struct temp_sensor_registers
 	123800, 124200, 124600, 124900, 125000, 125000,
 };
 
+#ifdef CONFIG_OMAP5_THERMAL
 /* OMAP54xx ES2.0 data */
 const struct ti_bandgap_data omap5430_data = {
 	.features = TI_BANDGAP_FEATURE_TSHUT_CONFIG |
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 4d45160..e483792 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -309,6 +309,9 @@ int ti_bandgap_adc_to_mcelsius(struct ti_bandgap *bgp, int adc_val, int *t)
 {
 	const struct ti_bandgap_data *conf = bgp->conf;
 
+	if (conf->adc_to_mcelsius)
+		return conf->adc_to_mcelsius(bgp, adc_val, t);
+
 	/* look up for temperature in the table and return the temperature */
 	if (adc_val < conf->adc_start_val || adc_val > conf->adc_end_val)
 		return -ERANGE;
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
index 4d5b54a..76c3361 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
@@ -330,6 +330,8 @@ struct ti_bandgap_data {
 	char				*div_ck_name;
 	int				sensor_count;
 
+	int (*adc_to_mcelsius)(struct ti_bandgap *bgp, int adc_val, int *t);
+
 	/* this needs to be at the end */
 	struct ti_temp_sensor		sensors[];
 };
-- 
1.9.1

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

* [PATCH 13/14] thermal: ti-soc-thermal: use short int for *_adc_to_temp[] conversion tables
       [not found]   ` <CGME20180514114355epcas2p4c24f87c5a76ff3d3e9ed319ddc2e78ad@epcas2p4.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

Switch *_adc_to_temp[] conversion tables to use short int (by
storing values / 100) and do the needed result multiplication
(by 100) in ti_bandgap_adc_to_mcelsius(). This saves space and
makes code cleaner.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/dra752-bandgap.h    |   2 +-
 .../thermal/ti-soc-thermal/dra752-thermal-data.c   |   2 +-
 .../thermal/ti-soc-thermal/omap3-thermal-data.c    |  64 ++++++------
 .../thermal/ti-soc-thermal/omap4-thermal-data.c    | 116 ++++++++++-----------
 .../thermal/ti-soc-thermal/omap5-thermal-data.c    |  98 ++++++++---------
 drivers/thermal/ti-soc-thermal/ti-bandgap.c        |   2 +-
 drivers/thermal/ti-soc-thermal/ti-bandgap.h        |   2 +-
 7 files changed, 136 insertions(+), 150 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/dra752-bandgap.h b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
index 8eb155a..8779607 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/dra752-bandgap.h
@@ -88,7 +88,7 @@
 extern struct temp_sensor_registers omap5430_gpu_temp_sensor_registers;
 extern struct temp_sensor_registers omap5430_core_temp_sensor_registers;
 
-extern int
+extern short
 omap5430_adc_to_temp[OMAP5430_ADC_END_VALUE - OMAP5430_ADC_START_VALUE + 1];
 
 #endif /* __DRA752_BANDGAP_H */
diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
index 87b4d97..1fde7c8 100644
--- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
@@ -103,7 +103,7 @@ static int dra752_adc_to_mcelsius(struct ti_bandgap *bgp, int adc_val, int *t)
 		*t = 122200;	/* 122400 */
 		break;
 	default:
-		*t = bgp->conf->conv_table[adc_val - conf->adc_start_val];
+		*t = bgp->conf->conv_table[adc_val - conf->adc_start_val] * 100;
 		break;
 	}
 
diff --git a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
index cc6498e..59af9f7 100644
--- a/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap3-thermal-data.c
@@ -53,23 +53,23 @@
 /*
  * Temperature values in milli degree celsius
  */
-static const int
+static const short
 omap34xx_adc_to_temp[128] = {
-	-40000, -40000, -40000, -40000, -40000, -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, 0000,
-	1000, 3000, 4000, 5000, 7000, 8000, 10000, 11000, 13000, 14000,
-	15000, 17000, 18000, 20000, 21000, 22000, 24000, 25000, 27000,
-	28000, 30000, 31000, 32000, 34000, 35000, 37000, 38000, 39000,
-	41000, 42000, 44000, 45000, 47000, 48000, 49000, 51000, 52000,
-	53000, 55000, 56000, 58000, 59000, 60000, 62000, 63000, 65000,
-	66000, 67000, 69000, 70000, 72000, 73000, 74000, 76000, 77000,
-	79000, 80000, 81000, 83000, 84000, 85000, 87000, 88000, 89000,
-	91000, 92000, 94000, 95000, 96000, 98000, 99000, 100000,
-	102000, 103000, 105000, 106000, 107000, 109000, 110000, 111000,
-	113000, 114000, 116000, 117000, 118000, 120000, 121000, 122000,
-	124000, 124000, 125000, 125000, 125000, 125000,	125000
+	-400, -400, -400, -400, -400, -390, -380, -360,
+	-340, -320, -310, -290, -280, -260, -250, -240,
+	-220, -210, -190, -180, -170, -150, -140, -120,
+	-110, -90, -80, -70, -50, -40, -20, -10, 00,
+	10, 30, 40, 50, 70, 80, 100, 110, 130, 140,
+	150, 170, 180, 200, 210, 220, 240, 250, 270,
+	280, 300, 310, 320, 340, 350, 370, 380, 390,
+	410, 420, 440, 450, 470, 480, 490, 510, 520,
+	530, 550, 560, 580, 590, 600, 620, 630, 650,
+	660, 670, 690, 700, 720, 730, 740, 760, 770,
+	790, 800, 810, 830, 840, 850, 870, 880, 890,
+	910, 920, 940, 950, 960, 980, 990, 1000,
+	1020, 1030, 1050, 1060, 1070, 1090, 1100, 1110,
+	1130, 1140, 1160, 1170, 1180, 1200, 1210, 1220,
+	1240, 1240, 1250, 1250, 1250, 1250, 1250
 };
 
 /* OMAP34XX data */
@@ -118,23 +118,23 @@
 /*
  * Temperature values in milli degree celsius
  */
-static const int
+static const short
 omap36xx_adc_to_temp[128] = {
-	-40000, -40000, -40000, -40000, -40000, -40000, -40000, -40000,
-	-40000, -40000, -40000,	-40000, -40000, -38000, -35000, -34000,
-	-32000, -30000, -28000, -26000, -24000, -22000,	-20000, -18500,
-	-17000, -15000, -13500, -12000, -10000, -8000, -6500, -5000, -3500,
-	-1500, 0, 2000, 3500, 5000, 6500, 8500, 10000, 12000, 13500,
-	15000, 17000, 19000, 21000, 23000, 25000, 27000, 28500, 30000,
-	32000, 33500, 35000, 37000, 38500, 40000, 42000, 43500, 45000,
-	47000, 48500, 50000, 52000, 53500, 55000, 57000, 58500, 60000,
-	62000, 64000, 66000, 68000, 70000, 71500, 73500, 75000, 77000,
-	78500, 80000, 82000, 83500, 85000, 87000, 88500, 90000, 92000,
-	93500, 95000, 97000, 98500, 100000, 102000, 103500, 105000, 107000,
-	109000, 111000, 113000, 115000, 117000, 118500, 120000, 122000,
-	123500, 125000, 125000, 125000, 125000, 125000, 125000, 125000,
-	125000, 125000, 125000, 125000, 125000, 125000, 125000, 125000,
-	125000, 125000, 125000, 125000, 125000, 125000,	125000
+	-400, -400, -400, -400, -400, -400, -400, -400,
+	-400, -400, -400, -400, -400, -380, -350, -340,
+	-320, -300, -280, -260, -240, -220, -200, -185,
+	-170, -150, -135, -120, -100, -80, -65, -50, -35,
+	-15, 0, 20, 35, 50, 65, 85, 100, 120, 135,
+	150, 170, 190, 210, 230, 250, 270, 285, 300,
+	320, 335, 350, 370, 385, 400, 420, 435, 450,
+	470, 485, 500, 520, 535, 550, 570, 585, 600,
+	620, 640, 660, 680, 700, 715, 735, 750, 770,
+	785, 800, 820, 835, 850, 870, 885, 900, 920,
+	935, 950, 970, 985, 1000, 1020, 1035, 1050, 1070,
+	1090, 1110, 1130, 1150, 1170, 1185, 1200, 1220,
+	1235, 1250, 1250, 1250, 1250, 1250, 1250, 1250,
+	1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250,
+	1250, 1250, 1250, 1250, 1250, 1250, 1250
 };
 
 /* OMAP36XX data */
diff --git a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
index 74d05cc..130c464 100644
--- a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
@@ -48,18 +48,18 @@
  * Temperature values in milli degree celsius
  * ADC code values from 0 to 127
  */
-static const int
+static const short
 omap4430_adc_to_temp[OMAP4430_ADC_END_VALUE - OMAP4430_ADC_START_VALUE + 1] = {
-	-38000, -35000, -34000, -32000, -30000, -28000, -26000, -24000, -22000,
-	-20000, -18000, -17000, -15000, -13000, -12000, -10000, -8000, -6000,
-	-5000, -3000, -1000, 0, 2000, 3000, 5000, 6000, 8000, 10000, 12000,
-	13000, 15000, 17000, 19000, 21000, 23000, 25000, 27000, 28000, 30000,
-	32000, 33000, 35000, 37000, 38000, 40000, 42000, 43000, 45000, 47000,
-	48000, 50000, 52000, 53000, 55000, 57000, 58000, 60000, 62000, 64000,
-	66000, 68000, 70000, 71000, 73000, 75000, 77000, 78000, 80000, 82000,
-	83000, 85000, 87000, 88000, 90000, 92000, 93000, 95000, 97000, 98000,
-	100000, 102000, 103000, 105000, 107000, 109000, 111000, 113000, 115000,
-	117000, 118000, 120000, 122000, 123000,
+	-380, -350, -340, -320, -300, -280, -260, -240, -220,
+	-200, -180, -170, -150, -130, -120, -100, -80, -60,
+	-50, -30, -10, 0, 20, 30, 50, 60, 80, 100, 120,
+	130, 150, 170, 190, 210, 230, 250, 270, 280, 300,
+	320, 330, 350, 370, 380, 400, 420, 430, 450, 470,
+	480, 500, 520, 530, 550, 570, 580, 600, 620, 640,
+	660, 680, 700, 710, 730, 750, 770, 780, 800, 820,
+	830, 850, 870, 880, 900, 920, 930, 950, 970, 980,
+	1000, 1020, 1030, 1050, 1070, 1090, 1110, 1130, 1150,
+	1170, 1180, 1200, 1220, 1230,
 };
 
 /* OMAP4430 data */
@@ -132,54 +132,54 @@
  * Temperature values in milli degree celsius
  * ADC code values from 530 to 932
  */
-static const int
+static const short
 omap4460_adc_to_temp[OMAP4460_ADC_END_VALUE - OMAP4460_ADC_START_VALUE + 1] = {
-	-40000, -40000, -40000, -40000, -39800, -39400, -39000, -38600, -38200,
-	-37800, -37300, -36800, -36400, -36000, -35600, -35200, -34800,
-	-34300, -33800, -33400, -33000, -32600, -32200, -31800, -31300,
-	-30800, -30400, -30000, -29600, -29200, -28700, -28200, -27800,
-	-27400, -27000, -26600, -26200, -25700, -25200, -24800, -24400,
-	-24000, -23600, -23200, -22700, -22200, -21800, -21400, -21000,
-	-20600, -20200, -19700, -19200, -18800, -18400, -18000, -17600,
-	-17200, -16700, -16200, -15800, -15400, -15000, -14600, -14200,
-	-13700, -13200, -12800, -12400, -12000, -11600, -11200, -10700,
-	-10200, -9800, -9400, -9000, -8600, -8200, -7700, -7200, -6800,
-	-6400, -6000, -5600, -5200, -4800, -4300, -3800, -3400, -3000,
-	-2600, -2200, -1800, -1300, -800, -400, 0, 400, 800, 1200, 1600,
-	2100, 2600, 3000, 3400, 3800, 4200, 4600, 5100, 5600, 6000, 6400,
-	6800, 7200, 7600, 8000, 8500, 9000, 9400, 9800, 10200, 10600, 11000,
-	11400, 11900, 12400, 12800, 13200, 13600, 14000, 14400, 14800,
-	15300, 15800, 16200, 16600, 17000, 17400, 17800, 18200, 18700,
-	19200, 19600, 20000, 20400, 20800, 21200, 21600, 22100, 22600,
-	23000, 23400, 23800, 24200, 24600, 25000, 25400, 25900, 26400,
-	26800, 27200, 27600, 28000, 28400, 28800, 29300, 29800, 30200,
-	30600, 31000, 31400, 31800, 32200, 32600, 33100, 33600, 34000,
-	34400, 34800, 35200, 35600, 36000, 36400, 36800, 37300, 37800,
-	38200, 38600, 39000, 39400, 39800, 40200, 40600, 41100, 41600,
-	42000, 42400, 42800, 43200, 43600, 44000, 44400, 44800, 45300,
-	45800, 46200, 46600, 47000, 47400, 47800, 48200, 48600, 49000,
-	49500, 50000, 50400, 50800, 51200, 51600, 52000, 52400, 52800,
-	53200, 53700, 54200, 54600, 55000, 55400, 55800, 56200, 56600,
-	57000, 57400, 57800, 58200, 58700, 59200, 59600, 60000, 60400,
-	60800, 61200, 61600, 62000, 62400, 62800, 63300, 63800, 64200,
-	64600, 65000, 65400, 65800, 66200, 66600, 67000, 67400, 67800,
-	68200, 68700, 69200, 69600, 70000, 70400, 70800, 71200, 71600,
-	72000, 72400, 72800, 73200, 73600, 74100, 74600, 75000, 75400,
-	75800, 76200, 76600, 77000, 77400, 77800, 78200, 78600, 79000,
-	79400, 79800, 80300, 80800, 81200, 81600, 82000, 82400, 82800,
-	83200, 83600, 84000, 84400, 84800, 85200, 85600, 86000, 86400,
-	86800, 87300, 87800, 88200, 88600, 89000, 89400, 89800, 90200,
-	90600, 91000, 91400, 91800, 92200, 92600, 93000, 93400, 93800,
-	94200, 94600, 95000, 95500, 96000, 96400, 96800, 97200, 97600,
-	98000, 98400, 98800, 99200, 99600, 100000, 100400, 100800, 101200,
-	101600, 102000, 102400, 102800, 103200, 103600, 104000, 104400,
-	104800, 105200, 105600, 106100, 106600, 107000, 107400, 107800,
-	108200, 108600, 109000, 109400, 109800, 110200, 110600, 111000,
-	111400, 111800, 112200, 112600, 113000, 113400, 113800, 114200,
-	114600, 115000, 115400, 115800, 116200, 116600, 117000, 117400,
-	117800, 118200, 118600, 119000, 119400, 119800, 120200, 120600,
-	121000, 121400, 121800, 122200, 122600, 123000, 123400, 123800, 124200,
-	124600, 124900, 125000, 125000, 125000, 125000
+	-400, -400, -400, -400, -398, -394, -390, -386, -382,
+	-378, -373, -368, -364, -360, -356, -352, -348,
+	-343, -338, -334, -330, -326, -322, -318, -313,
+	-308, -304, -300, -296, -292, -287, -282, -278,
+	-274, -270, -266, -262, -257, -252, -248, -244,
+	-240, -236, -232, -227, -222, -218, -214, -210,
+	-206, -202, -197, -192, -188, -184, -180, -176,
+	-172, -167, -162, -158, -154, -150, -146, -142,
+	-137, -132, -128, -124, -120, -116, -112, -107,
+	-102, -98, -94, -90, -86, -82, -77, -72, -68,
+	-64, -60, -56, -52, -48, -43, -38, -34, -30,
+	-26, -22, -18, -13, -8, -4, 0, 4, 8, 12, 16,
+	21, 26, 30, 34, 38, 42, 46, 51, 56, 60, 64,
+	68, 72, 76, 80, 85, 90, 94, 98, 102, 106, 110,
+	114, 119, 124, 128, 132, 136, 140, 144, 148,
+	153, 158, 162, 166, 170, 174, 178, 182, 187,
+	192, 196, 200, 204, 208, 212, 216, 221, 226,
+	230, 234, 238, 242, 246, 250, 254, 259, 264,
+	268, 272, 276, 280, 284, 288, 293, 298, 302,
+	306, 310, 314, 318, 322, 326, 331, 336, 340,
+	344, 348, 352, 356, 360, 364, 368, 373, 378,
+	382, 386, 390, 394, 398, 402, 406, 411, 416,
+	420, 424, 428, 432, 436, 440, 444, 448, 453,
+	458, 462, 466, 470, 474, 478, 482, 486, 490,
+	495, 500, 504, 508, 512, 516, 520, 524, 528,
+	532, 537, 542, 546, 550, 554, 558, 562, 566,
+	570, 574, 578, 582, 587, 592, 596, 600, 604,
+	608, 612, 616, 620, 624, 628, 633, 638, 642,
+	646, 650, 654, 658, 662, 666, 670, 674, 678,
+	682, 687, 692, 696, 700, 704, 708, 712, 716,
+	720, 724, 728, 732, 736, 741, 746, 750, 754,
+	758, 762, 766, 770, 774, 778, 782, 786, 790,
+	794, 798, 803, 808, 812, 816, 820, 824, 828,
+	832, 836, 840, 844, 848, 852, 856, 860, 864,
+	868, 873, 878, 882, 886, 890, 894, 898, 902,
+	906, 910, 914, 918, 922, 926, 930, 934, 938,
+	942, 946, 950, 955, 960, 964, 968, 972, 976,
+	980, 984, 988, 992, 996, 1000, 1004, 1008, 1012,
+	1016, 1020, 1024, 1028, 1032, 1036, 1040, 1044,
+	1048, 1052, 1056, 1061, 1066, 1070, 1074, 1078,
+	1082, 1086, 1090, 1094, 1098, 1102, 1106, 1110,
+	1114, 1118, 1122, 1126, 1130, 1134, 1138, 1142,
+	1146, 1150, 1154, 1158, 1162, 1166, 1170, 1174,
+	1178, 1182, 1186, 1190, 1194, 1198, 1202, 1206,
+	1210, 1214, 1218, 1222, 1226, 1230, 1234, 1238, 1242,
+	1246, 1249, 1250, 1250, 1250, 1250
 };
 
 /* OMAP4460 data */
diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index 63e95df..98b250a 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -130,104 +130,90 @@ struct temp_sensor_registers
  * OMAP54xx ES2.0 : Temperature values in milli degree celsius
  * ADC code values from 540 to 945
  */
-int omap5430_adc_to_temp[
+short omap5430_adc_to_temp[
 	OMAP5430_ADC_END_VALUE - OMAP5430_ADC_START_VALUE + 1] = {
 	/* Index 540 - 549 */
-	-40000, -40000, -40000, -40000, -39800, -39400, -39000, -38600, -38200,
-	-37800,
+	-400, -400, -400, -400, -398, -394, -390, -386, -382, -378,
 	/* Index 550 - 559 */
-	-37400, -37000, -36600, -36200, -35800, -35300, -34700, -34200, -33800,
-	-33400,
+	-374, -370, -366, -362, -358, -353, -347, -342, -338, -334,
 	/* Index 560 - 569 */
-	-33000, -32600, -32200, -31800, -31400, -31000, -30600, -30200, -29800,
-	-29400,
+	-330, -326, -322, -318, -314, -310, -306, -302, -298, -294,
 	/* Index 570 - 579 */
-	-29000, -28600, -28200, -27700, -27100, -26600, -26200, -25800, -25400,
-	-25000,
+	-290, -286, -282, -277, -271, -266, -262, -258, -254, -250,
 	/* Index 580 - 589 */
-	-24600, -24200, -23800, -23400, -23000, -22600, -22200, -21600, -21400,
-	-21000,
+	-246, -242, -238, -234, -230, -226, -222, -216, -214, -210,
 	/* Index 590 - 599 */
-	-20500, -19900, -19400, -19000, -18600, -18200, -17800, -17400, -17000,
-	-16600,
+	-205, -199, -194, -190, -186, -182, -178, -174, -170, -166,
 	/* Index 600 - 609 */
-	-16200, -15800, -15400, -15000, -14600, -14200, -13800,	-13400, -13000,
-	-12500,
+	-162, -158, -154, -150, -146, -142, -138, -134, -130, -125,
 	/* Index 610 - 619 */
-	-11900, -11400, -11000, -10600, -10200, -9800, -9400, -9000, -8600,
-	-8200,
+	-119, -114, -110, -106, -102, -98, -94, -90, -86, -82,
 	/* Index 620 - 629 */
-	-7800, -7400, -7000, -6600, -6200, -5800, -5400, -5000, -4500, -3900,
+	-78, -74, -70, -66, -62, -58, -54, -50, -45, -39,
 	/* Index 630 - 639 */
-	-3400, -3000, -2600, -2200, -1800, -1400, -1000, -600, -200, 200,
+	-34, -30, -26, -22, -18, -14, -10, -6, -2, 2,
 	/* Index 640 - 649 */
-	600, 1000, 1400, 1800, 2200, 2600, 3000, 3400, 3900, 4500,
+	6, 10, 14, 18, 22, 26, 30, 34, 39, 45,
 	/* Index 650 - 659 */
-	5000, 5400, 5800, 6200, 6600, 7000, 7400, 7800, 8200, 8600,
+	50, 54, 58, 62, 66, 70, 74, 78, 82, 86,
 	/* Index 660 - 669 */
-	9000, 9400, 9800, 10200, 10600, 11000, 11400, 11800, 12200, 12700,
+	90, 94, 98, 102, 106, 110, 114, 118, 122, 127,
 	/* Index 670 - 679 */
-	13300, 13800, 14200, 14600, 15000, 15400, 15800, 16200, 16600, 17000,
+	133, 138, 142, 146, 150, 154, 158, 162, 166, 170,
 	/* Index 680 - 689 */
-	17400, 17800, 18200, 18600, 19000, 19400, 19800, 20200, 20600, 21100,
+	174, 178, 182, 186, 190, 194, 198, 202, 206, 211,
 	/* Index 690 - 699 */
-	21400, 21900, 22500, 23000, 23400, 23800, 24200, 24600, 25000, 25400,
+	214, 219, 225, 230, 234, 238, 242, 246, 250, 254,
 	/* Index 700 - 709 */
-	25800, 26200, 26600, 27000, 27400, 27800, 28200, 28600, 29000, 29400,
+	258, 262, 266, 270, 274, 278, 282, 286, 290, 294,
 	/* Index 710 - 719 */
-	29800, 30200, 30600, 31000, 31400, 31900, 32500, 33000, 33400, 33800,
+	298, 302, 306, 310, 314, 319, 325, 330, 334, 338,
 	/* Index 720 - 729 */
-	34200, 34600, 35000, 35400, 35800, 36200, 36600, 37000, 37400, 37800,
+	342, 346, 350, 354, 358, 362, 366, 370, 374, 378,
 	/* Index 730 - 739 */
-	38200, 38600, 39000, 39400, 39800, 40200, 40600, 41000, 41400, 41800,
+	382, 386, 390, 394, 398, 402, 406, 410, 414, 418,
 	/* Index 740 - 749 */
-	42200, 42600, 43100, 43700, 44200, 44600, 45000, 45400, 45800, 46200,
+	422, 426, 431, 437, 442, 446, 450, 454, 458, 462,
 	/* Index 750 - 759 */
-	46600, 47000, 47400, 47800, 48200, 48600, 49000, 49400, 49800, 50200,
+	466, 470, 474, 478, 482, 486, 490, 494, 498, 502,
 	/* Index 760 - 769 */
-	50600, 51000, 51400, 51800, 52200, 52600, 53000, 53400, 53800, 54200,
+	506, 510, 514, 518, 522, 526, 530, 534, 538, 542,
 	/* Index 770 - 779 */
-	54600, 55000, 55400, 55900, 56500, 57000, 57400, 57800, 58200, 58600,
+	546, 550, 554, 559, 565, 570, 574, 578, 582, 586,
 	/* Index 780 - 789 */
-	59000, 59400, 59800, 60200, 60600, 61000, 61400, 61800, 62200, 62600,
+	590, 594, 598, 602, 606, 610, 614, 618, 622, 626,
 	/* Index 790 - 799 */
-	63000, 63400, 63800, 64200, 64600, 65000, 65400, 65800, 66200, 66600,
+	630, 634, 638, 642, 646, 650, 654, 658, 662, 666,
 	/* Index 800 - 809 */
-	67000, 67400, 67800, 68200, 68600, 69000, 69400, 69800, 70200, 70600,
+	670, 674, 678, 682, 686, 690, 694, 698, 702, 706,
 	/* Index 810 - 819 */
-	71000, 71500, 72100, 72600, 73000, 73400, 73800, 74200, 74600, 75000,
+	710, 715, 721, 726, 730, 734, 738, 742, 746, 750,
 	/* Index 820 - 829 */
-	75400, 75800, 76200, 76600, 77000, 77400, 77800, 78200, 78600, 79000,
+	754, 758, 762, 766, 770, 774, 778, 782, 786, 790,
 	/* Index 830 - 839 */
-	79400, 79800, 80200, 80600, 81000, 81400, 81800, 82200, 82600, 83000,
+	794, 798, 802, 806, 810, 814, 818, 822, 826, 830,
 	/* Index 840 - 849 */
-	83400, 83800, 84200, 84600, 85000, 85400, 85800, 86200, 86600, 87000,
+	834, 838, 842, 846, 850, 854, 858, 862, 866, 870,
 	/* Index 850 - 859 */
-	87400, 87800, 88200, 88600, 89000, 89400, 89800, 90200, 90600, 91000,
+	874, 878, 882, 886, 890, 894, 898, 902, 906, 910,
 	/* Index 860 - 869 */
-	91400, 91800, 92200, 92600, 93000, 93400, 93800, 94200, 94600, 95000,
+	914, 918, 922, 926, 930, 934, 938, 942, 946, 950,
 	/* Index 870 - 879 */
-	95400, 95800, 96200, 96600, 97000, 97500, 98100, 98600, 99000, 99400,
+	954, 958, 962, 966, 970, 975, 981, 986, 990, 994,
 	/* Index 880 - 889 */
-	99800, 100200, 100600, 101000, 101400, 101800, 102200, 102600, 103000,
-	103400,
+	998, 1002, 1006, 1010, 1014, 1018, 1022, 1026, 1030, 1034,
 	/* Index 890 - 899 */
-	103800, 104200, 104600, 105000, 105400, 105800, 106200, 106600, 107000,
-	107400,
+	1038, 1042, 1046, 1050, 1054, 1058, 1062, 1066, 1070, 1074,
 	/* Index 900 - 909 */
-	107800, 108200, 108600, 109000, 109400, 109800, 110200, 110600, 111000,
-	111400,
+	1078, 1082, 1086, 1090, 1094, 1098, 1102, 1106, 1110, 1114,
 	/* Index 910 - 919 */
-	111800, 112200, 112600, 113000, 113400, 113800, 114200, 114600, 115000,
-	115400,
+	1118, 1122, 1126, 1130, 1134, 1138, 1142, 1146, 1150, 1154,
 	/* Index 920 - 929 */
-	115800, 116200, 116600, 117000, 117400, 117800, 118200, 118600, 119000,
-	119400,
+	1158, 1162, 1166, 1170, 1174, 1178, 1182, 1186, 1190, 1194,
 	/* Index 930 - 939 */
-	119800, 120200, 120600, 121000, 121400, 121800, 122400, 122600, 123000,
-	123400,
+	1198, 1202, 1206, 1210, 1214, 1218, 1224, 1226, 1230, 1234,
 	/* Index 940 - 945 */
-	123800, 124200, 124600, 124900, 125000, 125000,
+	1238, 1242, 1246, 1249, 1250, 1250,
 };
 
 #ifdef CONFIG_OMAP5_THERMAL
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index e483792..6b5a45f 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -316,7 +316,7 @@ int ti_bandgap_adc_to_mcelsius(struct ti_bandgap *bgp, int adc_val, int *t)
 	if (adc_val < conf->adc_start_val || adc_val > conf->adc_end_val)
 		return -ERANGE;
 
-	*t = bgp->conf->conv_table[adc_val - conf->adc_start_val];
+	*t = bgp->conf->conv_table[adc_val - conf->adc_start_val] * 100;
 	return 0;
 }
 
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
index 76c3361..0a53458 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
@@ -323,7 +323,7 @@ struct ti_temp_sensor {
  */
 struct ti_bandgap_data {
 	unsigned int			features;
-	const int			*conv_table;
+	const short			*conv_table;
 	u32				adc_start_val;
 	u32				adc_end_val;
 	char				*fclock_name;
-- 
1.9.1

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

* [PATCH 14/14] thermal: ti-soc-thermal: remove SoC family config options
       [not found]   ` <CGME20180514114400epcas2p193e6f6643171575aab079329bed79c2c@epcas2p1.samsung.com>
@ 2018-05-14 11:42     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-14 11:42 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel, b.zolnierkie

Before latest changes:

$ size drivers/thermal/ti-soc-thermal/built-in.a
   text    data     bss     dec     hex filename
   9540     152       8    9700    25e4 drivers/thermal/ti-soc-thermal/ti-bandgap.o
   1604      48       8    1660     67c drivers/thermal/ti-soc-thermal/ti-thermal-common.o
    228    2264       0    2492     9bc drivers/thermal/ti-soc-thermal/dra752-thermal-data.o
   1172     256       0    1428     594 drivers/thermal/ti-soc-thermal/omap3-thermal-data.o
   2376     256       0    2632     a48 drivers/thermal/ti-soc-thermal/omap4-thermal-data.o
    160    2008       0    2168     878 drivers/thermal/ti-soc-thermal/omap5-thermal-data.o

After latest changes:

$ size drivers/thermal/ti-soc-thermal/built-in.a
   text    data     bss     dec     hex filename
   9532     152       8    9692    25dc drivers/thermal/ti-soc-thermal/ti-bandgap.o
   1604      48       8    1660     67c drivers/thermal/ti-soc-thermal/ti-thermal-common.o
    392     200       0     592     250 drivers/thermal/ti-soc-thermal/dra752-thermal-data.o
    152    1100       0    1252     4e4 drivers/thermal/ti-soc-thermal/omap5-thermal-data.o
    644     224       0     868     364 drivers/thermal/ti-soc-thermal/omap3-thermal-data.o
   1292     224       0    1516     5ec drivers/thermal/ti-soc-thermal/omap4-thermal-data.o

Maximum possible space savings (CONFIG_OMAP3_THERMAL=y with
other config options set to n) are down from ~7kB to ~3kB so
it is not really worth to have extra complexity and keep SoC
family config options. Just remove them.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/thermal/ti-soc-thermal/Kconfig             | 63 +++-------------------
 drivers/thermal/ti-soc-thermal/Makefile            |  8 +--
 .../thermal/ti-soc-thermal/omap5-thermal-data.c    |  4 --
 drivers/thermal/ti-soc-thermal/ti-bandgap.c        |  8 ---
 drivers/thermal/ti-soc-thermal/ti-bandgap.h        | 19 -------
 5 files changed, 12 insertions(+), 90 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/Kconfig b/drivers/thermal/ti-soc-thermal/Kconfig
index fe0e877..b16f239 100644
--- a/drivers/thermal/ti-soc-thermal/Kconfig
+++ b/drivers/thermal/ti-soc-thermal/Kconfig
@@ -2,8 +2,14 @@ config TI_SOC_THERMAL
 	tristate "Texas Instruments SoCs temperature sensor driver"
 	help
 	  If you say yes here you get support for the Texas Instruments
-	  OMAP4460+ on die bandgap temperature sensor support. The register
-	  set is part of system control module.
+	  on die bandgap temperature sensor support. The current chips
+	  supported are:
+	   - OMAP3430
+	   - OMAP4430
+	   - OMAP4460
+	   - OMAP4470
+	   - OMAP5430
+	   - DRA752
 
 	  This includes alert interrupts generation and also the TSHUT
 	  support.
@@ -17,56 +23,3 @@ 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
-	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:
-	   - OMAP4430
-	   - OMAP4460
-	   - OMAP4470
-
-	  This includes alert interrupts generation and also the TSHUT
-	  support.
-
-config OMAP5_THERMAL
-	bool "Texas Instruments OMAP5 thermal support"
-	depends on TI_SOC_THERMAL
-	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:
-	   - OMAP5430
-
-	  This includes alert interrupts generation and also the TSHUT
-	  support.
-
-config DRA752_THERMAL
-	bool "Texas Instruments DRA752 thermal support"
-	depends on TI_SOC_THERMAL
-	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:
-	   - DRA752
-
-	  This includes alert interrupts generation and also the TSHUT
-	  support.
diff --git a/drivers/thermal/ti-soc-thermal/Makefile b/drivers/thermal/ti-soc-thermal/Makefile
index aa1c38d..2986e1e 100644
--- a/drivers/thermal/ti-soc-thermal/Makefile
+++ b/drivers/thermal/ti-soc-thermal/Makefile
@@ -2,7 +2,7 @@
 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 omap5-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
+ti-soc-thermal-y			+= dra752-thermal-data.o
+ti-soc-thermal-y			+= omap3-thermal-data.o
+ti-soc-thermal-y			+= omap4-thermal-data.o
+ti-soc-thermal-y			+= omap5-thermal-data.o
diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
index 98b250a..fd344f6 100644
--- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
+++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
@@ -114,7 +114,6 @@ struct temp_sensor_registers
 	.bgap_efuse = OMAP5430_FUSE_OPP_BGAP_CORE,
 };
 
-#ifdef CONFIG_OMAP5_THERMAL
 /* Thresholds and limits for OMAP5430 MPU/GPU/CORE temperature sensor */
 static struct temp_sensor_data omap5430_temp_sensor_data = {
 	.tshut_hot = OMAP5430_TSHUT_HOT,
@@ -124,7 +123,6 @@ struct temp_sensor_registers
 	.min_freq = OMAP5430_MIN_FREQ,
 	.max_freq = OMAP5430_MAX_FREQ,
 };
-#endif /* CONFIG_OMAP5_THERMAL */
 
 /*
  * OMAP54xx ES2.0 : Temperature values in milli degree celsius
@@ -216,7 +214,6 @@ struct temp_sensor_registers
 	1238, 1242, 1246, 1249, 1250, 1250,
 };
 
-#ifdef CONFIG_OMAP5_THERMAL
 /* OMAP54xx ES2.0 data */
 const struct ti_bandgap_data omap5430_data = {
 	.features = TI_BANDGAP_FEATURE_TSHUT_CONFIG |
@@ -254,4 +251,3 @@ struct temp_sensor_registers
 	},
 	.sensor_count = 3,
 };
-#endif /* CONFIG_OMAP5_THERMAL */
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 6b5a45f..3bba232 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -1219,7 +1219,6 @@ 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",
 		.data = (void *)&omap34xx_data,
@@ -1228,8 +1227,6 @@ static SIMPLE_DEV_PM_OPS(ti_bandgap_dev_pm_ops, ti_bandgap_suspend,
 		.compatible = "ti,omap36xx-bandgap",
 		.data = (void *)&omap36xx_data,
 	},
-#endif
-#ifdef CONFIG_OMAP4_THERMAL
 	{
 		.compatible = "ti,omap4430-bandgap",
 		.data = (void *)&omap4430_data,
@@ -1242,19 +1239,14 @@ static SIMPLE_DEV_PM_OPS(ti_bandgap_dev_pm_ops, ti_bandgap_suspend,
 		.compatible = "ti,omap4470-bandgap",
 		.data = (void *)&omap4470_data,
 	},
-#endif
-#ifdef CONFIG_OMAP5_THERMAL
 	{
 		.compatible = "ti,omap5430-bandgap",
 		.data = (void *)&omap5430_data,
 	},
-#endif
-#ifdef CONFIG_DRA752_THERMAL
 	{
 		.compatible = "ti,dra752-bandgap",
 		.data = (void *)&dra752_data,
 	},
-#endif
 	/* Sentinel */
 	{ },
 };
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
index 0a53458..8e6d4cb 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
@@ -350,33 +350,14 @@ int ti_bandgap_read_temperature(struct ti_bandgap *bgp, int id,
 void *ti_bandgap_get_sensor_data(struct ti_bandgap *bgp, int id);
 int ti_bandgap_get_trend(struct ti_bandgap *bgp, int id, int *trend);
 
-#ifdef CONFIG_OMAP3_THERMAL
 extern const struct ti_bandgap_data omap34xx_data;
 extern const struct ti_bandgap_data omap36xx_data;
-#else
-#define omap34xx_data					NULL
-#define omap36xx_data					NULL
-#endif
 
-#ifdef CONFIG_OMAP4_THERMAL
 extern const struct ti_bandgap_data omap4430_data;
 extern const struct ti_bandgap_data omap4460_data;
 extern const struct ti_bandgap_data omap4470_data;
-#else
-#define omap4430_data					NULL
-#define omap4460_data					NULL
-#define omap4470_data					NULL
-#endif
 
-#ifdef CONFIG_OMAP5_THERMAL
 extern const struct ti_bandgap_data omap5430_data;
-#else
-#define omap5430_data					NULL
-#endif
 
-#ifdef CONFIG_DRA752_THERMAL
 extern const struct ti_bandgap_data dra752_data;
-#else
-#define dra752_data					NULL
-#endif
 #endif
-- 
1.9.1

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

* Re: [PATCH 01/14] thermal: ti-soc-thermal: fix TALERT IRQ handling for DRA752
  2018-05-14 11:42     ` [PATCH 01/14] thermal: ti-soc-thermal: fix TALERT IRQ handling for DRA752 Bartlomiej Zolnierkiewicz
@ 2018-07-11  2:19         ` J, KEERTHY
  0 siblings, 0 replies; 28+ messages in thread
From: J, KEERTHY @ 2018-07-11  2:19 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Eduardo Valentin
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel



On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
> .report_temperature is not set in dra752_data which
> results in temperature updates not being propagated by
> ti_bandgap_talert_irq_handler() (it doesn't make much
> sense to handle TALERT IRQ without reporting temperature
> updates to the thermal core). Fix it.

ATM no one is using TALERT as the thermal software polls on the 
temperature. No real benefit from TALERT.

TALERT is set at different temperature and software polling thresholds 
come from Device tree and i believe its best for software to go by 
polling and then act on trip points.

> 
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
>   drivers/thermal/ti-soc-thermal/dra752-thermal-data.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
> index 33a3030..e8ab7e5 100644
> --- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
> +++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
> @@ -338,6 +338,7 @@
>   	.adc_end_val = DRA752_ADC_END_VALUE,
>   	.expose_sensor = ti_thermal_expose_sensor,
>   	.remove_sensor = ti_thermal_remove_sensor,
> +	.report_temperature = ti_thermal_report_sensor_temperature,
>   	.sensors = {
>   		{
>   		.registers = &dra752_mpu_temp_sensor_registers,
> 

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

* Re: [PATCH 01/14] thermal: ti-soc-thermal: fix TALERT IRQ handling for DRA752
@ 2018-07-11  2:19         ` J, KEERTHY
  0 siblings, 0 replies; 28+ messages in thread
From: J, KEERTHY @ 2018-07-11  2:19 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Eduardo Valentin
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel



On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
> .report_temperature is not set in dra752_data which
> results in temperature updates not being propagated by
> ti_bandgap_talert_irq_handler() (it doesn't make much
> sense to handle TALERT IRQ without reporting temperature
> updates to the thermal core). Fix it.

ATM no one is using TALERT as the thermal software polls on the 
temperature. No real benefit from TALERT.

TALERT is set at different temperature and software polling thresholds 
come from Device tree and i believe its best for software to go by 
polling and then act on trip points.

> 
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
>   drivers/thermal/ti-soc-thermal/dra752-thermal-data.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
> index 33a3030..e8ab7e5 100644
> --- a/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
> +++ b/drivers/thermal/ti-soc-thermal/dra752-thermal-data.c
> @@ -338,6 +338,7 @@
>   	.adc_end_val = DRA752_ADC_END_VALUE,
>   	.expose_sensor = ti_thermal_expose_sensor,
>   	.remove_sensor = ti_thermal_remove_sensor,
> +	.report_temperature = ti_thermal_report_sensor_temperature,
>   	.sensors = {
>   		{
>   		.registers = &dra752_mpu_temp_sensor_registers,
> 

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

* Re: [PATCH 02/14] thermal: ti-soc-thermal: fix comment in omap5xxx-bandgap.h
  2018-05-14 11:42     ` [PATCH 02/14] thermal: ti-soc-thermal: fix comment in omap5xxx-bandgap.h Bartlomiej Zolnierkiewicz
@ 2018-07-11  2:21         ` J, KEERTHY
  0 siblings, 0 replies; 28+ messages in thread
From: J, KEERTHY @ 2018-07-11  2:21 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Eduardo Valentin
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel



On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
> The comment for OMAP5430.CORE register offsets is incorrect. Fix it.

Acked-by: Keerthy <j-keerthy@ti.com>

> 
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
>   drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> index 9096403..dcbf903 100644
> --- a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> +++ b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> @@ -55,7 +55,7 @@
>   #define OMAP5430_BGAP_DTEMP_MPU_1_OFFSET		0x1E4
>   #define OMAP5430_BGAP_DTEMP_MPU_2_OFFSET		0x1E8
>   
> -/* OMAP5430.MPU register offsets */
> +/* OMAP5430.CORE register offsets */
>   #define OMAP5430_FUSE_OPP_BGAP_CORE			0x8
>   #define OMAP5430_TEMP_SENSOR_CORE_OFFSET		0x154
>   #define OMAP5430_BGAP_THRESHOLD_CORE_OFFSET		0x1AC
> 

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

* Re: [PATCH 02/14] thermal: ti-soc-thermal: fix comment in omap5xxx-bandgap.h
@ 2018-07-11  2:21         ` J, KEERTHY
  0 siblings, 0 replies; 28+ messages in thread
From: J, KEERTHY @ 2018-07-11  2:21 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Eduardo Valentin
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel



On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
> The comment for OMAP5430.CORE register offsets is incorrect. Fix it.

Acked-by: Keerthy <j-keerthy@ti.com>

> 
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
>   drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> index 9096403..dcbf903 100644
> --- a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> +++ b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> @@ -55,7 +55,7 @@
>   #define OMAP5430_BGAP_DTEMP_MPU_1_OFFSET		0x1E4
>   #define OMAP5430_BGAP_DTEMP_MPU_2_OFFSET		0x1E8
>   
> -/* OMAP5430.MPU register offsets */
> +/* OMAP5430.CORE register offsets */
>   #define OMAP5430_FUSE_OPP_BGAP_CORE			0x8
>   #define OMAP5430_TEMP_SENSOR_CORE_OFFSET		0x154
>   #define OMAP5430_BGAP_THRESHOLD_CORE_OFFSET		0x1AC
> 

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

* Re: [PATCH 03/14] thermal: ti-soc-thermal: fix comments in omap4-thermal-data.c
  2018-05-14 11:42     ` [PATCH 03/14] thermal: ti-soc-thermal: fix comments in omap4-thermal-data.c Bartlomiej Zolnierkiewicz
@ 2018-07-11  2:27         ` J, KEERTHY
  0 siblings, 0 replies; 28+ messages in thread
From: J, KEERTHY @ 2018-07-11  2:27 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Eduardo Valentin
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel



On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
> The comments about ADC code values are incorrect. Fix them.

Acked-by: Keerthy <j-keerthy@ti.com>

> 
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
>   drivers/thermal/ti-soc-thermal/omap4-thermal-data.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
> index c12211e..85ba9dc 100644
> --- a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
> +++ b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
> @@ -46,7 +46,7 @@
>   
>   /*
>    * Temperature values in milli degree celsius
> - * ADC code values from 530 to 923
> + * ADC code values from 0 to 127
>    */
>   static const int
>   omap4430_adc_to_temp[OMAP4430_ADC_END_VALUE - OMAP4430_ADC_START_VALUE + 1] = {
> @@ -136,7 +136,7 @@
>   
>   /*
>    * Temperature values in milli degree celsius
> - * ADC code values from 530 to 923
> + * ADC code values from 530 to 932
>    */
>   static const int
>   omap4460_adc_to_temp[OMAP4460_ADC_END_VALUE - OMAP4460_ADC_START_VALUE + 1] = {
> 

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

* Re: [PATCH 03/14] thermal: ti-soc-thermal: fix comments in omap4-thermal-data.c
@ 2018-07-11  2:27         ` J, KEERTHY
  0 siblings, 0 replies; 28+ messages in thread
From: J, KEERTHY @ 2018-07-11  2:27 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Eduardo Valentin
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel



On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
> The comments about ADC code values are incorrect. Fix them.

Acked-by: Keerthy <j-keerthy@ti.com>

> 
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
>   drivers/thermal/ti-soc-thermal/omap4-thermal-data.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
> index c12211e..85ba9dc 100644
> --- a/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
> +++ b/drivers/thermal/ti-soc-thermal/omap4-thermal-data.c
> @@ -46,7 +46,7 @@
>   
>   /*
>    * Temperature values in milli degree celsius
> - * ADC code values from 530 to 923
> + * ADC code values from 0 to 127
>    */
>   static const int
>   omap4430_adc_to_temp[OMAP4430_ADC_END_VALUE - OMAP4430_ADC_START_VALUE + 1] = {
> @@ -136,7 +136,7 @@
>   
>   /*
>    * Temperature values in milli degree celsius
> - * ADC code values from 530 to 923
> + * ADC code values from 530 to 932
>    */
>   static const int
>   omap4460_adc_to_temp[OMAP4460_ADC_END_VALUE - OMAP4460_ADC_START_VALUE + 1] = {
> 

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

* Re: [PATCH 04/14] thermal: ti-soc-thermal: cleanup COUNTER feature handling for OMAP5
  2018-05-14 11:42     ` [PATCH 04/14] thermal: ti-soc-thermal: cleanup COUNTER feature handling for OMAP5 Bartlomiej Zolnierkiewicz
@ 2018-07-11  3:38         ` J, KEERTHY
  0 siblings, 0 replies; 28+ messages in thread
From: J, KEERTHY @ 2018-07-11  3:38 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Eduardo Valentin
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel



On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
> OMAP5 sensors don't claim COUNTER feature support (they use
> COUNTER_DELAY feature instead) so there is no need to set fields
> of struct temp_sensor_registers which are only used for COUNTER
> feature.
> 
> There should be no functional changes caused by this patch.

Acked-by: Keerthy <j-keerthy@ti.com>

> 
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
>   drivers/thermal/ti-soc-thermal/omap5-thermal-data.c | 9 ---------
>   drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h   | 3 ---
>   2 files changed, 12 deletions(-)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
> index 8191bae..e384be1 100644
> --- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
> +++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
> @@ -41,9 +41,6 @@
>   	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
>   	.mask_freeze_mask = OMAP5430_MASK_FREEZE_MPU_MASK,
>   
> -	.bgap_counter = OMAP5430_BGAP_CTRL_OFFSET,
> -	.counter_mask = OMAP5430_COUNTER_MASK,
> -
>   	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_MPU_OFFSET,
>   	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
>   	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
> @@ -77,9 +74,6 @@
>   	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
>   	.mask_freeze_mask = OMAP5430_MASK_FREEZE_GPU_MASK,
>   
> -	.bgap_counter = OMAP5430_BGAP_CTRL_OFFSET,
> -	.counter_mask = OMAP5430_COUNTER_MASK,
> -
>   	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_GPU_OFFSET,
>   	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
>   	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
> @@ -114,9 +108,6 @@
>   	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
>   	.mask_freeze_mask = OMAP5430_MASK_FREEZE_CORE_MASK,
>   
> -	.bgap_counter = OMAP5430_BGAP_CTRL_OFFSET,
> -	.counter_mask = OMAP5430_COUNTER_MASK,
> -
>   	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_CORE_OFFSET,
>   	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
>   	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
> diff --git a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> index dcbf903..223c7a8 100644
> --- a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> +++ b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> @@ -93,9 +93,6 @@
>   #define OMAP5430_MASK_HOT_MPU_MASK			BIT(1)
>   #define OMAP5430_MASK_COLD_MPU_MASK			BIT(0)
>   
> -/* OMAP5430.BANDGAP_COUNTER */
> -#define OMAP5430_COUNTER_MASK				(0xffffff << 0)
> -
>   /* OMAP5430.BANDGAP_THRESHOLD */
>   #define OMAP5430_T_HOT_MASK				(0x3ff << 16)
>   #define OMAP5430_T_COLD_MASK				(0x3ff << 0)
> 

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

* Re: [PATCH 04/14] thermal: ti-soc-thermal: cleanup COUNTER feature handling for OMAP5
@ 2018-07-11  3:38         ` J, KEERTHY
  0 siblings, 0 replies; 28+ messages in thread
From: J, KEERTHY @ 2018-07-11  3:38 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Eduardo Valentin
  Cc: Zhang Rui, linux-pm, linux-omap, linux-kernel



On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
> OMAP5 sensors don't claim COUNTER feature support (they use
> COUNTER_DELAY feature instead) so there is no need to set fields
> of struct temp_sensor_registers which are only used for COUNTER
> feature.
> 
> There should be no functional changes caused by this patch.

Acked-by: Keerthy <j-keerthy@ti.com>

> 
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
>   drivers/thermal/ti-soc-thermal/omap5-thermal-data.c | 9 ---------
>   drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h   | 3 ---
>   2 files changed, 12 deletions(-)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
> index 8191bae..e384be1 100644
> --- a/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
> +++ b/drivers/thermal/ti-soc-thermal/omap5-thermal-data.c
> @@ -41,9 +41,6 @@
>   	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
>   	.mask_freeze_mask = OMAP5430_MASK_FREEZE_MPU_MASK,
>   
> -	.bgap_counter = OMAP5430_BGAP_CTRL_OFFSET,
> -	.counter_mask = OMAP5430_COUNTER_MASK,
> -
>   	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_MPU_OFFSET,
>   	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
>   	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
> @@ -77,9 +74,6 @@
>   	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
>   	.mask_freeze_mask = OMAP5430_MASK_FREEZE_GPU_MASK,
>   
> -	.bgap_counter = OMAP5430_BGAP_CTRL_OFFSET,
> -	.counter_mask = OMAP5430_COUNTER_MASK,
> -
>   	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_GPU_OFFSET,
>   	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
>   	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
> @@ -114,9 +108,6 @@
>   	.mask_counter_delay_mask = OMAP5430_MASK_COUNTER_DELAY_MASK,
>   	.mask_freeze_mask = OMAP5430_MASK_FREEZE_CORE_MASK,
>   
> -	.bgap_counter = OMAP5430_BGAP_CTRL_OFFSET,
> -	.counter_mask = OMAP5430_COUNTER_MASK,
> -
>   	.bgap_threshold = OMAP5430_BGAP_THRESHOLD_CORE_OFFSET,
>   	.threshold_thot_mask = OMAP5430_T_HOT_MASK,
>   	.threshold_tcold_mask = OMAP5430_T_COLD_MASK,
> diff --git a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> index dcbf903..223c7a8 100644
> --- a/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> +++ b/drivers/thermal/ti-soc-thermal/omap5xxx-bandgap.h
> @@ -93,9 +93,6 @@
>   #define OMAP5430_MASK_HOT_MPU_MASK			BIT(1)
>   #define OMAP5430_MASK_COLD_MPU_MASK			BIT(0)
>   
> -/* OMAP5430.BANDGAP_COUNTER */
> -#define OMAP5430_COUNTER_MASK				(0xffffff << 0)
> -
>   /* OMAP5430.BANDGAP_THRESHOLD */
>   #define OMAP5430_T_HOT_MASK				(0x3ff << 16)
>   #define OMAP5430_T_COLD_MASK				(0x3ff << 0)
> 

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

* Re: [PATCH 01/14] thermal: ti-soc-thermal: fix TALERT IRQ handling for DRA752
       [not found]         ` <CGME20180725142707eucas1p25bf4bc7b63babc0732db13ae9a79d983@eucas1p2.samsung.com>
@ 2018-07-25 14:27           ` Bartlomiej Zolnierkiewicz
  2018-07-27  4:43               ` Keerthy
  0 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-07-25 14:27 UTC (permalink / raw)
  To: J, KEERTHY
  Cc: Eduardo Valentin, Zhang Rui, linux-pm, linux-omap, linux-kernel

On Wednesday, July 11, 2018 07:49:41 AM J, KEERTHY wrote:
> 
> On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
> > .report_temperature is not set in dra752_data which
> > results in temperature updates not being propagated by
> > ti_bandgap_talert_irq_handler() (it doesn't make much
> > sense to handle TALERT IRQ without reporting temperature
> > updates to the thermal core). Fix it.
> 
> ATM no one is using TALERT as the thermal software polls on the 
> temperature. No real benefit from TALERT.
> 
> TALERT is set at different temperature and software polling thresholds 
> come from Device tree and i believe its best for software to go by 
> polling and then act on trip points.

Could you please explain what do you mean by "no one is using
TALERT"?

The code in ti_bandgap_probe() sets TALERT thresholds and requests
IRQ if the TI_BANDGAP_FEATURE_TALERT feature flag is set (and this
flag is set in omap4460_data, omap4470_data, omap5430_data and
dra752_data).

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


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

* Re: [PATCH 04/14] thermal: ti-soc-thermal: cleanup COUNTER feature handling for OMAP5
       [not found]         ` <CGME20180725142832eucas1p26a8b5a1226b1043d57332b70ba5caaa0@eucas1p2.samsung.com>
@ 2018-07-25 14:28           ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-07-25 14:28 UTC (permalink / raw)
  To: J, KEERTHY
  Cc: Eduardo Valentin, Zhang Rui, linux-pm, linux-omap, linux-kernel

On Wednesday, July 11, 2018 09:08:29 AM J, KEERTHY wrote:
> 
> On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
> > OMAP5 sensors don't claim COUNTER feature support (they use
> > COUNTER_DELAY feature instead) so there is no need to set fields
> > of struct temp_sensor_registers which are only used for COUNTER
> > feature.
> > 
> > There should be no functional changes caused by this patch.
> 
> Acked-by: Keerthy <j-keerthy@ti.com>

Thank you! Could you please also review/verify patches 5-14?

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


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

* Re: [PATCH 01/14] thermal: ti-soc-thermal: fix TALERT IRQ handling for DRA752
  2018-07-25 14:27           ` Bartlomiej Zolnierkiewicz
@ 2018-07-27  4:43               ` Keerthy
  0 siblings, 0 replies; 28+ messages in thread
From: Keerthy @ 2018-07-27  4:43 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Eduardo Valentin, Zhang Rui, linux-pm, linux-omap, linux-kernel



On Wednesday 25 July 2018 07:57 PM, Bartlomiej Zolnierkiewicz wrote:
> On Wednesday, July 11, 2018 07:49:41 AM J, KEERTHY wrote:
>>
>> On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
>>> .report_temperature is not set in dra752_data which
>>> results in temperature updates not being propagated by
>>> ti_bandgap_talert_irq_handler() (it doesn't make much
>>> sense to handle TALERT IRQ without reporting temperature
>>> updates to the thermal core). Fix it.
>>
>> ATM no one is using TALERT as the thermal software polls on the 
>> temperature. No real benefit from TALERT.
>>
>> TALERT is set at different temperature and software polling thresholds 
>> come from Device tree and i believe its best for software to go by 
>> polling and then act on trip points.
> 
> Could you please explain what do you mean by "no one is using
> TALERT"?
> 
> The code in ti_bandgap_probe() sets TALERT thresholds and requests
> IRQ if the TI_BANDGAP_FEATURE_TALERT feature flag is set (and this
> flag is set in omap4460_data, omap4470_data, omap5430_data and
> dra752_data).

The software thresholds and the polling takes care of reducing the
temperature. What i actually meant was we never relied on talert and the
polling takes care of keeping a check on the temperature.

Regards,
Keerthy

> 
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
> 

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

* Re: [PATCH 01/14] thermal: ti-soc-thermal: fix TALERT IRQ handling for DRA752
@ 2018-07-27  4:43               ` Keerthy
  0 siblings, 0 replies; 28+ messages in thread
From: Keerthy @ 2018-07-27  4:43 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Eduardo Valentin, Zhang Rui, linux-pm, linux-omap, linux-kernel



On Wednesday 25 July 2018 07:57 PM, Bartlomiej Zolnierkiewicz wrote:
> On Wednesday, July 11, 2018 07:49:41 AM J, KEERTHY wrote:
>>
>> On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
>>> .report_temperature is not set in dra752_data which
>>> results in temperature updates not being propagated by
>>> ti_bandgap_talert_irq_handler() (it doesn't make much
>>> sense to handle TALERT IRQ without reporting temperature
>>> updates to the thermal core). Fix it.
>>
>> ATM no one is using TALERT as the thermal software polls on the 
>> temperature. No real benefit from TALERT.
>>
>> TALERT is set at different temperature and software polling thresholds 
>> come from Device tree and i believe its best for software to go by 
>> polling and then act on trip points.
> 
> Could you please explain what do you mean by "no one is using
> TALERT"?
> 
> The code in ti_bandgap_probe() sets TALERT thresholds and requests
> IRQ if the TI_BANDGAP_FEATURE_TALERT feature flag is set (and this
> flag is set in omap4460_data, omap4470_data, omap5430_data and
> dra752_data).

The software thresholds and the polling takes care of reducing the
temperature. What i actually meant was we never relied on talert and the
polling takes care of keeping a check on the temperature.

Regards,
Keerthy

> 
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
> 

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

* Re: [PATCH 01/14] thermal: ti-soc-thermal: fix TALERT IRQ handling for DRA752
       [not found]               ` <CGME20180727143023eucas1p1adfe1860327829e7cf39bcdd3290d11c@eucas1p1.samsung.com>
@ 2018-07-27 14:30                 ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-07-27 14:30 UTC (permalink / raw)
  To: Keerthy; +Cc: Eduardo Valentin, Zhang Rui, linux-pm, linux-omap, linux-kernel

On Friday, July 27, 2018 10:13:51 AM Keerthy wrote:
> 
> On Wednesday 25 July 2018 07:57 PM, Bartlomiej Zolnierkiewicz wrote:
> > On Wednesday, July 11, 2018 07:49:41 AM J, KEERTHY wrote:
> >>
> >> On 5/14/2018 5:12 PM, Bartlomiej Zolnierkiewicz wrote:
> >>> .report_temperature is not set in dra752_data which
> >>> results in temperature updates not being propagated by
> >>> ti_bandgap_talert_irq_handler() (it doesn't make much
> >>> sense to handle TALERT IRQ without reporting temperature
> >>> updates to the thermal core). Fix it.
> >>
> >> ATM no one is using TALERT as the thermal software polls on the 
> >> temperature. No real benefit from TALERT.
> >>
> >> TALERT is set at different temperature and software polling thresholds 
> >> come from Device tree and i believe its best for software to go by 
> >> polling and then act on trip points.
> > 
> > Could you please explain what do you mean by "no one is using
> > TALERT"?
> > 
> > The code in ti_bandgap_probe() sets TALERT thresholds and requests
> > IRQ if the TI_BANDGAP_FEATURE_TALERT feature flag is set (and this
> > flag is set in omap4460_data, omap4470_data, omap5430_data and
> > dra752_data).
> 
> The software thresholds and the polling takes care of reducing the
> temperature. What i actually meant was we never relied on talert and the
> polling takes care of keeping a check on the temperature.

OK I see, maybe TALERT handling can be removed altogether?

If not can we make TALERT behavior on DRA752 consistent with other
chipsets supporting TALERT (this is useful for code unification
between OMAP5430 and DRA752)?

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


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

end of thread, other threads:[~2018-07-27 14:30 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20180514114255epcas1p438ea8d32c2b7fd40b86afb25c9c8f2cf@epcas1p4.samsung.com>
2018-05-14 11:42 ` [PATCH 00/14] thermal: ti-soc-thermal: simplify the driver a bit Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114302epcas1p1890ad3296302900a736262b5d67aa10e@epcas1p1.samsung.com>
2018-05-14 11:42     ` [PATCH 01/14] thermal: ti-soc-thermal: fix TALERT IRQ handling for DRA752 Bartlomiej Zolnierkiewicz
2018-07-11  2:19       ` J, KEERTHY
2018-07-11  2:19         ` J, KEERTHY
     [not found]         ` <CGME20180725142707eucas1p25bf4bc7b63babc0732db13ae9a79d983@eucas1p2.samsung.com>
2018-07-25 14:27           ` Bartlomiej Zolnierkiewicz
2018-07-27  4:43             ` Keerthy
2018-07-27  4:43               ` Keerthy
     [not found]               ` <CGME20180727143023eucas1p1adfe1860327829e7cf39bcdd3290d11c@eucas1p1.samsung.com>
2018-07-27 14:30                 ` Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114308epcas2p3bba580c5500889f22d50549994b227db@epcas2p3.samsung.com>
2018-05-14 11:42     ` [PATCH 02/14] thermal: ti-soc-thermal: fix comment in omap5xxx-bandgap.h Bartlomiej Zolnierkiewicz
2018-07-11  2:21       ` J, KEERTHY
2018-07-11  2:21         ` J, KEERTHY
     [not found]   ` <CGME20180514114312epcas1p19fffd35baae3018f47df0fe31ca1b1b0@epcas1p1.samsung.com>
2018-05-14 11:42     ` [PATCH 03/14] thermal: ti-soc-thermal: fix comments in omap4-thermal-data.c Bartlomiej Zolnierkiewicz
2018-07-11  2:27       ` J, KEERTHY
2018-07-11  2:27         ` J, KEERTHY
     [not found]   ` <CGME20180514114319epcas1p1921a83c1baaaf1e6f94283f462022dc5@epcas1p1.samsung.com>
2018-05-14 11:42     ` [PATCH 04/14] thermal: ti-soc-thermal: cleanup COUNTER feature handling for OMAP5 Bartlomiej Zolnierkiewicz
2018-07-11  3:38       ` J, KEERTHY
2018-07-11  3:38         ` J, KEERTHY
     [not found]         ` <CGME20180725142832eucas1p26a8b5a1226b1043d57332b70ba5caaa0@eucas1p2.samsung.com>
2018-07-25 14:28           ` Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114326epcas2p2e27987b5be7a1fe614114466c6cf30f8@epcas2p2.samsung.com>
2018-05-14 11:42     ` [PATCH 05/14] thermal: ti-soc-thermal: remove redundant methods from struct ti_bandgap_data Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114331epcas2p3d52dea1f2feda21ff2cce1548f3f5bd4@epcas2p3.samsung.com>
2018-05-14 11:42     ` [PATCH 06/14] thermal: ti-soc-thermal: remove ->threshold_[thot,tcold]_mask fields Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114334epcas1p4c1b268d8253cda369826e67b06b4c28b@epcas1p4.samsung.com>
2018-05-14 11:42     ` [PATCH 07/14] thermal: ti-soc-thermal: remove ->tshut_[hot,cold]_mask fields Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114337epcas1p1ba67790ed771ab09c0be25712c8b385f@epcas1p1.samsung.com>
2018-05-14 11:42     ` [PATCH 08/14] thermal: ti-soc-thermal: use common struct temp_sensor_data for OMAP5 Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114340epcas2p10a9a4aad3064ad752cd2bea456581a98@epcas2p1.samsung.com>
2018-05-14 11:42     ` [PATCH 09/14] thermal: ti-soc-thermal: use common struct temp_sensor_data for DRA752 Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114343epcas2p4280b4ff50611a223a1b3ae37dbe743ee@epcas2p4.samsung.com>
2018-05-14 11:42     ` [PATCH 10/14] thermal: ti-soc-thermal: use OMAP5 defines " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114346epcas1p4a59f6760861791ae53eac48975c9172a@epcas1p4.samsung.com>
2018-05-14 11:42     ` [PATCH 11/14] thermal: ti-soc-thermal: use OMAP5 register tables " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114350epcas1p2d29cfa8de6b19096d91362c91feb2dc5@epcas1p2.samsung.com>
2018-05-14 11:42     ` [PATCH 12/14] thermal: ti-soc-thermal: add ->adc_to_mcelsius method Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114355epcas2p4c24f87c5a76ff3d3e9ed319ddc2e78ad@epcas2p4.samsung.com>
2018-05-14 11:42     ` [PATCH 13/14] thermal: ti-soc-thermal: use short int for *_adc_to_temp[] conversion tables Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20180514114400epcas2p193e6f6643171575aab079329bed79c2c@epcas2p1.samsung.com>
2018-05-14 11:42     ` [PATCH 14/14] thermal: ti-soc-thermal: remove SoC family config options Bartlomiej Zolnierkiewicz

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.