by v01d » Tue Apr 02, 2013 2:46 pm
Well I've starting dwelling into this and i'm a bit stuck.
It seems that there's a major portion of the required code (the mt9v032 module and the omap3isp), but the board-over.c file, which initializes the Overo's devices does not initialize the camera. So, I've found the appropriate patch and modified it a bit to correspond to linux 3.7. The problem is it does not compile since it seems it is designed for a previous version of omap3isp. The problem is that some omap3isp structure differs and therefore compilation fails. I wouldn't know how to adapt the code since it seems I would need to configure things like HSYNC/VSYNC polarity and "data polarity" fields.
The patch I have is:
$this->bbcode_second_pass_code('', '--- linux-3.7/arch/arm/mach-omap2/board-overo.c.orig 2012-12-10 21:30:57.000000000 -0600
+++ linux-3.7/arch/arm/mach-omap2/board-overo.c 2013-04-02 08:05:10.000000000 -0500
@@ -69,6 +69,68 @@
#define OVERO_SMSC911X2_CS 4
#define OVERO_SMSC911X2_GPIO 65
+#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
+
+#include <media/mt9v032.h>
+#include "devices.h"
+#include "../../../drivers/media/platform/omap3isp/isp.h"
+
+#define MT9V032_I2C_ADDR 0x5C
+#define MT9V032_I2C_BUS_NUM 3
+
+static void mt9v032_set_clock(struct v4l2_subdev *subdev, unsigned int rate)
+{
+ struct isp_device *isp = v4l2_dev_to_isp_device(subdev->v4l2_dev);
+
+ isp->platform_cb.set_xclk(isp, rate, ISP_XCLK_A);
+}
+
+static struct mt9v032_platform_data mt9v032_platform_data = {
+ .clk_pol = 0,
+ .set_clock = mt9v032_set_clock,
+};
+
+static struct i2c_board_info mt9v032_i2c_device = {
+ I2C_BOARD_INFO("mt9v032", MT9V032_I2C_ADDR),
+ .platform_data = &mt9v032_platform_data,
+};
+
+static struct isp_subdev_i2c_board_info mt9v032_subdevs[] = {
+ {
+ .board_info = &mt9v032_i2c_device,
+ .i2c_adapter_id = MT9V032_I2C_BUS_NUM,
+ },
+ { NULL, 0, },
+};
+
+static struct isp_v4l2_subdevs_group overo_camera_subdevs[] = {
+ {
+ .subdevs = mt9v032_subdevs,
+ .interface = ISP_INTERFACE_PARALLEL,
+ .bus = {
+ .parallel = {
+ .data_lane_shift = 0,
+ .clk_pol = 0,
+ .bridge = ISPCTRL_PAR_BRIDGE_DISABLE,
+ }
+ },
+ },
+ { NULL, 0, },
+};
+
+static struct isp_platform_data overo_isp_platform_data = {
+ .subdevs = overo_camera_subdevs,
+};
+
+static int __init overo_camera_init(void)
+{
+ return omap3_init_camera(&overo_isp_platform_data);
+}
+
+#else
+static inline void overo_camera_init(void) { return; }
+#endif
+
#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
@@ -505,6 +567,7 @@
overo_init_led();
overo_init_keys();
omap_twl4030_audio_init("overo");
+ overo_camera_init();
/* Ensure SDRC pins are mux'd for self-refresh */
omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
')
It fails on line:
$this->bbcode_second_pass_code('', '+ .bridge = ISPCTRL_PAR_BRIDGE_DISABLE,')
This "bridge" field does not exist but it should not be a problem since it seems current omap3isp takes care of such functionality internally. However, current structure implements new fields which need to be set for it to compile.