Patchwork [U-Boot,2/2] power: exynos-tmu: use the mux_addr bit fields in tmu_control register

login
register
mail settings
Submitter naveen krishna chatradhi
Date April 5, 2013, 10:21 p.m.
Message ID <1365200499-31651-2-git-send-email-naveenkrishna.ch@gmail.com>
Download mbox | patch
Permalink /patch/234293/
State Accepted
Delegated to: Minkyu Kang
Headers show

Comments

naveen krishna chatradhi - April 5, 2013, 10:21 p.m.
From: Naveen Krishna Chatradhi <ch.naveen@samsung.com>

This patch implements the mux_addr bit fields defined in tmu_control
register (used for debugging purpose)

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Reviewed-by: Vadim Bendebury <vbendeb@google.com>
---
 drivers/power/exynos-tmu.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
Minkyu Kang - June 13, 2013, 8:55 a.m.
On 06/04/13 07:21, Naveen Krishna Chatradhi wrote:
> From: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> 
> This patch implements the mux_addr bit fields defined in tmu_control
> register (used for debugging purpose)
> 
> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> Reviewed-by: Vadim Bendebury <vbendeb@google.com>
> ---
>  drivers/power/exynos-tmu.c |   11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 

applied to u-boot-samsung.

Thanks,
Minkyu Kang.

Patch

diff --git a/drivers/power/exynos-tmu.c b/drivers/power/exynos-tmu.c
index 6d74bc7..9a093a5 100644
--- a/drivers/power/exynos-tmu.c
+++ b/drivers/power/exynos-tmu.c
@@ -79,6 +79,8 @@  struct tmu_data {
 struct tmu_info {
 	/* base Address for the TMU */
 	struct exynos5_tmu_reg *tmu_base;
+	/* mux Address for the TMU */
+	int tmu_mux;
 	/* pre-defined values for calibration and thresholds */
 	struct tmu_data data;
 	/* value required for triminfo_25 calibration */
@@ -204,6 +206,13 @@  static int get_tmu_fdt_values(struct tmu_info *info, const void *blob)
 	}
 	info->tmu_base = (struct exynos5_tmu_reg *)addr;
 
+	/* Optional field. */
+	info->tmu_mux = fdtdec_get_int(blob,
+				node, "samsung,mux", -1);
+	/* Take default value as per the user manual b(110) */
+	if (info->tmu_mux == -1)
+		info->tmu_mux = 0x6;
+
 	info->data.ts.min_val = fdtdec_get_int(blob,
 				node, "samsung,min-temp", -1);
 	error |= (info->data.ts.min_val == -1);
@@ -307,7 +316,7 @@  static void tmu_setup_parameters(struct tmu_info *info)
 
 	/* TMU core enable */
 	con = readl(&reg->tmu_control);
-	con |= THERM_TRIP_EN | CORE_EN;
+	con |= THERM_TRIP_EN | CORE_EN | (info->tmu_mux << 20);
 
 	writel(con, &reg->tmu_control);