diff options
author | Tony Lindgren <tony@atomide.com> | 2020-07-06 21:39:34 +0300 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2020-08-13 09:49:42 +0300 |
commit | 819e42e00d2eca536d5187de21971ed345861102 (patch) | |
tree | 28f5c4399be1d4d138874e3df557adc58dd4209a /drivers | |
parent | 7d2594cd1fa0b03b2746ce811926ee150a3a14fa (diff) | |
download | linux-819e42e00d2eca536d5187de21971ed345861102.tar.xz |
mfd: motorola-cpcap: Disable interrupt for suspend
Otherwise we get spammed with errors on resume after rtcwake:
cpcap-core spi0.0: Failed to read IRQ status: -108
Note that rtcwake is still capable of waking up the system with
this patch.
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mfd/motorola-cpcap.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c index 52f38e57cdc1..2283d88adcc2 100644 --- a/drivers/mfd/motorola-cpcap.c +++ b/drivers/mfd/motorola-cpcap.c @@ -214,6 +214,28 @@ static const struct regmap_config cpcap_regmap_config = { .val_format_endian = REGMAP_ENDIAN_LITTLE, }; +#ifdef CONFIG_PM_SLEEP +static int cpcap_suspend(struct device *dev) +{ + struct spi_device *spi = to_spi_device(dev); + + disable_irq(spi->irq); + + return 0; +} + +static int cpcap_resume(struct device *dev) +{ + struct spi_device *spi = to_spi_device(dev); + + enable_irq(spi->irq); + + return 0; +} +#endif + +static SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume); + static const struct mfd_cell cpcap_mfd_devices[] = { { .name = "cpcap_adc", @@ -313,6 +335,7 @@ static struct spi_driver cpcap_driver = { .driver = { .name = "cpcap-core", .of_match_table = cpcap_of_match, + .pm = &cpcap_pm, }, .probe = cpcap_probe, }; |