aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenu Byravarasu <vbyravarasu@nvidia.com>2012-03-23 18:02:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-23 19:58:39 -0400
commitf7439bcb74aca4234fedc336a21e169e6e33bb2e (patch)
tree815b214ea649e068711e5b36de3952f1221c717d
parentce9f650636d310e4c8febc821b0038e9918a12db (diff)
drivers/rtc/rtc-twl.c: enable RTC irrespective of its prior state
As part of probe, before enabling RTC, RTC_CTRL register is read to check if it is already running. If RTC is used by kernel alone, then this read is not required. Even if RTC was enabled already by boot loader, setting STOP_RTC bit again should not harm. Hence removed unwanted read operation. Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/rtc/rtc-twl.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index 18dff5255670..18e4c0138a40 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -457,19 +457,11 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
457 REG_INT_MSK_STS_A); 457 REG_INT_MSK_STS_A);
458 } 458 }
459 459
460 /* Check RTC module status, Enable if it is off */ 460 dev_info(&pdev->dev, "Enabling TWL-RTC\n");
461 ret = twl_rtc_read_u8(&rd_reg, REG_RTC_CTRL_REG); 461 ret = twl_rtc_write_u8(BIT_RTC_CTRL_REG_STOP_RTC_M, REG_RTC_CTRL_REG);
462 if (ret < 0) 462 if (ret < 0)
463 goto out1; 463 goto out1;
464 464
465 if (!(rd_reg & BIT_RTC_CTRL_REG_STOP_RTC_M)) {
466 dev_info(&pdev->dev, "Enabling TWL-RTC.\n");
467 rd_reg = BIT_RTC_CTRL_REG_STOP_RTC_M;
468 ret = twl_rtc_write_u8(rd_reg, REG_RTC_CTRL_REG);
469 if (ret < 0)
470 goto out1;
471 }
472
473 /* init cached IRQ enable bits */ 465 /* init cached IRQ enable bits */
474 ret = twl_rtc_read_u8(&rtc_irq_bits, REG_RTC_INTERRUPTS_REG); 466 ret = twl_rtc_read_u8(&rtc_irq_bits, REG_RTC_INTERRUPTS_REG);
475 if (ret < 0) 467 if (ret < 0)