diff options
author | Bo Yan <byan@nvidia.com> | 2011-08-25 17:02:35 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:48:38 -0800 |
commit | 288191ddf65270fcd2dafd861c845f050a4b9e47 (patch) | |
tree | fc434d4a1975eb1f276b6002bbe08710c4e2e697 /drivers/rtc | |
parent | f40e14afb7b153d2ef084a8a04e71927f81c15c8 (diff) |
rtc: tps6591x: Clear interrupt when probing device
Make sure alarm interrupt is cleared during device probing.
bug 867362
Original-Change-Id: Iad33c0e0715de2ec68291a57c2a55d1ad1198565
Reviewed-on: http://git-master/r/49302
Reviewed-by: Bo Yan <byan@nvidia.com>
Tested-by: Bo Yan <byan@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Rebase-Id: R5574970052e9a1c1334003e0f03e1d62c7ee5109
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-tps6591x.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-tps6591x.c b/drivers/rtc/rtc-tps6591x.c index e650173f5de7..878c2046aac7 100644 --- a/drivers/rtc/rtc-tps6591x.c +++ b/drivers/rtc/rtc-tps6591x.c @@ -461,13 +461,6 @@ static int __devinit tps6591x_rtc_probe(struct platform_device *pdev) return -EBUSY; } - reg = ENABLE_ALARM_INT; - tps6591x_write_regs(&pdev->dev, RTC_INT, 1, ®); - if (err) { - dev_err(&pdev->dev, "unable to program Interrupt Mask reg\n"); - return -EBUSY; - } - tps6591x_rtc_read_time(&pdev->dev, &tm); if ((tm.tm_year < RTC_YEAR_OFFSET || tm.tm_year > (RTC_YEAR_OFFSET + 99))){ if (pdata->time.tm_year < 2000 || pdata->time.tm_year > 2100) { @@ -479,6 +472,20 @@ static int __devinit tps6591x_rtc_probe(struct platform_device *pdev) tps6591x_rtc_set_time(&pdev->dev, &pdata->time); } + reg = ALARM_INT_STATUS; + err = tps6591x_write_regs(&pdev->dev, RTC_STATUS, 1, ®); + if (err) { + dev_err(&pdev->dev, "unable to program RTC_STATUS reg\n"); + return -EBUSY; + } + + reg = ENABLE_ALARM_INT; + tps6591x_write_regs(&pdev->dev, RTC_INT, 1, ®); + if (err) { + dev_err(&pdev->dev, "unable to program Interrupt Mask reg\n"); + return -EBUSY; + } + if (pdata && (pdata->irq >= 0)) { rtc->irq = pdata->irq; err = request_threaded_irq(pdata->irq, NULL, tps6591x_rtc_irq, |