mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 23:23:53 +02:00
iommu/rockchip: add rockchip_iommu_is_enabled api
Change-Id: I07ee2a1998322acec525868552c5626081bd8137 Signed-off-by: Simon Xue <xxm@rock-chips.com>
This commit is contained in:
parent
c231916b68
commit
18762023bb
|
|
@ -1382,6 +1382,18 @@ int rockchip_iommu_enable(struct device *dev)
|
|||
}
|
||||
EXPORT_SYMBOL(rockchip_iommu_enable);
|
||||
|
||||
bool rockchip_iommu_is_enabled(struct device *dev)
|
||||
{
|
||||
struct rk_iommu *iommu;
|
||||
|
||||
iommu = rk_iommu_from_dev(dev);
|
||||
if (!iommu)
|
||||
return false;
|
||||
|
||||
return rk_iommu_is_paging_enabled(iommu);
|
||||
}
|
||||
EXPORT_SYMBOL(rockchip_iommu_is_enabled);
|
||||
|
||||
static void rk_iommu_detach_device(struct iommu_domain *domain,
|
||||
struct device *dev)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ int rockchip_iommu_enable(struct device *dev);
|
|||
int rockchip_iommu_disable(struct device *dev);
|
||||
int rockchip_pagefault_done(struct device *master_dev);
|
||||
void __iomem *rockchip_get_iommu_base(struct device *master_dev, int idx);
|
||||
bool rockchip_iommu_is_enabled(struct device *dev);
|
||||
#else
|
||||
static inline int rockchip_iommu_enable(struct device *dev)
|
||||
{
|
||||
|
|
@ -29,6 +30,10 @@ static inline void __iomem *rockchip_get_iommu_base(struct device *master_dev, i
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline bool rockchip_iommu_is_enabled(struct device *dev)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user