summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBibek Basu <bbasu@nvidia.com>2015-01-28 11:41:13 +0530
committerWinnie Hsu <whsu@nvidia.com>2015-01-29 21:48:24 -0800
commit3ab290755e0be6b207a5cd79f507c456195bba58 (patch)
treedf754984a35bcb292d7bf5461f21f5ed6a839c10
parent097e6ff87a8450a0040091d7a69e9894611df6e6 (diff)
rtc: as3722: add shutdown support
When shutdown process is ongoing, dont allow rtc read/write/irq activity.Add shutdown hook to the driver to disable irq and cancel any pending irq_work Bug 200072946 Change-Id: I1a68d17ec49ee32e849ad965a144b84be19ba6c5 Signed-off-by: Bibek Basu <bbasu@nvidia.com> Reviewed-on: http://git-master/r/677751 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Venkat Moganty <vmoganty@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
-rw-r--r--drivers/rtc/rtc-as3722.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-as3722.c b/drivers/rtc/rtc-as3722.c
index 555deef242ff..88983391686c 100644
--- a/drivers/rtc/rtc-as3722.c
+++ b/drivers/rtc/rtc-as3722.c
@@ -2,7 +2,7 @@
* rtc-as3722.c - Real Time Clock driver for ams AS3722 PMICs
*
* Copyright (C) 2013 ams AG
- * Copyright (c) 2013, NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2013-2015, NVIDIA Corporation. All rights reserved.
*
* Author: Florian Lobmaier <florian.lobmaier@ams.com>
* Author: Laxman Dewangan <ldewangan@nvidia.com>
@@ -239,6 +239,14 @@ static int as3722_rtc_remove(struct platform_device *pdev)
return 0;
}
+void as3722_rtc_shutdown(struct platform_device *pdev)
+{
+ struct as3722_rtc *as3722_rtc = platform_get_drvdata(pdev);
+
+ as3722_rtc_alarm_irq_enable(as3722_rtc->dev, 0);
+ rtc_device_shutdown(as3722_rtc->rtc);
+}
+
#ifdef CONFIG_PM_SLEEP
static int as3722_rtc_suspend(struct device *dev)
{
@@ -286,6 +294,7 @@ static const struct dev_pm_ops as3722_rtc_pm_ops = {
static struct platform_driver as3722_rtc_driver = {
.probe = as3722_rtc_probe,
.remove = as3722_rtc_remove,
+ .shutdown = as3722_rtc_shutdown,
.driver = {
.name = "as3722-rtc",
.pm = &as3722_rtc_pm_ops,