Skip to content

Commit 16c2480

Browse files
jonhunteralexandrebelloni
authored andcommitted
rtc: max77686: Fix wake-ups for max77620
Following commit d8f090d ("rtc: max77686: Do not allow interrupt to fire before system resume"), RTC wake-ups stopped working on Jetson TX2 and Jetson Xavier platforms. The Jetson TX2 uses the max77620 PMIC and the Jetson Xavier uses max20024 PMIC. Both of these PMICs have the same max77620 RTC controller. For the max77620 RTC, the variable 'rtc_irq_from_platform' is defined as true in the max77686 driver and because of this the IRQ passed to the max77686 driver for RTC is the PMIC IRQ and not the parent. Hence, following commit d8f090d ("rtc: max77686: Do not allow interrupt to fire before system resume"), for the max77620 the RTC IRQ within the PMIC is now getting disabled on entry to suspend and unable to wake the system up. Fix this by only disabling interrupts on entry to suspend in the max77686 RTC driver, if the interrupt is the parent interrupt. Fixes: d8f090d ("rtc: max77686: Do not allow interrupt to fire before system resume") Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Tested-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200806125431.699339-1-jonathanh@nvidia.com
1 parent 9bf1306 commit 16c2480

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

drivers/rtc/rtc-max77686.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -815,13 +815,15 @@ static int max77686_rtc_suspend(struct device *dev)
815815
}
816816

817817
/*
818-
* Main IRQ (not virtual) must be disabled during suspend because if it
819-
* happens while suspended it will be handled before resuming I2C.
818+
* If the main IRQ (not virtual) is the parent IRQ, then it must be
819+
* disabled during suspend because if it happens while suspended it
820+
* will be handled before resuming I2C.
820821
*
821822
* Since Main IRQ is shared, all its users should disable it to be sure
822823
* it won't fire while one of them is still suspended.
823824
*/
824-
disable_irq(info->rtc_irq);
825+
if (!info->drv_data->rtc_irq_from_platform)
826+
disable_irq(info->rtc_irq);
825827

826828
return ret;
827829
}
@@ -830,7 +832,8 @@ static int max77686_rtc_resume(struct device *dev)
830832
{
831833
struct max77686_rtc_info *info = dev_get_drvdata(dev);
832834

833-
enable_irq(info->rtc_irq);
835+
if (!info->drv_data->rtc_irq_from_platform)
836+
enable_irq(info->rtc_irq);
834837

835838
if (device_may_wakeup(dev)) {
836839
struct max77686_rtc_info *info = dev_get_drvdata(dev);

0 commit comments

Comments
 (0)