diff options
author | venu byravarasu <vbyravarasu@nvidia.com> | 2011-08-26 11:29:06 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:48:43 -0800 |
commit | ec95801e405b5f812c9d1e5ed49adf083721bae3 (patch) | |
tree | 35dd02580c75daedeeac32200fbac4629df3351e /drivers/rtc | |
parent | 3c9ccd23ff3eb03c0f40b0f8147e349e147f1cc9 (diff) |
rtc: tps80031: Clearing Alarm interrupt status
Sometimes it is observed that the POR value of RTC
interrupt register is having Alarm set.
Hence clearing it before enabling RTC interrupt.
bug 867362
Original-Change-Id: Id84db407880d4c1f5fb3023218c2b21e82cf515d
Reviewed-on: http://git-master/r/49372
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Rebase-Id: Reb9a71a090477a0c7b565f9fa188f25e7679fa15
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-tps80031.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-tps80031.c b/drivers/rtc/rtc-tps80031.c index 1ee3cdeb23a0..9ab1cc3b547e 100644 --- a/drivers/rtc/rtc-tps80031.c +++ b/drivers/rtc/rtc-tps80031.c @@ -306,7 +306,8 @@ static irqreturn_t tps80031_rtc_irq(int irq, void *data) return -EBUSY; } - err = tps80031_set_bits(dev->parent, 1, RTC_STATUS, ALARM_INT_STATUS); + err = tps80031_force_update(dev->parent, 1, RTC_STATUS, + ALARM_INT_STATUS, ALARM_INT_STATUS); if (err) { dev_err(dev->parent, "unable to set Alarm INT\n"); return -EBUSY; @@ -359,13 +360,6 @@ static int __devinit tps80031_rtc_probe(struct platform_device *pdev) goto fail; } - err = tps80031_set_bits(pdev->dev.parent, 1, RTC_INT, ENABLE_ALARM_INT); - if (err) { - dev_err(&pdev->dev, "unable to program Interrupt Mask reg\n"); - err = -EBUSY; - goto fail; - } - /* If RTC have POR values, set time using platform data*/ tps80031_rtc_read_time(&pdev->dev, &tm); if ((tm.tm_year == RTC_YEAR_OFFSET + RTC_POR_YEAR) && @@ -381,6 +375,20 @@ static int __devinit tps80031_rtc_probe(struct platform_device *pdev) tps80031_rtc_set_time(&pdev->dev, &pdata->time); } + reg = ALARM_INT_STATUS; + err = tps80031_write_regs(&pdev->dev, RTC_STATUS, 1, ®); + if (err) { + dev_err(&pdev->dev, "unable to program RTC_STATUS reg\n"); + return -EBUSY; + } + + err = tps80031_set_bits(pdev->dev.parent, 1, RTC_INT, ENABLE_ALARM_INT); + if (err) { + dev_err(&pdev->dev, "unable to program Interrupt Mask reg\n"); + err = -EBUSY; + goto fail; + } + dev_set_drvdata(&pdev->dev, rtc); if (pdata && (pdata->irq >= 0)) { rtc->irq = pdata->irq; |