linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv5 0/4] thermal: exynos: Add support for TRIMINFO feature of Exynos3250
@ 2014-08-26  1:31 Chanwoo Choi
  2014-08-26  1:31 ` [PATCHv5 1/4] thermal: samsung: Exynos5260 and Exynos5420 should not use TRIM_RELOAD flag Chanwoo Choi
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Chanwoo Choi @ 2014-08-26  1:31 UTC (permalink / raw)
  To: eduardo.valentin, amit.daniel, rui.zhang
  Cc: kgene.kim, ch.naveen, kyungmin.park, b.zolnierkie, linux-pm,
	linux-arm-kernel, linux-samsung-soc, linux-kernel, Chanwoo Choi

This patchset add the support of TRIMINFO_RELOAD feature for Exynos3250.
But Exynos3250 has two TRIMINFO_CTRL register instead other Exynos has only one
TRIMINFO_CTRL register. So, this patchset support the some Exynos SoC which
has more than one TRIMINF_CTRL.

Also, this patchset fix wrong value of TRIMINFO_RELOAD_SHIFT and remove
duplicate code when reading triminfo register of Exynos5440.

Changes from v4:
- Remove un-necessary triminfo_ctrl_{shift, mask} field
- Includes Bartlomiej's patch[1] that Exynos5260 / Exynos5420 should not use
TRIM_RELOAD flag
[2] https://lkml.org/lkml/2014/8/20/481

Changes from v3:
- Add reviewed message of Amit Daniel Kachhap <amit.daniel@samsung.com>
- Split RELOAD patch as two patch
- Fix 'TRIMINFO_RELOAD_SHIFT' value
- This series includes separate patch[1]
[1] https://lkml.org/lkml/2014/8/20/5
- Drop ACTIME bit setting because TRM includes not enough information of ACTIME bit.

Changes from v2:
- Fix build break because of missing 'or' operation.

Changes from v1:
- Add missing 'TMU_SUPPORT_TRIM_RELOAD' features

Bartlomiej Zolnierkiewicz (1):
  thermal: samsung: Exynos5260 and Exynos5420 should not use TRIM_RELOAD flag

Chanwoo Choi (3):
  thermal: exynos: Add support for many TRIMINFO_CTRL registers
  thermal: exynos: Add support for TRIM_RELOAD feature at Exynos3250
  thermal: exynos: Remove duplicate code when reading triminfo register of Exynos5440

 drivers/thermal/samsung/exynos_thermal_common.h |  1 +
 drivers/thermal/samsung/exynos_tmu.c            | 19 +++++++++++------
 drivers/thermal/samsung/exynos_tmu.h            |  9 ++++----
 drivers/thermal/samsung/exynos_tmu_data.c       | 28 ++++++++++++++-----------
 drivers/thermal/samsung/exynos_tmu_data.h       |  9 +++++---
 5 files changed, 40 insertions(+), 26 deletions(-)

-- 
1.8.0


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

* [PATCHv5 1/4] thermal: samsung: Exynos5260 and Exynos5420 should not use TRIM_RELOAD flag
  2014-08-26  1:31 [PATCHv5 0/4] thermal: exynos: Add support for TRIMINFO feature of Exynos3250 Chanwoo Choi
@ 2014-08-26  1:31 ` Chanwoo Choi
  2014-08-26  1:31 ` [PATCHv5 2/4] thermal: exynos: Add support for many TRIMINFO_CTRL registers Chanwoo Choi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Chanwoo Choi @ 2014-08-26  1:31 UTC (permalink / raw)
  To: eduardo.valentin, amit.daniel, rui.zhang
  Cc: kgene.kim, ch.naveen, kyungmin.park, b.zolnierkie, linux-pm,
	linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Eduardo Valentin, Chanwoo Choi

From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Currently these SoCs claim TRIM_RELOAD support but don't have
triminfo_ctrl register address defined in their struct
exynos_tmu_registers entries.  This causes incorrect write of
value "1" to data->base + 0x00 address (which happens to be
TRIMINFO register).  Additionally according to the documentation
that I have neither Exynos5260 nor Exynos5420 support/require
TRIM_RELOAD feature.  Thus fix the aforementioned issue by
removing TMU_SUPPORT_TRIM_RELOAD flag for both Exynos5260 and
Exynos5420.

Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/thermal/samsung/exynos_tmu_data.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index aa8e0de..8c0ada2 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -359,9 +359,8 @@ static const struct exynos_tmu_registers exynos5260_tmu_registers = {
 #define EXYNOS5260_TMU_DATA \
 	__EXYNOS5260_TMU_DATA \
 	.type = SOC_ARCH_EXYNOS5260, \
-	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
-			TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
-			TMU_SUPPORT_EMUL_TIME)
+	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \
+			TMU_SUPPORT_READY_STATUS | TMU_SUPPORT_EMUL_TIME)
 
 struct exynos_tmu_init_data const exynos5260_default_tmu_data = {
 	.tmu_data = {
@@ -451,16 +450,15 @@ static const struct exynos_tmu_registers exynos5420_tmu_registers = {
 #define EXYNOS5420_TMU_DATA \
 	__EXYNOS5420_TMU_DATA \
 	.type = SOC_ARCH_EXYNOS5250, \
-	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
-			TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
-			TMU_SUPPORT_EMUL_TIME)
+	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \
+			TMU_SUPPORT_READY_STATUS | TMU_SUPPORT_EMUL_TIME)
 
 #define EXYNOS5420_TMU_DATA_SHARED \
 	__EXYNOS5420_TMU_DATA \
 	.type = SOC_ARCH_EXYNOS5420_TRIMINFO, \
-	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
-			TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
-			TMU_SUPPORT_EMUL_TIME | TMU_SUPPORT_ADDRESS_MULTIPLE)
+	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \
+			TMU_SUPPORT_READY_STATUS | TMU_SUPPORT_EMUL_TIME | \
+			TMU_SUPPORT_ADDRESS_MULTIPLE)
 
 struct exynos_tmu_init_data const exynos5420_default_tmu_data = {
 	.tmu_data = {
-- 
1.8.0


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

* [PATCHv5 2/4] thermal: exynos: Add support for many TRIMINFO_CTRL registers
  2014-08-26  1:31 [PATCHv5 0/4] thermal: exynos: Add support for TRIMINFO feature of Exynos3250 Chanwoo Choi
  2014-08-26  1:31 ` [PATCHv5 1/4] thermal: samsung: Exynos5260 and Exynos5420 should not use TRIM_RELOAD flag Chanwoo Choi
@ 2014-08-26  1:31 ` Chanwoo Choi
  2014-08-26  1:31 ` [PATCHv5 3/4] thermal: exynos: Add support for TRIM_RELOAD feature at Exynos3250 Chanwoo Choi
  2014-08-26  1:31 ` [PATCHv5 4/4] thermal: exynos: Remove duplicate code when reading triminfo register of Exynos5440 Chanwoo Choi
  3 siblings, 0 replies; 10+ messages in thread
From: Chanwoo Choi @ 2014-08-26  1:31 UTC (permalink / raw)
  To: eduardo.valentin, amit.daniel, rui.zhang
  Cc: kgene.kim, ch.naveen, kyungmin.park, b.zolnierkie, linux-pm,
	linux-arm-kernel, linux-samsung-soc, linux-kernel, Chanwoo Choi,
	Eduardo Valentin

This patch support many TRIMINFO_CTRL registers if specific Exynos SoC
has one more TRIMINFO_CTRL registers. Also this patch uses proper 'RELOAD'
shift/mask bit operation to set RELOAD feature instead of static value.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
Reviewed-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
---
 drivers/thermal/samsung/exynos_thermal_common.h |  1 +
 drivers/thermal/samsung/exynos_tmu.c            | 15 ++++++++++++---
 drivers/thermal/samsung/exynos_tmu.h            |  9 ++++-----
 drivers/thermal/samsung/exynos_tmu_data.c       |  5 +++--
 drivers/thermal/samsung/exynos_tmu_data.h       |  2 +-
 5 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_thermal_common.h b/drivers/thermal/samsung/exynos_thermal_common.h
index 3eb2ed9..b211976 100644
--- a/drivers/thermal/samsung/exynos_thermal_common.h
+++ b/drivers/thermal/samsung/exynos_thermal_common.h
@@ -28,6 +28,7 @@
 #define MAX_TRIP_COUNT	8
 #define MAX_COOLING_DEVICE 4
 #define MAX_THRESHOLD_LEVS 5
+#define MAX_TRIMINFO_CTRL_REG	2
 
 #define ACTIVE_INTERVAL 500
 #define IDLE_INTERVAL 10000
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index acbff14..64c702a 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -147,7 +147,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
 	struct exynos_tmu_data *data = platform_get_drvdata(pdev);
 	struct exynos_tmu_platform_data *pdata = data->pdata;
 	const struct exynos_tmu_registers *reg = pdata->registers;
-	unsigned int status, trim_info = 0, con;
+	unsigned int status, trim_info = 0, con, ctrl;
 	unsigned int rising_threshold = 0, falling_threshold = 0;
 	int ret = 0, threshold_code, i, trigger_levs = 0;
 
@@ -164,8 +164,17 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
 		}
 	}
 
-	if (TMU_SUPPORTS(pdata, TRIM_RELOAD))
-		__raw_writel(1, data->base + reg->triminfo_ctrl);
+	if (TMU_SUPPORTS(pdata, TRIM_RELOAD)) {
+		for (i = 0; i < reg->triminfo_ctrl_count; i++) {
+			if (pdata->triminfo_reload[i]) {
+				ctrl = readl(data->base +
+						reg->triminfo_ctrl[i]);
+				ctrl |= pdata->triminfo_reload[i];
+				writel(ctrl, data->base +
+						reg->triminfo_ctrl[i]);
+			}
+		}
+	}
 
 	if (pdata->cal_mode == HW_MODE)
 		goto skip_calib_data;
diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
index 1b4a644..e051540 100644
--- a/drivers/thermal/samsung/exynos_tmu.h
+++ b/drivers/thermal/samsung/exynos_tmu.h
@@ -85,8 +85,7 @@ enum soc_type {
  * @triminfo_25_shift: shift bit of the 25 C trim value in triminfo_data reg.
  * @triminfo_85_shift: shift bit of the 85 C trim value in triminfo_data reg.
  * @triminfo_ctrl: trim info controller register.
- * @triminfo_reload_shift: shift of triminfo reload enable bit in triminfo_ctrl
-	reg.
+ * @triminfo_ctrl_count: the number of trim info controller register.
  * @tmu_ctrl: TMU main controller register.
  * @test_mux_addr_shift: shift bits of test mux address.
  * @buf_vref_sel_shift: shift bits of reference voltage in tmu_ctrl register.
@@ -151,9 +150,8 @@ struct exynos_tmu_registers {
 	u32	triminfo_25_shift;
 	u32	triminfo_85_shift;
 
-	u32	triminfo_ctrl;
-	u32	triminfo_ctrl1;
-	u32	triminfo_reload_shift;
+	u32	triminfo_ctrl[MAX_TRIMINFO_CTRL_REG];
+	u32	triminfo_ctrl_count;
 
 	u32	tmu_ctrl;
 	u32     test_mux_addr_shift;
@@ -295,6 +293,7 @@ struct exynos_tmu_platform_data {
 	u8 second_point_trim;
 	u8 default_temp_offset;
 	u8 test_mux;
+	u8 triminfo_reload[MAX_TRIMINFO_CTRL_REG];
 
 	enum calibration_type cal_type;
 	enum calibration_mode cal_mode;
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index 8c0ada2..0a13f2b 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -184,8 +184,8 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
 	.triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
 	.triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
 	.triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
-	.triminfo_ctrl = EXYNOS_TMU_TRIMINFO_CON,
-	.triminfo_reload_shift = EXYNOS_TRIMINFO_RELOAD_SHIFT,
+	.triminfo_ctrl[0] = EXYNOS_TMU_TRIMINFO_CON,
+	.triminfo_ctrl_count = 1,
 	.tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
 	.test_mux_addr_shift = EXYNOS4412_MUX_ADDR_SHIFT,
 	.buf_vref_sel_shift = EXYNOS_TMU_REF_VOLTAGE_SHIFT,
@@ -252,6 +252,7 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
 		.temp_level = 95, \
 	}, \
 	.freq_tab_count = 2, \
+	.triminfo_reload[0] = EXYNOS_TRIMINFO_RELOAD_ENABLE, \
 	.registers = &exynos4412_tmu_registers, \
 	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
 			TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
index f0979e5..05728f8 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.h
+++ b/drivers/thermal/samsung/exynos_tmu_data.h
@@ -63,7 +63,7 @@
 #define EXYNOS_THD_TEMP_FALL		0x54
 #define EXYNOS_EMUL_CON		0x80
 
-#define EXYNOS_TRIMINFO_RELOAD_SHIFT	1
+#define EXYNOS_TRIMINFO_RELOAD_ENABLE	1
 #define EXYNOS_TRIMINFO_25_SHIFT	0
 #define EXYNOS_TRIMINFO_85_SHIFT	8
 #define EXYNOS_TMU_RISE_INT_MASK	0x111
-- 
1.8.0


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

* [PATCHv5 3/4] thermal: exynos: Add support for TRIM_RELOAD feature at Exynos3250
  2014-08-26  1:31 [PATCHv5 0/4] thermal: exynos: Add support for TRIMINFO feature of Exynos3250 Chanwoo Choi
  2014-08-26  1:31 ` [PATCHv5 1/4] thermal: samsung: Exynos5260 and Exynos5420 should not use TRIM_RELOAD flag Chanwoo Choi
  2014-08-26  1:31 ` [PATCHv5 2/4] thermal: exynos: Add support for many TRIMINFO_CTRL registers Chanwoo Choi
@ 2014-08-26  1:31 ` Chanwoo Choi
  2014-08-26  1:31 ` [PATCHv5 4/4] thermal: exynos: Remove duplicate code when reading triminfo register of Exynos5440 Chanwoo Choi
  3 siblings, 0 replies; 10+ messages in thread
From: Chanwoo Choi @ 2014-08-26  1:31 UTC (permalink / raw)
  To: eduardo.valentin, amit.daniel, rui.zhang
  Cc: kgene.kim, ch.naveen, kyungmin.park, b.zolnierkie, linux-pm,
	linux-arm-kernel, linux-samsung-soc, linux-kernel, Chanwoo Choi,
	Eduardo Valentin

This patch add support for TRIM_RELOAD feature at Exynos3250. The TMu of
Exynos3250 has two TRIMINFO_CON register and must need to set RELOAD bit
before reading TRIMINFO register.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
Reviewed-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
---
 drivers/thermal/samsung/exynos_tmu_data.c | 9 +++++++--
 drivers/thermal/samsung/exynos_tmu_data.h | 7 +++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index 0a13f2b..8aeca00 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -95,6 +95,9 @@ static const struct exynos_tmu_registers exynos3250_tmu_registers = {
 	.triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
 	.triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
 	.triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
+	.triminfo_ctrl[0] = EXYNOS_TMU_TRIMINFO_CON1,
+	.triminfo_ctrl[1] = EXYNOS_TMU_TRIMINFO_CON2,
+	.triminfo_ctrl_count = 2,
 	.tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
 	.test_mux_addr_shift = EXYNOS4412_MUX_ADDR_SHIFT,
 	.buf_vref_sel_shift = EXYNOS_TMU_REF_VOLTAGE_SHIFT,
@@ -161,7 +164,9 @@ static const struct exynos_tmu_registers exynos3250_tmu_registers = {
 	}, \
 	.freq_tab_count = 2, \
 	.registers = &exynos3250_tmu_registers, \
-	.features = (TMU_SUPPORT_EMULATION | \
+	.triminfo_reload[0] = EXYNOS_TRIMINFO_RELOAD_ENABLE, \
+	.triminfo_reload[1] = EXYNOS_TRIMINFO_RELOAD_ENABLE, \
+	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
 			TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
 			TMU_SUPPORT_EMUL_TIME)
 #endif
@@ -184,7 +189,7 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
 	.triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
 	.triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
 	.triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
-	.triminfo_ctrl[0] = EXYNOS_TMU_TRIMINFO_CON,
+	.triminfo_ctrl[0] = EXYNOS_TMU_TRIMINFO_CON2,
 	.triminfo_ctrl_count = 1,
 	.tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
 	.test_mux_addr_shift = EXYNOS4412_MUX_ADDR_SHIFT,
diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
index 05728f8..95a4404 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.h
+++ b/drivers/thermal/samsung/exynos_tmu_data.h
@@ -57,8 +57,11 @@
 #define EXYNOS4210_TMU_TRIG_LEVEL_MASK	0x1111
 #define EXYNOS4210_TMU_INTCLEAR_VAL	0x1111
 
-/* Exynos5250 and Exynos4412 specific registers */
-#define EXYNOS_TMU_TRIMINFO_CON	0x14
+/*  Exynos3250 specific registers */
+#define EXYNOS_TMU_TRIMINFO_CON1	0x10
+
+/* Exynos5250 ,Exynos4412 and Exynos3250 specific registers */
+#define EXYNOS_TMU_TRIMINFO_CON2	0x14
 #define EXYNOS_THD_TEMP_RISE		0x50
 #define EXYNOS_THD_TEMP_FALL		0x54
 #define EXYNOS_EMUL_CON		0x80
-- 
1.8.0


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

* [PATCHv5 4/4] thermal: exynos: Remove duplicate code when reading triminfo register of Exynos5440
  2014-08-26  1:31 [PATCHv5 0/4] thermal: exynos: Add support for TRIMINFO feature of Exynos3250 Chanwoo Choi
                   ` (2 preceding siblings ...)
  2014-08-26  1:31 ` [PATCHv5 3/4] thermal: exynos: Add support for TRIM_RELOAD feature at Exynos3250 Chanwoo Choi
@ 2014-08-26  1:31 ` Chanwoo Choi
  2014-08-28  4:25   ` Chanwoo Choi
  3 siblings, 1 reply; 10+ messages in thread
From: Chanwoo Choi @ 2014-08-26  1:31 UTC (permalink / raw)
  To: eduardo.valentin, amit.daniel, rui.zhang
  Cc: kgene.kim, ch.naveen, kyungmin.park, b.zolnierkie, linux-pm,
	linux-arm-kernel, linux-samsung-soc, linux-kernel, Chanwoo Choi,
	Eduardo Valentin

This patch remove simply duplicate code when reading triminfo register of Exynos5440.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
Reviewed-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
---
 drivers/thermal/samsung/exynos_tmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 64c702a..5888467 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -187,15 +187,13 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
 		 */
 		switch (data->id) {
 		case 0:
+		case 2:
 			trim_info = readl(data->base +
 			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
 			break;
 		case 1:
 			trim_info = readl(data->base + reg->triminfo_data);
 			break;
-		case 2:
-			trim_info = readl(data->base -
-			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
 		}
 	} else {
 		/* On exynos5420 the triminfo register is in the shared space */
-- 
1.8.0


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

* Re: [PATCHv5 4/4] thermal: exynos: Remove duplicate code when reading triminfo register of Exynos5440
  2014-08-26  1:31 ` [PATCHv5 4/4] thermal: exynos: Remove duplicate code when reading triminfo register of Exynos5440 Chanwoo Choi
@ 2014-08-28  4:25   ` Chanwoo Choi
  2014-08-28 14:53     ` Eduardo Valentin
  0 siblings, 1 reply; 10+ messages in thread
From: Chanwoo Choi @ 2014-08-28  4:25 UTC (permalink / raw)
  To: Chanwoo Choi
  Cc: eduardo.valentin, amit.daniel, rui.zhang, kgene.kim, ch.naveen,
	kyungmin.park, b.zolnierkie, linux-pm, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, Eduardo Valentin

Dear Eduardo,

This patch is wrong. It is my mistake.

Please ignore only this patch because
the offset calculation of 'case 0' is different from 'case 2'.

Best Regards,
Chanwoo Choi

On 08/26/2014 10:31 AM, Chanwoo Choi wrote:
> This patch remove simply duplicate code when reading triminfo register of Exynos5440.
> 
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Eduardo Valentin <edubezval@gmail.com>
> Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
> Reviewed-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
> ---
>  drivers/thermal/samsung/exynos_tmu.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 64c702a..5888467 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -187,15 +187,13 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
>  		 */
>  		switch (data->id) {
>  		case 0:
> +		case 2:
>  			trim_info = readl(data->base +
>  			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
>  			break;
>  		case 1:
>  			trim_info = readl(data->base + reg->triminfo_data);
>  			break;
> -		case 2:
> -			trim_info = readl(data->base -
> -			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
>  		}
>  	} else {
>  		/* On exynos5420 the triminfo register is in the shared space */
> 


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

* Re: [PATCHv5 4/4] thermal: exynos: Remove duplicate code when reading triminfo register of Exynos5440
  2014-08-28  4:25   ` Chanwoo Choi
@ 2014-08-28 14:53     ` Eduardo Valentin
  2014-08-28 23:50       ` Chanwoo Choi
  0 siblings, 1 reply; 10+ messages in thread
From: Eduardo Valentin @ 2014-08-28 14:53 UTC (permalink / raw)
  To: Chanwoo Choi
  Cc: eduardo.valentin, amit.daniel, rui.zhang, kgene.kim, ch.naveen,
	kyungmin.park, b.zolnierkie, linux-pm, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

On Thu, Aug 28, 2014 at 01:25:14PM +0900, Chanwoo Choi wrote:
> Dear Eduardo,
> 
> This patch is wrong. It is my mistake.
> 
> Please ignore only this patch because
> the offset calculation of 'case 0' is different from 'case 2'.


Do patches 1 - 3 are still correct? Patch 1, from Barlomiej, seams to be
a common agreement. 

> 
> Best Regards,
> Chanwoo Choi
> 
> On 08/26/2014 10:31 AM, Chanwoo Choi wrote:
> > This patch remove simply duplicate code when reading triminfo register of Exynos5440.
> > 
> > Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> > Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
> > Cc: Zhang Rui <rui.zhang@intel.com>
> > Cc: Eduardo Valentin <edubezval@gmail.com>
> > Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
> > Reviewed-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
> > ---
> >  drivers/thermal/samsung/exynos_tmu.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> > index 64c702a..5888467 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -187,15 +187,13 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
> >  		 */
> >  		switch (data->id) {
> >  		case 0:
> > +		case 2:
> >  			trim_info = readl(data->base +
> >  			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
> >  			break;
> >  		case 1:
> >  			trim_info = readl(data->base + reg->triminfo_data);
> >  			break;
> > -		case 2:
> > -			trim_info = readl(data->base -
> > -			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
> >  		}
> >  	} else {
> >  		/* On exynos5420 the triminfo register is in the shared space */
> > 
> 

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

* Re: [PATCHv5 4/4] thermal: exynos: Remove duplicate code when reading triminfo register of Exynos5440
  2014-08-28 14:53     ` Eduardo Valentin
@ 2014-08-28 23:50       ` Chanwoo Choi
  2014-08-29 19:28         ` Eduardo Valentin
  0 siblings, 1 reply; 10+ messages in thread
From: Chanwoo Choi @ 2014-08-28 23:50 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: eduardo.valentin, amit.daniel, rui.zhang, kgene.kim, ch.naveen,
	kyungmin.park, b.zolnierkie, linux-pm, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Dear Eduardo,

On 08/28/2014 11:53 PM, Eduardo Valentin wrote:
> On Thu, Aug 28, 2014 at 01:25:14PM +0900, Chanwoo Choi wrote:
>> Dear Eduardo,
>>
>> This patch is wrong. It is my mistake.
>>
>> Please ignore only this patch because
>> the offset calculation of 'case 0' is different from 'case 2'.
> 
> 
> Do patches 1 - 3 are still correct? Patch 1, from Barlomiej, seams to be
> a common agreement. 

Yes, patches 1 - 3 are correct.

Best Regards,
Chanwoo Choi

> 
>>
>> Best Regards,
>> Chanwoo Choi
>>
>> On 08/26/2014 10:31 AM, Chanwoo Choi wrote:
>>> This patch remove simply duplicate code when reading triminfo register of Exynos5440.
>>>
>>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>>> Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
>>> Cc: Zhang Rui <rui.zhang@intel.com>
>>> Cc: Eduardo Valentin <edubezval@gmail.com>
>>> Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
>>> Reviewed-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
>>> ---
>>>  drivers/thermal/samsung/exynos_tmu.c | 4 +---
>>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
>>> index 64c702a..5888467 100644
>>> --- a/drivers/thermal/samsung/exynos_tmu.c
>>> +++ b/drivers/thermal/samsung/exynos_tmu.c
>>> @@ -187,15 +187,13 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
>>>  		 */
>>>  		switch (data->id) {
>>>  		case 0:
>>> +		case 2:
>>>  			trim_info = readl(data->base +
>>>  			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
>>>  			break;
>>>  		case 1:
>>>  			trim_info = readl(data->base + reg->triminfo_data);
>>>  			break;
>>> -		case 2:
>>> -			trim_info = readl(data->base -
>>> -			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
>>>  		}
>>>  	} else {
>>>  		/* On exynos5420 the triminfo register is in the shared space */
>>>
>>
> 


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

* Re: [PATCHv5 4/4] thermal: exynos: Remove duplicate code when reading triminfo register of Exynos5440
  2014-08-28 23:50       ` Chanwoo Choi
@ 2014-08-29 19:28         ` Eduardo Valentin
  2014-09-03  2:08           ` Chanwoo Choi
  0 siblings, 1 reply; 10+ messages in thread
From: Eduardo Valentin @ 2014-08-29 19:28 UTC (permalink / raw)
  To: Chanwoo Choi
  Cc: eduardo.valentin, amit.daniel, rui.zhang, kgene.kim, ch.naveen,
	kyungmin.park, b.zolnierkie, linux-pm, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Chanwoo,

On Fri, Aug 29, 2014 at 08:50:41AM +0900, Chanwoo Choi wrote:
> Dear Eduardo,
> 
> On 08/28/2014 11:53 PM, Eduardo Valentin wrote:
> > On Thu, Aug 28, 2014 at 01:25:14PM +0900, Chanwoo Choi wrote:
> >> Dear Eduardo,
> >>
> >> This patch is wrong. It is my mistake.
> >>
> >> Please ignore only this patch because
> >> the offset calculation of 'case 0' is different from 'case 2'.
> > 
> > 
> > Do patches 1 - 3 are still correct? Patch 1, from Barlomiej, seams to be
> > a common agreement. 

> 
> Yes, patches 1 - 3 are correct.
> 

OK. I pulled patch 01 into my next branch.

Can you please update patches 02 and 03 based on my next brach? They are
conflicting with the massive cleanups done by Bartlomiej (Thanks
Bartlomiej). So, please, resend patches 02 and 03 only, refreshed onto
my next branch.

Cheers.

> Best Regards,
> Chanwoo Choi
> 
> > 
> >>
> >> Best Regards,
> >> Chanwoo Choi
> >>
> >> On 08/26/2014 10:31 AM, Chanwoo Choi wrote:
> >>> This patch remove simply duplicate code when reading triminfo register of Exynos5440.
> >>>
> >>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> >>> Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
> >>> Cc: Zhang Rui <rui.zhang@intel.com>
> >>> Cc: Eduardo Valentin <edubezval@gmail.com>
> >>> Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
> >>> Reviewed-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
> >>> ---
> >>>  drivers/thermal/samsung/exynos_tmu.c | 4 +---
> >>>  1 file changed, 1 insertion(+), 3 deletions(-)
> >>>
> >>> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> >>> index 64c702a..5888467 100644
> >>> --- a/drivers/thermal/samsung/exynos_tmu.c
> >>> +++ b/drivers/thermal/samsung/exynos_tmu.c
> >>> @@ -187,15 +187,13 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
> >>>  		 */
> >>>  		switch (data->id) {
> >>>  		case 0:
> >>> +		case 2:
> >>>  			trim_info = readl(data->base +
> >>>  			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
> >>>  			break;
> >>>  		case 1:
> >>>  			trim_info = readl(data->base + reg->triminfo_data);
> >>>  			break;
> >>> -		case 2:
> >>> -			trim_info = readl(data->base -
> >>> -			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
> >>>  		}
> >>>  	} else {
> >>>  		/* On exynos5420 the triminfo register is in the shared space */
> >>>
> >>
> > 
> 

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

* Re: [PATCHv5 4/4] thermal: exynos: Remove duplicate code when reading triminfo register of Exynos5440
  2014-08-29 19:28         ` Eduardo Valentin
@ 2014-09-03  2:08           ` Chanwoo Choi
  0 siblings, 0 replies; 10+ messages in thread
From: Chanwoo Choi @ 2014-09-03  2:08 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: eduardo.valentin, amit.daniel, rui.zhang, kgene.kim, ch.naveen,
	kyungmin.park, b.zolnierkie, linux-pm, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Dear Eduardo,

On 08/30/2014 04:28 AM, Eduardo Valentin wrote:
> Chanwoo,
> 
> On Fri, Aug 29, 2014 at 08:50:41AM +0900, Chanwoo Choi wrote:
>> Dear Eduardo,
>>
>> On 08/28/2014 11:53 PM, Eduardo Valentin wrote:
>>> On Thu, Aug 28, 2014 at 01:25:14PM +0900, Chanwoo Choi wrote:
>>>> Dear Eduardo,
>>>>
>>>> This patch is wrong. It is my mistake.
>>>>
>>>> Please ignore only this patch because
>>>> the offset calculation of 'case 0' is different from 'case 2'.
>>>
>>>
>>> Do patches 1 - 3 are still correct? Patch 1, from Barlomiej, seams to be
>>> a common agreement. 
> 
>>
>> Yes, patches 1 - 3 are correct.
>>
> 
> OK. I pulled patch 01 into my next branch.
> 
> Can you please update patches 02 and 03 based on my next brach? They are
> conflicting with the massive cleanups done by Bartlomiej (Thanks
> Bartlomiej). So, please, resend patches 02 and 03 only, refreshed onto
> my next branch.

OK, I'll send new patchset after rebase it.

Best Regards,
Chanwoo Choi

> 
> Cheers.
> 
>> Best Regards,
>> Chanwoo Choi
>>
>>>
>>>>
>>>> Best Regards,
>>>> Chanwoo Choi
>>>>
>>>> On 08/26/2014 10:31 AM, Chanwoo Choi wrote:
>>>>> This patch remove simply duplicate code when reading triminfo register of Exynos5440.
>>>>>
>>>>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>>>>> Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
>>>>> Cc: Zhang Rui <rui.zhang@intel.com>
>>>>> Cc: Eduardo Valentin <edubezval@gmail.com>
>>>>> Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
>>>>> Reviewed-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
>>>>> ---
>>>>>  drivers/thermal/samsung/exynos_tmu.c | 4 +---
>>>>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
>>>>> index 64c702a..5888467 100644
>>>>> --- a/drivers/thermal/samsung/exynos_tmu.c
>>>>> +++ b/drivers/thermal/samsung/exynos_tmu.c
>>>>> @@ -187,15 +187,13 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
>>>>>  		 */
>>>>>  		switch (data->id) {
>>>>>  		case 0:
>>>>> +		case 2:
>>>>>  			trim_info = readl(data->base +
>>>>>  			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
>>>>>  			break;
>>>>>  		case 1:
>>>>>  			trim_info = readl(data->base + reg->triminfo_data);
>>>>>  			break;
>>>>> -		case 2:
>>>>> -			trim_info = readl(data->base -
>>>>> -			EXYNOS5440_EFUSE_SWAP_OFFSET + reg->triminfo_data);
>>>>>  		}
>>>>>  	} else {
>>>>>  		/* On exynos5420 the triminfo register is in the shared space */
>>>>>
>>>>
>>>
>>
> 


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

end of thread, other threads:[~2014-09-03  2:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-26  1:31 [PATCHv5 0/4] thermal: exynos: Add support for TRIMINFO feature of Exynos3250 Chanwoo Choi
2014-08-26  1:31 ` [PATCHv5 1/4] thermal: samsung: Exynos5260 and Exynos5420 should not use TRIM_RELOAD flag Chanwoo Choi
2014-08-26  1:31 ` [PATCHv5 2/4] thermal: exynos: Add support for many TRIMINFO_CTRL registers Chanwoo Choi
2014-08-26  1:31 ` [PATCHv5 3/4] thermal: exynos: Add support for TRIM_RELOAD feature at Exynos3250 Chanwoo Choi
2014-08-26  1:31 ` [PATCHv5 4/4] thermal: exynos: Remove duplicate code when reading triminfo register of Exynos5440 Chanwoo Choi
2014-08-28  4:25   ` Chanwoo Choi
2014-08-28 14:53     ` Eduardo Valentin
2014-08-28 23:50       ` Chanwoo Choi
2014-08-29 19:28         ` Eduardo Valentin
2014-09-03  2:08           ` Chanwoo Choi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).