Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rtc: ti-k3: Add support to resume from IO DDR low power mode

Restore the RTC HW context which may be lost when system enters
certain low power mode (IO+DDR mode).
Check if the RTC registers are locked which would indicate loss of
context (reset) and restore the context as needed.

Signed-off-by: Akashdeep Kaur <a-kaur@ti.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Link: https://patch.msgid.link/20260313111740.1492519-1-a-kaur@ti.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Akashdeep Kaur and committed by
Alexandre Belloni
0e9b12ee e9f850ba

+9 -1
+9 -1
drivers/rtc/rtc-ti-k3.c
··· 640 640 static int __maybe_unused ti_k3_rtc_resume(struct device *dev) 641 641 { 642 642 struct ti_k3_rtc *priv = dev_get_drvdata(dev); 643 + int ret = 0; 644 + 645 + if (k3rtc_check_unlocked(priv)) { 646 + /* RTC locked implies low power mode exit where RTC loses context */ 647 + ret = k3rtc_configure(dev); 648 + if (ret) 649 + return ret; 650 + } 643 651 644 652 if (device_may_wakeup(dev)) 645 653 disable_irq_wake(priv->irq); 646 - return 0; 654 + return ret; 647 655 } 648 656 649 657 static SIMPLE_DEV_PM_OPS(ti_k3_rtc_pm_ops, ti_k3_rtc_suspend, ti_k3_rtc_resume);