qcacld-3.0: Add api to get smmu domain
Add api to get smmu domain from platform driver. Change-Id: I71efe1a770c8c73f17ffe574555aa9c3b3595819
This commit is contained in:
@@ -616,7 +616,11 @@ int pld_athdiag_read(struct device *dev, uint32_t offset, uint32_t memtype,
|
|||||||
uint32_t datalen, uint8_t *output);
|
uint32_t datalen, uint8_t *output);
|
||||||
int pld_athdiag_write(struct device *dev, uint32_t offset, uint32_t memtype,
|
int pld_athdiag_write(struct device *dev, uint32_t offset, uint32_t memtype,
|
||||||
uint32_t datalen, uint8_t *input);
|
uint32_t datalen, uint8_t *input);
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
|
||||||
|
void *pld_smmu_get_domain(struct device *dev);
|
||||||
|
#else
|
||||||
void *pld_smmu_get_mapping(struct device *dev);
|
void *pld_smmu_get_mapping(struct device *dev);
|
||||||
|
#endif
|
||||||
int pld_smmu_map(struct device *dev, phys_addr_t paddr,
|
int pld_smmu_map(struct device *dev, phys_addr_t paddr,
|
||||||
uint32_t *iova_addr, size_t size);
|
uint32_t *iova_addr, size_t size);
|
||||||
int pld_get_user_msi_assignment(struct device *dev, char *user_name,
|
int pld_get_user_msi_assignment(struct device *dev, char *user_name,
|
||||||
|
@@ -1398,6 +1398,30 @@ int pld_athdiag_write(struct device *dev, uint32_t offset,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pld_smmu_get_domain() - Get SMMU domain
|
||||||
|
* @dev: device
|
||||||
|
*
|
||||||
|
* Return: Pointer to the domain
|
||||||
|
*/
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
|
||||||
|
void *pld_smmu_get_domain(struct device *dev)
|
||||||
|
{
|
||||||
|
void *ptr = NULL;
|
||||||
|
enum pld_bus_type type = pld_get_bus_type(dev);
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case PLD_BUS_TYPE_SNOC:
|
||||||
|
ptr = pld_snoc_smmu_get_domain(dev);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
pr_err("Invalid device type %d\n", type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
#else
|
||||||
/**
|
/**
|
||||||
* pld_smmu_get_mapping() - Get SMMU mapping context
|
* pld_smmu_get_mapping() - Get SMMU mapping context
|
||||||
* @dev: device
|
* @dev: device
|
||||||
@@ -1423,6 +1447,7 @@ void *pld_smmu_get_mapping(struct device *dev)
|
|||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pld_smmu_map() - Map SMMU
|
* pld_smmu_map() - Map SMMU
|
||||||
|
@@ -95,10 +95,20 @@ static inline int pld_snoc_athdiag_write(struct device *dev, uint32_t offset,
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
|
||||||
|
static inline void *pld_snoc_smmu_get_domain(struct device *dev)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
static inline void *pld_snoc_smmu_get_mapping(struct device *dev)
|
static inline void *pld_snoc_smmu_get_mapping(struct device *dev)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr,
|
static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr,
|
||||||
uint32_t *iova_addr, size_t size)
|
uint32_t *iova_addr, size_t size)
|
||||||
{
|
{
|
||||||
@@ -218,10 +228,20 @@ static inline int pld_snoc_athdiag_write(struct device *dev, uint32_t offset,
|
|||||||
{
|
{
|
||||||
return icnss_athdiag_write(dev, offset, memtype, datalen, input);
|
return icnss_athdiag_write(dev, offset, memtype, datalen, input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
|
||||||
|
static inline void *pld_snoc_smmu_get_domain(struct device *dev)
|
||||||
|
{
|
||||||
|
return icnss_smmu_get_domain(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
static inline void *pld_snoc_smmu_get_mapping(struct device *dev)
|
static inline void *pld_snoc_smmu_get_mapping(struct device *dev)
|
||||||
{
|
{
|
||||||
return icnss_smmu_get_mapping(dev);
|
return icnss_smmu_get_mapping(dev);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr,
|
static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr,
|
||||||
uint32_t *iova_addr, size_t size)
|
uint32_t *iova_addr, size_t size)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user