summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap-2.6.39/camera/0003-Add-support-for-mt9p031-LI-5M03-module-in-Beagleboar.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-2.6.39/camera/0003-Add-support-for-mt9p031-LI-5M03-module-in-Beagleboar.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap-2.6.39/camera/0003-Add-support-for-mt9p031-LI-5M03-module-in-Beagleboar.patch162
1 files changed, 162 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-2.6.39/camera/0003-Add-support-for-mt9p031-LI-5M03-module-in-Beagleboar.patch b/extras/recipes-kernel/linux/linux-omap-2.6.39/camera/0003-Add-support-for-mt9p031-LI-5M03-module-in-Beagleboar.patch
new file mode 100644
index 00000000..a1807e73
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap-2.6.39/camera/0003-Add-support-for-mt9p031-LI-5M03-module-in-Beagleboar.patch
@@ -0,0 +1,162 @@
1From f662a8a2b9794121568903f5cc969e50eb151892 Mon Sep 17 00:00:00 2001
2From: Javier Martin <javier.martin@vista-silicon.com>
3Date: Mon, 30 May 2011 10:37:17 +0200
4Subject: [PATCH 3/3] Add support for mt9p031 (LI-5M03 module) in Beagleboard xM.
5
6Since isp clocks have not been exposed yet, this patch
7includes a temporal solution for testing mt9p031 driver
8in Beagleboard xM.
9
10Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
11---
12 arch/arm/mach-omap2/Makefile | 1 +
13 arch/arm/mach-omap2/board-omap3beagle-camera.c | 95 ++++++++++++++++++++++++
14 arch/arm/mach-omap2/board-omap3beagle.c | 5 +
15 3 files changed, 101 insertions(+), 0 deletions(-)
16 create mode 100644 arch/arm/mach-omap2/board-omap3beagle-camera.c
17
18diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
19index 512b152..05cd983 100644
20--- a/arch/arm/mach-omap2/Makefile
21+++ b/arch/arm/mach-omap2/Makefile
22@@ -179,6 +179,7 @@ obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o \
23 hsmmc.o
24 obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o
25 obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o \
26+ board-omap3beagle-camera.o \
27 hsmmc.o
28 obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o \
29 hsmmc.o
30diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c
31new file mode 100644
32index 0000000..2632557
33--- /dev/null
34+++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c
35@@ -0,0 +1,95 @@
36+#include <linux/gpio.h>
37+#include <linux/regulator/machine.h>
38+
39+#include <plat/i2c.h>
40+
41+#include <media/mt9p031.h>
42+#include <asm/mach-types.h>
43+#include "devices.h"
44+#include "../../../drivers/media/video/omap3isp/isp.h"
45+
46+#define MT9P031_RESET_GPIO 98
47+#define MT9P031_XCLK ISP_XCLK_A
48+
49+static struct regulator *reg_1v8, *reg_2v8;
50+
51+static int beagle_cam_set_xclk(struct v4l2_subdev *subdev, int hz)
52+{
53+ struct isp_device *isp = v4l2_dev_to_isp_device(subdev->v4l2_dev);
54+ int ret;
55+
56+ ret = isp->platform_cb.set_xclk(isp, hz, MT9P031_XCLK);
57+ return 0;
58+}
59+
60+static int beagle_cam_reset(struct v4l2_subdev *subdev, int active)
61+{
62+ /* Set RESET_BAR to !active */
63+ gpio_set_value(MT9P031_RESET_GPIO, !active);
64+
65+ return 0;
66+}
67+
68+static struct mt9p031_platform_data beagle_mt9p031_platform_data = {
69+ .set_xclk = beagle_cam_set_xclk,
70+ .reset = beagle_cam_reset,
71+ .vdd_io = MT9P031_VDD_IO_1V8,
72+ .version = MT9P031_COLOR_VERSION,
73+};
74+
75+static struct i2c_board_info mt9p031_camera_i2c_device = {
76+ I2C_BOARD_INFO("mt9p031", 0x48),
77+ .platform_data = &beagle_mt9p031_platform_data,
78+};
79+
80+static struct isp_subdev_i2c_board_info mt9p031_camera_subdevs[] = {
81+ {
82+ .board_info = &mt9p031_camera_i2c_device,
83+ .i2c_adapter_id = 2,
84+ },
85+ { NULL, 0, },
86+};
87+
88+static struct isp_v4l2_subdevs_group beagle_camera_subdevs[] = {
89+ {
90+ .subdevs = mt9p031_camera_subdevs,
91+ .interface = ISP_INTERFACE_PARALLEL,
92+ .bus = {
93+ .parallel = {
94+ .data_lane_shift = 0,
95+ .clk_pol = 1,
96+ .bridge = ISPCTRL_PAR_BRIDGE_DISABLE,
97+ }
98+ },
99+ },
100+ { },
101+};
102+
103+static struct isp_platform_data beagle_isp_platform_data = {
104+ .subdevs = beagle_camera_subdevs,
105+};
106+
107+static int __init beagle_camera_init(void)
108+{
109+ if (!machine_is_omap3_beagle() || !cpu_is_omap3630())
110+ return 0;
111+
112+ reg_1v8 = regulator_get(NULL, "cam_1v8");
113+ if (IS_ERR(reg_1v8))
114+ pr_err("%s: cannot get cam_1v8 regulator\n", __func__);
115+ else
116+ regulator_enable(reg_1v8);
117+
118+ reg_2v8 = regulator_get(NULL, "cam_2v8");
119+ if (IS_ERR(reg_2v8))
120+ pr_err("%s: cannot get cam_2v8 regulator\n", __func__);
121+ else
122+ regulator_enable(reg_2v8);
123+
124+ omap_register_i2c_bus(2, 100, NULL, 0);
125+ gpio_request(MT9P031_RESET_GPIO, "cam_rst");
126+ gpio_direction_output(MT9P031_RESET_GPIO, 0);
127+ omap3_init_camera(&beagle_isp_platform_data);
128+ return 0;
129+}
130+late_initcall(beagle_camera_init);
131diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
132index 221bfda..dd6e31f 100644
133--- a/arch/arm/mach-omap2/board-omap3beagle.c
134+++ b/arch/arm/mach-omap2/board-omap3beagle.c
135@@ -25,12 +25,16 @@
136 #include <linux/input.h>
137 #include <linux/gpio_keys.h>
138 #include <linux/opp.h>
139+#include <linux/i2c.h>
140+#include <linux/mm.h>
141+#include <linux/videodev2.h>
142
143 #include <linux/mtd/mtd.h>
144 #include <linux/mtd/partitions.h>
145 #include <linux/mtd/nand.h>
146 #include <linux/mmc/host.h>
147
148+#include <linux/gpio.h>
149 #include <linux/regulator/machine.h>
150 #include <linux/i2c/twl.h>
151
152@@ -48,6 +52,7 @@
153 #include <plat/nand.h>
154 #include <plat/usb.h>
155 #include <plat/omap_device.h>
156+#include <plat/i2c.h>
157
158 #include "mux.h"
159 #include "hsmmc.h"
160--
1611.6.6.1
162