rtc: max77686: Fix wake-ups for max77620
authorJon Hunter <jonathanh@nvidia.com>
Thu, 6 Aug 2020 12:54:31 +0000 (13:54 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 7 Aug 2020 21:29:47 +0000 (23:29 +0200)
commit16c24801122e2961c588562f04707b98f9c84bbb
tree11d92bac5665157f9145910896eafc9897c58903
parent9bf1306257589b3a5ad46175538af9922d94e26f
rtc: max77686: Fix wake-ups for max77620

Following commit d8f090dbeafd ("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 d8f090dbeafd ("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: d8f090dbeafd ("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
drivers/rtc/rtc-max77686.c