Skip to content

Commit 5c4ca97

Browse files
committed
Merge branch 'patch/rtc-pm' into crust
2 parents 9160b55 + 4075faf commit 5c4ca97

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/rtc/rtc-sun6i.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,6 @@ static struct nvmem_config sun6i_rtc_nvmem_cfg = {
716716
.stride = 4,
717717
};
718718

719-
#ifdef CONFIG_PM_SLEEP
720719
/* Enable IRQ wake on suspend, to wake up from RTC. */
721720
static int sun6i_rtc_suspend(struct device *dev)
722721
{
@@ -729,7 +728,7 @@ static int sun6i_rtc_suspend(struct device *dev)
729728
}
730729

731730
/* 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)
733732
{
734733
struct sun6i_rtc_dev *chip = dev_get_drvdata(dev);
735734

@@ -738,7 +737,6 @@ static int sun6i_rtc_resume(struct device *dev)
738737

739738
return 0;
740739
}
741-
#endif
742740

743741
static SIMPLE_DEV_PM_OPS(sun6i_rtc_pm_ops,
744742
sun6i_rtc_suspend, sun6i_rtc_resume);
@@ -859,6 +857,11 @@ static int sun6i_rtc_probe(struct platform_device *pdev)
859857
return 0;
860858
}
861859

860+
static void sun6i_rtc_shutdown(struct platform_device *pdev)
861+
{
862+
sun6i_rtc_suspend(&pdev->dev);
863+
}
864+
862865
/*
863866
* As far as RTC functionality goes, all models are the same. The
864867
* datasheets claim that different models have different number of
@@ -881,6 +884,7 @@ MODULE_DEVICE_TABLE(of, sun6i_rtc_dt_ids);
881884

882885
static struct platform_driver sun6i_rtc_driver = {
883886
.probe = sun6i_rtc_probe,
887+
.shutdown = sun6i_rtc_shutdown,
884888
.driver = {
885889
.name = "sun6i-rtc",
886890
.of_match_table = sun6i_rtc_dt_ids,

0 commit comments

Comments
 (0)