From: Soomin Kim Date: Mon, 25 Jul 2016 05:12:44 +0000 (+0900) Subject: [8895] thermal: samsung: Fix the offset of INTEN and INTPEN X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5ce29700b040633818fb820bb66df0acb924f022;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [8895] thermal: samsung: Fix the offset of INTEN and INTPEN If sensor number is over 5, INTEN offset starts 0x310 and INTPEN offset starts 0x318. Change-Id: I9fbc9b90bbadb4783485caed00d54a701e0fd087 Signed-off-by: Soomin Kim --- diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 75de75f25217..4172b72ebc38 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -57,7 +57,9 @@ #define EXYNOS_TMU_REG_CURRENT_TEMP1_0 0x40 #define EXYNOS_TMU_REG_CURRENT_TEMP4_2 0x44 #define EXYNOS_TMU_REG_CURRENT_TEMP7_5 0x48 -#define EXYNOS_TMU_REG_INTEN 0x110 +#define EXYNOS_TMU_REG_INTEN0 0x110 +#define EXYNOS_TMU_REG_INTEN5 0x310 +#define EXYNOS_TMU_REG_INTEN_OFFSET 0x10 #define EXYNOS_TMU_REG_INTSTAT 0x74 #define EXYNOS_TMU_REG_INTCLEAR 0x78 @@ -516,7 +518,7 @@ static void exynos8890_tmu_control(struct platform_device *pdev, bool on) interrupt_en = 0; /* Disable all interrupts */ } - writel(interrupt_en, data->base + EXYNOS_TMU_REG_INTEN); + writel(interrupt_en, data->base + EXYNOS_TMU_REG_INTEN0); writel(con, data->base + EXYNOS_TMU_REG_CONTROL); } @@ -697,7 +699,14 @@ static void exynos8895_tmu_control(struct platform_device *pdev, bool on) if (strcmp(tz->tzp->governor_name, "power_allocator")) { for (i = 0; i < TOTAL_SENSORS; i++) { if (data->sensors & (1 << i)) { - writel(interrupt_en, data->base + EXYNOS_TMU_REG_INTEN + 0x10 * i); + int int_offset; + + if (i < 5) + int_offset = EXYNOS_TMU_REG_INTEN0 + EXYNOS_TMU_REG_INTEN_OFFSET * i; + else + int_offset = EXYNOS_TMU_REG_INTEN5 + EXYNOS_TMU_REG_INTEN_OFFSET * (i - 5) ; + + writel(interrupt_en, data->base + int_offset); } } } @@ -914,7 +923,7 @@ static void exynos8895_tmu_clear_irqs(struct exynos_tmu_data *data) if (i < 5) pend_reg = EXYNOS_TMU_REG_INTPEND0 + EXYNOS_TMU_REG_INTPEN_OFFSET * i; else - pend_reg = EXYNOS_TMU_REG_INTPEND5 + EXYNOS_TMU_REG_INTPEN_OFFSET * i; + pend_reg = EXYNOS_TMU_REG_INTPEND5 + EXYNOS_TMU_REG_INTPEN_OFFSET * (i - 5); val_irq = readl(data->base + pend_reg); writel(val_irq, data->base + pend_reg);