]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/blobdiff - drivers/rtc/rtc-as3722.c
rtc: as3722: add shutdown support
[sojka/nv-tegra/linux-3.10.git] / drivers / rtc / rtc-as3722.c
index 555deef242ff4ff236c20a26a56302d11a0e4d04..88983391686cc52a5092a2373b7edfa062b9906a 100644 (file)
@@ -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,