@@ -716,7 +716,6 @@ static struct nvmem_config sun6i_rtc_nvmem_cfg = {
716
716
.stride = 4 ,
717
717
};
718
718
719
- #ifdef CONFIG_PM_SLEEP
720
719
/* Enable IRQ wake on suspend, to wake up from RTC. */
721
720
static int sun6i_rtc_suspend (struct device * dev )
722
721
{
@@ -729,7 +728,7 @@ static int sun6i_rtc_suspend(struct device *dev)
729
728
}
730
729
731
730
/* Disable IRQ wake on resume. */
732
- static int sun6i_rtc_resume (struct device * dev )
731
+ static int __maybe_unused sun6i_rtc_resume (struct device * dev )
733
732
{
734
733
struct sun6i_rtc_dev * chip = dev_get_drvdata (dev );
735
734
@@ -738,7 +737,6 @@ static int sun6i_rtc_resume(struct device *dev)
738
737
739
738
return 0 ;
740
739
}
741
- #endif
742
740
743
741
static SIMPLE_DEV_PM_OPS (sun6i_rtc_pm_ops ,
744
742
sun6i_rtc_suspend , sun6i_rtc_resume ) ;
@@ -859,6 +857,11 @@ static int sun6i_rtc_probe(struct platform_device *pdev)
859
857
return 0 ;
860
858
}
861
859
860
+ static void sun6i_rtc_shutdown (struct platform_device * pdev )
861
+ {
862
+ sun6i_rtc_suspend (& pdev -> dev );
863
+ }
864
+
862
865
/*
863
866
* As far as RTC functionality goes, all models are the same. The
864
867
* datasheets claim that different models have different number of
@@ -881,6 +884,7 @@ MODULE_DEVICE_TABLE(of, sun6i_rtc_dt_ids);
881
884
882
885
static struct platform_driver sun6i_rtc_driver = {
883
886
.probe = sun6i_rtc_probe ,
887
+ .shutdown = sun6i_rtc_shutdown ,
884
888
.driver = {
885
889
.name = "sun6i-rtc" ,
886
890
.of_match_table = sun6i_rtc_dt_ids ,
0 commit comments