Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753835Ab2KTA5h (ORCPT ); Mon, 19 Nov 2012 19:57:37 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:64952 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753418Ab2KTA5f (ORCPT ); Mon, 19 Nov 2012 19:57:35 -0500 X-AuditID: cbfee61a-b7fa66d0000004cf-c3-50aad57d446d From: Jonghwan Choi To: "'Jonghwan Choi'" , "'open list'" Cc: "'Amit Daniel Kachhap'" , "'Sachin Kamat'" , "'Zhang Rui'" References: In-reply-to: Subject: [PATCH v3 1/2] thermal: exynos: Fix wrong bit to control tmu core Date: Tue, 20 Nov 2012 09:57:29 +0900 Message-id: <007301cdc6ba$067107e0$135317a0$%choi@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac22X7ZVF4M1NdAyQSSqkck9CTHe3QA04GwQA+GV/4A= Content-language: ko DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsVy+t8zI926q6sCDCbUWlzeNYfNgdHj8ya5 AMYoLpuU1JzMstQifbsEroztG18yFpwVrbi25S5rA+NCgS5GTg4JAROJM2tnM0LYYhIX7q1n 62Lk4hASWMYo8eXHdzaYomeLfzBCJKYzSkz5/YgJwpnHJHFx9QdWkCo2AV2JY+u3gNkiAtES fxr3MIMUMQs0MUocbZ3H3sXIAdTBLbG6OQikhlOAR2Ldn05mEFtYwEvi+J9FYNtYBFQl2s98 ArN5Bewkrm64zgphC0r8mHyPBcRmFtCSWL/zOBOELS+xec1bZpDxEgLqEo/+6kKcYCWx7tpK qHIRiX0v3jFCjBeQ+Db5EAtEuazEpgPMED8uY5dYco8bwpaUOLjiBssERolZSBbPQrJ4FpLF s5BsWMDIsopRNLUgua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Xf24qIDvXtz5Te+tOkpr3K8dKxmq8eyBWXV/yRcLRqe 7ZnsfeWFf6bQjr3zNOr+TLpg47n7+OuNsypbeaICbzZxZmt5KJyQ/pTs+HJ+gU7SnVtN0oXi KZ0RTv9uLLG+0br1eer/x/c2vnDvLIzIXMIZabn4Lpfh9/rCjSuzVAqUWIozEg21mIuKEwGw 0TdGCQMAAA== X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2941 Lines: 74 [0]bit is used to enable/disable tmu core. [1] bit is a reserved bit. Signed-off-by: Jonghwan Choi --- drivers/thermal/exynos_thermal.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c index 6dd29e4..129e827 100644 --- a/drivers/thermal/exynos_thermal.c +++ b/drivers/thermal/exynos_thermal.c @@ -52,9 +52,12 @@ #define EXYNOS_TMU_TRIM_TEMP_MASK 0xff #define EXYNOS_TMU_GAIN_SHIFT 8 +#define EXYNOS_TMU_GAIN_MASK (0xF << EXYNOS_TMU_GAIN_SHIFT) #define EXYNOS_TMU_REF_VOLTAGE_SHIFT 24 -#define EXYNOS_TMU_CORE_ON 3 -#define EXYNOS_TMU_CORE_OFF 2 +#define EXYNOS_TMU_REF_VOLTAGE_MASK (0x1F << EXYNOS_TMU_REF_VOLTAGE_SHIFT) +#define EXYNOS_TMU_CORE_ON BIT(0) +#define EXYNOS_TMU_CORE_ON_SHIFT 0 +#define EXYNOS_TMU_CORE_ON_MASK (0x1 << EXYNOS_TMU_CORE_ON_SHIFT) #define EXYNOS_TMU_DEF_CODE_TO_TEMP_OFFSET 50 /* Exynos4210 specific registers */ @@ -85,7 +88,9 @@ #define EXYNOS_TMU_CLEAR_FALL_INT (0x111 << 16) #define EXYNOS_MUX_ADDR_VALUE 6 #define EXYNOS_MUX_ADDR_SHIFT 20 +#define EXYNOS_MUX_ADDR_MASK (0x7 << EXYNOS_MUX_ADDR_SHIFT) #define EXYNOS_TMU_TRIP_MODE_SHIFT 13 +#define EXYNOS_TMU_TRIP_MODE_MASK (0x7 << EXYNOS_TMU_TRIP_MODE_SHIFT) #define EFUSE_MIN_VALUE 40 #define EFUSE_MAX_VALUE 100 @@ -650,10 +655,14 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on) mutex_lock(&data->lock); clk_enable(data->clk); - con = pdata->reference_voltage << EXYNOS_TMU_REF_VOLTAGE_SHIFT | + con = readl(data->base + EXYNOS_TMU_REG_CONTROL); + con &= ~(EXYNOS_TMU_REF_VOLTAGE_MASK | EXYNOS_TMU_GAIN_MASK | + EXYNOS_TMU_CORE_ON_MASK); + con |= pdata->reference_voltage << EXYNOS_TMU_REF_VOLTAGE_SHIFT | pdata->gain << EXYNOS_TMU_GAIN_SHIFT; if (data->soc == SOC_ARCH_EXYNOS) { + con &= ~(EXYNOS_TMU_TRIP_MODE_MASK | EXYNOS_MUX_ADDR_MASK); con |= pdata->noise_cancel_mode << EXYNOS_TMU_TRIP_MODE_SHIFT; con |= (EXYNOS_MUX_ADDR_VALUE << EXYNOS_MUX_ADDR_SHIFT); } @@ -665,7 +674,6 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on) pdata->trigger_level1_en << 4 | pdata->trigger_level0_en; } else { - con |= EXYNOS_TMU_CORE_OFF; interrupt_en = 0; /* Disable all interrupts */ } writel(interrupt_en, data->base + EXYNOS_TMU_REG_INTEN); -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/