From patchwork Mon Jun 17 06:46:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 2731391 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 999AEC0AB1 for ; Mon, 17 Jun 2013 06:53:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B825F201FF for ; Mon, 17 Jun 2013 06:53:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB430201FA for ; Mon, 17 Jun 2013 06:53:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755936Ab3FQGxZ (ORCPT ); Mon, 17 Jun 2013 02:53:25 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33263 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932350Ab3FQGr6 (ORCPT ); Mon, 17 Jun 2013 02:47:58 -0400 Received: by mail-pa0-f51.google.com with SMTP id lf11so2512089pab.24 for ; Sun, 16 Jun 2013 23:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=Vkib4TVaI0wS8A2m3xT41k9xFBPDVx9X1MuBr0Nc/us=; b=yElkqGZSz1afqiAv1FRLR7qxuF/twJMjXO18vb8Ub4jb2VXNuHiDs0DGC6JpobrARG lGIKYzAZSXHodMGSTRfITl1mFNpRR1b8dlkRo+eTi6ds38EfCc6djENIyn8umThCvPyo zZVnaIoD89+P7AImZo4To3Wm6lxLXrYaHN+FC8l6FCvZ2osMA4a7mlqbzc+l5DA5xwFm BhEVVSUoJqYayj1OIe1tX2Hnoa6Md2Ku96srU04t5ydRK2dg2N5VDPDjcxP/vsWQQR08 RrqJuLYApLnem3s40TLjJ4yiFwzwxkfq5SnDIcNuOi/Wocv4CX/n61f2cv2W/VCM8jhl 2wPw== X-Received: by 10.68.1.226 with SMTP id 2mr11861710pbp.150.1371451677492; Sun, 16 Jun 2013 23:47:57 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id xl3sm11639859pbb.17.2013.06.16.23.47.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 16 Jun 2013 23:47:56 -0700 (PDT) From: Amit Daniel Kachhap To: linux-pm@vger.kernel.org, Zhang Rui , Eduardo Valentin Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, Kukjin Kim , jonghwa3.lee@samsung.com Subject: [PATCH V6 12/30] thermal: exynos: Fix to clear only the generated interrupts Date: Mon, 17 Jun 2013 12:16:21 +0530 Message-Id: <1371451599-31035-13-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1371451599-31035-1-git-send-email-amit.daniel@samsung.com> References: <1371451599-31035-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 X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch uses the TMU status register to know the generated interrupts and only clear them in the interrupt handler. Acked-by: Kukjin Kim Acked-by: Jonghwa Lee Signed-off-by: Amit Daniel Kachhap Acked-by: Eduardo Valentin --- drivers/thermal/samsung/exynos_tmu.c | 11 +++++------ drivers/thermal/samsung/exynos_tmu_data.c | 2 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 33f494e..f6f63ca 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -351,17 +351,16 @@ static void exynos_tmu_work(struct work_struct *work) struct exynos_tmu_data, irq_work); struct exynos_tmu_platform_data *pdata = data->pdata; const 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); + /* TODO: take action based on particular interrupt */ + 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 e7cb1cc..7fcf183 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c +++ b/drivers/thermal/samsung/exynos_tmu_data.c @@ -45,6 +45,7 @@ static const 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 = { @@ -112,6 +113,7 @@ static const 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,