linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: motorola-cpcap: Disable interrupt for suspend
@ 2020-07-06 18:39 Tony Lindgren
  2020-07-16 14:57 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Tony Lindgren @ 2020-07-06 18:39 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Merlijn Wajer, Pavel Machek, Sebastian Reichel

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>
---

This has always been broken so can be merged whenever.

---
 drivers/mfd/motorola-cpcap.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
--- 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,
 };
-- 
2.27.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mfd: motorola-cpcap: Disable interrupt for suspend
  2020-07-06 18:39 [PATCH] mfd: motorola-cpcap: Disable interrupt for suspend Tony Lindgren
@ 2020-07-16 14:57 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2020-07-16 14:57 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-kernel, Merlijn Wajer, Pavel Machek, Sebastian Reichel

On Mon, 06 Jul 2020, Tony Lindgren wrote:

> 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>
> ---
> 
> This has always been broken so can be merged whenever.
> 
> ---
>  drivers/mfd/motorola-cpcap.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-16 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 18:39 [PATCH] mfd: motorola-cpcap: Disable interrupt for suspend Tony Lindgren
2020-07-16 14:57 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).