All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Enrico <ebutera@users.berlios.de>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: Re: omap3isp device tree support
Date: Mon, 09 Dec 2013 14:11:06 +0100	[thread overview]
Message-ID: <99045482.9AfPL8T2Si@avalon> (raw)
In-Reply-To: <CA+2YH7ueF46YA2ZpOT80w3jTzmw0aFWhfshry2k_mrXAmW=MXA@mail.gmail.com>

Hi Enrico,

On Friday 06 December 2013 11:13:50 Enrico wrote:
> Hi,
> 
> i know there is some work going on for omap3isp device tree support,
> but right now is it possible to enable it in some other way in a DT
> kernel?
> 
> I've tried enabling it in board-generic.c (omap3_init_camera(...) with
> proper platform data) but it hangs early at boot, do someone know if
> it's possible and how to do it?

Here's what I currently use to test the mt9v032 driver on my Beagleboard-xM
with a mainline kernel. If you need proper regulators support it will get more
complex.

commit 9184392db932be81ea9d33080c1740c3a20f5132
Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date:   Mon Jun 20 13:21:17 2011 +0200

    board-omap3beagle: Add support for the MT9V034 sensor module
    
    Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 1f25f3e..8bc8695 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -239,7 +239,8 @@ obj-$(CONFIG_SOC_OMAP2420)		+= msdi.o
 obj-$(CONFIG_MACH_OMAP_GENERIC)		+= board-generic.o pdata-quirks.o
 obj-$(CONFIG_MACH_OMAP_H4)		+= board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)		+= board-2430sdp.o
-obj-$(CONFIG_MACH_OMAP3_BEAGLE)		+= board-omap3beagle.o
+obj-$(CONFIG_MACH_OMAP3_BEAGLE)		+= board-omap3beagle.o \
+					   board-omap3beagle-camera.o
 obj-$(CONFIG_MACH_DEVKIT8000)     	+= board-devkit8000.o
 obj-$(CONFIG_MACH_OMAP_LDP)		+= board-ldp.o
 obj-$(CONFIG_MACH_OMAP3530_LV_SOM)      += board-omap3logic.o
diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c
new file mode 100644
index 0000000..c927c23
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c
@@ -0,0 +1,93 @@
+/*
+ * arch/arm/mach-omap2/board-omap3beagle-camera.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <asm/mach-types.h>
+#include <linux/clk.h>
+#include <linux/i2c.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
+#include <plat/cpu.h>
+#include <plat/i2c.h>
+
+#include <media/mt9v032.h>
+#include <media/omap3isp.h>
+
+#include "devices.h"
+
+#define MT9V034_RESET_GPIO	98
+
+static struct regulator_consumer_supply mt9v034_dummy_supplies[] = {
+	REGULATOR_SUPPLY("vaa", "3-0048"),
+	REGULATOR_SUPPLY("vdd", "3-0048"),
+	REGULATOR_SUPPLY("vdd_io", "3-0048"),
+};
+
+static const s64 mt9v034_link_freqs[] = {
+	13000000,
+	26600000,
+	27000000,
+	0,
+};
+
+static struct mt9v032_platform_data beagle_mt9v034_platform_data = {
+	.clk_pol	= 0,
+	.link_freqs	= mt9v034_link_freqs,
+	.link_def_freq	= 26600000,
+};
+
+static struct i2c_board_info mt9v034_camera_i2c_device = {
+	I2C_BOARD_INFO("mt9v034", 0x48),
+	.platform_data = &beagle_mt9v034_platform_data,
+};
+
+static struct isp_subdev_i2c_board_info mt9v034_camera_subdevs[] = {
+	{
+		.board_info = &mt9v034_camera_i2c_device,
+		.i2c_adapter_id = 3,
+	},
+	{ NULL, 0, },
+};
+
+static struct isp_v4l2_subdevs_group beagle_camera_subdevs[] = {
+	{
+		.subdevs = mt9v034_camera_subdevs,
+		.interface = ISP_INTERFACE_PARALLEL,
+		.bus = {
+			.parallel = {
+				.data_lane_shift = ISP_LANE_SHIFT_2,
+				.clk_pol = 0,
+			}
+		},
+	},
+	{ },
+};
+
+static struct isp_platform_data beagle_isp_platform_data = {
+	.xclks = {
+		[0] = {
+			.dev_id = "3-0048",
+		},
+	},
+	.subdevs = beagle_camera_subdevs,
+};
+
+static int __init beagle_camera_init(void)
+{
+	if (!of_machine_is_compatible("ti,omap3-beagle-xm"))
+		return 0;
+
+	clk_add_alias(NULL, "3-0048", "cam_xclka", NULL);
+
+	regulator_register_fixed(0, mt9v034_dummy_supplies,
+				 ARRAY_SIZE(mt9v034_dummy_supplies));
+
+	omap3_init_camera(&beagle_isp_platform_data);
+
+	return 0;
+}
+late_initcall(beagle_camera_init);

-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2013-12-09 13:10 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06 10:13 omap3isp device tree support Enrico
2013-12-06 10:31 ` Florian Vaussard
2013-12-06 10:54   ` Enrico
2013-12-17 13:11     ` Florian Vaussard
2013-12-18 10:09       ` Enrico
2013-12-23 17:45         ` Enrico
2013-12-23 18:33           ` Enrico
2014-01-03 11:30         ` Enrico
2014-01-06 10:11           ` Julien BERAUD
2014-01-07 10:12             ` Enrico
2014-01-08 11:55               ` Julien BERAUD
2014-01-09 18:14                 ` Enrico
2014-01-10  9:02                   ` Julien BERAUD
2014-02-07 10:24                     ` Enrico
2014-01-07 16:59           ` Laurent Pinchart
2014-01-09 20:26             ` Florian Vaussard
2014-01-09 20:49               ` Laurent Pinchart
2014-01-09 20:54                 ` Florian Vaussard
2014-01-09 21:30                 ` Sebastian Reichel
2014-01-09 23:14             ` Enrico
2014-01-10  0:00               ` Laurent Pinchart
2013-12-09 13:11 ` Laurent Pinchart [this message]
     [not found] <CALFbYK1kEnB2_3VqpLFNtaJ7hj9UHuhrL0iO_rFHD2VFt8THFw@mail.gmail.com>
2014-08-05 22:19 ` Laurent Pinchart
     [not found]   ` <CALFbYK3YtrDPGxc3UpASk7MgPTBGcd899Crvm1csY8g+j-fehg@mail.gmail.com>
2014-08-05 22:41     ` Laurent Pinchart
2014-08-05 22:50       ` alaganraj sandhanam
     [not found]         ` <1407284947.78794.YahooMailNeo@web162403.mail.bf1.yahoo.com>
2014-08-06 18:40           ` Alaganraj Sandhanam
2014-08-07  0:18     ` Sakari Ailus
2014-08-07 14:39       ` Alaganraj Sandhanam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=99045482.9AfPL8T2Si@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=ebutera@users.berlios.de \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.