From patchwork Tue May 7 13:01:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 2533511 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D8BC2DF215 for ; Tue, 7 May 2013 13:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932412Ab3EGNC0 (ORCPT ); Tue, 7 May 2013 09:02:26 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:53966 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932393Ab3EGNCX (ORCPT ); Tue, 7 May 2013 09:02:23 -0400 Received: by mail-pd0-f169.google.com with SMTP id bv13so357565pdb.0 for ; Tue, 07 May 2013 06:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=t2zvhvzytLoR0rWL70ZSHL9Dg07WsPIm6l6UBVe8ja8=; b=zVgQzNbC5j9+VohnIJqfttqmh1mwg3Tz39ljkK5VAev/6MdJSVbQvK/ObB2WidIKJG lxvNm+7hfe7ug37RQQ0J735bZk8yhjD8RJjZzpfXySQwcwVwa2fOPis9EgP3k/el0UR4 hH/DYxW9BDbAwCuvJnMGf2CQt2tkXR9hrIUIIBJ3j9ARHm8bA0dKLDPZEJ2gP2z/yHzS axUVX0xyrPPBQhe6czQDp4QBj/DeYQGLqB99ZZrNIHKy0tqa8UR5OYW1ReiaJexJ0Nft 7gnn3HJdY5KtyfPKYOFunQenK1Y4NhmLXjefKJdH3xaDsi3+GzuIQOYJT8j5fCXhAhkb LVtQ== X-Received: by 10.66.248.228 with SMTP id yp4mr2718206pac.158.1367931742545; Tue, 07 May 2013 06:02:22 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id l4sm28220809pbo.6.2013.05.07.06.02.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 07 May 2013 06:02:21 -0700 (PDT) From: Amit Daniel Kachhap To: linux-pm@vger.kernel.org Cc: Zhang Rui , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, Kukjin Kim , Eduardo Valentin Subject: [PATCH V3 10/21] thermal: exynos: Fix to clear only the generated interrupts Date: Tue, 7 May 2013 18:31:00 +0530 Message-Id: <1367931671-3906-11-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1367931671-3906-1-git-send-email-amit.daniel@samsung.com> References: <1367931671-3906-1-git-send-email-amit.daniel@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch uses the TMU status register to know the generated interrupts and only clear them in the interrupt handler. Acked-by: Kukjin Kim Signed-off-by: Amit Daniel Kachhap --- drivers/thermal/samsung/exynos_tmu.c | 10 ++++------ drivers/thermal/samsung/exynos_tmu_data.c | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 97b87aa..082d5a2 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -325,17 +325,15 @@ static void exynos_tmu_work(struct work_struct *work) struct exynos_tmu_data, irq_work); struct exynos_tmu_platform_data *pdata = data->pdata; struct exynos_tmu_registers *reg = pdata->registers; + unsigned int val_irq; exynos_report_trigger(); mutex_lock(&data->lock); clk_enable(data->clk); - if (data->soc == SOC_ARCH_EXYNOS) - writel((reg->inten_rise_mask << reg->inten_rise_shift) | - (reg->inten_fall_mask << reg->inten_fall_shift), - data->base + reg->tmu_intclear); - else - writel(reg->inten_rise_mask, data->base + reg->tmu_intclear); + val_irq = readl(data->base + reg->tmu_intstat); + /* clear the interrupts */ + writel(val_irq, data->base + reg->tmu_intclear); clk_disable(data->clk); mutex_unlock(&data->lock); diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c index 3a1ded1..7322597 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c +++ b/drivers/thermal/samsung/exynos_tmu_data.c @@ -45,6 +45,7 @@ static struct exynos_tmu_registers exynos4210_tmu_registers = { .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT, .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT, .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT, + .tmu_intstat = EXYNOS_TMU_REG_INTSTAT, .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR, }; struct exynos_tmu_platform_data const exynos4210_default_tmu_data = { @@ -111,6 +112,7 @@ static struct exynos_tmu_registers exynos5250_tmu_registers = { .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT, .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT, .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT, + .tmu_intstat = EXYNOS_TMU_REG_INTSTAT, .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR, .emul_con = EXYNOS_EMUL_CON, .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,