diff options
author | John Stultz <john.stultz@linaro.org> | 2012-03-06 20:16:09 -0500 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2012-03-15 21:23:10 -0400 |
commit | 4a649903f91232d02284d53724b0a45728111767 (patch) | |
tree | 065a4aa03fc377d34f6b332fdb8b608c9bf0bc26 /drivers/rtc/interface.c | |
parent | 74a622be3db2898251cb524d1edbeaea589f2723 (diff) |
rtc: Provide flag for rtc devices that don't support UIE
Richard Weinberger noticed that on some RTC hardware that
doesn't support UIE mode, due to coarse granular alarms
(like 1minute resolution), the current virtualized RTC
support doesn't properly error out when UIE is enabled.
Instead the current code queues an alarm for the next second,
but it won't fire until up to a miniute later.
This patch provides a generic way to flag this sort of hardware
and fixes the issue on the mpc5121 where Richard noticed the
problem.
CC: stable@vger.kernel.org
Reported-by: Richard Weinberger <richard@nod.at>
Tested-by: Richard Weinberger <richard@nod.at>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r-- | drivers/rtc/interface.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index dc87eda65814..eb415bd76494 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c | |||
@@ -458,6 +458,11 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled) | |||
458 | if (rtc->uie_rtctimer.enabled == enabled) | 458 | if (rtc->uie_rtctimer.enabled == enabled) |
459 | goto out; | 459 | goto out; |
460 | 460 | ||
461 | if (rtc->uie_unsupported) { | ||
462 | err = -EINVAL; | ||
463 | goto out; | ||
464 | } | ||
465 | |||
461 | if (enabled) { | 466 | if (enabled) { |
462 | struct rtc_time tm; | 467 | struct rtc_time tm; |
463 | ktime_t now, onesec; | 468 | ktime_t now, onesec; |