From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: linux-kernel@vger.kernel.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Alessandro Zummo <a.zummo@towertech.it>,
rtc-linux@googlegroups.com
Subject: [PATCH 3/4] rtc: Suppress duplicate enable/disable of WM8350 update interrupt
Date: Tue, 5 Jan 2010 13:59:08 +0000 [thread overview]
Message-ID: <1262699949-3079-3-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1262699949-3079-2-git-send-email-broonie@opensource.wolfsonmicro.com>
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 <broonie@opensource.wolfsonmicro.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
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
--
1.6.5.7
next prev parent reply other threads:[~2010-01-05 14:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-05 13:57 [PATCH 0/4] Convert WM8350 to genirq Mark Brown
2010-01-05 13:59 ` [PATCH 1/4] mfd: WM8350 off by one bug Mark Brown
2010-01-05 13:59 ` [PATCH 2/4] mfd: Add a data argument to the WM8350 IRQ free function Mark Brown
2010-01-05 13:59 ` Mark Brown [this message]
2010-01-05 13:59 ` [PATCH 4/4] mfd: Convert WM8350 to genirq Mark Brown
2010-01-05 20:40 ` [PATCH 5/4] mfd: Don't allow WM8350 to be built modular Mark Brown
2010-01-06 8:56 ` Samuel Ortiz
2010-01-05 15:04 ` [PATCH 3/4] rtc: Suppress duplicate enable/disable of WM8350 update interrupt Alessandro Zummo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1262699949-3079-3-git-send-email-broonie@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=a.zummo@towertech.it \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome