@@ -38,6 +38,7 @@
#include <linux/regulator/machine.h>
#include <linux/smsc911x.h>
#include <linux/sh_intc.h>
+#include <linux/sh_iommu.h>
#include <linux/sh_clk.h>
#include <linux/gpio.h>
#include <linux/input.h>
@@ -61,7 +62,6 @@
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/sh7372.h>
-#include <mach/ipmmu.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -45,6 +45,7 @@
#include <linux/regulator/machine.h>
#include <linux/smsc911x.h>
#include <linux/sh_intc.h>
+#include <linux/sh_iommu.h>
#include <linux/tca6416_keypad.h>
#include <linux/usb/renesas_usbhs.h>
#include <linux/dma-mapping.h>
@@ -60,7 +61,6 @@
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/sh7372.h>
-#include <mach/ipmmu.h>
#include <asm/mach/arch.h>
#include <asm/mach-types.h>
@@ -30,6 +30,7 @@
#include <linux/serial_sci.h>
#include <linux/sh_dma.h>
#include <linux/sh_intc.h>
+#include <linux/sh_iommu.h>
#include <linux/sh_timer.h>
#include <linux/pm_domain.h>
#include <linux/dma-mapping.h>
@@ -38,7 +39,6 @@
#include <mach/irqs.h>
#include <mach/sh7372.h>
#include <mach/common.h>
-#include <mach/ipmmu.h>
#include <asm/mach/map.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -23,8 +23,10 @@
#include <linux/io.h>
#include <linux/iommu.h>
#include <linux/platform_device.h>
+#include <linux/sh_iommu.h>
#include <linux/slab.h>
-#include <mach/ipmmu.h>
+
+#include "shmobile-ipmmu.h"
#define L1_SIZE CONFIG_SHMOBILE_IOMMU_L1SIZE
#define L1_LEN (L1_SIZE / 4)
@@ -22,7 +22,8 @@
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
-#include <mach/ipmmu.h>
+
+#include "shmobile-ipmmu.h"
#define IMCTR1 0x000
#define IMCTR2 0x004
similarity index 78%
rename from arch/arm/mach-shmobile/include/mach/ipmmu.h
rename to drivers/iommu/shmobile-ipmmu.h
@@ -5,13 +5,8 @@
void ipmmu_tlb_flush(struct device *ipmmu_dev);
void ipmmu_tlb_set(struct device *ipmmu_dev, unsigned long phys, int size,
int asid);
-void ipmmu_add_device(struct device *dev);
int ipmmu_iommu_init(struct device *dev);
#else
-static inline void ipmmu_add_device(struct device *dev)
-{
-}
-
static int ipmmu_iommu_init(struct device *dev)
{
return -EINVAL;
new file mode 100644
@@ -0,0 +1,12 @@
+#ifndef __SH_IOMMU_H__
+#define __SH_IOMMU_H__
+
+#ifdef CONFIG_SHMOBILE_IPMMU_TLB
+void ipmmu_add_device(struct device *dev);
+#else
+static inline void ipmmu_add_device(struct device *dev)
+{
+}
+#endif
+
+#endif /* __SH_IOMMU_H__ */
And split the function used by board code to its own include/linux/sh_iommu.h header. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> --- arch/arm/mach-shmobile/board-ap4evb.c | 2 +- arch/arm/mach-shmobile/board-mackerel.c | 2 +- arch/arm/mach-shmobile/setup-sh7372.c | 2 +- drivers/iommu/shmobile-iommu.c | 4 +++- drivers/iommu/shmobile-ipmmu.c | 3 ++- .../mach/ipmmu.h => drivers/iommu/shmobile-ipmmu.h | 5 ----- include/linux/sh_iommu.h | 12 ++++++++++++ 7 files changed, 20 insertions(+), 10 deletions(-) rename arch/arm/mach-shmobile/include/mach/ipmmu.h => drivers/iommu/shmobile-ipmmu.h (78%) create mode 100644 include/linux/sh_iommu.h