aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Parrot <bparrot@ti.com>2014-12-09 14:43:44 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-12-23 09:09:58 -0500
commit417d2e507edcb5cf15eb344f86bd3dd28737f24e (patch)
treec4f5d7079f63144c28aa5ceb6d7a94d7c62ae8cc
parent3b1635e02e524e2cc7bded4b998d35074b68065e (diff)
[media] media: platform: add VPFE capture driver support for AM437X
This patch adds Video Processing Front End (VPFE) driver for AM437X family of devices Driver supports the following: - V4L2 API using MMAP buffer access based on videobuf2 api - Asynchronous sensor/decoder sub device registration - DT support Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Darren Etheridge <detheridge@ti.com> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> [hans.verkuil@cisco.com: swapped two lines to fix vpfe_release() & add pinctrl include] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--Documentation/devicetree/bindings/media/ti-am437x-vpfe.txt61
-rw-r--r--MAINTAINERS9
-rw-r--r--drivers/media/platform/Kconfig1
-rw-r--r--drivers/media/platform/Makefile2
-rw-r--r--drivers/media/platform/am437x/Kconfig11
-rw-r--r--drivers/media/platform/am437x/Makefile3
-rw-r--r--drivers/media/platform/am437x/am437x-vpfe.c2778
-rw-r--r--drivers/media/platform/am437x/am437x-vpfe.h283
-rw-r--r--drivers/media/platform/am437x/am437x-vpfe_regs.h140
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/am437x-vpfe.h122
11 files changed, 3411 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/media/ti-am437x-vpfe.txt b/Documentation/devicetree/bindings/media/ti-am437x-vpfe.txt
new file mode 100644
index 000000000000..3932e766553a
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/ti-am437x-vpfe.txt
@@ -0,0 +1,61 @@
1Texas Instruments AM437x CAMERA (VPFE)
2--------------------------------------
3
4The Video Processing Front End (VPFE) is a key component for image capture
5applications. The capture module provides the system interface and the
6processing capability to connect RAW image-sensor modules and video decoders
7to the AM437x device.
8
9Required properties:
10- compatible: must be "ti,am437x-vpfe"
11- reg: physical base address and length of the registers set for the device;
12- interrupts: should contain IRQ line for the VPFE;
13- ti,am437x-vpfe-interface: can be one of the following,
14 0 - Raw Bayer Interface.
15 1 - 8 Bit BT656 Interface.
16 2 - 10 Bit BT656 Interface.
17 3 - YCbCr 8 Bit Interface.
18 4 - YCbCr 16 Bit Interface.
19
20VPFE supports a single port node with parallel bus. It should contain one
21'port' child node with child 'endpoint' node. Please refer to the bindings
22defined in Documentation/devicetree/bindings/media/video-interfaces.txt.
23
24Example:
25 vpfe: vpfe@f0034000 {
26 compatible = "ti,am437x-vpfe";
27 reg = <0x48328000 0x2000>;
28 interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
29
30 pinctrl-names = "default", "sleep";
31 pinctrl-0 = <&vpfe_pins_default>;
32 pinctrl-1 = <&vpfe_pins_sleep>;
33
34 port {
35 #address-cells = <1>;
36 #size-cells = <0>;
37
38 vpfe0_ep: endpoint {
39 remote-endpoint = <&ov2659_1>;
40 ti,am437x-vpfe-interface = <0>;
41 bus-width = <8>;
42 hsync-active = <0>;
43 vsync-active = <0>;
44 };
45 };
46 };
47
48 i2c1: i2c@4802a000 {
49
50 ov2659@30 {
51 compatible = "ti,ov2659";
52 reg = <0x30>;
53
54 port {
55 ov2659_1: endpoint {
56 remote-endpoint = <&vpfe0_ep>;
57 bus-width = <8>;
58 mclk-frequency = <12000000>;
59 };
60 };
61 };
diff --git a/MAINTAINERS b/MAINTAINERS
index dc2d91252d8b..4318f348dbd8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8745,6 +8745,15 @@ S: Maintained
8745F: drivers/media/platform/davinci/ 8745F: drivers/media/platform/davinci/
8746F: include/media/davinci/ 8746F: include/media/davinci/
8747 8747
8748TI AM437X VPFE DRIVER
8749M: Lad, Prabhakar <prabhakar.csengg@gmail.com>
8750L: linux-media@vger.kernel.org
8751W: http://linuxtv.org/
8752Q: http://patchwork.linuxtv.org/project/linux-media/list/
8753T: git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
8754S: Maintained
8755F: drivers/media/platform/am437x/
8756
8748SIS 190 ETHERNET DRIVER 8757SIS 190 ETHERNET DRIVER
8749M: Francois Romieu <romieu@fr.zoreil.com> 8758M: Francois Romieu <romieu@fr.zoreil.com>
8750L: netdev@vger.kernel.org 8759L: netdev@vger.kernel.org
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 480a174832a6..71e8873ceb94 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -118,6 +118,7 @@ config VIDEO_S3C_CAMIF
118source "drivers/media/platform/soc_camera/Kconfig" 118source "drivers/media/platform/soc_camera/Kconfig"
119source "drivers/media/platform/exynos4-is/Kconfig" 119source "drivers/media/platform/exynos4-is/Kconfig"
120source "drivers/media/platform/s5p-tv/Kconfig" 120source "drivers/media/platform/s5p-tv/Kconfig"
121source "drivers/media/platform/am437x/Kconfig"
121 122
122endif # V4L_PLATFORM_DRIVERS 123endif # V4L_PLATFORM_DRIVERS
123 124
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index a49936b8ce8a..3ec154742083 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -46,4 +46,6 @@ obj-$(CONFIG_VIDEO_RENESAS_VSP1) += vsp1/
46 46
47obj-y += omap/ 47obj-y += omap/
48 48
49obj-$(CONFIG_VIDEO_AM437X_VPFE) += am437x/
50
49ccflags-y += -I$(srctree)/drivers/media/i2c 51ccflags-y += -I$(srctree)/drivers/media/i2c
diff --git a/drivers/media/platform/am437x/Kconfig b/drivers/media/platform/am437x/Kconfig
new file mode 100644
index 000000000000..7b023a76e32e
--- /dev/null
+++ b/drivers/media/platform/am437x/Kconfig
@@ -0,0 +1,11 @@
1config VIDEO_AM437X_VPFE
2 tristate "TI AM437x VPFE video capture driver"
3 depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
4 depends on SOC_AM43XX || COMPILE_TEST
5 select VIDEOBUF2_DMA_CONTIG
6 help
7 Support for AM437x Video Processing Front End based Video
8 Capture Driver.
9
10 To compile this driver as a module, choose M here. The module
11 will be called am437x-vpfe.
diff --git a/drivers/media/platform/am437x/Makefile b/drivers/media/platform/am437x/Makefile
new file mode 100644
index 000000000000..d11fff16f260
--- /dev/null
+++ b/drivers/media/platform/am437x/Makefile
@@ -0,0 +1,3 @@
1# Makefile for AM437x VPFE driver
2
3obj-$(CONFIG_VIDEO_AM437X_VPFE) += am437x-vpfe.o
diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c
new file mode 100644
index 000000000000..e01ac22d6244
--- /dev/null
+++ b/drivers/media/platform/am437x/am437x-vpfe.c
@@ -0,0 +1,2778 @@
1/*
2 * TI VPFE capture Driver
3 *
4 * Copyright (C) 2013 - 2014 Texas Instruments, Inc.
5 *
6 * Benoit Parrot <bparrot@ti.com>
7 * Lad, Prabhakar <prabhakar.csengg@gmail.com>
8 *
9 * This program is free software; you may redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
17 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
18 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 * SOFTWARE.
21 */
22
23#include <linux/delay.h>
24#include <linux/err.h>
25#include <linux/init.h>
26#include <linux/interrupt.h>
27#include <linux/io.h>
28#include <linux/module.h>
29#include <linux/pinctrl/consumer.h>
30#include <linux/platform_device.h>
31#include <linux/pm_runtime.h>
32#include <linux/slab.h>
33#include <linux/uaccess.h>
34#include <linux/videodev2.h>
35
36#include <media/v4l2-common.h>
37#include <media/v4l2-ctrls.h>
38#include <media/v4l2-event.h>
39#include <media/v4l2-of.h>
40
41#include "am437x-vpfe.h"
42