From patchwork Tue Jan 5 13:59:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 42117 Return-Path: <3-1JDSwAACdwPRA-JGLSVEMMEJCEPMSNQ.AMK@listserv.bounces.google.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-gx0-f187.google.com (mail-gx0-f187.google.com [209.85.217.187]) by ozlabs.org (Postfix) with ESMTP id 77F9AB6EF2 for ; Wed, 6 Jan 2010 01:55:57 +1100 (EST) Received: by gxk3 with SMTP id 3sf12512000gxk.1 for ; Tue, 05 Jan 2010 06:55:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:mime-version:x-beenthere:received :received:received:received:received-spf:received:received:from:to :cc:subject:date:message-id:x-mailer:in-reply-to:references :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :x-thread-url:x-message-url:sender:list-unsubscribe:list-subscribe :content-type; bh=Zl5I4qU4SUGUAf4iO0xPzHNA6u/92R8O0LW2HgOWzDs=; b=v3kGGKeQmHHzTsi2/ZM1L7QZnn/CHIXOvFtSi/j0RPO6JeZUZjRWVqNA+Ij5mJtHMQ Tc/hBoek2OiqRqZJ02NSkxqHp4IHmQkEtKv5+oAQZnDVY1H08YMYl7uUoQmOjNh7rytR UZE+Ri8KWG9+/ox8gKw3RVlsVxwT0DlHv3jeI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=mime-version:x-beenthere:received-spf:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :x-thread-url:x-message-url:sender:list-unsubscribe:list-subscribe :content-type; b=VrBongf9xSGXxqT/fjRJ1BznSt3rosoehfJqkZbb+m8CXIC7+soyiOhvCCXZLSHnph 9mczZLFDtxqJeqOMFcE0xIDUYPZxVkYcQfVeuth/807KkxypWd1JzsFqCV33uq6XNLpH ITF4H7YgQBNDPfr1R1ewVfPLh25TOAsA//d0A= Received: by 10.101.165.2 with SMTP id s2mr3350443ano.55.1262703355838; Tue, 05 Jan 2010 06:55:55 -0800 (PST) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.213.3.206 with SMTP id 14ls309546ebo.0.p; Tue, 05 Jan 2010 06:55:54 -0800 (PST) Received: by 10.213.41.82 with SMTP id n18mr1569456ebe.25.1262699979667; Tue, 05 Jan 2010 05:59:39 -0800 (PST) Received: by 10.213.41.82 with SMTP id n18mr1569455ebe.25.1262699979645; Tue, 05 Jan 2010 05:59:39 -0800 (PST) Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by gmr-mx.google.com with ESMTP id 12si2558055ewy.10.2010.01.05.05.59.39; Tue, 05 Jan 2010 05:59:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of broonie@opensource.wolfsonmicro.com designates 80.75.67.52 as permitted sender) client-ip=80.75.67.52; Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com [87.246.78.27]) by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id 0554A76970F; Tue, 5 Jan 2010 13:59:39 +0000 (GMT) Received: from broonie by rakim.wolfsonmicro.main with local (Exim 4.71) (envelope-from ) id 1NS9wg-0000ov-G0; Tue, 05 Jan 2010 13:59:38 +0000 From: Mark Brown To: Samuel Ortiz Cc: linux-kernel@vger.kernel.org, Mark Brown , Alessandro Zummo , rtc-linux@googlegroups.com Subject: [rtc-linux] [PATCH 3/4] rtc: Suppress duplicate enable/disable of WM8350 update interrupt Date: Tue, 5 Jan 2010 13:59:08 +0000 Message-Id: <1262699949-3079-3-git-send-email-broonie@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.6.5.7 In-Reply-To: <1262699949-3079-2-git-send-email-broonie@opensource.wolfsonmicro.com> References: <20100105135756.GA2993@rakim.wolfsonmicro.main> <1262699949-3079-1-git-send-email-broonie@opensource.wolfsonmicro.com> <1262699949-3079-2-git-send-email-broonie@opensource.wolfsonmicro.com> X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of broonie@opensource.wolfsonmicro.com designates 80.75.67.52 as permitted sender) smtp.mail=broonie@opensource.wolfsonmicro.com X-Original-Sender: broonie@opensource.wolfsonmicro.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: X-Thread-Url: http://groups.google.com/group/rtc-linux/t/7f695320c4f05c11 X-Message-Url: http://groups.google.com/group/rtc-linux/msg/c21cde7491d73a13 Sender: rtc-linux@googlegroups.com List-Unsubscribe: , List-Subscribe: , Unlike the wm8350-custom code genirq nests enable and disable calls so we can't just unconditionally mask or unmask the interrupt, we need to remember the state we set and only mask or unmask when there is a real change. Signed-off-by: Mark Brown Cc: Alessandro Zummo Cc: rtc-linux@googlegroups.com --- drivers/rtc/rtc-wm8350.c | 7 +++++++ include/linux/mfd/wm8350/rtc.h | 1 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/rtc/rtc-wm8350.c b/drivers/rtc/rtc-wm8350.c index a427491..ef376d7 100644 --- a/drivers/rtc/rtc-wm8350.c +++ b/drivers/rtc/rtc-wm8350.c @@ -307,11 +307,18 @@ static int wm8350_rtc_update_irq_enable(struct device *dev, { struct wm8350 *wm8350 = dev_get_drvdata(dev); + /* Suppress duplicate changes since genirq nests enable and + * disable calls. */ + if (enabled == wm8350->rtc.update_enabled) + return 0; + if (enabled) wm8350_unmask_irq(wm8350, WM8350_IRQ_RTC_SEC); else wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC); + wm8350->rtc.update_enabled = enabled; + return 0; } diff --git a/include/linux/mfd/wm8350/rtc.h b/include/linux/mfd/wm8350/rtc.h index 24add2b..ebd72ff 100644 --- a/include/linux/mfd/wm8350/rtc.h +++ b/include/linux/mfd/wm8350/rtc.h @@ -263,6 +263,7 @@ struct wm8350_rtc { struct platform_device *pdev; struct rtc_device *rtc; int alarm_enabled; /* used over suspend/resume */ + int update_enabled; }; #endif