Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: cqhci: Add cqhci_deactivate()

Host controllers can reset CQHCI either directly or as a consequence of
host controller reset. Add cqhci_deactivate() which puts the CQHCI
driver into a state that is consistent with that.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
Link: https://lore.kernel.org/r/1583503724-13943-2-git-send-email-vbadigan@codeaurora.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Adrian Hunter and committed by
Ulf Hansson
0ffa6cfb 1a91a36a

+8 -4
+3 -3
drivers/mmc/host/cqhci.c
··· 298 298 cq_host->activated = false; 299 299 } 300 300 301 - int cqhci_suspend(struct mmc_host *mmc) 301 + int cqhci_deactivate(struct mmc_host *mmc) 302 302 { 303 303 struct cqhci_host *cq_host = mmc->cqe_private; 304 304 305 - if (cq_host->enabled) 305 + if (cq_host->enabled && cq_host->activated) 306 306 __cqhci_disable(cq_host); 307 307 308 308 return 0; 309 309 } 310 - EXPORT_SYMBOL(cqhci_suspend); 310 + EXPORT_SYMBOL(cqhci_deactivate); 311 311 312 312 int cqhci_resume(struct mmc_host *mmc) 313 313 {
+5 -1
drivers/mmc/host/cqhci.h
··· 230 230 int data_error); 231 231 int cqhci_init(struct cqhci_host *cq_host, struct mmc_host *mmc, bool dma64); 232 232 struct cqhci_host *cqhci_pltfm_init(struct platform_device *pdev); 233 - int cqhci_suspend(struct mmc_host *mmc); 233 + int cqhci_deactivate(struct mmc_host *mmc); 234 + static inline int cqhci_suspend(struct mmc_host *mmc) 235 + { 236 + return cqhci_deactivate(mmc); 237 + } 234 238 int cqhci_resume(struct mmc_host *mmc); 235 239 236 240 #endif