From patchwork Mon Oct 12 08:02:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 35735 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-qy0-f142.google.com (mail-qy0-f142.google.com [209.85.221.142]) by ozlabs.org (Postfix) with ESMTP id 802FAB7063 for ; Mon, 12 Oct 2009 19:02:20 +1100 (EST) Received: by qyk6 with SMTP id 6so9439813qyk.1 for ; Mon, 12 Oct 2009 01:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received:received-spf:received:received:received :from:to:cc:subject:date:message-id:x-mailer:reply-to:sender :precedence:x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; bh=z10Y2YLhB/3pKvnOXK5NJrKm2i2V3dQ41VYjoL7YL1c=; b=QgGWV1QWj92LXxgsjFPuDMtanjqw5RwiaShrjKhFzBNBDAZ/SHQ5LIXi48szhbffnk 6zBFTsjPSuMnBA5Fu709Jh/NJArYjQOP4WOyMGISxtDNM1b62/8QSsd191rZFOx72iOn 2hzEw8luvC2/r7tVMLCuY6j1P8dbjFwt3K9RM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results:from :to:cc:subject:date:message-id:x-mailer:reply-to:sender:precedence :x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; b=Myhk+nZSD4HChWboVw21OhucOsriOKFY9RMU7N1MiewTIYV9VuZHKbu+YVHCRk4+FP 3usc+yuW/2N48KAGfSp83wHlWaXyKcCguirvmUaIfrj+nJuAIlliBwtAJeW480UQg5bi mOOjkttaapju5u7Nh6slrYmmkoV7o0sdu/+kE= Received: by 10.229.78.67 with SMTP id j3mr228874qck.28.1255334536953; Mon, 12 Oct 2009 01:02:16 -0700 (PDT) Received: by 10.176.233.14 with SMTP id f14gr2947yqh.0; Mon, 12 Oct 2009 01:02:16 -0700 (PDT) X-Sender: triad@df.lth.se X-Apparently-To: rtc-linux@googlegroups.com Received: by 10.211.131.2 with SMTP id i2mr1049090ebn.22.1255334536121; Mon, 12 Oct 2009 01:02:16 -0700 (PDT) Received: by 10.211.131.2 with SMTP id i2mr1049088ebn.22.1255334536084; Mon, 12 Oct 2009 01:02:16 -0700 (PDT) Received: from df.lth.se (mail.df.lth.se [194.47.250.12]) by gmr-mx.google.com with ESMTP id 16si719228ewy.7.2009.10.12.01.02.15; Mon, 12 Oct 2009 01:02:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of triad@df.lth.se designates 194.47.250.12 as permitted sender) client-ip=194.47.250.12; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of triad@df.lth.se designates 194.47.250.12 as permitted sender) smtp.mail=triad@df.lth.se Received: from mer.df.lth.se (mer.df.lth.se [194.47.250.37]) by df.lth.se (8.14.2/8.13.7) with ESMTP id n9C82FHb004184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 12 Oct 2009 10:02:15 +0200 (CEST) Received: from mer.df.lth.se (triad@localhost.localdomain [127.0.0.1]) by mer.df.lth.se (8.14.3/8.14.3/Debian-5) with ESMTP id n9C82EPb030247; Mon, 12 Oct 2009 10:02:14 +0200 Received: (from triad@localhost) by mer.df.lth.se (8.14.3/8.14.3/Submit) id n9C82DKf030246; Mon, 12 Oct 2009 10:02:13 +0200 From: Linus Walleij To: Alessandro Zummo , rtc-linux@googlegroups.com Cc: Linus Walleij Subject: [rtc-linux] [PATCH] Disable IRQ on COH 901 331 after alarm Date: Mon, 12 Oct 2009 10:02:11 +0200 Message-Id: <1255334531-29981-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.6.2.rc1 Reply-To: rtc-linux@googlegroups.com Sender: rtc-linux@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rtc-linux@googlegroups.com; contact rtc-linux+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rtc-linux@googlegroups.com X-BeenThere: rtc-linux@googlegroups.com This disables the alarm IRQ from the COH 901 331 after an event, so as to avoid multiple triggers of the same alarm. Signed-off-by: Linus Walleij --- drivers/rtc/rtc-coh901331.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c index 7fe1fa2..8ce8d00 100644 --- a/drivers/rtc/rtc-coh901331.c +++ b/drivers/rtc/rtc-coh901331.c @@ -58,7 +58,16 @@ static irqreturn_t coh901331_interrupt(int irq, void *data) clk_enable(rtap->clk); /* Ack IRQ */ writel(1, rtap->virtbase + COH901331_IRQ_EVENT); + /* + * Disable the interrupt. This is necessary because + * the RTC lives on a lower-clocked line and will + * not release the IRQ line until after a few (slower) + * clock cycles. The interrupt will be re-enabled when + * a new alarm is set anyway. + */ + writel(0, rtap->virtbase + COH901331_IRQ_MASK); clk_disable(rtap->clk); + /* Set alarm flag */ rtc_update_irq(rtap->rtc, 1, RTC_AF);