All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V1] mmc: sdhci-msm: Add wakeup functionality support for sdio cards
@ 2022-04-26  9:10 Srinivasarao Pathipati
  2022-04-26 22:35 ` Ulf Hansson
  0 siblings, 1 reply; 4+ messages in thread
From: Srinivasarao Pathipati @ 2022-04-26  9:10 UTC (permalink / raw)
  To: ulf.hansson, u.kleine-koenig, YehezkelShB, rmk+kernel, t.scherer,
	s.shtylyov, sensor1010, sartgarg, hns, uic_kamasali, quic_spathi,
	tiantao6, linux-mmc, linux-kernel
  Cc: kamasali

From: Sarthak Garg <sartgarg@codeaurora.org>

This adds external GPIO wakeup support to sdhci-msm driver
for sdio cards.

Also enables clk gating only in system Suspend/Resume for SDIO card.

Also add the below fixes from 4.9 kernel :

c363224b: Fix wakeup functionality for SDIO
61fc5bf6: Remove flag MMC_PM_WAKE_SDIO_IRQ in mmc_resume_host
a7a2a82e: Set sdio_pending_processing default state to false.

Signed-off-by: Sarthak Garg <sartgarg@codeaurora.org>
Signed-off-by: kamasali <quic_kamasali@quicinc.com>
Signed-off-by: Srinivasarao Pathipati <quic_spathi@quicinc.com>
---
 drivers/mmc/core/bus.c  | 7 +++++++
 drivers/mmc/core/sdio.c | 1 +
 2 files changed, 8 insertions(+)

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 58a60af..a475fe1 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -364,6 +364,13 @@ int mmc_add_card(struct mmc_card *card)
 #endif
 	card->dev.of_node = mmc_of_find_child_device(card->host, 0);
 
+	if (mmc_card_sdio(card)) {
+		ret = device_init_wakeup(&card->dev, true);
+		if (ret)
+			pr_err("%s: %s: failed to init wakeup: %d\n",
+				mmc_hostname(card->host), __func__, ret);
+	}
+
 	device_enable_async_suspend(&card->dev);
 
 	ret = device_add(&card->dev);
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 25799ac..9502318 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1096,6 +1096,7 @@ static int mmc_sdio_resume(struct mmc_host *host)
 	mmc_release_host(host);
 
 	host->pm_flags &= ~MMC_PM_KEEP_POWER;
+	host->pm_flags &= ~MMC_PM_WAKE_SDIO_IRQ;
 	return err;
 }
 
-- 
2.7.4


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

end of thread, other threads:[~2022-05-26 11:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26  9:10 [PATCH V1] mmc: sdhci-msm: Add wakeup functionality support for sdio cards Srinivasarao Pathipati
2022-04-26 22:35 ` Ulf Hansson
2022-05-24 11:56   ` Kamasali Satyanarayan (Consultant) (QUIC)
2022-05-26 11:58     ` Sarthak Garg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.