Commit e740d199 authored by Luca Ceresoli's avatar Luca Ceresoli Committed by Hans Verkuil
Browse files

staging: media: tegra-video: add support for Tegra20 parallel input



The VI peripheral of Tegra supports capturing from MIPI CSI-2 or parallel
video (called VIP in the docs).

The staging tegra-video driver currently implements MIPI CSI-2 video
capture for Tegra210. Add support for parallel video capture (VIP) on
Tegra20. With the generalizations added to the VI driver in previous
commits, this is only a matter of adding the vip.c and tegra20.c
implementations and registering them.

Unfortunately there was no documentation available for the VI or VIP
peripherals of Tegra20 (or any other Tegra chips). This implementation has
been based entirely on the code from a vendor kernel based on Linux 3.1 and
massively adapted to fit into the tegra-video driver. Parts of this code is
definitely non-optimal to say the least (especially tegra20_vi_enable() and
the single-frame capture logic), but it was impossible to improve it.

Signed-off-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: fix host1x_client_unregister usage: it's now a void func]
parent eeb036ab
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2,7 +2,9 @@
tegra-video-objs := \
		video.o \
		vi.o \
		vip.o \
		csi.o

tegra-video-$(CONFIG_ARCH_TEGRA_2x_SOC)  += tegra20.o
tegra-video-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210.o
obj-$(CONFIG_VIDEO_TEGRA) += tegra-video.o
+661 −0

File added.

Preview size limit exceeded, changes collapsed.

+3 −0
Original line number Diff line number Diff line
@@ -1955,6 +1955,9 @@ static int tegra_vi_remove(struct platform_device *pdev)
}

static const struct of_device_id tegra_vi_of_id_table[] = {
#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
	{ .compatible = "nvidia,tegra20-vi",  .data = &tegra20_vi_soc },
#endif
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
	{ .compatible = "nvidia,tegra210-vi", .data = &tegra210_vi_soc },
#endif
+3 −0
Original line number Diff line number Diff line
@@ -296,6 +296,9 @@ struct tegra_video_format {
	u32 fourcc;
};

#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
extern const struct tegra_vi_soc tegra20_vi_soc;
#endif
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
extern const struct tegra_vi_soc tegra210_vi_soc;
#endif
+5 −0
Original line number Diff line number Diff line
@@ -123,6 +123,10 @@ static int host1x_video_remove(struct host1x_device *dev)
}

static const struct of_device_id host1x_video_subdevs[] = {
#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
	{ .compatible = "nvidia,tegra20-vip", },
	{ .compatible = "nvidia,tegra20-vi", },
#endif
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
	{ .compatible = "nvidia,tegra210-csi", },
	{ .compatible = "nvidia,tegra210-vi", },
@@ -141,6 +145,7 @@ static struct host1x_driver host1x_video_driver = {

static struct platform_driver * const drivers[] = {
	&tegra_csi_driver,
	&tegra_vip_driver,
	&tegra_vi_driver,
};

Loading