mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09: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:
@@ -1382,6 +1382,18 @@ int rockchip_iommu_enable(struct device *dev)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(rockchip_iommu_enable);
|
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,
|
static void rk_iommu_detach_device(struct iommu_domain *domain,
|
||||||
struct device *dev)
|
struct device *dev)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ int rockchip_iommu_enable(struct device *dev);
|
|||||||
int rockchip_iommu_disable(struct device *dev);
|
int rockchip_iommu_disable(struct device *dev);
|
||||||
int rockchip_pagefault_done(struct device *master_dev);
|
int rockchip_pagefault_done(struct device *master_dev);
|
||||||
void __iomem *rockchip_get_iommu_base(struct device *master_dev, int idx);
|
void __iomem *rockchip_get_iommu_base(struct device *master_dev, int idx);
|
||||||
|
bool rockchip_iommu_is_enabled(struct device *dev);
|
||||||
#else
|
#else
|
||||||
static inline int rockchip_iommu_enable(struct device *dev)
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
static inline bool rockchip_iommu_is_enabled(struct device *dev)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user