1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * CQHCI crypto engine (inline encryption) support
5 * Copyright 2020 Google LLC
8 #ifndef LINUX_MMC_CQHCI_CRYPTO_H
9 #define LINUX_MMC_CQHCI_CRYPTO_H
11 #include <linux/mmc/host.h>
15 #ifdef CONFIG_MMC_CRYPTO
17 int cqhci_crypto_init(struct cqhci_host *host);
20 * Returns the crypto bits that should be set in bits 64-127 of the
23 static inline u64 cqhci_crypto_prep_task_desc(struct mmc_request *mrq)
25 if (!mrq->crypto_enabled)
28 return CQHCI_CRYPTO_ENABLE_BIT |
29 CQHCI_CRYPTO_KEYSLOT(mrq->crypto_key_slot) |
33 #else /* CONFIG_MMC_CRYPTO */
35 static inline int cqhci_crypto_init(struct cqhci_host *host)
40 static inline u64 cqhci_crypto_prep_task_desc(struct mmc_request *mrq)
45 #endif /* !CONFIG_MMC_CRYPTO */
47 #endif /* LINUX_MMC_CQHCI_CRYPTO_H */