aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2011-09-23 09:37:27 -0400
committerOhad Ben-Cohen <ohad@wizery.com>2011-12-05 08:43:30 -0500
commit1fa02ac9536c9a5278e999e40e274bba62c23a4d (patch)
tree46dc370512775faba7920b8ff4e1b40c186e8dee /arch/arm
parentcfcfc9eca2bcbd26a8e206baeb005b055dbf8e37 (diff)
ARM: OMAP: iommu: declare a private iommu binding struct
Declare an omap iommu private struct, which binds an iommu user to its iommu device. This struct should be placed at the iommu user's dev_archdata so generic IOMMU API can be used without having to utilize omap-specific plumbing anymore. While at it, provide an accessor method to ease the retrieval of the omap_iommu handle from a user device. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Acked-by: Tony Lindgren <tony@atomide.com> Cc: Hiroshi Doyu <hdoyu@nvidia.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/plat-omap/include/plat/iommu.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h
index a1d79ee19250..fa11ee26aca9 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -111,6 +111,32 @@ struct iommu_platform_data {
111 u32 da_end; 111 u32 da_end;
112}; 112};
113 113
114/**
115 * struct iommu_arch_data - omap iommu private data
116 * @name: name of the iommu device
117 * @iommu_dev: handle of the iommu device
118 *
119 * This is an omap iommu private data object, which binds an iommu user
120 * to its iommu device. This object should be placed at the iommu user's
121 * dev_archdata so generic IOMMU API can be used without having to
122 * utilize omap-specific plumbing anymore.
123 */
124struct omap_iommu_arch_data {
125 const char *name;
126 struct omap_iommu *iommu_dev;
127};
128
129/**
130 * dev_to_omap_iommu() - retrieves an omap iommu object from a user device
131 * @dev: iommu client device
132 */
133static inline struct omap_iommu *dev_to_omap_iommu(struct device *dev)
134{
135 struct omap_iommu_arch_data *arch_data = dev->archdata.iommu;
136
137 return arch_data->iommu_dev;
138}
139
114/* IOMMU errors */ 140/* IOMMU errors */
115#define OMAP_IOMMU_ERR_TLB_MISS (1 << 0) 141#define OMAP_IOMMU_ERR_TLB_MISS (1 << 0)
116#define OMAP_IOMMU_ERR_TRANS_FAULT (1 << 1) 142#define OMAP_IOMMU_ERR_TRANS_FAULT (1 << 1)