summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinctrl-amd.h
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-12-03 06:24:31 +0300
committerLinus Walleij <linus.walleij@linaro.org>2023-12-04 17:46:02 +0300
commit2fff0b5e1a6b9c577b4dd4958902c877159c856b (patch)
tree334cb0a9f4d79f803392e36b2a8b381efdf0b045 /drivers/pinctrl/pinctrl-amd.h
parent5c584f175d32f9cc66c909f851cd905da58b39ea (diff)
downloadlinux-2fff0b5e1a6b9c577b4dd4958902c877159c856b.tar.xz
pinctrl: amd: Mask non-wake source pins with interrupt enabled at suspend
If a pin isn't marked as a wake source processing any interrupts is just going to destroy battery life. The APU may wake up from a hardware sleep state to process the interrupt but not return control to the OS. Mask interrupt for all non-wake source pins at suspend. They'll be re-enabled at resume. Reported-and-tested-by: Marcus Aram <marcus+oss@oxar.nl> Reported-and-tested-by: Mark Herbert <mark.herbert42@gmail.com> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2812 Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20231203032431.30277-3-mario.limonciello@amd.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-amd.h')
-rw-r--r--drivers/pinctrl/pinctrl-amd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-amd.h b/drivers/pinctrl/pinctrl-amd.h
index 34c5c3e71fb2..cf59089f2776 100644
--- a/drivers/pinctrl/pinctrl-amd.h
+++ b/drivers/pinctrl/pinctrl-amd.h
@@ -80,6 +80,11 @@
#define FUNCTION_MASK GENMASK(1, 0)
#define FUNCTION_INVALID GENMASK(7, 0)
+#define WAKE_SOURCE (BIT(WAKE_CNTRL_OFF_S0I3) | \
+ BIT(WAKE_CNTRL_OFF_S3) | \
+ BIT(WAKE_CNTRL_OFF_S4) | \
+ BIT(WAKECNTRL_Z_OFF))
+
struct amd_function {
const char *name;
const char * const groups[NSELECTS];