qcacld-3.0: Add PLD API for Audio SMMU map and unmap

Add PLD API support for mapping and unmapping memory
regions via platform driver API calls to Audio SMMU
context bank.

Change-Id: I93b5308ce6cb024773a780c0aaf98a4fd06281d7
CRs-Fixed: 3351568
This commit is contained in:
Yeshwanth Sriram Guntuka
2022-12-02 12:44:21 +05:30
committed by Madan Koyyalamudi
parent 075d170c06
commit 8ec8609bb9
3 changed files with 103 additions and 0 deletions

View File

@@ -1267,4 +1267,40 @@ static inline bool pld_get_enable_intx(struct device *dev)
* Return: true if it is one MSI
*/
bool pld_is_one_msi(struct device *dev);
#ifdef FEATURE_DIRECT_LINK
/**
* pld_audio_smmu_map()- Map memory region into Audio SMMU CB
* @dev: pointer to device structure
* @paddr: physical address
* @iova: DMA address
* @size: memory region size
*
* Return: 0 on success else failure code
*/
int pld_audio_smmu_map(struct device *dev, phys_addr_t paddr, dma_addr_t iova,
size_t size);
/**
* pld_audio_smmu_unmap()- Remove memory region mapping from Audio SMMU CB
* @dev: pointer to device structure
* @iova: DMA address
* @size: memory region size
*
* Return: None
*/
void pld_audio_smmu_unmap(struct device *dev, dma_addr_t iova, size_t size);
#else
static inline
int pld_audio_smmu_map(struct device *dev, phys_addr_t paddr, dma_addr_t iova,
size_t size)
{
return 0;
}
static inline
void pld_audio_smmu_unmap(struct device *dev, dma_addr_t iova, size_t size)
{
}
#endif
#endif