xref: /OK3568_Linux_fs/kernel/drivers/mmc/host/sdhci-cqhci.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright 2022 The Chromium OS Authors
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Support that applies to the combination of SDHCI and CQHCI, while not
6*4882a593Smuzhiyun  * expressing a dependency between the two modules.
7*4882a593Smuzhiyun  */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #ifndef __MMC_HOST_SDHCI_CQHCI_H__
10*4882a593Smuzhiyun #define __MMC_HOST_SDHCI_CQHCI_H__
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun #include "cqhci.h"
13*4882a593Smuzhiyun #include "sdhci.h"
14*4882a593Smuzhiyun 
sdhci_and_cqhci_reset(struct sdhci_host * host,u8 mask)15*4882a593Smuzhiyun static inline void sdhci_and_cqhci_reset(struct sdhci_host *host, u8 mask)
16*4882a593Smuzhiyun {
17*4882a593Smuzhiyun 	if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL) &&
18*4882a593Smuzhiyun 	    host->mmc->cqe_private)
19*4882a593Smuzhiyun 		cqhci_deactivate(host->mmc);
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun 	sdhci_reset(host, mask);
22*4882a593Smuzhiyun }
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun #endif /* __MMC_HOST_SDHCI_CQHCI_H__ */
25