From 4a34ec8e470cb126b85f737d73a879726c66259e Mon Sep 17 00:00:00 2001 From: Steve Longerbeam Date: Wed, 7 Jun 2017 15:34:01 -0300 Subject: [PATCH] [media] media: imx: Add CSI subdev driver This is a media entity subdevice for the i.MX Camera Sensor Interface module. - Added support for negotiation of frame intervals. - Fixed cropping rectangle negotiation at input and output pads. - Added support for /2 downscaling, if the output pad dimension(s) are 1/2 the crop dimension(s) at csi_setup() time. Signed-off-by: Steve Longerbeam Signed-off-by: Russell King Signed-off-by: Philipp Zabel [hans.verkuil@cisco.com: add linux/pinctrl/consumer.h include] Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/imx/Kconfig | 14 + drivers/staging/media/imx/Makefile | 2 + drivers/staging/media/imx/imx-media-csi.c | 1473 +++++++++++++++++++++ 3 files changed, 1489 insertions(+) create mode 100644 drivers/staging/media/imx/imx-media-csi.c diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index 5e79a36ce225..7eff50bcea39 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -5,3 +5,17 @@ config VIDEO_IMX_MEDIA ---help--- Say yes here to enable support for video4linux media controller driver for the i.MX5/6 SOC. + +if VIDEO_IMX_MEDIA +menu "i.MX5/6 Media Sub devices" + +config VIDEO_IMX_CSI + tristate "i.MX5/6 Camera Sensor Interface driver" + depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C + select VIDEOBUF2_DMA_CONTIG + default y + ---help--- + A video4linux camera sensor interface driver for i.MX5/6. + +endmenu +endif diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index 4606a3a28831..c054490589ff 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -4,3 +4,5 @@ imx-media-common-objs := imx-media-utils.o imx-media-fim.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-capture.o + +obj-$(CONFIG_VIDEO_IMX_CSI) += imx-media-csi.o diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c new file mode 100644 index 000000000000..1e926ec5ac6f --- /dev/null +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -0,0 +1,1473 @@ +/* + * V4L2 Capture CSI Subdev for Freescale i.MX5/6 SOC + * + * Copyright (c) 2014-2017 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include