Skip to contentSkip to conversation

ADP1653 board code for Nokia RX-51

PATCH In review Pali Rohár 8 participants 27 messages Feb 17, 2013 – Sep 23, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ADP1653 board code for Nokia RX-51

Hello,

I'm sending ADP1653 flash torch board code for Nokia RX-51. Kernel driver ADP1653 is already in upstream kernel. Board code was extracted from this big camera meego patch:

https://api.pub.meego.com/public/source/CE:Adaptation:N900/kernel-adaptation-n900/linux-2.6-Camera-for-Meego-N900-Adaptation-kernel-2.6.37-patch.patch

arch/arm/mach-omap2/board-rx51.c +2 -0
index d0374ea..92117a13 100644
@@ -75,6 +75,7 @@ static struct platform_device leds_gpio = {
 */
 
 extern void __init rx51_peripherals_init(void);
+extern void __init rx51_camera_init(void);
 
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
@@ -100,6 +101,7 @@ static void __init rx51_init(void)
 
 	usb_musb_init(&musb_board_data);
 	rx51_peripherals_init();
+	rx51_camera_init();
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
 	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
arch/arm/mach-omap2/board-rx51-camera.c new file +177 -0

177 lines not on this page · raw message

arch/arm/mach-omap2/Kconfig +1 -0
index be0f62b..268fa57 100644
@@ -286,6 +287,7 @@ config MACH_NOKIA_RX51
 	depends on ARCH_OMAP3
 	default y
 	select OMAP_PACKAGE_CBB
+	select VIDEO_ADP1653 if VIDEO_OMAP3 && VIDEO_HELPER_CHIPS_AUTO
 
 config MACH_OMAP_ZOOM2
 	bool "OMAP3 Zoom2 board"
arch/arm/mach-omap2/Makefile +1 -0
index c8b6ff3..df78c58 100644
@@ -239,6 +239,7 @@ obj-$(CONFIG_MACH_NOKIA_RM680)		+= board-rm680.o sdram-nokia.o
 obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51.o sdram-nokia.o
 obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51-peripherals.o
 obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51-video.o
+obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51-camera.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)		+= board-zoom.o board-zoom-peripherals.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)		+= board-zoom-display.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)		+= board-zoom-debugboard.o
Signature · 2 lines
Pali Rohár
[email protected]
maintainer
#1 lore raw

Hi,

Quoted 5 lines · Pali Rohár

I'm sending ADP1653 flash torch board code for Nokia RX-51. Kernel driver ADP1653 is already in upstream kernel. Board code was extracted from this big camera meego patch:

https://api.pub.meego.com/public/source/CE:Adaptation:N900/kernel-adaptation-n900/linux-2.6-Camera-for-Meego-N900-Adaptation-kernel-2.6.37-patch.patch

You need to sign-off the patch.

arch/arm/mach-omap2/board-rx51-camera.c

Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

I'm not sure if adding a new file is sensible. There are already 3 board files for RX-51, which I think is overkill.

arch/arm/mach-omap2/board-rx51-camera.c line 7

Quoted 8 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +7 -0
@@ -0,0 +1,177 @@
+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ *          Tuukka Toivonen <[email protected]>

You should put these people to CC... Just to see if the addresses are still valid (which I doubt).

Quoted 20 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +20 -0
+static int __init rx51_adp1653_init(void)
+{
+	int err;
+
+	err = gpio_request(ADP1653_GPIO_ENABLE, "adp1653 enable");
+	if (err) {
+		printk(KERN_ERR ADP1653_NAME
+		       " Failed to request EN gpio\n");
+		err = -ENODEV;
+		goto err_omap_request_gpio;
+	}
+
+	err = gpio_request(ADP1653_GPIO_INT, "adp1653 interrupt");
+	if (err) {
+		printk(KERN_ERR ADP1653_NAME " Failed to request IRQ gpio\n");
+		err = -ENODEV;
+		goto err_omap_request_gpio_2;
+	}
+
+	err = gpio_request(ADP1653_GPIO_STROBE, "adp1653 strobe");

arch/arm/mach-omap2/board-rx51-camera.c line 70

Quoted 10 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +10 -0
+	if (err) {
+		printk(KERN_ERR ADP1653_NAME
+		       " Failed to request STROBE gpio\n");
+		err = -ENODEV;
+		goto err_omap_request_gpio_3;
+	}
+
+	gpio_direction_output(ADP1653_GPIO_ENABLE, 0);
+	gpio_direction_input(ADP1653_GPIO_INT);
+	gpio_direction_output(ADP1653_GPIO_STROBE, 0);

gpio_request_array() should be used.

arch/arm/mach-omap2/board-rx51-camera.c line 176

Quoted 11 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +11 -0
+void __init rx51_camera_init(void)
+{
+	if (rx51_camera_hw_init()) {
+		printk(KERN_WARNING "%s: Unable to initialize camera\n",
+		       __func__);
+		return;
+	}
+
+	if (omap3_init_camera(&rx51_isp_platform_data) < 0)
+		printk(KERN_WARNING "%s: Unable to register camera platform "
+		       "device\n", __func__);

pr_warn() should be used.

A.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 7 lines · On Sunday 17 February 2013 20:03:03 Aaro Koskinen wrote:

Hi,

Quoted 4 lines · Pali Rohár

I'm sending ADP1653 flash torch board code for Nokia RX-51. Kernel driver ADP1653 is already in upstream kernel. Board code was extracted from this big camera meego patch:

Quoted 6 lines
Quoted 3 lines

https://api.pub.meego.com/public/source/CE:Adaptation:N900/k
ernel-adaptation-n900/linux-2.6-Camera-for-Meego-N900-Adapta tion-kernel-2.6.37-patch.patch

You need to sign-off the patch.

Quoted 6 lines

arch/arm/mach-omap2/board-rx51-camera.c

Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

I'm not sure if adding a new file is sensible. There are already 3 board files for RX-51, which I think is overkill.

You can see that camera board code is big, so code was moved to separate file. Because not all camera drivers are upstreamed yet there is no camera support in RX-51 board code. Current peripheral file for RX-51 is big too and split camera code into separate file can be usefull...

Quoted 12 lines

arch/arm/mach-omap2/board-rx51-camera.c line 7

Quoted 8 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +7 -0
@@ -0,0 +1,177 @@
+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ *          Tuukka Toivonen <[email protected]>

You should put these people to CC... Just to see if the addresses are still valid (which I doubt).

Ok, trying :-)

Quoted 24 lines
Quoted 24 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +15 -0
+static int __init rx51_adp1653_init(void)
+{
+	int err;
+
+	err = gpio_request(ADP1653_GPIO_ENABLE, "adp1653 enable");
+	if (err) {
+		printk(KERN_ERR ADP1653_NAME
+		       " Failed to request EN gpio\n");
+		err = -ENODEV;
+		goto err_omap_request_gpio;
+	}
+
+	err = gpio_request(ADP1653_GPIO_INT, "adp1653 interrupt");
+	if (err) {
+		printk(KERN_ERR ADP1653_NAME " Failed to request IRQ

gpio\n"); + err = -ENODEV;

arch/arm/mach-omap2/board-rx51-camera.c new file +8 -0
+		goto err_omap_request_gpio_2;
+	}
+
+	err = gpio_request(ADP1653_GPIO_STROBE, "adp1653 strobe");
+	if (err) {
+		printk(KERN_ERR ADP1653_NAME
+		       " Failed to request STROBE gpio\n");
+		err = -ENODEV;
Quoted 9 lines

arch/arm/mach-omap2/board-rx51-camera.c

Quoted 6 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +6 -0
+		goto err_omap_request_gpio_3;
+	}
+
+	gpio_direction_output(ADP1653_GPIO_ENABLE, 0);
+	gpio_direction_input(ADP1653_GPIO_INT);
+	gpio_direction_output(ADP1653_GPIO_STROBE, 0);

gpio_request_array() should be used.

Ok, fixing this.

Quoted 14 lines
Quoted 11 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +10 -0
+void __init rx51_camera_init(void)
+{
+	if (rx51_camera_hw_init()) {
+		printk(KERN_WARNING "%s: Unable to initialize camera\n",
+		       __func__);
+		return;
+	}
+
+	if (omap3_init_camera(&rx51_isp_platform_data) < 0)
+		printk(KERN_WARNING "%s: Unable to register camera

platform " + "device\n", __func__);

pr_warn() should be used.

Quoted 1 line

A.

Fixed too.

Here is new version v2 of this patch:

arch/arm/mach-omap2/Kconfig +1 -0
index 41b581f..268fa57 100644
@@ -287,6 +287,7 @@ config MACH_NOKIA_RX51
 	depends on ARCH_OMAP3
 	default y
 	select OMAP_PACKAGE_CBB
+	select VIDEO_ADP1653 if VIDEO_OMAP3 && VIDEO_HELPER_CHIPS_AUTO
 
 config MACH_OMAP_ZOOM2
 	bool "OMAP3 Zoom2 board"
arch/arm/mach-omap2/Makefile +1 -0
index 947cafe..f20f693 100644
@@ -236,6 +236,7 @@ obj-$(CONFIG_MACH_NOKIA_RM680)		+= board-rm680.o sdram-nokia.o
 obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51.o sdram-nokia.o
 obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51-peripherals.o
 obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51-video.o
+obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51-camera.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)		+= board-zoom.o board-zoom-peripherals.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)		+= board-zoom-display.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)		+= board-zoom-debugboard.o
arch/arm/mach-omap2/board-rx51-camera.c new file +152 -0

152 lines not on this page · raw message

arch/arm/mach-omap2/board-rx51.c +2 -0
index d0374ea..92117a13 100644
@@ -75,6 +75,7 @@ static struct platform_device leds_gpio = {
 */
 
 extern void __init rx51_peripherals_init(void);
+extern void __init rx51_camera_init(void);
 
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
@@ -100,6 +101,7 @@ static void __init rx51_init(void)
 
 	usb_musb_init(&musb_board_data);
 	rx51_peripherals_init();
+	rx51_camera_init();
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
 	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
Signature · 5 lines
1.7.10.4

-- 
Pali Rohár
[email protected]
#3 lore raw
Quoted 12 lines · On Wednesday 06 March 2013 21:12:06 Pali Rohár wrote:
Quoted 11 lines · On Sunday 17 February 2013 20:03:03 Aaro Koskinen wrote:

Hi,

Quoted 7 lines · Pali Rohár

+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ * Tuukka Toivonen <[email protected]>

Quoted 5 lines
Quoted 2 lines

You should put these people to CC... Just to see if the addresses are still valid (which I doubt).

Ok, trying :-)

I got "Delivery Status Notification (Failure)" for both addresses.

Signature · 2 lines
Pali Rohár
[email protected]
#4 lore raw
Quoted 11 lines · Pali Rohár
Quoted 10 lines · On Wednesday 06 March 2013 21:12:06 Pali Rohár wrote:
Quoted 9 lines · On Sunday 17 February 2013 20:03:03 Aaro Koskinen wrote:
Quoted 7 lines · Pali Rohár

+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ * Tuukka Toivonen <[email protected]>

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

You should put these people to CC... Just to see if the addresses are still valid (which I doubt).

Ok, trying :-)

I got "Delivery Status Notification (Failure)" for both addresses.

Sakari Ailus hosts some code on github [0], which has the following email address: [email protected]

I added it to this mail's CC.

[0] https://gitorious.org/~sailus

-- Sebastian

#5 lore raw

Hi guys,

Quoted 12 lines · Sebastian Reichel
Quoted 11 lines · Pali Rohár
Quoted 10 lines · On Wednesday 06 March 2013 21:12:06 Pali Rohár wrote:
Quoted 9 lines · On Sunday 17 February 2013 20:03:03 Aaro Koskinen wrote:
Quoted 7 lines · Pali Rohár

+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ * Tuukka Toivonen <[email protected]>

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

You should put these people to CC... Just to see if the addresses are still valid (which I doubt).

Ok, trying :-)

I got "Delivery Status Notification (Failure)" for both addresses.

This is expected.

Quoted 6 lines

Sakari Ailus hosts some code on github [0], which has the following email address: [email protected]

I added it to this mail's CC.

[0] https://gitorious.org/~sailus

Nice to hear people are interested in this. ;-)

The primary reason I haven't tried submitting this to mainline is that ARM board code has a bad reputation these days. The N900 does not have yet support for device tree (AFAIK), which also would require a few bits and pieces on the flash driver to work.

Also the sensor and lens drivers would need at least some work before being ready for submission to mainline for camera to be usable. Unfortunately I haven't had recently time to work on this. N9(50) support has higher priority for myself. That, too, is pending the DT support for the device.

There's indeed more up-to-date code in my repository. Even if it's not too close to mainline anymore it should be a better starting point than the old kernel from MeeGo.

<URL:https://gitorious.org/omap3camera/pages/Home>

Signature · 4 lines
Kind regards,

Sakari Ailus
e-mail: [email protected]	XMPP: [email protected]
#6 lore raw
Quoted 3 lines · On Thursday 07 March 2013 23:18:27 Sakari Ailus wrote:

Hi guys,

On Wed, Mar 06, 2013 at 10:44:41PM +0100, Sebastian Reichel

Quoted 4 lines · wrote:
Quoted 4 lines · Pali Rohár
Quoted 3 lines · On Wednesday 06 March 2013 21:12:06 Pali Rohár wrote:
Quoted 2 lines · On Sunday 17 February 2013 20:03:03 Aaro Koskinen wrote:
Quoted 1 line

On Sun, Feb 17, 2013 at 04:16:49PM +0100, Pali Rohár

Quoted 41 lines · wrote:
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ * Tuukka Toivonen
<[email protected]>

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You should put these people to CC... Just to see if the addresses are still valid (which I doubt).

Ok, trying :-)

I got "Delivery Status Notification (Failure)" for both addresses.

This is expected.

Quoted 7 lines

Sakari Ailus hosts some code on github [0], which has the following email address:
[email protected]

I added it to this mail's CC.

[0] https://gitorious.org/~sailus

Nice to hear people are interested in this. ;-)

The primary reason I haven't tried submitting this to mainline is that ARM board code has a bad reputation these days. The N900 does not have yet support for device tree (AFAIK), which also would require a few bits and pieces on the flash driver to work.

Also the sensor and lens drivers would need at least some work before being ready for submission to mainline for camera to be usable. Unfortunately I haven't had recently time to work on this. N9(50) support has higher priority for myself. That, too, is pending the DT support for the device.

Quoted 5 lines

There's indeed more up-to-date code in my repository. Even if it's not too close to mainline anymore it should be a better starting point than the old kernel from MeeGo.

<URL:https://gitorious.org/omap3camera/pages/Home>

Hi,

this board code is same in your git repository and on meego obs.

Patch only adding support for adp1653 driver which is already in upstream kernel.

Are there any other problems with this patch to go for upstream?

Signature · 2 lines
Pali Rohár
[email protected]
#7 lore raw

Hi Pali,

Quoted 57 lines · Pali Rohár
Quoted 3 lines · On Thursday 07 March 2013 23:18:27 Sakari Ailus wrote:

Hi guys,

On Wed, Mar 06, 2013 at 10:44:41PM +0100, Sebastian Reichel

Quoted 4 lines · wrote:
Quoted 4 lines · Pali Rohár
Quoted 3 lines · On Wednesday 06 March 2013 21:12:06 Pali Rohár wrote:
Quoted 2 lines · On Sunday 17 February 2013 20:03:03 Aaro Koskinen wrote:
Quoted 1 line

On Sun, Feb 17, 2013 at 04:16:49PM +0100, Pali Rohár

Quoted 41 lines · wrote:
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ * Tuukka Toivonen
<[email protected]>

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You should put these people to CC... Just to see if the addresses are still valid (which I doubt).

Ok, trying :-)

I got "Delivery Status Notification (Failure)" for both addresses.

This is expected.

Quoted 7 lines

Sakari Ailus hosts some code on github [0], which has the following email address:
[email protected]

I added it to this mail's CC.

[0] https://gitorious.org/~sailus

Nice to hear people are interested in this. ;-)

The primary reason I haven't tried submitting this to mainline is that ARM board code has a bad reputation these days. The N900 does not have yet support for device tree (AFAIK), which also would require a few bits and pieces on the flash driver to work.

Also the sensor and lens drivers would need at least some work before being ready for submission to mainline for camera to be usable. Unfortunately I haven't had recently time to work on this. N9(50) support has higher priority for myself. That, too, is pending the DT support for the device.

Quoted 5 lines

There's indeed more up-to-date code in my repository. Even if it's not too close to mainline anymore it should be a better starting point than the old kernel from MeeGo.

<URL:https://gitorious.org/omap3camera/pages/Home>

Quoted 8 lines

Hi,

this board code is same in your git repository and on meego obs.

Patch only adding support for adp1653 driver which is already in upstream kernel.

Are there any other problems with this patch to go for upstream?

A few more things comes to mind. We depend a little bit on actual board code; it's not only static data. That's the configuration of the external clock from the ISP to the sensor. That should move to the common clock framework so that the ISP registers the clock and the sensor driver can then use it. AFAIR Laurent has done some work on that.

The peculiar detail of the rx51 is that there's a switch on the camera CCP2 bus that selects either sensor (primary or secondary). Both sensors are connected to the same receiver. That isn't properly modelled currently at all, so that's why we have rx51_camera_set_xshutdown(). I guess it'd still work if you only power (i.e. open) either of the devices at a time, though.

That should be all.

Signature · 8 lines
Kind regards,

Sakari Ailus
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#8 lore raw

Hi Sakari,

Quoted 58 lines · On Sunday 24 March 2013 23:46:01 Sakari Ailus wrote:
Quoted 57 lines · Pali Rohár
Quoted 43 lines · On Thursday 07 March 2013 23:18:27 Sakari Ailus wrote:
Quoted 12 lines · Sebastian Reichel
Quoted 11 lines · Pali Rohár
Quoted 10 lines · On Wednesday 06 March 2013 21:12:06 Pali Rohár wrote:
Quoted 9 lines · On Sunday 17 February 2013 20:03:03 Aaro Koskinen wrote:
Quoted 7 lines · Pali Rohár

+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ * Tuukka Toivonen <[email protected]>

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

You should put these people to CC... Just to see if the addresses are still valid (which I doubt).

Ok, trying :-)

I got "Delivery Status Notification (Failure)" for both addresses.

This is expected.

Quoted 7 lines

Sakari Ailus hosts some code on github [0], which has the following email address:
[email protected]

I added it to this mail's CC.

[0] https://gitorious.org/~sailus

Nice to hear people are interested in this. ;-)

The primary reason I haven't tried submitting this to mainline is that ARM board code has a bad reputation these days. The N900 does not have yet support for device tree (AFAIK), which also would require a few bits and pieces on the flash driver to work.

Also the sensor and lens drivers would need at least some work before being ready for submission to mainline for camera to be usable. Unfortunately I haven't had recently time to work on this. N9(50) support has higher priority for myself. That, too, is pending the DT support for the device.

Quoted 5 lines

There's indeed more up-to-date code in my repository. Even if it's not too close to mainline anymore it should be a better starting point than the old kernel from MeeGo.

<URL:https://gitorious.org/omap3camera/pages/Home>

Hi,

this board code is same in your git repository and on meego obs.

Patch only adding support for adp1653 driver which is already in upstream kernel.

Quoted 7 lines
Quoted 1 line

Are there any other problems with this patch to go for upstream?

A few more things comes to mind. We depend a little bit on actual board code; it's not only static data. That's the configuration of the external clock from the ISP to the sensor. That should move to the common clock framework so that the ISP registers the clock and the sensor driver can then use it. AFAIR Laurent has done some work on that.

Yes. I hope to get the patches in v3.10.

Quoted 5 lines

The peculiar detail of the rx51 is that there's a switch on the camera CCP2 bus that selects either sensor (primary or secondary). Both sensors are connected to the same receiver. That isn't properly modelled currently at all, so that's why we have rx51_camera_set_xshutdown(). I guess it'd still work if you only power (i.e. open) either of the devices at a time, though.

Have you thought about how we could model that ?

Quoted 1 line

That should be all.

Signature · 3 lines
Regards,

Laurent Pinchart
#9 lore raw

Hi Laurent,

Quoted 61 lines · Laurent Pinchart
Quoted 60 lines · On Sunday 24 March 2013 23:46:01 Sakari Ailus wrote:
Quoted 58 lines · Pali Rohár
Quoted 43 lines · On Thursday 07 March 2013 23:18:27 Sakari Ailus wrote:
Quoted 12 lines · Sebastian Reichel
Quoted 11 lines · Pali Rohár
Quoted 10 lines · On Wednesday 06 March 2013 21:12:06 Pali Rohár wrote:
Quoted 9 lines · On Sunday 17 February 2013 20:03:03 Aaro Koskinen wrote:
Quoted 7 lines · Pali Rohár

+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ * Tuukka Toivonen <[email protected]>

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

You should put these people to CC... Just to see if the addresses are still valid (which I doubt).

Ok, trying :-)

I got "Delivery Status Notification (Failure)" for both addresses.

This is expected.

Quoted 7 lines

Sakari Ailus hosts some code on github [0], which has the following email address:
[email protected]

I added it to this mail's CC.

[0] https://gitorious.org/~sailus

Nice to hear people are interested in this. ;-)

The primary reason I haven't tried submitting this to mainline is that ARM board code has a bad reputation these days. The N900 does not have yet support for device tree (AFAIK), which also would require a few bits and pieces on the flash driver to work.

Also the sensor and lens drivers would need at least some work before being ready for submission to mainline for camera to be usable. Unfortunately I haven't had recently time to work on this. N9(50) support has higher priority for myself. That, too, is pending the DT support for the device.

Quoted 5 lines

There's indeed more up-to-date code in my repository. Even if it's not too close to mainline anymore it should be a better starting point than the old kernel from MeeGo.

<URL:https://gitorious.org/omap3camera/pages/Home>

Hi,

this board code is same in your git repository and on meego obs.

Patch only adding support for adp1653 driver which is already in upstream kernel.

Are there any other problems with this patch to go for upstream?

Quoted 7 lines
Quoted 5 lines

A few more things comes to mind. We depend a little bit on actual board code; it's not only static data. That's the configuration of the external clock from the ISP to the sensor. That should move to the common clock framework so that the ISP registers the clock and the sensor driver can then use it. AFAIR Laurent has done some work on that.

Yes. I hope to get the patches in v3.10.

Cool! :)

Quoted 7 lines
Quoted 5 lines

The peculiar detail of the rx51 is that there's a switch on the camera CCP2 bus that selects either sensor (primary or secondary). Both sensors are connected to the same receiver. That isn't properly modelled currently at all, so that's why we have rx51_camera_set_xshutdown(). I guess it'd still work if you only power (i.e. open) either of the devices at a time, though.

Have you thought about how we could model that ?

Well, the two dependent gpios could be modelled as two independent ones ( for sensor drivers), but setting the state of those gpios could fail, gpio_set_value() still returns void. This isn't pretty perhaps but as a result the initialisation of the secondary sensor to be powered up at the same time will fail since it's in reset: the xshutdown of both sensors is controlled by the same gpio as is the mux (AFAIR).

So one N900 camera specific gpio driver would be needed. It'd be a very simple driver. What do you think?

Signature · 4 lines
Cheers,

Sakari Ailus
e-mail: [email protected]	XMPP: [email protected]
#10 lore raw

Hi Sakari,

Quoted 68 lines · On Thursday 04 April 2013 01:22:28 Sakari Ailus wrote:
Quoted 67 lines · Laurent Pinchart
Quoted 65 lines · On Sunday 24 March 2013 23:46:01 Sakari Ailus wrote:
Quoted 50 lines · Pali Rohár
Quoted 43 lines · On Thursday 07 March 2013 23:18:27 Sakari Ailus wrote:
Quoted 12 lines · Sebastian Reichel
Quoted 11 lines · Pali Rohár
Quoted 10 lines · On Wednesday 06 March 2013 21:12:06 Pali Rohár wrote:
Quoted 9 lines · On Sunday 17 February 2013 20:03:03 Aaro Koskinen wrote:
Quoted 7 lines · Pali Rohár

+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ * Tuukka Toivonen <[email protected]>

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

You should put these people to CC... Just to see if the addresses are still valid (which I doubt).

Ok, trying :-)

I got "Delivery Status Notification (Failure)" for both addresses.

This is expected.

Quoted 7 lines

Sakari Ailus hosts some code on github [0], which has the following email address:
[email protected]

I added it to this mail's CC.

[0] https://gitorious.org/~sailus

Nice to hear people are interested in this. ;-)

The primary reason I haven't tried submitting this to mainline is that ARM board code has a bad reputation these days. The N900 does not have yet support for device tree (AFAIK), which also would require a few bits and pieces on the flash driver to work.

Also the sensor and lens drivers would need at least some work before being ready for submission to mainline for camera to be usable. Unfortunately I haven't had recently time to work on this. N9(50) support has higher priority for myself. That, too, is pending the DT support for the device.

Quoted 5 lines

There's indeed more up-to-date code in my repository. Even if it's not too close to mainline anymore it should be a better starting point than the old kernel from MeeGo.

<URL:https://gitorious.org/omap3camera/pages/Home>

Quoted 8 lines

Hi,

this board code is same in your git repository and on meego obs.

Patch only adding support for adp1653 driver which is already in upstream kernel.

Are there any other problems with this patch to go for upstream?

A few more things comes to mind. We depend a little bit on actual board code; it's not only static data. That's the configuration of the external clock from the ISP to the sensor. That should move to the common clock framework so that the ISP registers the clock and the sensor driver can then use it. AFAIR Laurent has done some work on that.

Quoted 3 lines
Quoted 1 line

Yes. I hope to get the patches in v3.10.

Cool! :)

The patches have been posted to the linux-media mailing list. If the dependencies make it to v3.10 the OMAP3 ISP patches should get there too.

Quoted 16 lines
Quoted 8 lines
Quoted 6 lines

The peculiar detail of the rx51 is that there's a switch on the camera CCP2 bus that selects either sensor (primary or secondary). Both sensors are connected to the same receiver. That isn't properly modelled currently at all, so that's why we have rx51_camera_set_xshutdown(). I guess it'd still work if you only power (i.e. open) either of the devices at a time, though.

Have you thought about how we could model that ?

Well, the two dependent gpios could be modelled as two independent ones ( for sensor drivers), but setting the state of those gpios could fail, gpio_set_value() still returns void. This isn't pretty perhaps but as a result the initialisation of the secondary sensor to be powered up at the same time will fail since it's in reset: the xshutdown of both sensors is controlled by the same gpio as is the mux (AFAIR).

Quoted 2 lines

So one N900 camera specific gpio driver would be needed. It'd be a very simple driver. What do you think?

I think I'll need to see how the GPIOs are wired up on the board.

Signature · 3 lines
Regards,

Laurent Pinchart
#11 lore raw

Re: [PATCH v2] Camera drivers for Nokia RX-51

Quoted 4 lines · On Thursday 04 April 2013 15:11:27 Laurent Pinchart wrote:

Hi Sakari,

Quoted 1 line · On Thursday 04 April 2013 01:22:28 Sakari Ailus wrote:

On Tue, Mar 26, 2013 at 12:07:01AM +0100, Laurent Pinchart

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines · On Sunday 24 March 2013 23:46:01 Sakari Ailus wrote:
Quoted 3 lines
Quoted 2 lines · Pali Rohár
Quoted 1 line · On Thursday 07 March 2013 23:18:27 Sakari Ailus wrote:

On Wed, Mar 06, 2013 at 10:44:41PM +0100, Sebastian

Quoted 1 line · Reichel
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Wed, Mar 06, 2013 at 09:20:16PM +0100, Pali Rohár

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Wednesday 06 March 2013 21:12:06 Pali Rohár

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Sunday 17 February 2013 20:03:03 Aaro Koskinen

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Sun, Feb 17, 2013 at 04:16:49PM +0100, Pali

Quoted 97 lines · Rohár
Quoted 69 lines
Quoted 69 lines
Quoted 68 lines
Quoted 52 lines
Quoted 43 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus
<[email protected]> + * Tuukka
Toivonen <[email protected]>

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

You should put these people to CC... Just to see
if the addresses are still valid (which I
doubt).

Ok, trying :-)

I got "Delivery Status Notification (Failure)" for both addresses.

This is expected.

Quoted 7 lines

Sakari Ailus hosts some code on github [0], which
has the following email address:
[email protected]

I added it to this mail's CC.

[0] https://gitorious.org/~sailus

Nice to hear people are interested in this. ;-)

The primary reason I haven't tried submitting this to mainline is that ARM board code has a bad reputation these days. The N900 does not have yet support for device tree (AFAIK), which also would require a few bits and pieces on the flash driver to work.

Also the sensor and lens drivers would need at least some work before being ready for submission to mainline for camera to be usable. Unfortunately I haven't had recently time to work on this. N9(50) support has higher priority for myself. That, too, is pending the DT support for the device.

Quoted 6 lines

There's indeed more up-to-date code in my repository. Even if it's not too close to mainline anymore it should be a better starting point than the old kernel from MeeGo.

<URL:https://gitorious.org/omap3camera/pages/Home>

Hi,

Quoted 8 lines

this board code is same in your git repository and on meego obs.

Patch only adding support for adp1653 driver which is already in upstream kernel.

Are there any other problems with this patch to go for upstream?

A few more things comes to mind. We depend a little bit on actual board code; it's not only static data. That's the configuration of the external clock from the ISP to the sensor. That should move to the common clock framework so that the ISP registers the clock and the sensor driver can then use it. AFAIR Laurent has done some work on that.

Quoted 3 lines
Quoted 1 line

Yes. I hope to get the patches in v3.10.

Cool! :)

The patches have been posted to the linux-media mailing list. If the dependencies make it to v3.10 the OMAP3 ISP patches should get there too.

Quoted 20 lines
Quoted 10 lines
Quoted 8 lines

The peculiar detail of the rx51 is that there's a switch on the camera CCP2 bus that selects either sensor (primary or secondary). Both sensors are connected to the same receiver. That isn't properly modelled currently at all, so that's why we have rx51_camera_set_xshutdown(). I guess it'd still work if you only power (i.e. open) either of the devices at a time, though.

Have you thought about how we could model that ?

Well, the two dependent gpios could be modelled as two independent ones ( for sensor drivers), but setting the state of those gpios could fail, gpio_set_value() still returns void. This isn't pretty perhaps but as a result the initialisation of the secondary sensor to be powered up at the same time will fail since it's in reset: the xshutdown of both sensors is controlled by the same gpio as is the mux (AFAIR).

Quoted 5 lines
Quoted 2 lines

So one N900 camera specific gpio driver would be needed. It'd be a very simple driver. What do you think?

I think I'll need to see how the GPIOs are wired up on the board.

Hello, after months, what is state of drivers now?

Signature · 2 lines
Pali Rohár
[email protected]
#12 lore raw

Re: [PATCH v2] Camera drivers for Nokia RX-51

Hi Pali,

Quoted 116 lines · Pali Rohár
Quoted 4 lines · On Thursday 04 April 2013 15:11:27 Laurent Pinchart wrote:

Hi Sakari,

Quoted 1 line · On Thursday 04 April 2013 01:22:28 Sakari Ailus wrote:

On Tue, Mar 26, 2013 at 12:07:01AM +0100, Laurent Pinchart

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines · On Sunday 24 March 2013 23:46:01 Sakari Ailus wrote:
Quoted 3 lines
Quoted 2 lines · Pali Rohár
Quoted 1 line · On Thursday 07 March 2013 23:18:27 Sakari Ailus wrote:

On Wed, Mar 06, 2013 at 10:44:41PM +0100, Sebastian

Quoted 1 line · Reichel
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Wed, Mar 06, 2013 at 09:20:16PM +0100, Pali Rohár

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Wednesday 06 March 2013 21:12:06 Pali Rohár

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Sunday 17 February 2013 20:03:03 Aaro Koskinen

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Sun, Feb 17, 2013 at 04:16:49PM +0100, Pali

Quoted 97 lines · Rohár
Quoted 69 lines
Quoted 69 lines
Quoted 68 lines
Quoted 52 lines
Quoted 43 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus
<[email protected]> + * Tuukka
Toivonen <[email protected]>

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

You should put these people to CC... Just to see
if the addresses are still valid (which I
doubt).

Ok, trying :-)

I got "Delivery Status Notification (Failure)" for both addresses.

This is expected.

Quoted 7 lines

Sakari Ailus hosts some code on github [0], which
has the following email address:
[email protected]

I added it to this mail's CC.

[0] https://gitorious.org/~sailus

Nice to hear people are interested in this. ;-)

The primary reason I haven't tried submitting this to mainline is that ARM board code has a bad reputation these days. The N900 does not have yet support for device tree (AFAIK), which also would require a few bits and pieces on the flash driver to work.

Also the sensor and lens drivers would need at least some work before being ready for submission to mainline for camera to be usable. Unfortunately I haven't had recently time to work on this. N9(50) support has higher priority for myself. That, too, is pending the DT support for the device.

Quoted 6 lines

There's indeed more up-to-date code in my repository. Even if it's not too close to mainline anymore it should be a better starting point than the old kernel from MeeGo.

<URL:https://gitorious.org/omap3camera/pages/Home>

Hi,

Quoted 8 lines

this board code is same in your git repository and on meego obs.

Patch only adding support for adp1653 driver which is already in upstream kernel.

Are there any other problems with this patch to go for upstream?

A few more things comes to mind. We depend a little bit on actual board code; it's not only static data. That's the configuration of the external clock from the ISP to the sensor. That should move to the common clock framework so that the ISP registers the clock and the sensor driver can then use it. AFAIR Laurent has done some work on that.

Quoted 3 lines
Quoted 1 line

Yes. I hope to get the patches in v3.10.

Cool! :)

The patches have been posted to the linux-media mailing list. If the dependencies make it to v3.10 the OMAP3 ISP patches should get there too.

Quoted 20 lines
Quoted 10 lines
Quoted 8 lines

The peculiar detail of the rx51 is that there's a switch on the camera CCP2 bus that selects either sensor (primary or secondary). Both sensors are connected to the same receiver. That isn't properly modelled currently at all, so that's why we have rx51_camera_set_xshutdown(). I guess it'd still work if you only power (i.e. open) either of the devices at a time, though.

Have you thought about how we could model that ?

Well, the two dependent gpios could be modelled as two independent ones ( for sensor drivers), but setting the state of those gpios could fail, gpio_set_value() still returns void. This isn't pretty perhaps but as a result the initialisation of the secondary sensor to be powered up at the same time will fail since it's in reset: the xshutdown of both sensors is controlled by the same gpio as is the mux (AFAIR).

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

So one N900 camera specific gpio driver would be needed. It'd be a very simple driver. What do you think?

I think I'll need to see how the GPIOs are wired up on the board.

Hello, after months, what is state of drivers now?

I have no choice except to say, much to my regret, that it's not really better than it was half a year ago. That said, I have not taken that off my to-do list.

Please keep in mind that the user space interface used by the omap3camd (and implemented by omap34xxcam) is entirely unsupported in the mainline kernel. A wrapper would need to be implemented to mimic the old interface to that binary blob --- all the equivalent functionality is there, albeit much better but quite different. Or it could be re-implemented.

Having working drivers is a pre-dependency to that; I agree.

Signature · 4 lines
Kind regards,

Sakari Ailus
e-mail: [email protected]	XMPP: [email protected]
#13 lore raw
In reply to Pali Rohár
Quoted 117 lines · On Wednesday 06 March 2013 21:12:06 Pali Rohár wrote:
Quoted 8 lines · On Sunday 17 February 2013 20:03:03 Aaro Koskinen wrote:

Hi,

Quoted 5 lines · Pali Rohár

I'm sending ADP1653 flash torch board code for Nokia RX-51. Kernel driver ADP1653 is already in upstream kernel. Board code was extracted from this big camera meego patch:

Quoted 6 lines
Quoted 4 lines

https://api.pub.meego.com/public/source/CE:Adaptation:N900
/k ernel-adaptation-n900/linux-2.6-Camera-for-Meego-N900-Ada pta tion-kernel-2.6.37-patch.patch

You need to sign-off the patch.

Quoted 5 lines

arch/arm/mach-omap2/board-rx51-camera.c

Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

I'm not sure if adding a new file is sensible. There are already 3 board files for RX-51, which I think is overkill.

You can see that camera board code is big, so code was moved to separate file. Because not all camera drivers are upstreamed yet there is no camera support in RX-51 board code. Current peripheral file for RX-51 is big too and split camera code into separate file can be usefull...

Quoted 11 lines

arch/arm/mach-omap2/board-rx51-camera.c line 7

Quoted 8 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +7 -0
@@ -0,0 +1,177 @@
+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ *          Tuukka Toivonen <[email protected]>

You should put these people to CC... Just to see if the addresses are still valid (which I doubt).

Ok, trying :-)

Quoted 24 lines
Quoted 24 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +5 -0
+static int __init rx51_adp1653_init(void)
+{
+	int err;
+
+	err = gpio_request(ADP1653_GPIO_ENABLE, "adp1653

enable"); + if (err) {

arch/arm/mach-omap2/board-rx51-camera.c new file +7 -0
+		printk(KERN_ERR ADP1653_NAME
+		       " Failed to request EN gpio\n");
+		err = -ENODEV;
+		goto err_omap_request_gpio;
+	}
+
+	err = gpio_request(ADP1653_GPIO_INT, "adp1653

interrupt"); + if (err) {

arch/arm/mach-omap2/board-rx51-camera.c new file +1 -0
+		printk(KERN_ERR ADP1653_NAME " Failed to request IRQ

gpio\n"); + err = -ENODEV;

arch/arm/mach-omap2/board-rx51-camera.c new file +4 -0
+		goto err_omap_request_gpio_2;
+	}
+
+	err = gpio_request(ADP1653_GPIO_STROBE, "adp1653

strobe"); + if (err) {

arch/arm/mach-omap2/board-rx51-camera.c new file +3 -0
+		printk(KERN_ERR ADP1653_NAME
+		       " Failed to request STROBE gpio\n");
+		err = -ENODEV;
Quoted 8 lines

arch/arm/mach-omap2/board-rx51-camera.c

Quoted 6 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +6 -0
+		goto err_omap_request_gpio_3;
+	}
+
+	gpio_direction_output(ADP1653_GPIO_ENABLE, 0);
+	gpio_direction_input(ADP1653_GPIO_INT);
+	gpio_direction_output(ADP1653_GPIO_STROBE, 0);

gpio_request_array() should be used.

Ok, fixing this.

Quoted 14 lines
Quoted 11 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +4 -0
+void __init rx51_camera_init(void)
+{
+	if (rx51_camera_hw_init()) {
+		printk(KERN_WARNING "%s: Unable to initialize

camera\n", + __func__);

arch/arm/mach-omap2/board-rx51-camera.c new file +5 -0
+		return;
+	}
+
+	if (omap3_init_camera(&rx51_isp_platform_data) < 0)
+		printk(KERN_WARNING "%s: Unable to register camera

platform " + "device\n", __func__);

pr_warn() should be used.

Quoted 1 line

A.

Fixed too.

Here is new version v2 of this patch:

(quoted diff) +0 -0

b/arch/arm/mach-omap2/Kconfig index 41b581f..268fa57 100644

arch/arm/mach-omap2/Kconfig +1 -0
@@ -287,6 +287,7 @@ config MACH_NOKIA_RX51
 	depends on ARCH_OMAP3
 	default y
 	select OMAP_PACKAGE_CBB
+	select VIDEO_ADP1653 if VIDEO_OMAP3 &&

VIDEO_HELPER_CHIPS_AUTO

config MACH_OMAP_ZOOM2

arch/arm/mach-omap2/Kconfig +0 -0
 	bool "OMAP3 Zoom2 board"
(quoted diff) +0 -0

b/arch/arm/mach-omap2/Makefile index 947cafe..f20f693 100644

arch/arm/mach-omap2/Makefile +0 -0
@@ -236,6 +236,7 @@ obj-$(CONFIG_MACH_NOKIA_RM680)		+=
Quoted 2 lines

board-rm680.o sdram-nokia.o obj-$(CONFIG_MACH_NOKIA_RX51) +=
board-rx51.o sdram-nokia.o obj-$(CONFIG_MACH_NOKIA_RX51)

+=

Quoted 52 lines

board-rx51-peripherals.o obj-$(CONFIG_MACH_NOKIA_RX51) +=
board-rx51-video.o +obj-$(CONFIG_MACH_NOKIA_RX51) +=
board-rx51-camera.o obj-$(CONFIG_MACH_OMAP_ZOOM2) +=
board-zoom.o board-zoom-peripherals.o
obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom-display.o
obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom-debugboard.o

(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-rx51-camera.c new file mode 100644
index 0000000..80057ab

arch/arm/mach-omap2/board-rx51-camera.c new file +9 -0
@@ -0,0 +1,152 @@
+/*
+ * arch/arm/mach-omap2/board-rx51-camera.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Contact: Sakari Ailus <[email protected]>
+ *          Tuukka Toivonen <[email protected]>
+ *
+ * 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. + *
+ * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA
+ *
+ */

arch/arm/mach-omap2/board-rx51-camera.c new file +12 -0
+
+#include <linux/i2c.h>
+#include <linux/delay.h>
+#include <linux/gpio.h>
+
+#include "../../../drivers/media/platform/omap3isp/isp.h"
+
+#include <media/adp1653.h>
+
+#include "devices.h"
+
+#define ADP1653_GPIO_ENABLE	88	/* Used for resetting ADP1653

*/ +#define ADP1653_GPIO_INT 167 /* Fault interrupt */
+#define ADP1653_GPIO_STROBE 126 /* Pin used in cam_strobe
mode -> + * control using ISP drivers */

arch/arm/mach-omap2/board-rx51-camera.c

Quoted 3 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +3 -0
+
+static struct gpio rx51_adp1653_gpios[] __initdata = {
+	{ ADP1653_GPIO_ENABLE,	GPIOF_OUT_INIT_LOW,	"adp1653 

enable"

arch/arm/mach-omap2/board-rx51-camera.c

Quoted 2 lines

}, + { ADP1653_GPIO_INT, GPIOF_IN, "adp1653 interrupt" },

arch/arm/mach-omap2/board-rx51-camera.c new file +1 -0
+	{ ADP1653_GPIO_STROBE,	GPIOF_OUT_INIT_LOW,	"adp1653 

strobe"

Quoted 127 lines

}, +};

arch/arm/mach-omap2/board-rx51-camera.c new file +33 -0
+
+static int __init rx51_adp1653_init(void)
+{
+	int ret;
+
+	ret = gpio_request_array(rx51_adp1653_gpios,
+				 ARRAY_SIZE(rx51_adp1653_gpios));
+	if (ret < 0) {
+		pr_err(ADP1653_NAME ": Failed to request gpios\n");
+		return -ENODEV;
+	}
+
+	return 0;
+}
+
+static int __init rx51_camera_hw_init(void)
+{
+	int rval;
+
+	rval = rx51_adp1653_init();
+	if (rval)
+		return rval;
+
+	return 0;
+}
+
+/*
+ *
+ * ADP1653
+ *
+ */
+
+static int rx51_adp1653_power(struct v4l2_subdev *subdev, int

on) +{

arch/arm/mach-omap2/board-rx51-camera.c new file +10 -0
+	gpio_set_value(ADP1653_GPIO_ENABLE, on);
+	if (on) {
+		/* Some delay is apparently required. */
+		udelay(20);
+	}
+
+	return 0;
+}
+
+static struct adp1653_platform_data

rx51_adp1653_platform_data = { + .power =
rx51_adp1653_power,

arch/arm/mach-omap2/board-rx51-camera.c new file +3 -0
+	/* Must be limited to 500 ms in RX-51 */
+	.max_flash_timeout	 = 500000,		/* us */
+	/* Must be limited to 320 mA in RX-51 B3 and newer hardware

*/ + .max_flash_intensity =
ADP1653_FLASH_INTENSITY_REG_TO_mA(19), + /* Must be limited
to 50 mA in RX-51 */

arch/arm/mach-omap2/board-rx51-camera.c new file +1 -0
+	.max_torch_intensity	 =

ADP1653_FLASH_INTENSITY_REG_TO_mA(1),

arch/arm/mach-omap2/board-rx51-camera.c new file +1 -0
+	.max_indicator_intensity =

ADP1653_INDICATOR_INTENSITY_REG_TO_uA(

arch/arm/mach-omap2/board-rx51-camera.c new file +19 -0
+		ADP1653_REG_OUT_SEL_ILED_MAX),
+};
+
+/*
+ *
+ * Init it all
+ *
+ */
+
+#define ADP1653_I2C_BUS_NUM		2
+
+static struct i2c_board_info rx51_camera_i2c_devices[] = {
+	{
+		I2C_BOARD_INFO(ADP1653_NAME, ADP1653_I2C_ADDR),
+		.platform_data = &rx51_adp1653_platform_data,
+	},
+};
+
+static struct isp_subdev_i2c_board_info

rx51_camera_primary_subdevs[] = { + {

arch/arm/mach-omap2/board-rx51-camera.c new file +7 -0
+		.board_info = &rx51_camera_i2c_devices[0],
+		.i2c_adapter_id = ADP1653_I2C_BUS_NUM,
+	},
+	{ NULL, 0, },
+};
+
+static struct isp_v4l2_subdevs_group rx51_camera_subdevs[] =

{ + {

arch/arm/mach-omap2/board-rx51-camera.c new file +28 -0
+		.subdevs = rx51_camera_primary_subdevs,
+		.interface = ISP_INTERFACE_CCP2B_PHY1,
+		.bus = { .ccp2 = {
+			.strobe_clk_pol		= 0,
+			.crc			= 1,
+			.ccp2_mode		= 1,
+			.phy_layer		= 1,
+			.vpclk_div		= 1,
+		} },
+	},
+	{ NULL, 0, },
+};
+
+static struct isp_platform_data rx51_isp_platform_data = {
+	.subdevs = rx51_camera_subdevs,
+};
+
+void __init rx51_camera_init(void)
+{
+	if (rx51_camera_hw_init()) {
+		pr_warn("%s: Unable to initialize camera\n", __func__);
+		return;
+	}
+
+	if (omap3_init_camera(&rx51_isp_platform_data) < 0)
+		pr_warn("%s: Unable to register camera platform "
+		       "device\n", __func__);
+}
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-rx51.c index d0374ea..92117a13 100644

arch/arm/mach-omap2/board-rx51.c +1 -0
@@ -75,6 +75,7 @@ static struct platform_device leds_gpio = {
 */
 
 extern void __init rx51_peripherals_init(void);
+extern void __init rx51_camera_init(void);
 
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {

arch/arm/mach-omap2/board-rx51.c static void __init rx51_init(void) · line 107

Quoted 7 lines
arch/arm/mach-omap2/board-rx51.c +1 -0
@@ -100,6 +101,7 @@ static void __init rx51_init(void)
 
 	usb_musb_init(&musb_board_data);
 	rx51_peripherals_init();
+	rx51_camera_init();
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
 	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);

Ping, can you review this patch v2?

Signature · 2 lines
Pali Rohár
[email protected]
maintainer
#14 lore raw

Hi,

Quoted 2 lines · Pali Rohár
Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

[...]

Quoted 1 line

Ping, can you review this patch v2?

I don't think Tony will accept any new board stuff for RX-51/N900. See for example: http://marc.info/?l=linux-kernel&m=137629626213187&w=2

There should be initial Nokia N900 DTS file in 3.12-rc1, and we should continue converting this board fully to DT.

A.

maintainer
#15 lore raw
Quoted 6 lines · Aaro Koskinen

Hi,

Quoted 2 lines · Pali Rohár
Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

[...]

Quoted 7 lines
Quoted 1 line

Ping, can you review this patch v2?

I don't think Tony will accept any new board stuff for RX-51/N900. See for example: http://marc.info/?l=linux-kernel&m=137629626213187&w=2

There should be initial Nokia N900 DTS file in 3.12-rc1, and we should continue converting this board fully to DT.

Yes let's plan on making mach-omap2 to be DT only soonish. AFAIK the only stopper right now for omap3 are the pending pinctrl changes for the wake-up events as otherwise we would have sever PM regressions with off-idle.

Regards,

Tony

#16 lore raw
Quoted 12 lines · Tony Lindgren
Quoted 11 lines · Aaro Koskinen

Hi,

Quoted 2 lines · Pali Rohár
Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

[...]

Quoted 1 line

Ping, can you review this patch v2?

I don't think Tony will accept any new board stuff for RX-51/N900. See for example: http://marc.info/?l=linux-kernel&m=137629626213187&w=2

Quoted 8 lines
Quoted 2 lines

There should be initial Nokia N900 DTS file in 3.12-rc1, and we should continue converting this board fully to DT.

Yes let's plan on making mach-omap2 to be DT only soonish. AFAIK the only stopper right now for omap3 are the pending pinctrl changes for the wake-up events as otherwise we would have sever PM regressions with off-idle.

Hi Tony,

I don't know if OMAP2+ DT will happen soon as you said. At least I know about a big issue we had with GPIO pins not being auto-requested when are mapped as IRQ. You can refer to [1] for the latest approach and how this discussion have been going.

This is something that we have been trying to solve for a couple of kernel releases by now so it would be great if you can join the discussion.

Quoted 3 lines

Regards,

Tony

Thanks a lot and best regards,
Javier

[1]: https://lkml.org/lkml/2013/8/26/260
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#17 lore raw
Quoted 11 lines · Javier Martinez Canillas

Hi Tony,

I don't know if OMAP2+ DT will happen soon as you said. At least I know about a big issue we had with GPIO pins not being auto-requested when are mapped as IRQ. You can refer to [1] for the latest approach and how this discussion have been going.

This is something that we have been trying to solve for a couple of kernel releases by now so it would be great if you can join the discussion.

Yes I'm painfully aware of that mess too, that needs to be sorted out for sure.

Regards,

Tony

Quoted 1 line

[1]: https://lkml.org/lkml/2013/8/26/260

#18 lore raw
In reply to Aaro Koskinen
Quoted 6 lines · Aaro Koskinen

Hi,

Quoted 2 lines · Pali Rohár
Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

[...]

Quoted 7 lines
Quoted 1 line

Ping, can you review this patch v2?

I don't think Tony will accept any new board stuff for RX-51/N900. See for example: http://marc.info/?l=linux-kernel&m=137629626213187&w=2

There should be initial Nokia N900 DTS file in 3.12-rc1, and we should continue converting this board fully to DT.

That's not reasonable. N900 is pretty far away from working with device tree. Yes, I was able to get some bits merged, but that should not be excuse to halt other N900 development.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#19 lore raw
Quoted 15 lines · On Wednesday 18 September 2013 15:16:44 Pavel Machek wrote:
Quoted 14 lines · Aaro Koskinen

Hi,

Quoted 2 lines · Pali Rohár
Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

[...]

Quoted 1 line

Ping, can you review this patch v2?

I don't think Tony will accept any new board stuff for RX-51/N900. See for example:
http://marc.info/?l=linux-kernel&m=137629626213187&w=2

Quoted 7 lines
Quoted 2 lines

There should be initial Nokia N900 DTS file in 3.12-rc1, and we should continue converting this board fully to DT.

That's not reasonable. N900 is pretty far away from working
with device tree. Yes, I was able to get some bits merged,
but that should not be excuse to halt other N900 development.
Pavel

Right. So Tony, will you accept future patches for board files?

Signature · 2 lines
Pali Rohár
[email protected]
maintainer
#20 lore raw
Quoted 19 lines · Pali Rohár
Quoted 18 lines · On Wednesday 18 September 2013 15:16:44 Pavel Machek wrote:
Quoted 16 lines · Aaro Koskinen

Hi,

Quoted 2 lines · Pali Rohár
Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

[...]

Quoted 1 line

Ping, can you review this patch v2?

I don't think Tony will accept any new board stuff for RX-51/N900. See for example:
http://marc.info/?l=linux-kernel&m=137629626213187&w=2

There should be initial Nokia N900 DTS file in 3.12-rc1, and we should continue converting this board fully to DT.

Quoted 6 lines
Quoted 4 lines

That's not reasonable. N900 is pretty far away from working
with device tree. Yes, I was able to get some bits merged,
but that should not be excuse to halt other N900 development.
Pavel

Right. So Tony, will you accept future patches for board files?

Only fixes to board-*.c files please unless there's a _really_ good reason to make things more complex with the platform data. Let's not make the DT conversion any more complex than it already is.

Getting things working with DT for the devices is pretty trivial in most cases. And we can also still initialize the legacy devices using platform data the same way as earlier.

Regards,

Tony

#21 lore raw
Quoted 6 lines · On Wednesday 18 September 2013 19:42:12 Tony Lindgren wrote:
Quoted 5 lines · Pali Rohár
Quoted 4 lines · On Wednesday 18 September 2013 15:16:44 Pavel Machek wrote:
Quoted 3 lines · Aaro Koskinen

Hi,

On Fri, Sep 06, 2013 at 10:34:05PM +0200, Pali Rohár

Quoted 30 lines · wrote:
Quoted 20 lines
Quoted 20 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

[...]

Quoted 1 line

Ping, can you review this patch v2?

Quoted 7 lines

I don't think Tony will accept any new board stuff for RX-51/N900. See for example:
http://marc.info/?l=linux-kernel&m=137629626213187&w=2

There should be initial Nokia N900 DTS file in 3.12-rc1, and we should continue converting this board fully to DT.

That's not reasonable. N900 is pretty far away from working with device tree. Yes, I was able to get some bits merged, but that should not be excuse to halt other N900 development.

Quoted 4 lines
Quoted 1 line

Pavel

Right. So Tony, will you accept future patches for board files?

Only fixes to board-*.c files please unless there's a _really_ good reason to make things more complex with the platform data. Let's not make the DT conversion any more complex than it already is.

Quoted 7 lines

Getting things working with DT for the devices is pretty trivial in most cases. And we can also still initialize the legacy devices using platform data the same way as earlier.

Regards,

Tony

So, what to this with this patch v2 (it was sent 06.03.2013)? It adding board support for ADP1653 flash torch which is part of rx51 camera code. Driver itself is already in kernel tree. Can you comment/review this patch?

Signature · 2 lines
Pali Rohár
[email protected]
maintainer
#22 lore raw
Quoted 42 lines · Pali Rohár
Quoted 6 lines · On Wednesday 18 September 2013 19:42:12 Tony Lindgren wrote:
Quoted 5 lines · Pali Rohár
Quoted 4 lines · On Wednesday 18 September 2013 15:16:44 Pavel Machek wrote:
Quoted 3 lines · Aaro Koskinen

Hi,

On Fri, Sep 06, 2013 at 10:34:05PM +0200, Pali Rohár

Quoted 34 lines · wrote:
Quoted 20 lines
Quoted 20 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

[...]

Quoted 1 line

Ping, can you review this patch v2?

Quoted 7 lines

I don't think Tony will accept any new board stuff for RX-51/N900. See for example:
http://marc.info/?l=linux-kernel&m=137629626213187&w=2

There should be initial Nokia N900 DTS file in 3.12-rc1, and we should continue converting this board fully to DT.

That's not reasonable. N900 is pretty far away from working with device tree. Yes, I was able to get some bits merged, but that should not be excuse to halt other N900 development.

Quoted 4 lines
Quoted 1 line

Pavel

Right. So Tony, will you accept future patches for board files?

Only fixes to board-*.c files please unless there's a _really_ good reason to make things more complex with the platform data. Let's not make the DT conversion any more complex than it already is.

Getting things working with DT for the devices is pretty trivial in most cases. And we can also still initialize the legacy devices using platform data the same way as earlier.

Quoted 8 lines
Quoted 3 lines

Regards,

Tony

So, what to this with this patch v2 (it was sent 06.03.2013)? It adding board support for ADP1653 flash torch which is part of rx51 camera code. Driver itself is already in kernel tree. Can you comment/review this patch?

Yeah I'm not taking any more of new platform data like this, this all is already very trivial to do with device tree directly in the driver. Adding this would make the pains of moving to device tree based booting just more of a pain and guess who has to deal with all of that.

For the hwrng platform data makes still sense even for the device tree as we don't have any better way currently to do the SMC callbacks.

Regards,

Tony

#23 lore raw
In reply to Tony Lindgren

Hi!

Quoted 21 lines
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

[...]

Quoted 1 line

Ping, can you review this patch v2?

I don't think Tony will accept any new board stuff for RX-51/N900. See for example:
http://marc.info/?l=linux-kernel&m=137629626213187&w=2

There should be initial Nokia N900 DTS file in 3.12-rc1, and we should continue converting this board fully to DT.

Quoted 6 lines
Quoted 4 lines

That's not reasonable. N900 is pretty far away from working
with device tree. Yes, I was able to get some bits merged,
but that should not be excuse to halt other N900 development.
Pavel

Right. So Tony, will you accept future patches for board files?

Quoted 8 lines

Only fixes to board-*.c files please unless there's a _really_ good reason to make things more complex with the platform data. Let's not make the DT conversion any more complex than it already is.

Getting things working with DT for the devices is pretty trivial in most cases. And we can also still initialize the legacy devices using platform data the same way as earlier.

Well... It was quite a struggle to get video working with device tree in 3.10, and now it is broken in 3.12-rc1, again.

"Now, here, you see, it takes all the running you can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that! "

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
maintainer
#24 lore raw
Quoted 28 lines · Pavel Machek

Hi!

Quoted 26 lines
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +0 -0

[...]

Quoted 1 line

Ping, can you review this patch v2?

I don't think Tony will accept any new board stuff for RX-51/N900. See for example:
http://marc.info/?l=linux-kernel&m=137629626213187&w=2

There should be initial Nokia N900 DTS file in 3.12-rc1, and we should continue converting this board fully to DT.

Quoted 6 lines
Quoted 4 lines

That's not reasonable. N900 is pretty far away from working
with device tree. Yes, I was able to get some bits merged,
but that should not be excuse to halt other N900 development.
Pavel

Right. So Tony, will you accept future patches for board files?

Only fixes to board-*.c files please unless there's a _really_ good reason to make things more complex with the platform data. Let's not make the DT conversion any more complex than it already is.

Quoted 6 lines
Quoted 3 lines

Getting things working with DT for the devices is pretty trivial in most cases. And we can also still initialize the legacy devices using platform data the same way as earlier.

Well... It was quite a struggle to get video working with device tree in 3.10, and now it is broken in 3.12-rc1, again.

Hmm didn't Aaro reply that you just need to change the Kconfig option for the panel to fix it?

Quoted 3 lines

"Now, here, you see, it takes all the running you can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that! "

True at least for reading the mailing lists :)

Regards,

Tony

#25 lore raw

Hi!

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 1 line

Right. So Tony, will you accept future patches for board files?

Only fixes to board-*.c files please unless there's a _really_ good reason to make things more complex with the platform data. Let's not make the DT conversion any more complex than it already is.

Getting things working with DT for the devices is pretty trivial in most cases. And we can also still initialize the legacy devices using platform data the same way as earlier.

Quoted 5 lines
Quoted 2 lines

Well... It was quite a struggle to get video working with device tree in 3.10, and now it is broken in 3.12-rc1, again.

Hmm didn't Aaro reply that you just need to change the Kconfig option for the panel to fix it?

Aha, spam filters playing games :-(. Sorry about that.

Quoted 5 lines
Quoted 3 lines

"Now, here, you see, it takes all the running you can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that! "

True at least for reading the mailing lists :)

:-).
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#26 lore raw
In reply to Pali Rohár

Hi!

arch/arm/mach-omap2/board-rx51-camera.c line 93

Quoted 10 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +10 -0
+static int __init rx51_camera_hw_init(void)
+{
+	int rval;
+
+	rval = rx51_adp1653_init();
+	if (rval)
+		return rval;
+
+	return 0;
+}

"return rx51_adp1653_init()". Or better yet, rename rx51_adp1653_init to rx51_camera_hw_init.

Thanks for all the n900 work, btw :-).

arch/arm/mach-omap2/board-rx51-camera.c

Quoted 8 lines
arch/arm/mach-omap2/board-rx51-camera.c new file +8 -0
+static struct adp1653_platform_data rx51_adp1653_platform_data = {
+	.power			 = rx51_adp1653_power,
+	/* Must be limited to 500 ms in RX-51 */
+	.max_flash_timeout	 = 500000,		/* us */
+	/* Must be limited to 320 mA in RX-51 B3 and newer hardware */
+	.max_flash_intensity	 = ADP1653_FLASH_INTENSITY_REG_TO_mA(19),
+	/* Must be limited to 50 mA in RX-51 */
+	.max_torch_intensity	 = > ADP1653_FLASH_INTENSITY_REG_TO_mA(1),

So we do 1mA to be safe?

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html