All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: unlisted-recipients:; (no To-header on input)@bombadil.infradead.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>,
	Jacob Chen <jacob-chen@iotwrt.com>,
	Mauro Carvalho Chehab <mchehab@s-opensource.com>
Subject: [PATCH 3/5] media: omap3isp: allow it to build with COMPILE_TEST
Date: Tue, 17 Apr 2018 06:20:13 -0400	[thread overview]
Message-ID: <2c20d94e468837a035a30c84723442769a306083.1523960171.git.mchehab@s-opensource.com> (raw)
In-Reply-To: <cover.1523960171.git.mchehab@s-opensource.com>
In-Reply-To: <cover.1523960171.git.mchehab@s-opensource.com>

From: Arnd Bergmann <arnd@arndb.de>

There aren't much things required for it to build with COMPILE_TEST.
It just needs to not compile the code that depends on arm-specific
iommu implementation.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Co-developed-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 drivers/media/platform/Kconfig        | 6 ++----
 drivers/media/platform/omap3isp/isp.c | 8 ++++++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 1ee915b794c0..2757b621091c 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -63,12 +63,10 @@ config VIDEO_MUX
 config VIDEO_OMAP3
 	tristate "OMAP 3 Camera support"
 	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
-	depends on ARCH_OMAP3 || COMPILE_TEST
-	depends on ARM
+	depends on ((ARCH_OMAP3 && OMAP_IOMMU) || COMPILE_TEST)
 	depends on COMMON_CLK
 	depends on HAS_DMA && OF
-	depends on OMAP_IOMMU
-	select ARM_DMA_USE_IOMMU
+	select ARM_DMA_USE_IOMMU if OMAP_IOMMU
 	select VIDEOBUF2_DMA_CONTIG
 	select MFD_SYSCON
 	select V4L2_FWNODE
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 16c50099cccd..b8c8761a76b6 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -61,7 +61,9 @@
 #include <linux/sched.h>
 #include <linux/vmalloc.h>
 
+#ifdef CONFIG_ARM_DMA_USE_IOMMU
 #include <asm/dma-iommu.h>
+#endif
 
 #include <media/v4l2-common.h>
 #include <media/v4l2-fwnode.h>
@@ -1938,12 +1940,15 @@ static int isp_initialize_modules(struct isp_device *isp)
 
 static void isp_detach_iommu(struct isp_device *isp)
 {
+#ifdef CONFIG_ARM_DMA_USE_IOMMU
 	arm_iommu_release_mapping(isp->mapping);
 	isp->mapping = NULL;
+#endif
 }
 
 static int isp_attach_iommu(struct isp_device *isp)
 {
+#ifdef CONFIG_ARM_DMA_USE_IOMMU
 	struct dma_iommu_mapping *mapping;
 	int ret;
 
@@ -1972,6 +1977,9 @@ static int isp_attach_iommu(struct isp_device *isp)
 error:
 	isp_detach_iommu(isp);
 	return ret;
+#else
+	return -ENODEV;
+#endif
 }
 
 /*
-- 
2.14.3

  parent reply	other threads:[~2018-04-17 10:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 10:20 [PATCH 0/5] Remaining COMPILE_TEST and smatch cleanups Mauro Carvalho Chehab
2018-04-17 10:20 ` [PATCH 1/5] omap: omap-iommu.h: allow building drivers with COMPILE_TEST Mauro Carvalho Chehab
2018-04-17 10:20 ` [PATCH 2/5] media: omap3isp: Enable driver compilation on ARM " Mauro Carvalho Chehab
2018-04-17 10:20 ` Mauro Carvalho Chehab [this message]
2018-04-17 10:20 ` [PATCH 4/5] media: v4l2-compat-ioctl32: fix several __user annotations Mauro Carvalho Chehab
2018-04-17 10:33   ` Hans Verkuil
2018-04-17 10:53     ` Mauro Carvalho Chehab
2018-04-17 11:04       ` Hans Verkuil
2018-04-17 11:30         ` Mauro Carvalho Chehab
2018-04-17 13:01         ` Mauro Carvalho Chehab
2018-04-17 13:10           ` Mauro Carvalho Chehab
2018-04-17 13:58             ` Mauro Carvalho Chehab
2018-04-17 14:21               ` Mauro Carvalho Chehab
2018-04-17 13:11           ` Hans Verkuil
2018-04-17 13:35             ` Mauro Carvalho Chehab
2018-04-17 10:20 ` [PATCH 5/5] media: v4l2-compat-ioctl32: better name userspace pointers Mauro Carvalho Chehab
2018-04-17 10:37   ` Hans Verkuil
2018-04-17 10:22 ` [PATCH 0/5] Remaining COMPILE_TEST and smatch cleanups Mauro Carvalho Chehab
     [not found] ` <20180418090414.6h5q3zfm3udzscd7@valkosipuli.retiisi.org.uk>
2018-04-19 10:42   ` Mauro Carvalho Chehab
2018-04-23 14:09     ` Sakari Ailus
2018-04-23 14:37       ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c20d94e468837a035a30c84723442769a306083.1523960171.git.mchehab@s-opensource.com \
    --to=mchehab@s-opensource.com \
    --cc=arnd@arndb.de \
    --cc=hans.verkuil@cisco.com \
    --cc=jacob-chen@iotwrt.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=p.zabel@pengutronix.de \
    --cc=ramesh.shanmugasundaram@bp.renesas.com \
    --cc=stanimir.varbanov@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.