[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1326967949-8248-2-git-send-email-vbyravarasu@nvidia.com>
Date: Thu, 19 Jan 2012 15:42:27 +0530
From: Venu Byravarasu <vbyravarasu@...dia.com>
To: a.zummo@...ertech.it, rtc-linux@...glegroups.com,
linux-kernel@...r.kernel.org
Cc: swarren@...dia.com, Venu Byravarasu <vbyravarasu@...dia.com>
Subject: [PATCH 1/3] rtc: twl: Enable RTC irrespective of its prior state
From: Venu Byravarasu <vbyravarasu@...dia.com>
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@...dia.com>
---
drivers/rtc/rtc-twl.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index 20687d5..61ae1b7 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -449,19 +449,11 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
REG_INT_MSK_STS_A);
}
- /* Check RTC module status, Enable if it is off */
- ret = twl_rtc_read_u8(&rd_reg, REG_RTC_CTRL_REG);
+ dev_info(&pdev->dev, "Enabling TWL-RTC\n");
+ ret = twl_rtc_write_u8(BIT_RTC_CTRL_REG_STOP_RTC_M, REG_RTC_CTRL_REG);
if (ret < 0)
goto out1;
- if (!(rd_reg & BIT_RTC_CTRL_REG_STOP_RTC_M)) {
- dev_info(&pdev->dev, "Enabling TWL-RTC.\n");
- rd_reg = BIT_RTC_CTRL_REG_STOP_RTC_M;
- ret = twl_rtc_write_u8(rd_reg, REG_RTC_CTRL_REG);
- if (ret < 0)
- goto out1;
- }
-
/* init cached IRQ enable bits */
ret = twl_rtc_read_u8(&rtc_irq_bits, REG_RTC_INTERRUPTS_REG);
if (ret < 0)
--
1.7.1.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists