]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/iommu.h
iommu/core: Convert iommu_found to iommu_present
[mv-sheeva.git] / include / linux / iommu.h
index 9940319d6f9d3ab0d1442a5fa31a7db9be6dafa3..f56e559442a2dad5975b73b4b8c703c634cf7e4d 100644 (file)
 #define IOMMU_WRITE    (2)
 #define IOMMU_CACHE    (4) /* DMA cache coherency */
 
+struct iommu_ops;
+struct bus_type;
 struct device;
 
 struct iommu_domain {
+       struct iommu_ops *ops;
        void *priv;
 };
 
 #define IOMMU_CAP_CACHE_COHERENCY      0x1
 #define IOMMU_CAP_INTR_REMAP           0x2     /* isolates device intrs */
 
+#ifdef CONFIG_IOMMU_API
+
 struct iommu_ops {
        int (*domain_init)(struct iommu_domain *domain);
        void (*domain_destroy)(struct iommu_domain *domain);
@@ -49,11 +54,10 @@ struct iommu_ops {
                              unsigned long cap);
 };
 
-#ifdef CONFIG_IOMMU_API
-
 extern void register_iommu(struct iommu_ops *ops);
-extern bool iommu_found(void);
-extern struct iommu_domain *iommu_domain_alloc(void);
+extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops);
+extern bool iommu_present(struct bus_type *bus);
+extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus);
 extern void iommu_domain_free(struct iommu_domain *domain);
 extern int iommu_attach_device(struct iommu_domain *domain,
                               struct device *dev);
@@ -70,16 +74,14 @@ extern int iommu_domain_has_cap(struct iommu_domain *domain,
 
 #else /* CONFIG_IOMMU_API */
 
-static inline void register_iommu(struct iommu_ops *ops)
-{
-}
+struct iommu_ops {};
 
-static inline bool iommu_found(void)
+static inline bool iommu_present(struct bus_type *bus)
 {
        return false;
 }
 
-static inline struct iommu_domain *iommu_domain_alloc(void)
+static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
 {
        return NULL;
 }