Commit 819e42e0 authored by Tony Lindgren's avatar Tony Lindgren Committed by Lee Jones

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: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 7d2594cd
...@@ -214,6 +214,28 @@ static const struct regmap_config cpcap_regmap_config = { ...@@ -214,6 +214,28 @@ static const struct regmap_config cpcap_regmap_config = {
.val_format_endian = REGMAP_ENDIAN_LITTLE, .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[] = { static const struct mfd_cell cpcap_mfd_devices[] = {
{ {
.name = "cpcap_adc", .name = "cpcap_adc",
...@@ -313,6 +335,7 @@ static struct spi_driver cpcap_driver = { ...@@ -313,6 +335,7 @@ static struct spi_driver cpcap_driver = {
.driver = { .driver = {
.name = "cpcap-core", .name = "cpcap-core",
.of_match_table = cpcap_of_match, .of_match_table = cpcap_of_match,
.pm = &cpcap_pm,
}, },
.probe = cpcap_probe, .probe = cpcap_probe,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment