All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update
@ 2009-11-03 16:45 Antonio Ospite
  2009-11-03 16:45   ` Antonio Ospite
                   ` (2 more replies)
  0 siblings, 3 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-03 16:45 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

some updates for the EZX platform:

[PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
[PATCH 2/3] ezx: Add leds-lp3944 support for A910 EZX phone
[PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in

Are we still in time for 2.6.32?

Ciao ciao,
   Antonio

--
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-03 16:45 [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update Antonio Ospite
@ 2009-11-03 16:45   ` Antonio Ospite
  2009-11-03 17:44 ` [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update Stefan Schmidt
  2009-11-04 21:35 ` [PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in Antonio Ospite
  2 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-03 16:45 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: openezx-devel, Antonio Ospite, Eric Miao, Bart Visscher,
	linux-media, Guennadi Liakhovetski

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Bart Visscher <bartv@thisnet.nl>
---
 arch/arm/mach-pxa/ezx.c |  178 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 178 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 588b265..9faa6e5 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -17,8 +17,11 @@
 #include <linux/delay.h>
 #include <linux/pwm_backlight.h>
 #include <linux/input.h>
+#include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 
+#include <media/soc_camera.h>
+
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -29,6 +32,7 @@
 #include <plat/i2c.h>
 #include <mach/hardware.h>
 #include <mach/pxa27x_keypad.h>
+#include <mach/camera.h>
 
 #include "devices.h"
 #include "generic.h"
@@ -683,8 +687,102 @@ static struct platform_device a780_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a780_pxacamera_init(struct device *dev)
+{
+	int err;
+
+	/*
+	 * GPIO50_GPIO is CAM_EN: active low
+	 * GPIO19_GPIO is CAM_RST: active high
+	 */
+	err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(MFP_PIN_GPIO19, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(MFP_PIN_GPIO50, 0);
+	gpio_direction_output(MFP_PIN_GPIO19, 1);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(MFP_PIN_GPIO50);
+fail:
+	return err;
+}
+
+static int a780_pxacamera_power(struct device *dev, int on)
+{
+	gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
+
+#if 0
+	/*
+	 * This is reported to resolve the "vertical line in view finder"
+	 * issue (LIBff11930), in the original source code released by
+	 * Motorola, but we never experienced the problem, so we don't use
+	 * this for now.
+	 *
+	 * AP Kernel camera driver: set TC_MM_EN to low when camera is running
+	 * and TC_MM_EN to high when camera stops.
+	 *
+	 * BP Software: if TC_MM_EN is low, BP do not shut off 26M clock, but
+	 * BP can sleep itself.
+	 */
+	gpio_set_value(MFP_PIN_GPIO99, on ? 0 : 1);
+#endif
+
+	return 0;
+}
+
+static int a780_pxacamera_reset(struct device *dev)
+{
+	gpio_set_value(MFP_PIN_GPIO19, 0);
+	msleep(10);
+	gpio_set_value(MFP_PIN_GPIO19, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a780_pxacamera_platform_data = {
+	.init	= a780_pxacamera_init,
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a780_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a780_iclink = {
+	.bus_id         = 0,
+	.flags          = SOCAM_SENSOR_INVERT_PCLK,
+	.i2c_adapter_id = 0,
+	.board_info     = &a780_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a780_pxacamera_power,
+	.reset          = a780_pxacamera_reset,
+};
+
+static struct platform_device a780_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a780_iclink,
+	},
+};
+
 static struct platform_device *a780_devices[] __initdata = {
 	&a780_gpio_keys,
+	&a780_camera,
 };
 
 static void __init a780_init(void)
@@ -699,6 +797,8 @@ static void __init a780_init(void)
 
 	pxa_set_keypad_info(&a780_keypad_platform_data);
 
+	pxa_set_camera_info(&a780_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
 }
@@ -864,8 +964,84 @@ static struct platform_device a910_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a910_pxacamera_init(struct device *dev)
+{
+	int err;
+
+	/*
+	 * GPIO50_GPIO is CAM_EN: active low
+	 * GPIO28_GPIO is CAM_RST: active high
+	 */
+	err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(MFP_PIN_GPIO28, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(MFP_PIN_GPIO50, 0);
+	gpio_direction_output(MFP_PIN_GPIO28, 1);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(MFP_PIN_GPIO50);
+fail:
+	return err;
+}
+
+static int a910_pxacamera_power(struct device *dev, int on)
+{
+	gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
+	return 0;
+}
+
+static int a910_pxacamera_reset(struct device *dev)
+{
+	gpio_set_value(MFP_PIN_GPIO28, 0);
+	msleep(10);
+	gpio_set_value(MFP_PIN_GPIO28, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a910_pxacamera_platform_data = {
+	.init	= a910_pxacamera_init,
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a910_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a910_iclink = {
+	.bus_id         = 0,
+	.i2c_adapter_id = 0,
+	.board_info     = &a910_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a910_pxacamera_power,
+	.reset          = a910_pxacamera_reset,
+};
+
+static struct platform_device a910_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a910_iclink,
+	},
+};
+
 static struct platform_device *a910_devices[] __initdata = {
 	&a910_gpio_keys,
+	&a910_camera,
 };
 
 static void __init a910_init(void)
@@ -880,6 +1056,8 @@ static void __init a910_init(void)
 
 	pxa_set_keypad_info(&a910_keypad_platform_data);
 
+	pxa_set_camera_info(&a910_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
 }
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-03 16:45   ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-03 16:45 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Bart Visscher <bartv@thisnet.nl>
---
 arch/arm/mach-pxa/ezx.c |  178 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 178 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 588b265..9faa6e5 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -17,8 +17,11 @@
 #include <linux/delay.h>
 #include <linux/pwm_backlight.h>
 #include <linux/input.h>
+#include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 
+#include <media/soc_camera.h>
+
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -29,6 +32,7 @@
 #include <plat/i2c.h>
 #include <mach/hardware.h>
 #include <mach/pxa27x_keypad.h>
+#include <mach/camera.h>
 
 #include "devices.h"
 #include "generic.h"
@@ -683,8 +687,102 @@ static struct platform_device a780_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a780_pxacamera_init(struct device *dev)
+{
+	int err;
+
+	/*
+	 * GPIO50_GPIO is CAM_EN: active low
+	 * GPIO19_GPIO is CAM_RST: active high
+	 */
+	err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(MFP_PIN_GPIO19, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(MFP_PIN_GPIO50, 0);
+	gpio_direction_output(MFP_PIN_GPIO19, 1);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(MFP_PIN_GPIO50);
+fail:
+	return err;
+}
+
+static int a780_pxacamera_power(struct device *dev, int on)
+{
+	gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
+
+#if 0
+	/*
+	 * This is reported to resolve the "vertical line in view finder"
+	 * issue (LIBff11930), in the original source code released by
+	 * Motorola, but we never experienced the problem, so we don't use
+	 * this for now.
+	 *
+	 * AP Kernel camera driver: set TC_MM_EN to low when camera is running
+	 * and TC_MM_EN to high when camera stops.
+	 *
+	 * BP Software: if TC_MM_EN is low, BP do not shut off 26M clock, but
+	 * BP can sleep itself.
+	 */
+	gpio_set_value(MFP_PIN_GPIO99, on ? 0 : 1);
+#endif
+
+	return 0;
+}
+
+static int a780_pxacamera_reset(struct device *dev)
+{
+	gpio_set_value(MFP_PIN_GPIO19, 0);
+	msleep(10);
+	gpio_set_value(MFP_PIN_GPIO19, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a780_pxacamera_platform_data = {
+	.init	= a780_pxacamera_init,
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a780_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a780_iclink = {
+	.bus_id         = 0,
+	.flags          = SOCAM_SENSOR_INVERT_PCLK,
+	.i2c_adapter_id = 0,
+	.board_info     = &a780_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a780_pxacamera_power,
+	.reset          = a780_pxacamera_reset,
+};
+
+static struct platform_device a780_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a780_iclink,
+	},
+};
+
 static struct platform_device *a780_devices[] __initdata = {
 	&a780_gpio_keys,
+	&a780_camera,
 };
 
 static void __init a780_init(void)
@@ -699,6 +797,8 @@ static void __init a780_init(void)
 
 	pxa_set_keypad_info(&a780_keypad_platform_data);
 
+	pxa_set_camera_info(&a780_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
 }
@@ -864,8 +964,84 @@ static struct platform_device a910_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a910_pxacamera_init(struct device *dev)
+{
+	int err;
+
+	/*
+	 * GPIO50_GPIO is CAM_EN: active low
+	 * GPIO28_GPIO is CAM_RST: active high
+	 */
+	err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(MFP_PIN_GPIO28, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(MFP_PIN_GPIO50, 0);
+	gpio_direction_output(MFP_PIN_GPIO28, 1);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(MFP_PIN_GPIO50);
+fail:
+	return err;
+}
+
+static int a910_pxacamera_power(struct device *dev, int on)
+{
+	gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
+	return 0;
+}
+
+static int a910_pxacamera_reset(struct device *dev)
+{
+	gpio_set_value(MFP_PIN_GPIO28, 0);
+	msleep(10);
+	gpio_set_value(MFP_PIN_GPIO28, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a910_pxacamera_platform_data = {
+	.init	= a910_pxacamera_init,
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a910_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a910_iclink = {
+	.bus_id         = 0,
+	.i2c_adapter_id = 0,
+	.board_info     = &a910_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a910_pxacamera_power,
+	.reset          = a910_pxacamera_reset,
+};
+
+static struct platform_device a910_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a910_iclink,
+	},
+};
+
 static struct platform_device *a910_devices[] __initdata = {
 	&a910_gpio_keys,
+	&a910_camera,
 };
 
 static void __init a910_init(void)
@@ -880,6 +1056,8 @@ static void __init a910_init(void)
 
 	pxa_set_keypad_info(&a910_keypad_platform_data);
 
+	pxa_set_camera_info(&a910_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
 }
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 2/3] ezx: Add leds-lp3944 support for A910 EZX phone
  2009-11-03 16:45   ` Antonio Ospite
  (?)
@ 2009-11-03 16:45   ` Antonio Ospite
  2009-11-04  6:40     ` Eric Miao
  -1 siblings, 1 reply; 63+ messages in thread
From: Antonio Ospite @ 2009-11-03 16:45 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
 arch/arm/mach-pxa/ezx.c |   53 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 9faa6e5..ac58083 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -19,6 +19,7 @@
 #include <linux/input.h>
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
+#include <linux/leds-lp3944.h>
 
 #include <media/soc_camera.h>
 
@@ -1039,6 +1040,57 @@ static struct platform_device a910_camera = {
 	},
 };
 
+/* leds-lp3944 */
+static struct lp3944_platform_data a910_lp3944_leds = {
+	.leds_size = LP3944_LEDS_MAX,
+	.leds = {
+		[0] = {
+			.name = "a910:red:",
+			.status = LP3944_LED_STATUS_OFF,
+			.type = LP3944_LED_TYPE_LED,
+		},
+		[1] = {
+			.name = "a910:green:",
+			.status = LP3944_LED_STATUS_OFF,
+			.type = LP3944_LED_TYPE_LED,
+		},
+		[2] {
+			.name = "a910:blue:",
+			.status = LP3944_LED_STATUS_OFF,
+			.type = LP3944_LED_TYPE_LED,
+		},
+		/* Leds 3 and 4 are used as display power switches */
+		[3] = {
+			.name = "a910::cli_display",
+			.status = LP3944_LED_STATUS_OFF,
+			.type = LP3944_LED_TYPE_LED_INVERTED
+		},
+		[4] = {
+			.name = "a910::main_display",
+			.status = LP3944_LED_STATUS_ON,
+			.type = LP3944_LED_TYPE_LED_INVERTED
+		},
+		[5] = { .type = LP3944_LED_TYPE_NONE },
+		[6] = {
+			.name = "a910::torch",
+			.status = LP3944_LED_STATUS_OFF,
+			.type = LP3944_LED_TYPE_LED,
+		},
+		[7] = {
+			.name = "a910::flash",
+			.status = LP3944_LED_STATUS_OFF,
+			.type = LP3944_LED_TYPE_LED_INVERTED,
+		},
+	},
+};
+
+static struct i2c_board_info __initdata a910_i2c_board_info[] = {
+	{
+		I2C_BOARD_INFO("lp3944", 0x60),
+		.platform_data = &a910_lp3944_leds,
+	},
+};
+
 static struct platform_device *a910_devices[] __initdata = {
 	&a910_gpio_keys,
 	&a910_camera,
@@ -1051,6 +1103,7 @@ static void __init a910_init(void)
 	pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
 
 	pxa_set_i2c_info(NULL);
+	i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info));
 
 	set_pxa_fb_info(&ezx_fb_info_2);
 
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update
  2009-11-03 16:45 [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update Antonio Ospite
  2009-11-03 16:45   ` Antonio Ospite
@ 2009-11-03 17:44 ` Stefan Schmidt
  2009-11-03 20:40   ` Antonio Ospite
  2009-11-04 21:35 ` [PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in Antonio Ospite
  2 siblings, 1 reply; 63+ messages in thread
From: Stefan Schmidt @ 2009-11-03 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

[Put Eric in CC]

On Tue, 2009-11-03 at 17:45, Antonio Ospite wrote:
> 
> some updates for the EZX platform:

Thanks for driving this forward.

> [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
> [PATCH 2/3] ezx: Add leds-lp3944 support for A910 EZX phone
> [PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in
> 
> Are we still in time for 2.6.32?

Given that we are near -rc6 and this is clearly no fix I would say no. But Eric
should be happy to apply it to his devel branch which will hit Linus tree during
the next merge window.

Eric, Antonio is doing a good deal of the current work at OpenEZX. If you need
an ACK anyway you can put mine into it.

Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>

regards
Stefan Schmidt

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update
  2009-11-03 17:44 ` [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update Stefan Schmidt
@ 2009-11-03 20:40   ` Antonio Ospite
  2009-11-04  6:42     ` Eric Miao
  0 siblings, 1 reply; 63+ messages in thread
From: Antonio Ospite @ 2009-11-03 20:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 3 Nov 2009 18:44:30 +0100
Stefan Schmidt <stefan@datenfreihafen.org> wrote:

> Hello.
> 
> [Put Eric in CC]
>

<OT>
Thanks, I've realized that the best practice to write the summary
message is via 'git format-patch --cover-letter' to add the needed
recipients, rather than using 'git send-email --compose' which doesn't
process CCs, BCCs and SOBs for the introduction message.
</OT>

> On Tue, 2009-11-03 at 17:45, Antonio Ospite wrote:
> > 
> > some updates for the EZX platform:
> 
> Thanks for driving this forward.
> 
> > [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
> > [PATCH 2/3] ezx: Add leds-lp3944 support for A910 EZX phone
> > [PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in
> > 
> > Are we still in time for 2.6.32?
> 
> Given that we are near -rc6 and this is clearly no fix I would say no. But Eric
> should be happy to apply it to his devel branch which will hit Linus tree during
> the next merge window.
>

That's fine, of course.

> Eric, Antonio is doing a good deal of the current work at OpenEZX. If you need
> an ACK anyway you can put mine into it.
> 
> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
> 
> regards
> Stefan Schmidt
>

Ciao,
  Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091103/63619ce5/attachment.sig>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-03 16:45   ` Antonio Ospite
@ 2009-11-04  6:38     ` Eric Miao
  -1 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-04  6:38 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: linux-arm-kernel, openezx-devel, Bart Visscher, linux-media,
	Guennadi Liakhovetski

Hi Antonio,

Patch looks generally OK except for the MFP/GPIO usage, check my
comments below, thanks.

> +/* camera */
> +static int a780_pxacamera_init(struct device *dev)
> +{
> +       int err;
> +
> +       /*
> +        * GPIO50_GPIO is CAM_EN: active low
> +        * GPIO19_GPIO is CAM_RST: active high
> +        */
> +       err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");

Mmm... MFP != GPIO, so this probably should be written simply as:

#define GPIO_nCAM_EN	(50)

or (which tends to be more accurate but not necessary)

#define GPIO_nCAM_EN	mfp_to_gpio(MFP_PIN_GPIO50)

If platform matters, I suggest something like:

#define GPIO_A780_nCAM_EN	(50)
#define GPIO_A910_nCAM_EN	(<something else>)

...

	err = gpio_request(GPIO_nCAM_EN, "nCAM_EN");

> +       if (err) {
> +               pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +               goto fail;
> +       }
> +
> +       err = gpio_request(MFP_PIN_GPIO19, "CAM_RST");

ditto

> +       if (err) {
> +               pr_err("%s: Failed to request CAM_RST\n", __func__);
> +               goto fail_gpio_cam_rst;
> +       }
> +
> +       gpio_direction_output(MFP_PIN_GPIO50, 0);
> +       gpio_direction_output(MFP_PIN_GPIO19, 1);
> +
> +       return 0;
> +
> +fail_gpio_cam_rst:
> +       gpio_free(MFP_PIN_GPIO50);
> +fail:
> +       return err;
> +}
> +
> +static int a780_pxacamera_power(struct device *dev, int on)
> +{
> +       gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);

	gpio_set_value(GPIO_nCAM_EN, on ? 0 : 1);

> +
> +#if 0
> +       /*
> +        * This is reported to resolve the "vertical line in view finder"
> +        * issue (LIBff11930), in the original source code released by
> +        * Motorola, but we never experienced the problem, so we don't use
> +        * this for now.
> +        *
> +        * AP Kernel camera driver: set TC_MM_EN to low when camera is running
> +        * and TC_MM_EN to high when camera stops.
> +        *
> +        * BP Software: if TC_MM_EN is low, BP do not shut off 26M clock, but
> +        * BP can sleep itself.
> +        */
> +       gpio_set_value(MFP_PIN_GPIO99, on ? 0 : 1);
> +#endif

This is a little bit confusing - can we remove this for this stage?

> +
> +       return 0;
> +}
> +
> +static int a780_pxacamera_reset(struct device *dev)
> +{
> +       gpio_set_value(MFP_PIN_GPIO19, 0);
> +       msleep(10);
> +       gpio_set_value(MFP_PIN_GPIO19, 1);

better to define something like above:

#define GPIO_CAM_RESET	(19)

...

	gpio_set_value(GPIO_CAM_RESET, ...);

> +
> +       return 0;
> +}
> +
> +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> +       .init   = a780_pxacamera_init,
> +       .flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +               PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +       .mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a780_camera_i2c_board_info = {
> +       I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a780_iclink = {
> +       .bus_id         = 0,
> +       .flags          = SOCAM_SENSOR_INVERT_PCLK,
> +       .i2c_adapter_id = 0,
> +       .board_info     = &a780_camera_i2c_board_info,
> +       .module_name    = "mt9m111",
> +       .power          = a780_pxacamera_power,
> +       .reset          = a780_pxacamera_reset,
> +};
> +
> +static struct platform_device a780_camera = {
> +       .name   = "soc-camera-pdrv",
> +       .id     = 0,
> +       .dev    = {
> +               .platform_data = &a780_iclink,
> +       },
> +};
> +
>  static struct platform_device *a780_devices[] __initdata = {
>        &a780_gpio_keys,
> +       &a780_camera,
>  };
>
>  static void __init a780_init(void)
> @@ -699,6 +797,8 @@ static void __init a780_init(void)
>
>        pxa_set_keypad_info(&a780_keypad_platform_data);
>
> +       pxa_set_camera_info(&a780_pxacamera_platform_data);
> +
>        platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>        platform_add_devices(ARRAY_AND_SIZE(a780_devices));
>  }
> @@ -864,8 +964,84 @@ static struct platform_device a910_gpio_keys = {
>        },
>  };
>
> +/* camera */
> +static int a910_pxacamera_init(struct device *dev)
> +{
> +       int err;
> +
> +       /*
> +        * GPIO50_GPIO is CAM_EN: active low
> +        * GPIO28_GPIO is CAM_RST: active high
> +        */
> +       err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> +       if (err) {
> +               pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +               goto fail;
> +       }
> +
> +       err = gpio_request(MFP_PIN_GPIO28, "CAM_RST");
> +       if (err) {
> +               pr_err("%s: Failed to request CAM_RST\n", __func__);
> +               goto fail_gpio_cam_rst;
> +       }
> +
> +       gpio_direction_output(MFP_PIN_GPIO50, 0);
> +       gpio_direction_output(MFP_PIN_GPIO28, 1);
> +
> +       return 0;
> +
> +fail_gpio_cam_rst:
> +       gpio_free(MFP_PIN_GPIO50);
> +fail:
> +       return err;
> +}
> +
> +static int a910_pxacamera_power(struct device *dev, int on)
> +{
> +       gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
> +       return 0;
> +}
> +
> +static int a910_pxacamera_reset(struct device *dev)
> +{
> +       gpio_set_value(MFP_PIN_GPIO28, 0);
> +       msleep(10);
> +       gpio_set_value(MFP_PIN_GPIO28, 1);
> +
> +       return 0;
> +}
> +
> +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> +       .init   = a910_pxacamera_init,
> +       .flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +               PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +       .mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a910_camera_i2c_board_info = {
> +       I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a910_iclink = {
> +       .bus_id         = 0,
> +       .i2c_adapter_id = 0,
> +       .board_info     = &a910_camera_i2c_board_info,
> +       .module_name    = "mt9m111",
> +       .power          = a910_pxacamera_power,
> +       .reset          = a910_pxacamera_reset,
> +};
> +
> +static struct platform_device a910_camera = {
> +       .name   = "soc-camera-pdrv",
> +       .id     = 0,
> +       .dev    = {
> +               .platform_data = &a910_iclink,
> +       },
> +};
> +
>  static struct platform_device *a910_devices[] __initdata = {
>        &a910_gpio_keys,
> +       &a910_camera,
>  };
>
>  static void __init a910_init(void)
> @@ -880,6 +1056,8 @@ static void __init a910_init(void)
>
>        pxa_set_keypad_info(&a910_keypad_platform_data);
>
> +       pxa_set_camera_info(&a910_pxacamera_platform_data);
> +
>        platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>        platform_add_devices(ARRAY_AND_SIZE(a910_devices));
>  }
> --
> 1.6.5.2
>
>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-04  6:38     ` Eric Miao
  0 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-04  6:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Antonio,

Patch looks generally OK except for the MFP/GPIO usage, check my
comments below, thanks.

> +/* camera */
> +static int a780_pxacamera_init(struct device *dev)
> +{
> + ? ? ? int err;
> +
> + ? ? ? /*
> + ? ? ? ?* GPIO50_GPIO is CAM_EN: active low
> + ? ? ? ?* GPIO19_GPIO is CAM_RST: active high
> + ? ? ? ?*/
> + ? ? ? err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");

Mmm... MFP != GPIO, so this probably should be written simply as:

#define GPIO_nCAM_EN	(50)

or (which tends to be more accurate but not necessary)

#define GPIO_nCAM_EN	mfp_to_gpio(MFP_PIN_GPIO50)

If platform matters, I suggest something like:

#define GPIO_A780_nCAM_EN	(50)
#define GPIO_A910_nCAM_EN	(<something else>)

...

	err = gpio_request(GPIO_nCAM_EN, "nCAM_EN");

> + ? ? ? if (err) {
> + ? ? ? ? ? ? ? pr_err("%s: Failed to request nCAM_EN\n", __func__);
> + ? ? ? ? ? ? ? goto fail;
> + ? ? ? }
> +
> + ? ? ? err = gpio_request(MFP_PIN_GPIO19, "CAM_RST");

ditto

> + ? ? ? if (err) {
> + ? ? ? ? ? ? ? pr_err("%s: Failed to request CAM_RST\n", __func__);
> + ? ? ? ? ? ? ? goto fail_gpio_cam_rst;
> + ? ? ? }
> +
> + ? ? ? gpio_direction_output(MFP_PIN_GPIO50, 0);
> + ? ? ? gpio_direction_output(MFP_PIN_GPIO19, 1);
> +
> + ? ? ? return 0;
> +
> +fail_gpio_cam_rst:
> + ? ? ? gpio_free(MFP_PIN_GPIO50);
> +fail:
> + ? ? ? return err;
> +}
> +
> +static int a780_pxacamera_power(struct device *dev, int on)
> +{
> + ? ? ? gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);

	gpio_set_value(GPIO_nCAM_EN, on ? 0 : 1);

> +
> +#if 0
> + ? ? ? /*
> + ? ? ? ?* This is reported to resolve the "vertical line in view finder"
> + ? ? ? ?* issue (LIBff11930), in the original source code released by
> + ? ? ? ?* Motorola, but we never experienced the problem, so we don't use
> + ? ? ? ?* this for now.
> + ? ? ? ?*
> + ? ? ? ?* AP Kernel camera driver: set TC_MM_EN to low when camera is running
> + ? ? ? ?* and TC_MM_EN to high when camera stops.
> + ? ? ? ?*
> + ? ? ? ?* BP Software: if TC_MM_EN is low, BP do not shut off 26M clock, but
> + ? ? ? ?* BP can sleep itself.
> + ? ? ? ?*/
> + ? ? ? gpio_set_value(MFP_PIN_GPIO99, on ? 0 : 1);
> +#endif

This is a little bit confusing - can we remove this for this stage?

> +
> + ? ? ? return 0;
> +}
> +
> +static int a780_pxacamera_reset(struct device *dev)
> +{
> + ? ? ? gpio_set_value(MFP_PIN_GPIO19, 0);
> + ? ? ? msleep(10);
> + ? ? ? gpio_set_value(MFP_PIN_GPIO19, 1);

better to define something like above:

#define GPIO_CAM_RESET	(19)

...

	gpio_set_value(GPIO_CAM_RESET, ...);

> +
> + ? ? ? return 0;
> +}
> +
> +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> + ? ? ? .init ? = a780_pxacamera_init,
> + ? ? ? .flags ?= PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> + ? ? ? ? ? ? ? PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> + ? ? ? .mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a780_camera_i2c_board_info = {
> + ? ? ? I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a780_iclink = {
> + ? ? ? .bus_id ? ? ? ? = 0,
> + ? ? ? .flags ? ? ? ? ?= SOCAM_SENSOR_INVERT_PCLK,
> + ? ? ? .i2c_adapter_id = 0,
> + ? ? ? .board_info ? ? = &a780_camera_i2c_board_info,
> + ? ? ? .module_name ? ?= "mt9m111",
> + ? ? ? .power ? ? ? ? ?= a780_pxacamera_power,
> + ? ? ? .reset ? ? ? ? ?= a780_pxacamera_reset,
> +};
> +
> +static struct platform_device a780_camera = {
> + ? ? ? .name ? = "soc-camera-pdrv",
> + ? ? ? .id ? ? = 0,
> + ? ? ? .dev ? ?= {
> + ? ? ? ? ? ? ? .platform_data = &a780_iclink,
> + ? ? ? },
> +};
> +
> ?static struct platform_device *a780_devices[] __initdata = {
> ? ? ? ?&a780_gpio_keys,
> + ? ? ? &a780_camera,
> ?};
>
> ?static void __init a780_init(void)
> @@ -699,6 +797,8 @@ static void __init a780_init(void)
>
> ? ? ? ?pxa_set_keypad_info(&a780_keypad_platform_data);
>
> + ? ? ? pxa_set_camera_info(&a780_pxacamera_platform_data);
> +
> ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
> ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(a780_devices));
> ?}
> @@ -864,8 +964,84 @@ static struct platform_device a910_gpio_keys = {
> ? ? ? ?},
> ?};
>
> +/* camera */
> +static int a910_pxacamera_init(struct device *dev)
> +{
> + ? ? ? int err;
> +
> + ? ? ? /*
> + ? ? ? ?* GPIO50_GPIO is CAM_EN: active low
> + ? ? ? ?* GPIO28_GPIO is CAM_RST: active high
> + ? ? ? ?*/
> + ? ? ? err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> + ? ? ? if (err) {
> + ? ? ? ? ? ? ? pr_err("%s: Failed to request nCAM_EN\n", __func__);
> + ? ? ? ? ? ? ? goto fail;
> + ? ? ? }
> +
> + ? ? ? err = gpio_request(MFP_PIN_GPIO28, "CAM_RST");
> + ? ? ? if (err) {
> + ? ? ? ? ? ? ? pr_err("%s: Failed to request CAM_RST\n", __func__);
> + ? ? ? ? ? ? ? goto fail_gpio_cam_rst;
> + ? ? ? }
> +
> + ? ? ? gpio_direction_output(MFP_PIN_GPIO50, 0);
> + ? ? ? gpio_direction_output(MFP_PIN_GPIO28, 1);
> +
> + ? ? ? return 0;
> +
> +fail_gpio_cam_rst:
> + ? ? ? gpio_free(MFP_PIN_GPIO50);
> +fail:
> + ? ? ? return err;
> +}
> +
> +static int a910_pxacamera_power(struct device *dev, int on)
> +{
> + ? ? ? gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
> + ? ? ? return 0;
> +}
> +
> +static int a910_pxacamera_reset(struct device *dev)
> +{
> + ? ? ? gpio_set_value(MFP_PIN_GPIO28, 0);
> + ? ? ? msleep(10);
> + ? ? ? gpio_set_value(MFP_PIN_GPIO28, 1);
> +
> + ? ? ? return 0;
> +}
> +
> +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> + ? ? ? .init ? = a910_pxacamera_init,
> + ? ? ? .flags ?= PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> + ? ? ? ? ? ? ? PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> + ? ? ? .mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a910_camera_i2c_board_info = {
> + ? ? ? I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a910_iclink = {
> + ? ? ? .bus_id ? ? ? ? = 0,
> + ? ? ? .i2c_adapter_id = 0,
> + ? ? ? .board_info ? ? = &a910_camera_i2c_board_info,
> + ? ? ? .module_name ? ?= "mt9m111",
> + ? ? ? .power ? ? ? ? ?= a910_pxacamera_power,
> + ? ? ? .reset ? ? ? ? ?= a910_pxacamera_reset,
> +};
> +
> +static struct platform_device a910_camera = {
> + ? ? ? .name ? = "soc-camera-pdrv",
> + ? ? ? .id ? ? = 0,
> + ? ? ? .dev ? ?= {
> + ? ? ? ? ? ? ? .platform_data = &a910_iclink,
> + ? ? ? },
> +};
> +
> ?static struct platform_device *a910_devices[] __initdata = {
> ? ? ? ?&a910_gpio_keys,
> + ? ? ? &a910_camera,
> ?};
>
> ?static void __init a910_init(void)
> @@ -880,6 +1056,8 @@ static void __init a910_init(void)
>
> ? ? ? ?pxa_set_keypad_info(&a910_keypad_platform_data);
>
> + ? ? ? pxa_set_camera_info(&a910_pxacamera_platform_data);
> +
> ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
> ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(a910_devices));
> ?}
> --
> 1.6.5.2
>
>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 2/3] ezx: Add leds-lp3944 support for A910 EZX phone
  2009-11-03 16:45   ` [PATCH 2/3] ezx: Add leds-lp3944 support for A910 EZX phone Antonio Ospite
@ 2009-11-04  6:40     ` Eric Miao
  2009-11-13  8:24       ` Eric Miao
  0 siblings, 1 reply; 63+ messages in thread
From: Eric Miao @ 2009-11-04  6:40 UTC (permalink / raw)
  To: linux-arm-kernel

This patch looks good, will apply later.

On Wed, Nov 4, 2009 at 12:45 AM, Antonio Ospite
<ospite@studenti.unina.it> wrote:
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> ---
> ?arch/arm/mach-pxa/ezx.c | ? 53 +++++++++++++++++++++++++++++++++++++++++++++++
> ?1 files changed, 53 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index 9faa6e5..ac58083 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -19,6 +19,7 @@
> ?#include <linux/input.h>
> ?#include <linux/gpio.h>
> ?#include <linux/gpio_keys.h>
> +#include <linux/leds-lp3944.h>
>
> ?#include <media/soc_camera.h>
>
> @@ -1039,6 +1040,57 @@ static struct platform_device a910_camera = {
> ? ? ? ?},
> ?};
>
> +/* leds-lp3944 */
> +static struct lp3944_platform_data a910_lp3944_leds = {
> + ? ? ? .leds_size = LP3944_LEDS_MAX,
> + ? ? ? .leds = {
> + ? ? ? ? ? ? ? [0] = {
> + ? ? ? ? ? ? ? ? ? ? ? .name = "a910:red:",
> + ? ? ? ? ? ? ? ? ? ? ? .status = LP3944_LED_STATUS_OFF,
> + ? ? ? ? ? ? ? ? ? ? ? .type = LP3944_LED_TYPE_LED,
> + ? ? ? ? ? ? ? },
> + ? ? ? ? ? ? ? [1] = {
> + ? ? ? ? ? ? ? ? ? ? ? .name = "a910:green:",
> + ? ? ? ? ? ? ? ? ? ? ? .status = LP3944_LED_STATUS_OFF,
> + ? ? ? ? ? ? ? ? ? ? ? .type = LP3944_LED_TYPE_LED,
> + ? ? ? ? ? ? ? },
> + ? ? ? ? ? ? ? [2] {
> + ? ? ? ? ? ? ? ? ? ? ? .name = "a910:blue:",
> + ? ? ? ? ? ? ? ? ? ? ? .status = LP3944_LED_STATUS_OFF,
> + ? ? ? ? ? ? ? ? ? ? ? .type = LP3944_LED_TYPE_LED,
> + ? ? ? ? ? ? ? },
> + ? ? ? ? ? ? ? /* Leds 3 and 4 are used as display power switches */
> + ? ? ? ? ? ? ? [3] = {
> + ? ? ? ? ? ? ? ? ? ? ? .name = "a910::cli_display",
> + ? ? ? ? ? ? ? ? ? ? ? .status = LP3944_LED_STATUS_OFF,
> + ? ? ? ? ? ? ? ? ? ? ? .type = LP3944_LED_TYPE_LED_INVERTED
> + ? ? ? ? ? ? ? },
> + ? ? ? ? ? ? ? [4] = {
> + ? ? ? ? ? ? ? ? ? ? ? .name = "a910::main_display",
> + ? ? ? ? ? ? ? ? ? ? ? .status = LP3944_LED_STATUS_ON,
> + ? ? ? ? ? ? ? ? ? ? ? .type = LP3944_LED_TYPE_LED_INVERTED
> + ? ? ? ? ? ? ? },
> + ? ? ? ? ? ? ? [5] = { .type = LP3944_LED_TYPE_NONE },
> + ? ? ? ? ? ? ? [6] = {
> + ? ? ? ? ? ? ? ? ? ? ? .name = "a910::torch",
> + ? ? ? ? ? ? ? ? ? ? ? .status = LP3944_LED_STATUS_OFF,
> + ? ? ? ? ? ? ? ? ? ? ? .type = LP3944_LED_TYPE_LED,
> + ? ? ? ? ? ? ? },
> + ? ? ? ? ? ? ? [7] = {
> + ? ? ? ? ? ? ? ? ? ? ? .name = "a910::flash",
> + ? ? ? ? ? ? ? ? ? ? ? .status = LP3944_LED_STATUS_OFF,
> + ? ? ? ? ? ? ? ? ? ? ? .type = LP3944_LED_TYPE_LED_INVERTED,
> + ? ? ? ? ? ? ? },
> + ? ? ? },
> +};
> +
> +static struct i2c_board_info __initdata a910_i2c_board_info[] = {
> + ? ? ? {
> + ? ? ? ? ? ? ? I2C_BOARD_INFO("lp3944", 0x60),
> + ? ? ? ? ? ? ? .platform_data = &a910_lp3944_leds,
> + ? ? ? },
> +};
> +
> ?static struct platform_device *a910_devices[] __initdata = {
> ? ? ? ?&a910_gpio_keys,
> ? ? ? ?&a910_camera,
> @@ -1051,6 +1103,7 @@ static void __init a910_init(void)
> ? ? ? ?pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
>
> ? ? ? ?pxa_set_i2c_info(NULL);
> + ? ? ? i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info));
>
> ? ? ? ?set_pxa_fb_info(&ezx_fb_info_2);
>
> --
> 1.6.5.2
>
>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update
  2009-11-03 20:40   ` Antonio Ospite
@ 2009-11-04  6:42     ` Eric Miao
  2009-11-04  7:42       ` Antonio Ospite
  0 siblings, 1 reply; 63+ messages in thread
From: Eric Miao @ 2009-11-04  6:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 4, 2009 at 4:40 AM, Antonio Ospite <ospite@studenti.unina.it> wrote:
> On Tue, 3 Nov 2009 18:44:30 +0100
> Stefan Schmidt <stefan@datenfreihafen.org> wrote:
>
>> Hello.
>>
>> [Put Eric in CC]
>>
>
> <OT>
> Thanks, I've realized that the best practice to write the summary
> message is via 'git format-patch --cover-letter' to add the needed
> recipients, rather than using 'git send-email --compose' which doesn't
> process CCs, BCCs and SOBs for the introduction message.
> </OT>
>
>> On Tue, 2009-11-03 at 17:45, Antonio Ospite wrote:
>> >
>> > some updates for the EZX platform:
>>
>> Thanks for driving this forward.
>>
>> > [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
>> > [PATCH 2/3] ezx: Add leds-lp3944 support for A910 EZX phone
>> > [PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in
>> >
>> > Are we still in time for 2.6.32?
>>
>> Given that we are near -rc6 and this is clearly no fix I would say no. But Eric
>> should be happy to apply it to his devel branch which will hit Linus tree during
>> the next merge window.
>>
>
> That's fine, of course.
>
>> Eric, Antonio is doing a good deal of the current work at OpenEZX. If you need
>> an ACK anyway you can put mine into it.
>>
>> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
>>

Thanks Stefan and Antonio,

We are still in -rc phase so will not likely miss the next merge window
once you get the MFP/GPIO issue solved.

BTW: I didn't see [PATCH 3/3], or maybe I overlooked?

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update
  2009-11-04  6:42     ` Eric Miao
@ 2009-11-04  7:42       ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-04  7:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 4 Nov 2009 14:42:09 +0800
Eric Miao <eric.y.miao@gmail.com> wrote:

> On Wed, Nov 4, 2009 at 4:40 AM, Antonio Ospite <ospite@studenti.unina.it> wrote:
> > On Tue, 3 Nov 2009 18:44:30 +0100
> > Stefan Schmidt <stefan@datenfreihafen.org> wrote:
>
> >> Eric, Antonio is doing a good deal of the current work at OpenEZX. If you need
> >> an ACK anyway you can put mine into it.
> >>
> >> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
> >>
> 
> Thanks Stefan and Antonio,
> 
> We are still in -rc phase so will not likely miss the next merge window
> once you get the MFP/GPIO issue solved.
> 
> BTW: I didn't see [PATCH 3/3], or maybe I overlooked?

I'll send it again, it must have been eaten by some MTA for some
reason.

Regards,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091104/b9262f38/attachment.sig>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-04  6:38     ` Eric Miao
@ 2009-11-04  8:13       ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-04  8:13 UTC (permalink / raw)
  To: Eric Miao
  Cc: Antonio Ospite, linux-arm-kernel, openezx-devel, Bart Visscher,
	Linux Media Mailing List

On Wed, 4 Nov 2009, Eric Miao wrote:

> Hi Antonio,
> 
> Patch looks generally OK except for the MFP/GPIO usage, check my
> comments below, thanks.
> 
> > +/* camera */
> > +static int a780_pxacamera_init(struct device *dev)
> > +{
> > +       int err;
> > +
> > +       /*
> > +        * GPIO50_GPIO is CAM_EN: active low
> > +        * GPIO19_GPIO is CAM_RST: active high
> > +        */
> > +       err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> 
> Mmm... MFP != GPIO, so this probably should be written simply as:
> 
> #define GPIO_nCAM_EN	(50)

...but without parenthesis, please:

#define GPIO_nCAM_EN	50

same everywhere below

> or (which tends to be more accurate but not necessary)
> 
> #define GPIO_nCAM_EN	mfp_to_gpio(MFP_PIN_GPIO50)
> 
> If platform matters, I suggest something like:
> 
> #define GPIO_A780_nCAM_EN	(50)
> #define GPIO_A910_nCAM_EN	(<something else>)
> 
> ...
> 
> 	err = gpio_request(GPIO_nCAM_EN, "nCAM_EN");
> 
> > +       if (err) {
> > +               pr_err("%s: Failed to request nCAM_EN\n", __func__);
> > +               goto fail;
> > +       }
> > +
> > +       err = gpio_request(MFP_PIN_GPIO19, "CAM_RST");
> 
> ditto
> 
> > +       if (err) {
> > +               pr_err("%s: Failed to request CAM_RST\n", __func__);
> > +               goto fail_gpio_cam_rst;
> > +       }
> > +
> > +       gpio_direction_output(MFP_PIN_GPIO50, 0);
> > +       gpio_direction_output(MFP_PIN_GPIO19, 1);
> > +
> > +       return 0;
> > +
> > +fail_gpio_cam_rst:
> > +       gpio_free(MFP_PIN_GPIO50);
> > +fail:
> > +       return err;
> > +}
> > +
> > +static int a780_pxacamera_power(struct device *dev, int on)
> > +{
> > +       gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
> 
> 	gpio_set_value(GPIO_nCAM_EN, on ? 0 : 1);

IMHO better yet

	gpio_set_value(GPIO_nCAM_EN, !on);

Also throughout the patch below.

I'm still to look at it miself and maybe provide a couple more comments, 
if any.

Thanks
Guennadi

> 
> > +
> > +#if 0
> > +       /*
> > +        * This is reported to resolve the "vertical line in view finder"
> > +        * issue (LIBff11930), in the original source code released by
> > +        * Motorola, but we never experienced the problem, so we don't use
> > +        * this for now.
> > +        *
> > +        * AP Kernel camera driver: set TC_MM_EN to low when camera is running
> > +        * and TC_MM_EN to high when camera stops.
> > +        *
> > +        * BP Software: if TC_MM_EN is low, BP do not shut off 26M clock, but
> > +        * BP can sleep itself.
> > +        */
> > +       gpio_set_value(MFP_PIN_GPIO99, on ? 0 : 1);
> > +#endif
> 
> This is a little bit confusing - can we remove this for this stage?
> 
> > +
> > +       return 0;
> > +}
> > +
> > +static int a780_pxacamera_reset(struct device *dev)
> > +{
> > +       gpio_set_value(MFP_PIN_GPIO19, 0);
> > +       msleep(10);
> > +       gpio_set_value(MFP_PIN_GPIO19, 1);
> 
> better to define something like above:
> 
> #define GPIO_CAM_RESET	(19)
> 
> ...
> 
> 	gpio_set_value(GPIO_CAM_RESET, ...);
> 
> > +
> > +       return 0;
> > +}
> > +
> > +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> > +       .init   = a780_pxacamera_init,
> > +       .flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> > +               PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> > +       .mclk_10khz = 5000,
> > +};
> > +
> > +static struct i2c_board_info a780_camera_i2c_board_info = {
> > +       I2C_BOARD_INFO("mt9m111", 0x5d),
> > +};
> > +
> > +static struct soc_camera_link a780_iclink = {
> > +       .bus_id         = 0,
> > +       .flags          = SOCAM_SENSOR_INVERT_PCLK,
> > +       .i2c_adapter_id = 0,
> > +       .board_info     = &a780_camera_i2c_board_info,
> > +       .module_name    = "mt9m111",
> > +       .power          = a780_pxacamera_power,
> > +       .reset          = a780_pxacamera_reset,
> > +};
> > +
> > +static struct platform_device a780_camera = {
> > +       .name   = "soc-camera-pdrv",
> > +       .id     = 0,
> > +       .dev    = {
> > +               .platform_data = &a780_iclink,
> > +       },
> > +};
> > +
> >  static struct platform_device *a780_devices[] __initdata = {
> >        &a780_gpio_keys,
> > +       &a780_camera,
> >  };
> >
> >  static void __init a780_init(void)
> > @@ -699,6 +797,8 @@ static void __init a780_init(void)
> >
> >        pxa_set_keypad_info(&a780_keypad_platform_data);
> >
> > +       pxa_set_camera_info(&a780_pxacamera_platform_data);
> > +
> >        platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
> >        platform_add_devices(ARRAY_AND_SIZE(a780_devices));
> >  }
> > @@ -864,8 +964,84 @@ static struct platform_device a910_gpio_keys = {
> >        },
> >  };
> >
> > +/* camera */
> > +static int a910_pxacamera_init(struct device *dev)
> > +{
> > +       int err;
> > +
> > +       /*
> > +        * GPIO50_GPIO is CAM_EN: active low
> > +        * GPIO28_GPIO is CAM_RST: active high
> > +        */
> > +       err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> > +       if (err) {
> > +               pr_err("%s: Failed to request nCAM_EN\n", __func__);
> > +               goto fail;
> > +       }
> > +
> > +       err = gpio_request(MFP_PIN_GPIO28, "CAM_RST");
> > +       if (err) {
> > +               pr_err("%s: Failed to request CAM_RST\n", __func__);
> > +               goto fail_gpio_cam_rst;
> > +       }
> > +
> > +       gpio_direction_output(MFP_PIN_GPIO50, 0);
> > +       gpio_direction_output(MFP_PIN_GPIO28, 1);
> > +
> > +       return 0;
> > +
> > +fail_gpio_cam_rst:
> > +       gpio_free(MFP_PIN_GPIO50);
> > +fail:
> > +       return err;
> > +}
> > +
> > +static int a910_pxacamera_power(struct device *dev, int on)
> > +{
> > +       gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
> > +       return 0;
> > +}
> > +
> > +static int a910_pxacamera_reset(struct device *dev)
> > +{
> > +       gpio_set_value(MFP_PIN_GPIO28, 0);
> > +       msleep(10);
> > +       gpio_set_value(MFP_PIN_GPIO28, 1);
> > +
> > +       return 0;
> > +}
> > +
> > +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> > +       .init   = a910_pxacamera_init,
> > +       .flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> > +               PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> > +       .mclk_10khz = 5000,
> > +};
> > +
> > +static struct i2c_board_info a910_camera_i2c_board_info = {
> > +       I2C_BOARD_INFO("mt9m111", 0x5d),
> > +};
> > +
> > +static struct soc_camera_link a910_iclink = {
> > +       .bus_id         = 0,
> > +       .i2c_adapter_id = 0,
> > +       .board_info     = &a910_camera_i2c_board_info,
> > +       .module_name    = "mt9m111",
> > +       .power          = a910_pxacamera_power,
> > +       .reset          = a910_pxacamera_reset,
> > +};
> > +
> > +static struct platform_device a910_camera = {
> > +       .name   = "soc-camera-pdrv",
> > +       .id     = 0,
> > +       .dev    = {
> > +               .platform_data = &a910_iclink,
> > +       },
> > +};
> > +
> >  static struct platform_device *a910_devices[] __initdata = {
> >        &a910_gpio_keys,
> > +       &a910_camera,
> >  };
> >
> >  static void __init a910_init(void)
> > @@ -880,6 +1056,8 @@ static void __init a910_init(void)
> >
> >        pxa_set_keypad_info(&a910_keypad_platform_data);
> >
> > +       pxa_set_camera_info(&a910_pxacamera_platform_data);
> > +
> >        platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
> >        platform_add_devices(ARRAY_AND_SIZE(a910_devices));
> >  }
> > --
> > 1.6.5.2
> >
> >
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-04  8:13       ` Guennadi Liakhovetski
  0 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-04  8:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 4 Nov 2009, Eric Miao wrote:

> Hi Antonio,
> 
> Patch looks generally OK except for the MFP/GPIO usage, check my
> comments below, thanks.
> 
> > +/* camera */
> > +static int a780_pxacamera_init(struct device *dev)
> > +{
> > + ? ? ? int err;
> > +
> > + ? ? ? /*
> > + ? ? ? ?* GPIO50_GPIO is CAM_EN: active low
> > + ? ? ? ?* GPIO19_GPIO is CAM_RST: active high
> > + ? ? ? ?*/
> > + ? ? ? err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> 
> Mmm... MFP != GPIO, so this probably should be written simply as:
> 
> #define GPIO_nCAM_EN	(50)

...but without parenthesis, please:

#define GPIO_nCAM_EN	50

same everywhere below

> or (which tends to be more accurate but not necessary)
> 
> #define GPIO_nCAM_EN	mfp_to_gpio(MFP_PIN_GPIO50)
> 
> If platform matters, I suggest something like:
> 
> #define GPIO_A780_nCAM_EN	(50)
> #define GPIO_A910_nCAM_EN	(<something else>)
> 
> ...
> 
> 	err = gpio_request(GPIO_nCAM_EN, "nCAM_EN");
> 
> > + ? ? ? if (err) {
> > + ? ? ? ? ? ? ? pr_err("%s: Failed to request nCAM_EN\n", __func__);
> > + ? ? ? ? ? ? ? goto fail;
> > + ? ? ? }
> > +
> > + ? ? ? err = gpio_request(MFP_PIN_GPIO19, "CAM_RST");
> 
> ditto
> 
> > + ? ? ? if (err) {
> > + ? ? ? ? ? ? ? pr_err("%s: Failed to request CAM_RST\n", __func__);
> > + ? ? ? ? ? ? ? goto fail_gpio_cam_rst;
> > + ? ? ? }
> > +
> > + ? ? ? gpio_direction_output(MFP_PIN_GPIO50, 0);
> > + ? ? ? gpio_direction_output(MFP_PIN_GPIO19, 1);
> > +
> > + ? ? ? return 0;
> > +
> > +fail_gpio_cam_rst:
> > + ? ? ? gpio_free(MFP_PIN_GPIO50);
> > +fail:
> > + ? ? ? return err;
> > +}
> > +
> > +static int a780_pxacamera_power(struct device *dev, int on)
> > +{
> > + ? ? ? gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
> 
> 	gpio_set_value(GPIO_nCAM_EN, on ? 0 : 1);

IMHO better yet

	gpio_set_value(GPIO_nCAM_EN, !on);

Also throughout the patch below.

I'm still to look at it miself and maybe provide a couple more comments, 
if any.

Thanks
Guennadi

> 
> > +
> > +#if 0
> > + ? ? ? /*
> > + ? ? ? ?* This is reported to resolve the "vertical line in view finder"
> > + ? ? ? ?* issue (LIBff11930), in the original source code released by
> > + ? ? ? ?* Motorola, but we never experienced the problem, so we don't use
> > + ? ? ? ?* this for now.
> > + ? ? ? ?*
> > + ? ? ? ?* AP Kernel camera driver: set TC_MM_EN to low when camera is running
> > + ? ? ? ?* and TC_MM_EN to high when camera stops.
> > + ? ? ? ?*
> > + ? ? ? ?* BP Software: if TC_MM_EN is low, BP do not shut off 26M clock, but
> > + ? ? ? ?* BP can sleep itself.
> > + ? ? ? ?*/
> > + ? ? ? gpio_set_value(MFP_PIN_GPIO99, on ? 0 : 1);
> > +#endif
> 
> This is a little bit confusing - can we remove this for this stage?
> 
> > +
> > + ? ? ? return 0;
> > +}
> > +
> > +static int a780_pxacamera_reset(struct device *dev)
> > +{
> > + ? ? ? gpio_set_value(MFP_PIN_GPIO19, 0);
> > + ? ? ? msleep(10);
> > + ? ? ? gpio_set_value(MFP_PIN_GPIO19, 1);
> 
> better to define something like above:
> 
> #define GPIO_CAM_RESET	(19)
> 
> ...
> 
> 	gpio_set_value(GPIO_CAM_RESET, ...);
> 
> > +
> > + ? ? ? return 0;
> > +}
> > +
> > +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> > + ? ? ? .init ? = a780_pxacamera_init,
> > + ? ? ? .flags ?= PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> > + ? ? ? ? ? ? ? PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> > + ? ? ? .mclk_10khz = 5000,
> > +};
> > +
> > +static struct i2c_board_info a780_camera_i2c_board_info = {
> > + ? ? ? I2C_BOARD_INFO("mt9m111", 0x5d),
> > +};
> > +
> > +static struct soc_camera_link a780_iclink = {
> > + ? ? ? .bus_id ? ? ? ? = 0,
> > + ? ? ? .flags ? ? ? ? ?= SOCAM_SENSOR_INVERT_PCLK,
> > + ? ? ? .i2c_adapter_id = 0,
> > + ? ? ? .board_info ? ? = &a780_camera_i2c_board_info,
> > + ? ? ? .module_name ? ?= "mt9m111",
> > + ? ? ? .power ? ? ? ? ?= a780_pxacamera_power,
> > + ? ? ? .reset ? ? ? ? ?= a780_pxacamera_reset,
> > +};
> > +
> > +static struct platform_device a780_camera = {
> > + ? ? ? .name ? = "soc-camera-pdrv",
> > + ? ? ? .id ? ? = 0,
> > + ? ? ? .dev ? ?= {
> > + ? ? ? ? ? ? ? .platform_data = &a780_iclink,
> > + ? ? ? },
> > +};
> > +
> > ?static struct platform_device *a780_devices[] __initdata = {
> > ? ? ? ?&a780_gpio_keys,
> > + ? ? ? &a780_camera,
> > ?};
> >
> > ?static void __init a780_init(void)
> > @@ -699,6 +797,8 @@ static void __init a780_init(void)
> >
> > ? ? ? ?pxa_set_keypad_info(&a780_keypad_platform_data);
> >
> > + ? ? ? pxa_set_camera_info(&a780_pxacamera_platform_data);
> > +
> > ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
> > ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(a780_devices));
> > ?}
> > @@ -864,8 +964,84 @@ static struct platform_device a910_gpio_keys = {
> > ? ? ? ?},
> > ?};
> >
> > +/* camera */
> > +static int a910_pxacamera_init(struct device *dev)
> > +{
> > + ? ? ? int err;
> > +
> > + ? ? ? /*
> > + ? ? ? ?* GPIO50_GPIO is CAM_EN: active low
> > + ? ? ? ?* GPIO28_GPIO is CAM_RST: active high
> > + ? ? ? ?*/
> > + ? ? ? err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> > + ? ? ? if (err) {
> > + ? ? ? ? ? ? ? pr_err("%s: Failed to request nCAM_EN\n", __func__);
> > + ? ? ? ? ? ? ? goto fail;
> > + ? ? ? }
> > +
> > + ? ? ? err = gpio_request(MFP_PIN_GPIO28, "CAM_RST");
> > + ? ? ? if (err) {
> > + ? ? ? ? ? ? ? pr_err("%s: Failed to request CAM_RST\n", __func__);
> > + ? ? ? ? ? ? ? goto fail_gpio_cam_rst;
> > + ? ? ? }
> > +
> > + ? ? ? gpio_direction_output(MFP_PIN_GPIO50, 0);
> > + ? ? ? gpio_direction_output(MFP_PIN_GPIO28, 1);
> > +
> > + ? ? ? return 0;
> > +
> > +fail_gpio_cam_rst:
> > + ? ? ? gpio_free(MFP_PIN_GPIO50);
> > +fail:
> > + ? ? ? return err;
> > +}
> > +
> > +static int a910_pxacamera_power(struct device *dev, int on)
> > +{
> > + ? ? ? gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
> > + ? ? ? return 0;
> > +}
> > +
> > +static int a910_pxacamera_reset(struct device *dev)
> > +{
> > + ? ? ? gpio_set_value(MFP_PIN_GPIO28, 0);
> > + ? ? ? msleep(10);
> > + ? ? ? gpio_set_value(MFP_PIN_GPIO28, 1);
> > +
> > + ? ? ? return 0;
> > +}
> > +
> > +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> > + ? ? ? .init ? = a910_pxacamera_init,
> > + ? ? ? .flags ?= PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> > + ? ? ? ? ? ? ? PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> > + ? ? ? .mclk_10khz = 5000,
> > +};
> > +
> > +static struct i2c_board_info a910_camera_i2c_board_info = {
> > + ? ? ? I2C_BOARD_INFO("mt9m111", 0x5d),
> > +};
> > +
> > +static struct soc_camera_link a910_iclink = {
> > + ? ? ? .bus_id ? ? ? ? = 0,
> > + ? ? ? .i2c_adapter_id = 0,
> > + ? ? ? .board_info ? ? = &a910_camera_i2c_board_info,
> > + ? ? ? .module_name ? ?= "mt9m111",
> > + ? ? ? .power ? ? ? ? ?= a910_pxacamera_power,
> > + ? ? ? .reset ? ? ? ? ?= a910_pxacamera_reset,
> > +};
> > +
> > +static struct platform_device a910_camera = {
> > + ? ? ? .name ? = "soc-camera-pdrv",
> > + ? ? ? .id ? ? = 0,
> > + ? ? ? .dev ? ?= {
> > + ? ? ? ? ? ? ? .platform_data = &a910_iclink,
> > + ? ? ? },
> > +};
> > +
> > ?static struct platform_device *a910_devices[] __initdata = {
> > ? ? ? ?&a910_gpio_keys,
> > + ? ? ? &a910_camera,
> > ?};
> >
> > ?static void __init a910_init(void)
> > @@ -880,6 +1056,8 @@ static void __init a910_init(void)
> >
> > ? ? ? ?pxa_set_keypad_info(&a910_keypad_platform_data);
> >
> > + ? ? ? pxa_set_camera_info(&a910_pxacamera_platform_data);
> > +
> > ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
> > ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(a910_devices));
> > ?}
> > --
> > 1.6.5.2
> >
> >
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-04  6:38     ` Eric Miao
@ 2009-11-04  9:14       ` Antonio Ospite
  -1 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-04  9:14 UTC (permalink / raw)
  To: Eric Miao
  Cc: linux-arm-kernel, openezx-devel, Bart Visscher, linux-media,
	Guennadi Liakhovetski

[-- Attachment #1: Type: text/plain, Size: 2429 bytes --]

On Wed, 4 Nov 2009 14:38:40 +0800
Eric Miao <eric.y.miao@gmail.com> wrote:

> Hi Antonio,
> 
> Patch looks generally OK except for the MFP/GPIO usage, check my
> comments below, thanks.
>

Ok, will resend ASAP. Some questions inlined below after your comments.

> > +/* camera */
> > +static int a780_pxacamera_init(struct device *dev)
> > +{
> > +       int err;
> > +
> > +       /*
> > +        * GPIO50_GPIO is CAM_EN: active low
> > +        * GPIO19_GPIO is CAM_RST: active high
> > +        */
> > +       err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> 
> Mmm... MFP != GPIO, so this probably should be written simply as:
> 
> #define GPIO_nCAM_EN	(50)
>

If the use of parentheses here is recommended, should I send another
patch to add them to current defines for GPIOs in ezx.c, for style
consistency?

> or (which tends to be more accurate but not necessary)
> 
> #define GPIO_nCAM_EN	mfp_to_gpio(MFP_PIN_GPIO50)
>

For me it is the same, just tell me if you really prefer this one.

> > +
> > +static int a780_pxacamera_power(struct device *dev, int on)
> > +{
> > +       gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
> 
> 	gpio_set_value(GPIO_nCAM_EN, on ? 0 : 1);
> 
> > +
> > +#if 0
> > +       /*
> > +        * This is reported to resolve the "vertical line in view finder"
> > +        * issue (LIBff11930), in the original source code released by
> > +        * Motorola, but we never experienced the problem, so we don't use
> > +        * this for now.
> > +        *
> > +        * AP Kernel camera driver: set TC_MM_EN to low when camera is running
> > +        * and TC_MM_EN to high when camera stops.
> > +        *
> > +        * BP Software: if TC_MM_EN is low, BP do not shut off 26M clock, but
> > +        * BP can sleep itself.
> > +        */
> > +       gpio_set_value(MFP_PIN_GPIO99, on ? 0 : 1);
> > +#endif
> 
> This is a little bit confusing - can we remove this for this stage?
>

Ok, I am removing it for now. I might put this note in again in
future, hopefully with a better description.

[...]

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-04  9:14       ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-04  9:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 4 Nov 2009 14:38:40 +0800
Eric Miao <eric.y.miao@gmail.com> wrote:

> Hi Antonio,
> 
> Patch looks generally OK except for the MFP/GPIO usage, check my
> comments below, thanks.
>

Ok, will resend ASAP. Some questions inlined below after your comments.

> > +/* camera */
> > +static int a780_pxacamera_init(struct device *dev)
> > +{
> > + ? ? ? int err;
> > +
> > + ? ? ? /*
> > + ? ? ? ?* GPIO50_GPIO is CAM_EN: active low
> > + ? ? ? ?* GPIO19_GPIO is CAM_RST: active high
> > + ? ? ? ?*/
> > + ? ? ? err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> 
> Mmm... MFP != GPIO, so this probably should be written simply as:
> 
> #define GPIO_nCAM_EN	(50)
>

If the use of parentheses here is recommended, should I send another
patch to add them to current defines for GPIOs in ezx.c, for style
consistency?

> or (which tends to be more accurate but not necessary)
> 
> #define GPIO_nCAM_EN	mfp_to_gpio(MFP_PIN_GPIO50)
>

For me it is the same, just tell me if you really prefer this one.

> > +
> > +static int a780_pxacamera_power(struct device *dev, int on)
> > +{
> > + ? ? ? gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
> 
> 	gpio_set_value(GPIO_nCAM_EN, on ? 0 : 1);
> 
> > +
> > +#if 0
> > + ? ? ? /*
> > + ? ? ? ?* This is reported to resolve the "vertical line in view finder"
> > + ? ? ? ?* issue (LIBff11930), in the original source code released by
> > + ? ? ? ?* Motorola, but we never experienced the problem, so we don't use
> > + ? ? ? ?* this for now.
> > + ? ? ? ?*
> > + ? ? ? ?* AP Kernel camera driver: set TC_MM_EN to low when camera is running
> > + ? ? ? ?* and TC_MM_EN to high when camera stops.
> > + ? ? ? ?*
> > + ? ? ? ?* BP Software: if TC_MM_EN is low, BP do not shut off 26M clock, but
> > + ? ? ? ?* BP can sleep itself.
> > + ? ? ? ?*/
> > + ? ? ? gpio_set_value(MFP_PIN_GPIO99, on ? 0 : 1);
> > +#endif
> 
> This is a little bit confusing - can we remove this for this stage?
>

Ok, I am removing it for now. I might put this note in again in
future, hopefully with a better description.

[...]

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091104/34863856/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-04  9:14       ` Antonio Ospite
@ 2009-11-04  9:19         ` Eric Miao
  -1 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-04  9:19 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: linux-arm-kernel, openezx-devel, Bart Visscher, linux-media,
	Guennadi Liakhovetski

On Wed, Nov 4, 2009 at 5:14 PM, Antonio Ospite <ospite@studenti.unina.it> wrote:
> On Wed, 4 Nov 2009 14:38:40 +0800
> Eric Miao <eric.y.miao@gmail.com> wrote:
>
>> Hi Antonio,
>>
>> Patch looks generally OK except for the MFP/GPIO usage, check my
>> comments below, thanks.
>>
>
> Ok, will resend ASAP. Some questions inlined below after your comments.
>
>> > +/* camera */
>> > +static int a780_pxacamera_init(struct device *dev)
>> > +{
>> > +       int err;
>> > +
>> > +       /*
>> > +        * GPIO50_GPIO is CAM_EN: active low
>> > +        * GPIO19_GPIO is CAM_RST: active high
>> > +        */
>> > +       err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
>>
>> Mmm... MFP != GPIO, so this probably should be written simply as:
>>
>> #define GPIO_nCAM_EN  (50)
>>
>
> If the use of parentheses here is recommended, should I send another
> patch to add them to current defines for GPIOs in ezx.c, for style
> consistency?

I don't actually care about that - with or without parentheses are both OK
to me, though Guennadi recommends removing them, so it would be
just OK to left them untouched.

>
>> or (which tends to be more accurate but not necessary)
>>
>> #define GPIO_nCAM_EN  mfp_to_gpio(MFP_PIN_GPIO50)
>>
>
> For me it is the same, just tell me if you really prefer this one.
>

OK, the first/simple one pls

>> > +
>> > +static int a780_pxacamera_power(struct device *dev, int on)
>> > +{
>> > +       gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
>>
>>       gpio_set_value(GPIO_nCAM_EN, on ? 0 : 1);
>>
>> > +
>> > +#if 0
>> > +       /*
>> > +        * This is reported to resolve the "vertical line in view finder"
>> > +        * issue (LIBff11930), in the original source code released by
>> > +        * Motorola, but we never experienced the problem, so we don't use
>> > +        * this for now.
>> > +        *
>> > +        * AP Kernel camera driver: set TC_MM_EN to low when camera is running
>> > +        * and TC_MM_EN to high when camera stops.
>> > +        *
>> > +        * BP Software: if TC_MM_EN is low, BP do not shut off 26M clock, but
>> > +        * BP can sleep itself.
>> > +        */
>> > +       gpio_set_value(MFP_PIN_GPIO99, on ? 0 : 1);
>> > +#endif
>>
>> This is a little bit confusing - can we remove this for this stage?
>>
>
> Ok, I am removing it for now. I might put this note in again in
> future, hopefully with a better description.
>

That would be good.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-04  9:19         ` Eric Miao
  0 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-04  9:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 4, 2009 at 5:14 PM, Antonio Ospite <ospite@studenti.unina.it> wrote:
> On Wed, 4 Nov 2009 14:38:40 +0800
> Eric Miao <eric.y.miao@gmail.com> wrote:
>
>> Hi Antonio,
>>
>> Patch looks generally OK except for the MFP/GPIO usage, check my
>> comments below, thanks.
>>
>
> Ok, will resend ASAP. Some questions inlined below after your comments.
>
>> > +/* camera */
>> > +static int a780_pxacamera_init(struct device *dev)
>> > +{
>> > + ? ? ? int err;
>> > +
>> > + ? ? ? /*
>> > + ? ? ? ?* GPIO50_GPIO is CAM_EN: active low
>> > + ? ? ? ?* GPIO19_GPIO is CAM_RST: active high
>> > + ? ? ? ?*/
>> > + ? ? ? err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
>>
>> Mmm... MFP != GPIO, so this probably should be written simply as:
>>
>> #define GPIO_nCAM_EN ?(50)
>>
>
> If the use of parentheses here is recommended, should I send another
> patch to add them to current defines for GPIOs in ezx.c, for style
> consistency?

I don't actually care about that - with or without parentheses are both OK
to me, though Guennadi recommends removing them, so it would be
just OK to left them untouched.

>
>> or (which tends to be more accurate but not necessary)
>>
>> #define GPIO_nCAM_EN ?mfp_to_gpio(MFP_PIN_GPIO50)
>>
>
> For me it is the same, just tell me if you really prefer this one.
>

OK, the first/simple one pls

>> > +
>> > +static int a780_pxacamera_power(struct device *dev, int on)
>> > +{
>> > + ? ? ? gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
>>
>> ? ? ? gpio_set_value(GPIO_nCAM_EN, on ? 0 : 1);
>>
>> > +
>> > +#if 0
>> > + ? ? ? /*
>> > + ? ? ? ?* This is reported to resolve the "vertical line in view finder"
>> > + ? ? ? ?* issue (LIBff11930), in the original source code released by
>> > + ? ? ? ?* Motorola, but we never experienced the problem, so we don't use
>> > + ? ? ? ?* this for now.
>> > + ? ? ? ?*
>> > + ? ? ? ?* AP Kernel camera driver: set TC_MM_EN to low when camera is running
>> > + ? ? ? ?* and TC_MM_EN to high when camera stops.
>> > + ? ? ? ?*
>> > + ? ? ? ?* BP Software: if TC_MM_EN is low, BP do not shut off 26M clock, but
>> > + ? ? ? ?* BP can sleep itself.
>> > + ? ? ? ?*/
>> > + ? ? ? gpio_set_value(MFP_PIN_GPIO99, on ? 0 : 1);
>> > +#endif
>>
>> This is a little bit confusing - can we remove this for this stage?
>>
>
> Ok, I am removing it for now. I might put this note in again in
> future, hopefully with a better description.
>

That would be good.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-04  8:13       ` Guennadi Liakhovetski
@ 2009-11-04 11:35         ` Antonio Ospite
  -1 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-04 11:35 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Eric Miao, linux-arm-kernel, openezx-devel, Bart Visscher,
	Linux Media Mailing List

[-- Attachment #1: Type: text/plain, Size: 1764 bytes --]

On Wed, 4 Nov 2009 09:13:16 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Wed, 4 Nov 2009, Eric Miao wrote:
> 
> > Hi Antonio,
> > 
> > Patch looks generally OK except for the MFP/GPIO usage, check my
> > comments below, thanks.
> > 
> > > +/* camera */
> > > +static int a780_pxacamera_init(struct device *dev)
> > > +{
> > > +       int err;
> > > +
> > > +       /*
> > > +        * GPIO50_GPIO is CAM_EN: active low
> > > +        * GPIO19_GPIO is CAM_RST: active high
> > > +        */
> > > +       err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> > 
> > Mmm... MFP != GPIO, so this probably should be written simply as:
> > 
> > #define GPIO_nCAM_EN	(50)
> 
> ...but without parenthesis, please:
> 
> #define GPIO_nCAM_EN	50
> 
> same everywhere below
>

OK.

BTW, Guennadi, shouldn't the pxa_camera platform_data expose also an
exit() method for symmetry with the init() one, where we can free the
requested resources?

If you want I think I can add it.

[...]
> > > +
> > > +static int a780_pxacamera_power(struct device *dev, int on)
> > > +{
> > > +       gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
> > 
> > 	gpio_set_value(GPIO_nCAM_EN, on ? 0 : 1);
> 
> IMHO better yet
> 
> 	gpio_set_value(GPIO_nCAM_EN, !on);
> 
> Also throughout the patch below.
> 
> I'm still to look at it miself and maybe provide a couple more comments, 
> if any.
> 

Ok, thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-04 11:35         ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-04 11:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 4 Nov 2009 09:13:16 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Wed, 4 Nov 2009, Eric Miao wrote:
> 
> > Hi Antonio,
> > 
> > Patch looks generally OK except for the MFP/GPIO usage, check my
> > comments below, thanks.
> > 
> > > +/* camera */
> > > +static int a780_pxacamera_init(struct device *dev)
> > > +{
> > > + ? ? ? int err;
> > > +
> > > + ? ? ? /*
> > > + ? ? ? ?* GPIO50_GPIO is CAM_EN: active low
> > > + ? ? ? ?* GPIO19_GPIO is CAM_RST: active high
> > > + ? ? ? ?*/
> > > + ? ? ? err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> > 
> > Mmm... MFP != GPIO, so this probably should be written simply as:
> > 
> > #define GPIO_nCAM_EN	(50)
> 
> ...but without parenthesis, please:
> 
> #define GPIO_nCAM_EN	50
> 
> same everywhere below
>

OK.

BTW, Guennadi, shouldn't the pxa_camera platform_data expose also an
exit() method for symmetry with the init() one, where we can free the
requested resources?

If you want I think I can add it.

[...]
> > > +
> > > +static int a780_pxacamera_power(struct device *dev, int on)
> > > +{
> > > + ? ? ? gpio_set_value(MFP_PIN_GPIO50, on ? 0 : 1);
> > 
> > 	gpio_set_value(GPIO_nCAM_EN, on ? 0 : 1);
> 
> IMHO better yet
> 
> 	gpio_set_value(GPIO_nCAM_EN, !on);
> 
> Also throughout the patch below.
> 
> I'm still to look at it miself and maybe provide a couple more comments, 
> if any.
> 

Ok, thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091104/a4c5d482/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-04  9:19         ` Eric Miao
@ 2009-11-04 20:47           ` Antonio Ospite
  -1 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-04 20:47 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Antonio Ospite, Eric Miao, openezx-devel, Bart Visscher,
	linux-media, Guennadi Liakhovetski

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Bart Visscher <bartv@thisnet.nl>
---

Changes since previous version:
  Addressed all the comments from Eric and Guennadi.

CAM_RST gpios are different for different platform generations, as also
shown in current MFP pins setup.


 arch/arm/mach-pxa/ezx.c |  164 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 164 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 588b265..7cfd633 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -17,8 +17,11 @@
 #include <linux/delay.h>
 #include <linux/pwm_backlight.h>
 #include <linux/input.h>
+#include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 
+#include <media/soc_camera.h>
+
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -29,6 +32,7 @@
 #include <plat/i2c.h>
 #include <mach/hardware.h>
 #include <mach/pxa27x_keypad.h>
+#include <mach/camera.h>
 
 #include "devices.h"
 #include "generic.h"
@@ -38,6 +42,9 @@
 #define GPIO15_A910_FLIP_LID 		15
 #define GPIO12_E680_LOCK_SWITCH 	12
 #define GPIO15_E6_LOCK_SWITCH 		15
+#define GPIO50_nCAM_EN			50
+#define GPIO19_GEN1_CAM_RST		19
+#define GPIO28_GEN2_CAM_RST		28
 
 static struct platform_pwm_backlight_data ezx_backlight_data = {
 	.pwm_id		= 0,
@@ -683,8 +690,85 @@ static struct platform_device a780_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a780_pxacamera_init(struct device *dev)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO19_GEN1_CAM_RST is active high
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 0);
+	gpio_direction_output(GPIO19_GEN1_CAM_RST, 1);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a780_pxacamera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a780_pxacamera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a780_pxacamera_platform_data = {
+	.init	= a780_pxacamera_init,
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a780_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a780_iclink = {
+	.bus_id         = 0,
+	.flags          = SOCAM_SENSOR_INVERT_PCLK,
+	.i2c_adapter_id = 0,
+	.board_info     = &a780_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a780_pxacamera_power,
+	.reset          = a780_pxacamera_reset,
+};
+
+static struct platform_device a780_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a780_iclink,
+	},
+};
+
 static struct platform_device *a780_devices[] __initdata = {
 	&a780_gpio_keys,
+	&a780_camera,
 };
 
 static void __init a780_init(void)
@@ -699,6 +783,8 @@ static void __init a780_init(void)
 
 	pxa_set_keypad_info(&a780_keypad_platform_data);
 
+	pxa_set_camera_info(&a780_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
 }
@@ -864,8 +950,84 @@ static struct platform_device a910_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a910_pxacamera_init(struct device *dev)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO28_GEN2_CAM_RST is active high
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 0);
+	gpio_direction_output(GPIO28_GEN2_CAM_RST, 1);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a910_pxacamera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a910_pxacamera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a910_pxacamera_platform_data = {
+	.init	= a910_pxacamera_init,
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a910_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a910_iclink = {
+	.bus_id         = 0,
+	.i2c_adapter_id = 0,
+	.board_info     = &a910_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a910_pxacamera_power,
+	.reset          = a910_pxacamera_reset,
+};
+
+static struct platform_device a910_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a910_iclink,
+	},
+};
+
 static struct platform_device *a910_devices[] __initdata = {
 	&a910_gpio_keys,
+	&a910_camera,
 };
 
 static void __init a910_init(void)
@@ -880,6 +1042,8 @@ static void __init a910_init(void)
 
 	pxa_set_keypad_info(&a910_keypad_platform_data);
 
+	pxa_set_camera_info(&a910_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
 }
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-04 20:47           ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-04 20:47 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Bart Visscher <bartv@thisnet.nl>
---

Changes since previous version:
  Addressed all the comments from Eric and Guennadi.

CAM_RST gpios are different for different platform generations, as also
shown in current MFP pins setup.


 arch/arm/mach-pxa/ezx.c |  164 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 164 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 588b265..7cfd633 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -17,8 +17,11 @@
 #include <linux/delay.h>
 #include <linux/pwm_backlight.h>
 #include <linux/input.h>
+#include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 
+#include <media/soc_camera.h>
+
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -29,6 +32,7 @@
 #include <plat/i2c.h>
 #include <mach/hardware.h>
 #include <mach/pxa27x_keypad.h>
+#include <mach/camera.h>
 
 #include "devices.h"
 #include "generic.h"
@@ -38,6 +42,9 @@
 #define GPIO15_A910_FLIP_LID 		15
 #define GPIO12_E680_LOCK_SWITCH 	12
 #define GPIO15_E6_LOCK_SWITCH 		15
+#define GPIO50_nCAM_EN			50
+#define GPIO19_GEN1_CAM_RST		19
+#define GPIO28_GEN2_CAM_RST		28
 
 static struct platform_pwm_backlight_data ezx_backlight_data = {
 	.pwm_id		= 0,
@@ -683,8 +690,85 @@ static struct platform_device a780_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a780_pxacamera_init(struct device *dev)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO19_GEN1_CAM_RST is active high
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 0);
+	gpio_direction_output(GPIO19_GEN1_CAM_RST, 1);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a780_pxacamera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a780_pxacamera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a780_pxacamera_platform_data = {
+	.init	= a780_pxacamera_init,
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a780_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a780_iclink = {
+	.bus_id         = 0,
+	.flags          = SOCAM_SENSOR_INVERT_PCLK,
+	.i2c_adapter_id = 0,
+	.board_info     = &a780_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a780_pxacamera_power,
+	.reset          = a780_pxacamera_reset,
+};
+
+static struct platform_device a780_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a780_iclink,
+	},
+};
+
 static struct platform_device *a780_devices[] __initdata = {
 	&a780_gpio_keys,
+	&a780_camera,
 };
 
 static void __init a780_init(void)
@@ -699,6 +783,8 @@ static void __init a780_init(void)
 
 	pxa_set_keypad_info(&a780_keypad_platform_data);
 
+	pxa_set_camera_info(&a780_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
 }
@@ -864,8 +950,84 @@ static struct platform_device a910_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a910_pxacamera_init(struct device *dev)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO28_GEN2_CAM_RST is active high
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 0);
+	gpio_direction_output(GPIO28_GEN2_CAM_RST, 1);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a910_pxacamera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a910_pxacamera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a910_pxacamera_platform_data = {
+	.init	= a910_pxacamera_init,
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a910_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a910_iclink = {
+	.bus_id         = 0,
+	.i2c_adapter_id = 0,
+	.board_info     = &a910_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a910_pxacamera_power,
+	.reset          = a910_pxacamera_reset,
+};
+
+static struct platform_device a910_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a910_iclink,
+	},
+};
+
 static struct platform_device *a910_devices[] __initdata = {
 	&a910_gpio_keys,
+	&a910_camera,
 };
 
 static void __init a910_init(void)
@@ -880,6 +1042,8 @@ static void __init a910_init(void)
 
 	pxa_set_keypad_info(&a910_keypad_platform_data);
 
+	pxa_set_camera_info(&a910_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
 }
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in
  2009-11-03 16:45 [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update Antonio Ospite
  2009-11-03 16:45   ` Antonio Ospite
  2009-11-03 17:44 ` [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update Stefan Schmidt
@ 2009-11-04 21:35 ` Antonio Ospite
  2009-11-11 14:08   ` Antonio Ospite
  2009-11-13  8:25   ` Eric Miao
  2 siblings, 2 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-04 21:35 UTC (permalink / raw)
  To: linux-arm-kernel

---
Resent from another place, since it looks like the previous copy has been
lost by my ISP...

 arch/arm/configs/ezx_defconfig |  947 ++++++++++++++++++++++++++++------------
 1 files changed, 667 insertions(+), 280 deletions(-)

diff --git a/arch/arm/configs/ezx_defconfig b/arch/arm/configs/ezx_defconfig
index d5ee16e..492f29a 100644
--- a/arch/arm/configs/ezx_defconfig
+++ b/arch/arm/configs/ezx_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc3
-# Mon Jul  7 17:52:21 2008
+# Linux kernel version: 2.6.32-rc5
+# Mon Nov  2 13:18:50 2009
 #
 CONFIG_ARM=y
 CONFIG_HAVE_PWM=y
@@ -9,24 +9,22 @@ CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
-# CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
 CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_ARCH_SUPPORTS_AOUT=y
-CONFIG_ZONE_DMA=y
 CONFIG_ARCH_MTD_XIP=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_VECTORS_BASE=0xffff0000
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y
 
 #
 # General setup
@@ -35,7 +33,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-CONFIG_LOCALVERSION="-ezxdev"
+CONFIG_LOCALVERSION="-ezx200910312315"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
@@ -44,56 +42,78 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
+
+#
+# RCU Subsystem
+#
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_CGROUPS is not set
 CONFIG_GROUP_SCHED=y
 CONFIG_FAIR_GROUP_SCHED=y
 # CONFIG_RT_GROUP_SCHED is not set
 CONFIG_USER_SCHED=y
 # CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
-# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
 CONFIG_EMBEDDED=y
 CONFIG_UID16=y
 CONFIG_SYSCTL_SYSCALL=y
-CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
-CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
+
+#
+# Kernel Performance Events And Counters
+#
 CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
-# CONFIG_HAVE_DMA_ATTRS is not set
-CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_GCOV_KERNEL is not set
+CONFIG_SLOW_WORK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
 # CONFIG_MODULE_FORCE_LOAD is not set
@@ -101,12 +121,10 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_KMOD=y
 CONFIG_BLOCK=y
-# CONFIG_LBD is not set
-# CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
+# CONFIG_LBDAF is not set
 # CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -120,25 +138,27 @@ CONFIG_DEFAULT_DEADLINE=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="deadline"
-CONFIG_CLASSIC_RCU=y
+CONFIG_FREEZER=y
 
 #
 # System Type
 #
+CONFIG_MMU=y
 # CONFIG_ARCH_AAEC2000 is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_VERSATILE is not set
 # CONFIG_ARCH_AT91 is not set
-# CONFIG_ARCH_CLPS7500 is not set
 # CONFIG_ARCH_CLPS711X is not set
-# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_EP93XX is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_NOMADIK is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -146,39 +166,64 @@ CONFIG_CLASSIC_RCU=y
 # CONFIG_ARCH_IXP2000 is not set
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KIRKWOOD is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
 # CONFIG_ARCH_KS8695 is not set
 # CONFIG_ARCH_NS9XXX is not set
-# CONFIG_ARCH_MXC is not set
-# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_W90X900 is not set
 # CONFIG_ARCH_PNX4008 is not set
 CONFIG_ARCH_PXA=y
+# CONFIG_ARCH_MSM is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5PC1XX is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_U300 is not set
 # CONFIG_ARCH_DAVINCI is not set
 # CONFIG_ARCH_OMAP is not set
-# CONFIG_ARCH_MSM7X00A is not set
+# CONFIG_ARCH_BCMRING is not set
 
 #
 # Intel PXA2xx/PXA3xx Implementations
 #
 # CONFIG_ARCH_GUMSTIX is not set
+# CONFIG_MACH_INTELMOTE2 is not set
+# CONFIG_MACH_STARGATE2 is not set
 # CONFIG_ARCH_LUBBOCK is not set
 # CONFIG_MACH_LOGICPD_PXA270 is not set
 # CONFIG_MACH_MAINSTONE is not set
+# CONFIG_MACH_MP900C is not set
+# CONFIG_MACH_BALLOON3 is not set
 # CONFIG_ARCH_PXA_IDP is not set
 # CONFIG_PXA_SHARPSL is not set
+# CONFIG_ARCH_VIPER is not set
 # CONFIG_ARCH_PXA_ESERIES is not set
-# CONFIG_MACH_TRIZEPS4 is not set
+# CONFIG_TRIZEPS_PXA is not set
+# CONFIG_MACH_H5000 is not set
 # CONFIG_MACH_EM_X270 is not set
+# CONFIG_MACH_EXEDA is not set
 # CONFIG_MACH_COLIBRI is not set
+# CONFIG_MACH_COLIBRI300 is not set
+# CONFIG_MACH_COLIBRI320 is not set
 # CONFIG_MACH_ZYLONITE is not set
 # CONFIG_MACH_LITTLETON is not set
+# CONFIG_MACH_TAVOREVB is not set
+# CONFIG_MACH_SAAR is not set
 # CONFIG_MACH_ARMCORE is not set
+# CONFIG_MACH_CM_X300 is not set
+# CONFIG_MACH_H4700 is not set
 # CONFIG_MACH_MAGICIAN is not set
+# CONFIG_MACH_HIMALAYA is not set
+# CONFIG_MACH_MIOA701 is not set
 # CONFIG_MACH_PCM027 is not set
+# CONFIG_ARCH_PXA_PALM is not set
+# CONFIG_MACH_CSB726 is not set
 CONFIG_PXA_EZX=y
 CONFIG_MACH_EZX_A780=y
 CONFIG_MACH_EZX_E680=y
@@ -186,17 +231,11 @@ CONFIG_MACH_EZX_A1200=y
 CONFIG_MACH_EZX_A910=y
 CONFIG_MACH_EZX_E6=y
 CONFIG_MACH_EZX_E2=y
+# CONFIG_MACH_XCEP is not set
 CONFIG_PXA27x=y
 CONFIG_PXA_SSP=y
-CONFIG_PXA_PWM=y
-
-#
-# Boot options
-#
-
-#
-# Power management
-#
+CONFIG_PXA_HAVE_BOARD_IRQS=y
+CONFIG_PLAT_PXA=y
 
 #
 # Processor Type
@@ -205,7 +244,7 @@ CONFIG_CPU_32=y
 CONFIG_CPU_XSCALE=y
 CONFIG_CPU_32v5=y
 CONFIG_CPU_ABRT_EV5T=y
-CONFIG_CPU_PABRT_NOIFAR=y
+CONFIG_CPU_PABRT_LEGACY=y
 CONFIG_CPU_CACHE_VIVT=y
 CONFIG_CPU_TLB_V4WBI=y
 CONFIG_CPU_CP15=y
@@ -216,9 +255,10 @@ CONFIG_CPU_CP15_MMU=y
 #
 CONFIG_ARM_THUMB=y
 # CONFIG_CPU_DCACHE_DISABLE is not set
-# CONFIG_OUTER_CACHE is not set
+CONFIG_ARM_L1_CACHE_SHIFT=5
 CONFIG_IWMMXT=y
 CONFIG_XSCALE_PMU=y
+CONFIG_COMMON_CLKDEV=y
 
 #
 # Bus support
@@ -231,44 +271,71 @@ CONFIG_XSCALE_PMU=y
 # Kernel Features
 #
 CONFIG_TICK_ONESHOT=y
-# CONFIG_NO_HZ is not set
+CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREEMPT=y
 CONFIG_HZ=100
 CONFIG_AEABI=y
 CONFIG_OABI_COMPAT=y
-# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+# CONFIG_HIGHMEM is not set
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
 # CONFIG_SPARSEMEM_MANUAL is not set
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4096
-# CONFIG_RESOURCES_64BIT is not set
-CONFIG_ZONE_DMA_FLAG=1
-CONFIG_BOUNCE=y
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
 CONFIG_VIRT_TO_BUS=y
+CONFIG_HAVE_MLOCK=y
+CONFIG_HAVE_MLOCKED_PAGE_BIT=y
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
 CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
 
 #
 # Boot options
 #
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="console=tty1 root=/dev/mmcblk0p2 rootfstype=ext2 rootdelay=1 ip=192.168.0.202:192.168.0.200:192.168.0.200:255.255.255.0 debug"
+CONFIG_CMDLINE="console=tty1 root=/dev/mmcblk0p2 rootfstype=ext2 rootdelay=3 ip=192.168.0.202:192.168.0.200:192.168.0.200:255.255.255.0 debug"
 # CONFIG_XIP_KERNEL is not set
 CONFIG_KEXEC=y
 CONFIG_ATAGS_PROC=y
 
 #
-# CPU Frequency scaling
-#
-# CONFIG_CPU_FREQ is not set
+# CPU Power Management
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_DEBUG=y
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
+CONFIG_CPU_FREQ_GOV_ONDEMAND=m
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
 
 #
 # Floating point emulation
@@ -285,6 +352,8 @@ CONFIG_FPE_NWFPE=y
 # Userspace binary formats
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 
@@ -297,11 +366,8 @@ CONFIG_PM_SLEEP=y
 CONFIG_SUSPEND=y
 CONFIG_SUSPEND_FREEZER=y
 CONFIG_APM_EMULATION=y
+CONFIG_PM_RUNTIME=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
-
-#
-# Networking
-#
 CONFIG_NET=y
 
 #
@@ -315,6 +381,7 @@ CONFIG_XFRM=y
 # CONFIG_XFRM_SUB_POLICY is not set
 # CONFIG_XFRM_MIGRATE is not set
 # CONFIG_XFRM_STATISTICS is not set
+CONFIG_XFRM_IPCOMP=m
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -342,7 +409,6 @@ CONFIG_INET_TUNNEL=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 # CONFIG_IPV6_PRIVACY is not set
 # CONFIG_IPV6_ROUTER_PREF is not set
@@ -393,18 +459,22 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 CONFIG_NF_CT_NETLINK=m
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 # CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
 # CONFIG_NETFILTER_XT_TARGET_DSCP is not set
+CONFIG_NETFILTER_XT_TARGET_HL=m
+CONFIG_NETFILTER_XT_TARGET_LED=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 # CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
 # CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
 # CONFIG_NETFILTER_XT_TARGET_TRACE is not set
 CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
 # CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
+# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
 CONFIG_NETFILTER_XT_MATCH_COMMENT=m
 CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
 CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
@@ -413,20 +483,23 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_HL=m
 # CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 # CONFIG_NETFILTER_XT_MATCH_OWNER is not set
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 # CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 # CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -434,20 +507,21 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_NETFILTER_XT_MATCH_OSF is not set
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -455,8 +529,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -469,9 +543,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -483,30 +557,29 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_TARGET_HL=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
-CONFIG_IP6_NF_TARGET_HL=m
 CONFIG_IP6_NF_RAW=m
-
-#
-# Bridge: Netfilter Configuration
-#
 # CONFIG_BRIDGE_NF_EBTABLES is not set
 # CONFIG_IP_DCCP is not set
 # CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
+CONFIG_STP=m
 CONFIG_BRIDGE=m
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -517,9 +590,11 @@ CONFIG_LLC=m
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
 # CONFIG_NET_SCHED is not set
 CONFIG_NET_CLS_ROUTE=y
-CONFIG_NET_SCH_FIFO=y
+# CONFIG_DCB is not set
 
 #
 # Network testing
@@ -529,64 +604,34 @@ CONFIG_NET_SCH_FIFO=y
 # CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 CONFIG_BT=y
-CONFIG_BT_L2CAP=m
+CONFIG_BT_L2CAP=y
 CONFIG_BT_SCO=y
-CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM=y
 CONFIG_BT_RFCOMM_TTY=y
-CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP=y
 CONFIG_BT_BNEP_MC_FILTER=y
 CONFIG_BT_BNEP_PROTO_FILTER=y
-CONFIG_BT_HIDP=m
+CONFIG_BT_HIDP=y
 
 #
 # Bluetooth device drivers
 #
-# CONFIG_BT_HCIUSB is not set
-# CONFIG_BT_HCIBTUSB is not set
-# CONFIG_BT_HCIBTSDIO is not set
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
 CONFIG_BT_HCIUART=y
 CONFIG_BT_HCIUART_H4=y
 # CONFIG_BT_HCIUART_BCSP is not set
 # CONFIG_BT_HCIUART_LL is not set
-# CONFIG_BT_HCIBCM203X is not set
-# CONFIG_BT_HCIBPA10X is not set
-# CONFIG_BT_HCIBFUSB is not set
-# CONFIG_BT_HCIVHCI is not set
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
 # CONFIG_AF_RXRPC is not set
 CONFIG_FIB_RULES=y
-
-#
-# Wireless
-#
-CONFIG_CFG80211=m
-CONFIG_NL80211=y
-CONFIG_WIRELESS_EXT=y
-CONFIG_MAC80211=m
-
-#
-# Rate control algorithm selection
-#
-CONFIG_MAC80211_RC_DEFAULT_PID=y
-# CONFIG_MAC80211_RC_DEFAULT_NONE is not set
-
-#
-# Selecting 'y' for an algorithm will
-#
-
-#
-# build the algorithm into mac80211.
-#
-CONFIG_MAC80211_RC_DEFAULT="pid"
-CONFIG_MAC80211_RC_PID=y
-# CONFIG_MAC80211_MESH is not set
-CONFIG_MAC80211_LEDS=y
-# CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT is not set
-# CONFIG_MAC80211_DEBUG is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -598,13 +643,19 @@ CONFIG_IEEE80211_CRYPT_TKIP=m
 # Generic Driver Options
 #
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# CONFIG_DEVTMPFS is not set
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
 CONFIG_CONNECTOR=m
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_TESTS is not set
 # CONFIG_MTD_CONCAT is not set
 CONFIG_MTD_PARTITIONS=y
 # CONFIG_MTD_REDBOOT_PARTS is not set
@@ -616,9 +667,9 @@ CONFIG_MTD_PARTITIONS=y
 # User Modules And Translation Layers
 #
 CONFIG_MTD_CHAR=y
-# CONFIG_MTD_BLKDEVS is not set
-# CONFIG_MTD_BLOCK is not set
-# CONFIG_MTD_BLOCK_RO is not set
+CONFIG_HAVE_MTD_OTP=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
 # CONFIG_FTL is not set
 # CONFIG_NFTL is not set
 # CONFIG_INFTL is not set
@@ -647,7 +698,7 @@ CONFIG_MTD_CFI_I1=y
 # CONFIG_MTD_CFI_I2 is not set
 # CONFIG_MTD_CFI_I4 is not set
 # CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_OTP is not set
+CONFIG_MTD_OTP=y
 CONFIG_MTD_CFI_INTELEXT=y
 # CONFIG_MTD_CFI_AMDSTD is not set
 # CONFIG_MTD_CFI_STAA is not set
@@ -655,19 +706,15 @@ CONFIG_MTD_CFI_UTIL=y
 # CONFIG_MTD_RAM is not set
 # CONFIG_MTD_ROM is not set
 # CONFIG_MTD_ABSENT is not set
-CONFIG_MTD_XIP=y
+# CONFIG_MTD_XIP is not set
 
 #
 # Mapping drivers for chip access
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_PHYSMAP_START=0x0
-CONFIG_MTD_PHYSMAP_LEN=0x0
-CONFIG_MTD_PHYSMAP_BANKWIDTH=2
-# CONFIG_MTD_PXA2XX is not set
+# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_PXA2XX=y
 # CONFIG_MTD_ARM_INTEGRATOR is not set
-# CONFIG_MTD_SHARP_SL is not set
 # CONFIG_MTD_PLATRAM is not set
 
 #
@@ -675,6 +722,7 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
 #
 # CONFIG_MTD_DATAFLASH is not set
 # CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SST25L is not set
 # CONFIG_MTD_SLRAM is not set
 # CONFIG_MTD_PHRAM is not set
 # CONFIG_MTD_MTDRAM is not set
@@ -690,6 +738,11 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
 # CONFIG_MTD_ONENAND is not set
 
 #
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+
+#
 # UBI - Unsorted block images
 #
 # CONFIG_MTD_UBI is not set
@@ -700,15 +753,14 @@ CONFIG_BLK_DEV_LOOP=m
 CONFIG_BLK_DEV_CRYPTOLOOP=m
 CONFIG_BLK_DEV_NBD=m
 # CONFIG_BLK_DEV_UB is not set
-CONFIG_BLK_DEV_RAM=m
+CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
 # CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-CONFIG_MISC_DEVICES=y
-# CONFIG_EEPROM_93CX6 is not set
-# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_MG_DISK is not set
+# CONFIG_MISC_DEVICES is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -722,7 +774,6 @@ CONFIG_HAVE_IDE=y
 # CONFIG_ATA is not set
 # CONFIG_MD is not set
 CONFIG_NETDEVICES=y
-# CONFIG_NETDEVICES_MULTIQUEUE is not set
 CONFIG_DUMMY=y
 # CONFIG_BONDING is not set
 # CONFIG_MACVLAN is not set
@@ -732,13 +783,11 @@ CONFIG_DUMMY=y
 # CONFIG_NET_ETHERNET is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
+# CONFIG_WLAN is not set
 
 #
-# Wireless LAN
+# Enable WiMAX (Networking options) to see the WiMAX drivers
 #
-# CONFIG_WLAN_PRE80211 is not set
-# CONFIG_WLAN_80211 is not set
-# CONFIG_IWLWIFI_LEDS is not set
 
 #
 # USB Network Adapters
@@ -765,6 +814,7 @@ CONFIG_SLHC=m
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
 # CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -786,29 +836,45 @@ CONFIG_INPUT_EVDEV=y
 # Input Device Drivers
 #
 CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
 # CONFIG_KEYBOARD_ATKBD is not set
-# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_QT2160 is not set
 # CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_LM8323 is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
 # CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
 CONFIG_KEYBOARD_PXA27x=y
-CONFIG_KEYBOARD_GPIO=y
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
 CONFIG_INPUT_TOUCHSCREEN=y
 # CONFIG_TOUCHSCREEN_ADS7846 is not set
+# CONFIG_TOUCHSCREEN_AD7877 is not set
+# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
+# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
+# CONFIG_TOUCHSCREEN_AD7879 is not set
+# CONFIG_TOUCHSCREEN_EETI is not set
 # CONFIG_TOUCHSCREEN_FUJITSU is not set
 # CONFIG_TOUCHSCREEN_GUNZE is not set
 # CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_MCS5000 is not set
 # CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO is not set
 # CONFIG_TOUCHSCREEN_MK712 is not set
 # CONFIG_TOUCHSCREEN_PENMOUNT is not set
 # CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
 # CONFIG_TOUCHSCREEN_TOUCHWIN is not set
-# CONFIG_TOUCHSCREEN_UCB1400 is not set
 # CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+# CONFIG_TOUCHSCREEN_TSC2007 is not set
+# CONFIG_TOUCHSCREEN_W90X900 is not set
 CONFIG_TOUCHSCREEN_PCAP=y
 CONFIG_INPUT_MISC=y
 # CONFIG_INPUT_ATI_REMOTE is not set
@@ -816,7 +882,10 @@ CONFIG_INPUT_MISC=y
 # CONFIG_INPUT_KEYSPAN_REMOTE is not set
 # CONFIG_INPUT_POWERMATE is not set
 # CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_CM109 is not set
 CONFIG_INPUT_UINPUT=y
+# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+CONFIG_INPUT_PCAP=y
 
 #
 # Hardware I/O ports
@@ -828,6 +897,7 @@ CONFIG_INPUT_UINPUT=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
@@ -842,92 +912,130 @@ CONFIG_DEVKMEM=y
 #
 # Non-8250 serial port support
 #
+# CONFIG_SERIAL_MAX3100 is not set
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=8
 # CONFIG_IPMI_HANDLER is not set
-CONFIG_HW_RANDOM=y
-# CONFIG_NVRAM is not set
+# CONFIG_HW_RANDOM is not set
 # CONFIG_R3964 is not set
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_TCG_TPM is not set
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
 CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
 
 #
 # I2C Hardware Bus support
 #
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_DESIGNWARE is not set
 # CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
 CONFIG_I2C_PXA=y
 # CONFIG_I2C_PXA_SLAVE is not set
-# CONFIG_I2C_OCORES is not set
-# CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_TAOS_EVM is not set
-# CONFIG_I2C_STUB is not set
 # CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
 # CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
 
 #
 # Miscellaneous I2C Chip support
 #
 # CONFIG_DS1682 is not set
-# CONFIG_EEPROM_LEGACY is not set
-# CONFIG_SENSORS_PCF8574 is not set
-# CONFIG_PCF8575 is not set
-# CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_TPS65010 is not set
-# CONFIG_SENSORS_MAX6875 is not set
 # CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
 CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
 CONFIG_SPI_MASTER=y
 
 #
 # SPI Master Controller Drivers
 #
 # CONFIG_SPI_BITBANG is not set
-CONFIG_SPI_PXA2XX=m
+# CONFIG_SPI_GPIO is not set
+CONFIG_SPI_PXA2XX=y
 
 #
 # SPI Protocol Masters
 #
-# CONFIG_EEPROM_AT25 is not set
 # CONFIG_SPI_SPIDEV is not set
 # CONFIG_SPI_TLE62X0 is not set
-CONFIG_HAVE_GPIO_LIB=y
 
 #
-# GPIO Support
+# PPS support
+#
+# CONFIG_PPS is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO expanders:
 #
 
 #
 # I2C GPIO expanders:
 #
+# CONFIG_GPIO_MAX732X is not set
 # CONFIG_GPIO_PCA953X is not set
 # CONFIG_GPIO_PCF857X is not set
 
 #
+# PCI GPIO expanders:
+#
+
+#
 # SPI GPIO expanders:
 #
+# CONFIG_GPIO_MAX7301 is not set
 # CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_GPIO_MC33880 is not set
+
+#
+# AC97 GPIO expanders:
+#
 # CONFIG_W1 is not set
-# CONFIG_POWER_SUPPLY is not set
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_APM_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
 # CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -938,54 +1046,170 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_ASIC3 is not set
 # CONFIG_HTC_EGPIO is not set
 # CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
 # CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM831X is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_MFD_MC13783 is not set
+# CONFIG_AB3100_CORE is not set
 CONFIG_EZX_PCAP=y
-
-#
-# Multimedia devices
-#
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_DEBUG=y
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+CONFIG_REGULATOR_VIRTUAL_CONSUMER=y
+CONFIG_REGULATOR_USERSPACE_CONSUMER=y
+# CONFIG_REGULATOR_BQ24022 is not set
+# CONFIG_REGULATOR_MAX1586 is not set
+# CONFIG_REGULATOR_LP3971 is not set
+CONFIG_REGULATOR_PCAP=y
+# CONFIG_REGULATOR_TPS65023 is not set
+# CONFIG_REGULATOR_TPS6507X is not set
+CONFIG_MEDIA_SUPPORT=y
 
 #
 # Multimedia core support
 #
-CONFIG_VIDEO_DEV=m
-CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2_COMMON=y
 CONFIG_VIDEO_ALLOW_V4L1=y
 CONFIG_VIDEO_V4L1_COMPAT=y
 # CONFIG_DVB_CORE is not set
-CONFIG_VIDEO_MEDIA=m
+CONFIG_VIDEO_MEDIA=y
 
 #
 # Multimedia drivers
 #
 # CONFIG_MEDIA_ATTACH is not set
-CONFIG_MEDIA_TUNER=m
-# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
-CONFIG_MEDIA_TUNER_SIMPLE=m
-CONFIG_MEDIA_TUNER_TDA8290=m
-CONFIG_MEDIA_TUNER_TDA9887=m
-CONFIG_MEDIA_TUNER_TEA5761=m
-CONFIG_MEDIA_TUNER_TEA5767=m
-CONFIG_MEDIA_TUNER_MT20XX=m
-CONFIG_MEDIA_TUNER_XC2028=m
-CONFIG_MEDIA_TUNER_XC5000=m
-CONFIG_VIDEO_V4L2=m
-CONFIG_VIDEO_V4L1=m
+CONFIG_MEDIA_TUNER=y
+CONFIG_MEDIA_TUNER_CUSTOMISE=y
+# CONFIG_MEDIA_TUNER_SIMPLE is not set
+# CONFIG_MEDIA_TUNER_TDA8290 is not set
+# CONFIG_MEDIA_TUNER_TDA827X is not set
+# CONFIG_MEDIA_TUNER_TDA18271 is not set
+# CONFIG_MEDIA_TUNER_TDA9887 is not set
+# CONFIG_MEDIA_TUNER_TEA5761 is not set
+# CONFIG_MEDIA_TUNER_TEA5767 is not set
+# CONFIG_MEDIA_TUNER_MT20XX is not set
+# CONFIG_MEDIA_TUNER_MT2060 is not set
+# CONFIG_MEDIA_TUNER_MT2266 is not set
+# CONFIG_MEDIA_TUNER_MT2131 is not set
+# CONFIG_MEDIA_TUNER_QT1010 is not set
+# CONFIG_MEDIA_TUNER_XC2028 is not set
+# CONFIG_MEDIA_TUNER_XC5000 is not set
+# CONFIG_MEDIA_TUNER_MXL5005S is not set
+# CONFIG_MEDIA_TUNER_MXL5007T is not set
+# CONFIG_MEDIA_TUNER_MC44S803 is not set
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEO_V4L1=y
+CONFIG_VIDEOBUF_GEN=y
+CONFIG_VIDEOBUF_DMA_SG=y
 CONFIG_VIDEO_CAPTURE_DRIVERS=y
 # CONFIG_VIDEO_ADV_DEBUG is not set
-CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
+
+#
+# Encoders/decoders and other helper chips
+#
+
+#
+# Audio decoders
+#
+# CONFIG_VIDEO_TVAUDIO is not set
+# CONFIG_VIDEO_TDA7432 is not set
+# CONFIG_VIDEO_TDA9840 is not set
+# CONFIG_VIDEO_TDA9875 is not set
+# CONFIG_VIDEO_TEA6415C is not set
+# CONFIG_VIDEO_TEA6420 is not set
+# CONFIG_VIDEO_MSP3400 is not set
+# CONFIG_VIDEO_CS5345 is not set
+# CONFIG_VIDEO_CS53L32A is not set
+# CONFIG_VIDEO_M52790 is not set
+# CONFIG_VIDEO_TLV320AIC23B is not set
+# CONFIG_VIDEO_WM8775 is not set
+# CONFIG_VIDEO_WM8739 is not set
+# CONFIG_VIDEO_VP27SMPX is not set
+
+#
+# RDS decoders
+#
+# CONFIG_VIDEO_SAA6588 is not set
+
+#
+# Video decoders
+#
+# CONFIG_VIDEO_ADV7180 is not set
+# CONFIG_VIDEO_BT819 is not set
+# CONFIG_VIDEO_BT856 is not set
+# CONFIG_VIDEO_BT866 is not set
+# CONFIG_VIDEO_KS0127 is not set
+# CONFIG_VIDEO_OV7670 is not set
+# CONFIG_VIDEO_MT9V011 is not set
+# CONFIG_VIDEO_TCM825X is not set
+# CONFIG_VIDEO_SAA7110 is not set
+# CONFIG_VIDEO_SAA711X is not set
+# CONFIG_VIDEO_SAA717X is not set
+# CONFIG_VIDEO_SAA7191 is not set
+# CONFIG_VIDEO_TVP514X is not set
+# CONFIG_VIDEO_TVP5150 is not set
+# CONFIG_VIDEO_VPX3220 is not set
+
+#
+# Video and audio decoders
+#
+# CONFIG_VIDEO_CX25840 is not set
+
+#
+# MPEG video encoders
+#
+# CONFIG_VIDEO_CX2341X is not set
+
+#
+# Video encoders
+#
+# CONFIG_VIDEO_SAA7127 is not set
+# CONFIG_VIDEO_SAA7185 is not set
+# CONFIG_VIDEO_ADV7170 is not set
+# CONFIG_VIDEO_ADV7175 is not set
+# CONFIG_VIDEO_THS7303 is not set
+# CONFIG_VIDEO_ADV7343 is not set
+
+#
+# Video improvement chips
+#
+# CONFIG_VIDEO_UPD64031A is not set
+# CONFIG_VIDEO_UPD64083 is not set
 # CONFIG_VIDEO_VIVI is not set
 # CONFIG_VIDEO_CPIA is not set
 # CONFIG_VIDEO_CPIA2 is not set
 # CONFIG_VIDEO_SAA5246A is not set
 # CONFIG_VIDEO_SAA5249 is not set
-# CONFIG_TUNER_3036 is not set
+CONFIG_SOC_CAMERA=y
+# CONFIG_SOC_CAMERA_MT9M001 is not set
+CONFIG_SOC_CAMERA_MT9M111=y
+# CONFIG_SOC_CAMERA_MT9T031 is not set
+# CONFIG_SOC_CAMERA_MT9V022 is not set
+# CONFIG_SOC_CAMERA_TW9910 is not set
+# CONFIG_SOC_CAMERA_PLATFORM is not set
+# CONFIG_SOC_CAMERA_OV772X is not set
+CONFIG_VIDEO_PXA27x=y
+# CONFIG_VIDEO_SH_MOBILE_CEU is not set
 # CONFIG_V4L_USB_DRIVERS is not set
-# CONFIG_SOC_CAMERA is not set
-# CONFIG_VIDEO_PXA27x is not set
 CONFIG_RADIO_ADAPTERS=y
+# CONFIG_I2C_SI4713 is not set
+# CONFIG_RADIO_SI4713 is not set
 # CONFIG_USB_DSBR is not set
-# CONFIG_USB_SI470X is not set
+# CONFIG_RADIO_SI470X is not set
+# CONFIG_USB_MR800 is not set
+CONFIG_RADIO_TEA5764=y
+CONFIG_RADIO_TEA5764_XTAL=y
 # CONFIG_DAB is not set
 
 #
@@ -996,6 +1220,7 @@ CONFIG_RADIO_ADAPTERS=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
@@ -1017,15 +1242,19 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 # CONFIG_FB_UVESA is not set
 # CONFIG_FB_S1D13XXX is not set
 CONFIG_FB_PXA=y
+CONFIG_FB_PXA_OVERLAY=y
 # CONFIG_FB_PXA_SMARTPANEL is not set
 CONFIG_FB_PXA_PARAMETERS=y
 # CONFIG_FB_MBX is not set
-# CONFIG_FB_AM200EPD is not set
+# CONFIG_FB_W100 is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_BROADSHEET is not set
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
 # CONFIG_LCD_CLASS_DEVICE is not set
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
-# CONFIG_BACKLIGHT_CORGI is not set
+CONFIG_BACKLIGHT_GENERIC=y
 CONFIG_BACKLIGHT_PWM=y
 
 #
@@ -1053,85 +1282,60 @@ CONFIG_FONT_MINI_4x6=y
 # CONFIG_FONT_SUN12x22 is not set
 # CONFIG_FONT_10x18 is not set
 # CONFIG_LOGO is not set
-
-#
-# Sound
-#
 CONFIG_SOUND=y
-
-#
-# Advanced Linux Sound Architecture
-#
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SOUND_OSS_CORE_PRECLAIM=y
 CONFIG_SND=y
 CONFIG_SND_TIMER=y
 CONFIG_SND_PCM=y
+CONFIG_SND_JACK=y
 # CONFIG_SND_SEQUENCER is not set
 CONFIG_SND_OSSEMUL=y
 CONFIG_SND_MIXER_OSS=y
 CONFIG_SND_PCM_OSS=y
 CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_HRTIMER is not set
 # CONFIG_SND_DYNAMIC_MINORS is not set
 CONFIG_SND_SUPPORT_OLD_API=y
 CONFIG_SND_VERBOSE_PROCFS=y
 # CONFIG_SND_VERBOSE_PRINTK is not set
 # CONFIG_SND_DEBUG is not set
-
-#
-# Generic devices
-#
-# CONFIG_SND_DUMMY is not set
-# CONFIG_SND_MTPAV is not set
-# CONFIG_SND_SERIAL_U16550 is not set
-# CONFIG_SND_MPU401 is not set
-
-#
-# ALSA ARM devices
-#
-# CONFIG_SND_PXA2XX_AC97 is not set
-
-#
-# SPI devices
-#
-
-#
-# USB devices
-#
-# CONFIG_SND_USB_AUDIO is not set
-# CONFIG_SND_USB_CAIAQ is not set
-
-#
-# System on Chip audio support
-#
+# CONFIG_SND_RAWMIDI_SEQ is not set
+# CONFIG_SND_OPL3_LIB_SEQ is not set
+# CONFIG_SND_OPL4_LIB_SEQ is not set
+# CONFIG_SND_SBAWE_SEQ is not set
+# CONFIG_SND_EMU10K1_SEQ is not set
+# CONFIG_SND_DRIVERS is not set
+# CONFIG_SND_ARM is not set
+CONFIG_SND_PXA2XX_LIB=y
+# CONFIG_SND_SPI is not set
+# CONFIG_SND_USB is not set
 CONFIG_SND_SOC=y
 CONFIG_SND_PXA2XX_SOC=y
-
-#
-# ALSA SoC audio for Freescale SOCs
-#
-
-#
-# SoC Audio for the Texas Instruments OMAP
-#
-
-#
-# Open Sound System
-#
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
 # CONFIG_SOUND_PRIME is not set
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
-# CONFIG_HID_DEBUG is not set
 # CONFIG_HIDRAW is not set
 
 #
 # USB Input Devices
 #
 # CONFIG_USB_HID is not set
+# CONFIG_HID_PID is not set
 
 #
 # USB HID Boot Protocol drivers
 #
 # CONFIG_USB_KBD is not set
 # CONFIG_USB_MOUSE is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_APPLE=m
+# CONFIG_HID_WACOM is not set
 CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1150,32 +1354,42 @@ CONFIG_USB=y
 # CONFIG_USB_OTG is not set
 # CONFIG_USB_OTG_WHITELIST is not set
 # CONFIG_USB_OTG_BLACKLIST_HUB is not set
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
 
 #
 # USB Host Controller Drivers
 #
 # CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
 # CONFIG_USB_ISP116X_HCD is not set
 # CONFIG_USB_ISP1760_HCD is not set
+# CONFIG_USB_ISP1362_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
 # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_SL811_HCD is not set
 # CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+# CONFIG_USB_MUSB_HDRC is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
 
 #
 # USB Device Class drivers
 #
 # CONFIG_USB_ACM is not set
 # CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
 #
 
 #
-# may also be needed; see USB_STORAGE Help for more information
+# also be needed; see USB_STORAGE Help for more info
 #
 # CONFIG_USB_LIBUSUAL is not set
 
@@ -1183,7 +1397,6 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
-# CONFIG_USB_MON is not set
 
 #
 # USB port drivers
@@ -1196,7 +1409,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_EMI62 is not set
 # CONFIG_USB_EMI26 is not set
 # CONFIG_USB_ADUTUX is not set
-# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_SEVSEG is not set
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
@@ -1204,62 +1417,94 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_LED is not set
 # CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
-# CONFIG_USB_PHIDGET is not set
 # CONFIG_USB_IDMOUSE is not set
 # CONFIG_USB_FTDI_ELAN is not set
 # CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
 CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
 # CONFIG_USB_GADGET_DEBUG_FILES is not set
+# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
 CONFIG_USB_GADGET_SELECTED=y
-# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_AT91 is not set
 # CONFIG_USB_GADGET_ATMEL_USBA is not set
 # CONFIG_USB_GADGET_FSL_USB2 is not set
-# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
 # CONFIG_USB_GADGET_PXA25X is not set
-# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_R8A66597 is not set
 CONFIG_USB_GADGET_PXA27X=y
 CONFIG_USB_PXA27X=y
-# CONFIG_USB_GADGET_GOKU is not set
-# CONFIG_USB_GADGET_LH7A40X is not set
-# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_S3C_HSOTG is not set
+# CONFIG_USB_GADGET_IMX is not set
 # CONFIG_USB_GADGET_S3C2410 is not set
-# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LANGWELL is not set
 # CONFIG_USB_GADGET_DUMMY_HCD is not set
 # CONFIG_USB_GADGET_DUALSPEED is not set
 # CONFIG_USB_ZERO is not set
+# CONFIG_USB_AUDIO is not set
 CONFIG_USB_ETH=y
 # CONFIG_USB_ETH_RNDIS is not set
+# CONFIG_USB_ETH_EEM is not set
 # CONFIG_USB_GADGETFS is not set
 # CONFIG_USB_FILE_STORAGE is not set
 # CONFIG_USB_G_SERIAL is not set
 # CONFIG_USB_MIDI_GADGET is not set
 # CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_NOP_USB_XCEIV is not set
 CONFIG_MMC=y
 # CONFIG_MMC_DEBUG is not set
 CONFIG_MMC_UNSAFE_RESUME=y
 
 #
-# MMC/SD Card Drivers
+# MMC/SD/SDIO Card Drivers
 #
 CONFIG_MMC_BLOCK=y
 CONFIG_MMC_BLOCK_BOUNCE=y
-CONFIG_SDIO_UART=y
+CONFIG_SDIO_UART=m
+# CONFIG_MMC_TEST is not set
 
 #
-# MMC/SD Host Controller Drivers
+# MMC/SD/SDIO Host Controller Drivers
 #
 CONFIG_MMC_PXA=y
-# CONFIG_MMC_SPI is not set
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_AT91 is not set
+# CONFIG_MMC_ATMELMCI is not set
+CONFIG_MMC_SPI=y
+# CONFIG_MEMSTICK is not set
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 
 #
 # LED drivers
 #
+# CONFIG_LEDS_PCA9532 is not set
 # CONFIG_LEDS_GPIO is not set
+CONFIG_LEDS_LP3944=y
+# CONFIG_LEDS_PCA955X is not set
+# CONFIG_LEDS_DAC124S085 is not set
+# CONFIG_LEDS_PWM is not set
+# CONFIG_LEDS_BD2802 is not set
 
 #
 # LED Triggers
@@ -1267,7 +1512,14 @@ CONFIG_LEDS_CLASS=y
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_TIMER=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+
+#
+# iptables trigger is under Netfilter config (LED target)
+#
+# CONFIG_ACCESSIBILITY is not set
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_HCTOSYS=y
@@ -1297,45 +1549,67 @@ CONFIG_RTC_INTF_DEV=y
 # CONFIG_RTC_DRV_PCF8583 is not set
 # CONFIG_RTC_DRV_M41T80 is not set
 # CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+# CONFIG_RTC_DRV_RX8025 is not set
 
 #
 # SPI RTC drivers
 #
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
 # CONFIG_RTC_DRV_MAX6902 is not set
 # CONFIG_RTC_DRV_R9701 is not set
 # CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+# CONFIG_RTC_DRV_PCF2123 is not set
 
 #
 # Platform RTC drivers
 #
 # CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
 # CONFIG_RTC_DRV_DS1511 is not set
 # CONFIG_RTC_DRV_DS1553 is not set
 # CONFIG_RTC_DRV_DS1742 is not set
 # CONFIG_RTC_DRV_STK17TA8 is not set
 # CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
 # CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
 # CONFIG_RTC_DRV_V3020 is not set
 
 #
 # on-CPU RTC drivers
 #
-CONFIG_RTC_DRV_SA1100=m
+# CONFIG_RTC_DRV_SA1100 is not set
+# CONFIG_RTC_DRV_PXA is not set
+CONFIG_RTC_DRV_PCAP=y
+# CONFIG_DMADEVICES is not set
+# CONFIG_AUXDISPLAY is not set
 # CONFIG_UIO is not set
 
 #
+# TI VLYNQ
+#
+# CONFIG_STAGING is not set
+
+#
 # File systems
 #
 CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XATTR is not set
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=m
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
 CONFIG_EXT3_FS_XATTR=y
 # CONFIG_EXT3_FS_POSIX_ACL is not set
 # CONFIG_EXT3_FS_SECURITY is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=m
-CONFIG_FS_MBCACHE=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -1350,6 +1624,10 @@ CONFIG_XFS_FS=m
 # CONFIG_XFS_RT is not set
 # CONFIG_XFS_DEBUG is not set
 # CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -1357,6 +1635,12 @@ CONFIG_INOTIFY_USER=y
 CONFIG_AUTOFS_FS=y
 CONFIG_AUTOFS4_FS=y
 CONFIG_FUSE_FS=m
+CONFIG_CUSE=m
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
 
 #
 # CD-ROM/DVD Filesystems
@@ -1381,15 +1665,13 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
 # CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
+CONFIG_MISC_FILESYSTEMS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
@@ -1397,13 +1679,35 @@ CONFIG_TMPFS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
-# CONFIG_JFFS2_FS is not set
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
 CONFIG_CRAMFS=m
+CONFIG_SQUASHFS=m
+# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
-# CONFIG_ROMFS_FS is not set
+CONFIG_ROMFS_FS=m
+CONFIG_ROMFS_BACKED_BY_BLOCK=y
+# CONFIG_ROMFS_BACKED_BY_MTD is not set
+# CONFIG_ROMFS_BACKED_BY_BOTH is not set
+CONFIG_ROMFS_ON_BLOCK=y
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
 CONFIG_NETWORK_FILESYSTEMS=y
@@ -1411,19 +1715,18 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 # CONFIG_NFS_V4 is not set
+# CONFIG_ROOT_NFS is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
 # CONFIG_NFSD_V4 is not set
-# CONFIG_ROOT_NFS is not set
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=m
 CONFIG_NFS_ACL_SUPPORT=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_BIND34 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -1490,25 +1793,83 @@ CONFIG_NLS_UTF8=m
 #
 # Kernel hacking
 #
-# CONFIG_PRINTK_TIME is not set
+CONFIG_PRINTK_TIME=y
 CONFIG_ENABLE_WARN_DEPRECATED=y
-# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_FRAME_WARN=1024
 # CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_STRIP_ASM_SYMS is not set
 # CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
+CONFIG_DEBUG_FS=y
 # CONFIG_HEADERS_CHECK is not set
-# CONFIG_DEBUG_KERNEL is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
-CONFIG_FRAME_POINTER=y
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_KMEMLEAK is not set
+CONFIG_DEBUG_PREEMPT=y
+CONFIG_DEBUG_RT_MUTEXES=y
+CONFIG_DEBUG_PI_LIST=y
+# CONFIG_RT_MUTEX_TESTER is not set
+CONFIG_DEBUG_SPINLOCK=y
+CONFIG_DEBUG_MUTEXES=y
+CONFIG_DEBUG_LOCK_ALLOC=y
+CONFIG_PROVE_LOCKING=y
+CONFIG_LOCKDEP=y
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_LOCKDEP is not set
+CONFIG_TRACE_IRQFLAGS=y
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+# CONFIG_PAGE_POISONING is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+# CONFIG_DYNAMIC_DEBUG is not set
 # CONFIG_SAMPLES is not set
-# CONFIG_DEBUG_USER is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+CONFIG_ARM_UNWIND=y
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_ERRORS=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_LL is not set
 
 #
 # Security options
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
 
@@ -1516,12 +1877,20 @@ CONFIG_CRYPTO=y
 # Crypto core or helper
 #
 CONFIG_CRYPTO_ALGAPI=m
+CONFIG_CRYPTO_ALGAPI2=m
 CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=m
 CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_BLKCIPHER2=m
 CONFIG_CRYPTO_HASH=m
+CONFIG_CRYPTO_HASH2=m
+CONFIG_CRYPTO_RNG2=m
+CONFIG_CRYPTO_PCOMP=m
 CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=m
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_WORKQUEUE=m
 CONFIG_CRYPTO_CRYPTD=m
 CONFIG_CRYPTO_AUTHENC=m
 CONFIG_CRYPTO_TEST=m
@@ -1549,14 +1918,20 @@ CONFIG_CRYPTO_XTS=m
 #
 CONFIG_CRYPTO_HMAC=m
 CONFIG_CRYPTO_XCBC=m
+CONFIG_CRYPTO_VMAC=m
 
 #
 # Digest
 #
 CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_GHASH=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 CONFIG_CRYPTO_SHA1=m
 CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
@@ -1587,28 +1962,40 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 # Compression
 #
 CONFIG_CRYPTO_DEFLATE=m
+# CONFIG_CRYPTO_ZLIB is not set
 # CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_CRYPTO_HW=y
+# CONFIG_BINARY_PRINTF is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
+CONFIG_GENERIC_FIND_LAST_BIT=y
 CONFIG_CRC_CCITT=m
-CONFIG_CRC16=m
-# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC16=y
+# CONFIG_CRC_T10DIF is not set
+CONFIG_CRC_ITU_T=y
 CONFIG_CRC32=y
-# CONFIG_CRC7 is not set
+CONFIG_CRC7=y
 CONFIG_LIBCRC32C=m
-CONFIG_ZLIB_INFLATE=m
+CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=m
+CONFIG_LZO_COMPRESS=m
+CONFIG_LZO_DECOMPRESS=m
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_LZMA=y
 CONFIG_TEXTSEARCH=y
 CONFIG_TEXTSEARCH_KMP=m
 CONFIG_TEXTSEARCH_BM=m
 CONFIG_TEXTSEARCH_FSM=m
-CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-04 20:47           ` Antonio Ospite
@ 2009-11-04 23:53             ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-04 23:53 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: linux-arm-kernel, Eric Miao, openezx-devel, Bart Visscher,
	Linux Media Mailing List

On Wed, 4 Nov 2009, Antonio Ospite wrote:

> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> Signed-off-by: Bart Visscher <bartv@thisnet.nl>

Is this patch going via Bart? Or should this be an Acked-by?

> ---
> 
> Changes since previous version:
>   Addressed all the comments from Eric and Guennadi.

I said I still wanted to have a better look at it, so, basically, I just 
think you have a typo in two comments:

> 
> CAM_RST gpios are different for different platform generations, as also
> shown in current MFP pins setup.
> 
> 
>  arch/arm/mach-pxa/ezx.c |  164 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 164 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index 588b265..7cfd633 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -17,8 +17,11 @@
>  #include <linux/delay.h>
>  #include <linux/pwm_backlight.h>
>  #include <linux/input.h>
> +#include <linux/gpio.h>
>  #include <linux/gpio_keys.h>
>  
> +#include <media/soc_camera.h>
> +
>  #include <asm/setup.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> @@ -29,6 +32,7 @@
>  #include <plat/i2c.h>
>  #include <mach/hardware.h>
>  #include <mach/pxa27x_keypad.h>
> +#include <mach/camera.h>
>  
>  #include "devices.h"
>  #include "generic.h"
> @@ -38,6 +42,9 @@
>  #define GPIO15_A910_FLIP_LID 		15
>  #define GPIO12_E680_LOCK_SWITCH 	12
>  #define GPIO15_E6_LOCK_SWITCH 		15
> +#define GPIO50_nCAM_EN			50
> +#define GPIO19_GEN1_CAM_RST		19
> +#define GPIO28_GEN2_CAM_RST		28
>  
>  static struct platform_pwm_backlight_data ezx_backlight_data = {
>  	.pwm_id		= 0,
> @@ -683,8 +690,85 @@ static struct platform_device a780_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a780_pxacamera_init(struct device *dev)
> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO19_GEN1_CAM_RST is active high
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 0);
> +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 1);

Don't understand this, are you sure your comments are correct? This would 
mean, that in init() you enable the camera and hold it in reset.

> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a780_pxacamera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);

This agrees with the comment above, but then why do you enable it 
immediately in init?

> +	return 0;
> +}
> +
> +static int a780_pxacamera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);

This, however, seems to contradict the comment and confirm the code above 
- looks like your reset pin is active low too?

> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> +	.init	= a780_pxacamera_init,
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a780_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a780_iclink = {
> +	.bus_id         = 0,
> +	.flags          = SOCAM_SENSOR_INVERT_PCLK,

Do you have schematics or have you found this out experimentally? What 
happens if you don't invert pclk?

> +	.i2c_adapter_id = 0,
> +	.board_info     = &a780_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a780_pxacamera_power,
> +	.reset          = a780_pxacamera_reset,
> +};
> +
> +static struct platform_device a780_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a780_iclink,
> +	},
> +};
> +
>  static struct platform_device *a780_devices[] __initdata = {
>  	&a780_gpio_keys,
> +	&a780_camera,
>  };
>  
>  static void __init a780_init(void)
> @@ -699,6 +783,8 @@ static void __init a780_init(void)
>  
>  	pxa_set_keypad_info(&a780_keypad_platform_data);
>  
> +	pxa_set_camera_info(&a780_pxacamera_platform_data);
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
>  }
> @@ -864,8 +950,84 @@ static struct platform_device a910_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a910_pxacamera_init(struct device *dev)
> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO28_GEN2_CAM_RST is active high
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 0);
> +	gpio_direction_output(GPIO28_GEN2_CAM_RST, 1);

ditto

> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a910_pxacamera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);
> +	return 0;
> +}
> +
> +static int a910_pxacamera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> +	.init	= a910_pxacamera_init,
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a910_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a910_iclink = {
> +	.bus_id         = 0,
> +	.i2c_adapter_id = 0,
> +	.board_info     = &a910_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a910_pxacamera_power,
> +	.reset          = a910_pxacamera_reset,
> +};
> +
> +static struct platform_device a910_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a910_iclink,
> +	},
> +};
> +
>  static struct platform_device *a910_devices[] __initdata = {
>  	&a910_gpio_keys,
> +	&a910_camera,
>  };
>  
>  static void __init a910_init(void)
> @@ -880,6 +1042,8 @@ static void __init a910_init(void)
>  
>  	pxa_set_keypad_info(&a910_keypad_platform_data);
>  
> +	pxa_set_camera_info(&a910_pxacamera_platform_data);
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
>  }
> -- 
> 1.6.5.2
> 

A general question for the ezx.c: wouldn't it be better to convert that 
full-of-ifdef's file to a mach-pxa/ezx/ directory?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-04 23:53             ` Guennadi Liakhovetski
  0 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-04 23:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 4 Nov 2009, Antonio Ospite wrote:

> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> Signed-off-by: Bart Visscher <bartv@thisnet.nl>

Is this patch going via Bart? Or should this be an Acked-by?

> ---
> 
> Changes since previous version:
>   Addressed all the comments from Eric and Guennadi.

I said I still wanted to have a better look at it, so, basically, I just 
think you have a typo in two comments:

> 
> CAM_RST gpios are different for different platform generations, as also
> shown in current MFP pins setup.
> 
> 
>  arch/arm/mach-pxa/ezx.c |  164 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 164 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index 588b265..7cfd633 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -17,8 +17,11 @@
>  #include <linux/delay.h>
>  #include <linux/pwm_backlight.h>
>  #include <linux/input.h>
> +#include <linux/gpio.h>
>  #include <linux/gpio_keys.h>
>  
> +#include <media/soc_camera.h>
> +
>  #include <asm/setup.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> @@ -29,6 +32,7 @@
>  #include <plat/i2c.h>
>  #include <mach/hardware.h>
>  #include <mach/pxa27x_keypad.h>
> +#include <mach/camera.h>
>  
>  #include "devices.h"
>  #include "generic.h"
> @@ -38,6 +42,9 @@
>  #define GPIO15_A910_FLIP_LID 		15
>  #define GPIO12_E680_LOCK_SWITCH 	12
>  #define GPIO15_E6_LOCK_SWITCH 		15
> +#define GPIO50_nCAM_EN			50
> +#define GPIO19_GEN1_CAM_RST		19
> +#define GPIO28_GEN2_CAM_RST		28
>  
>  static struct platform_pwm_backlight_data ezx_backlight_data = {
>  	.pwm_id		= 0,
> @@ -683,8 +690,85 @@ static struct platform_device a780_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a780_pxacamera_init(struct device *dev)
> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO19_GEN1_CAM_RST is active high
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 0);
> +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 1);

Don't understand this, are you sure your comments are correct? This would 
mean, that in init() you enable the camera and hold it in reset.

> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a780_pxacamera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);

This agrees with the comment above, but then why do you enable it 
immediately in init?

> +	return 0;
> +}
> +
> +static int a780_pxacamera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);

This, however, seems to contradict the comment and confirm the code above 
- looks like your reset pin is active low too?

> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> +	.init	= a780_pxacamera_init,
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a780_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a780_iclink = {
> +	.bus_id         = 0,
> +	.flags          = SOCAM_SENSOR_INVERT_PCLK,

Do you have schematics or have you found this out experimentally? What 
happens if you don't invert pclk?

> +	.i2c_adapter_id = 0,
> +	.board_info     = &a780_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a780_pxacamera_power,
> +	.reset          = a780_pxacamera_reset,
> +};
> +
> +static struct platform_device a780_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a780_iclink,
> +	},
> +};
> +
>  static struct platform_device *a780_devices[] __initdata = {
>  	&a780_gpio_keys,
> +	&a780_camera,
>  };
>  
>  static void __init a780_init(void)
> @@ -699,6 +783,8 @@ static void __init a780_init(void)
>  
>  	pxa_set_keypad_info(&a780_keypad_platform_data);
>  
> +	pxa_set_camera_info(&a780_pxacamera_platform_data);
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
>  }
> @@ -864,8 +950,84 @@ static struct platform_device a910_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a910_pxacamera_init(struct device *dev)
> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO28_GEN2_CAM_RST is active high
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 0);
> +	gpio_direction_output(GPIO28_GEN2_CAM_RST, 1);

ditto

> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a910_pxacamera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);
> +	return 0;
> +}
> +
> +static int a910_pxacamera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> +	.init	= a910_pxacamera_init,
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a910_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a910_iclink = {
> +	.bus_id         = 0,
> +	.i2c_adapter_id = 0,
> +	.board_info     = &a910_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a910_pxacamera_power,
> +	.reset          = a910_pxacamera_reset,
> +};
> +
> +static struct platform_device a910_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a910_iclink,
> +	},
> +};
> +
>  static struct platform_device *a910_devices[] __initdata = {
>  	&a910_gpio_keys,
> +	&a910_camera,
>  };
>  
>  static void __init a910_init(void)
> @@ -880,6 +1042,8 @@ static void __init a910_init(void)
>  
>  	pxa_set_keypad_info(&a910_keypad_platform_data);
>  
> +	pxa_set_camera_info(&a910_pxacamera_platform_data);
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
>  }
> -- 
> 1.6.5.2
> 

A general question for the ezx.c: wouldn't it be better to convert that 
full-of-ifdef's file to a mach-pxa/ezx/ directory?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-04 23:53             ` Guennadi Liakhovetski
@ 2009-11-05  2:48               ` Eric Miao
  -1 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-05  2:48 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Antonio Ospite, linux-arm-kernel, openezx-devel, Bart Visscher,
	Linux Media Mailing List

On Thu, Nov 5, 2009 at 7:53 AM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Wed, 4 Nov 2009, Antonio Ospite wrote:
>
>> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
>> Signed-off-by: Bart Visscher <bartv@thisnet.nl>
>
> Is this patch going via Bart? Or should this be an Acked-by?

Sometimes there are multiple people working on the same patch,
and I don't see anyway for the SOB process to address this correctly
since the author could be _only_ one and the SOB list respresents
a patch passing route. So basically I don't care too much about
SOB by multiple people yet not strictly conform to the patch forwarding
route.

>
...
>
> A general question for the ezx.c: wouldn't it be better to convert that
> full-of-ifdef's file to a mach-pxa/ezx/ directory?
>

I'm only concerned that mach-pxa/* is already very crowded, I'm
even thinkin of merging all those eseries things in a single file.

The real difficulty with ezx is that they share many things, and the
sharing sometimes is not just common, it can be shared by some
of the platforms but not all - even if one eventually separates them
into different files, there still needs to be a lot #ifdef .. #endif.

Since these #ifdef .. #endif are actually inclusive, and can even
be removed if no one cares about the size compiling all the
platforms together, I don't see them as big problems.

> Thanks
> Guennadi
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-05  2:48               ` Eric Miao
  0 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-05  2:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 5, 2009 at 7:53 AM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Wed, 4 Nov 2009, Antonio Ospite wrote:
>
>> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
>> Signed-off-by: Bart Visscher <bartv@thisnet.nl>
>
> Is this patch going via Bart? Or should this be an Acked-by?

Sometimes there are multiple people working on the same patch,
and I don't see anyway for the SOB process to address this correctly
since the author could be _only_ one and the SOB list respresents
a patch passing route. So basically I don't care too much about
SOB by multiple people yet not strictly conform to the patch forwarding
route.

>
...
>
> A general question for the ezx.c: wouldn't it be better to convert that
> full-of-ifdef's file to a mach-pxa/ezx/ directory?
>

I'm only concerned that mach-pxa/* is already very crowded, I'm
even thinkin of merging all those eseries things in a single file.

The real difficulty with ezx is that they share many things, and the
sharing sometimes is not just common, it can be shared by some
of the platforms but not all - even if one eventually separates them
into different files, there still needs to be a lot #ifdef .. #endif.

Since these #ifdef .. #endif are actually inclusive, and can even
be removed if no one cares about the size compiling all the
platforms together, I don't see them as big problems.

> Thanks
> Guennadi
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-04 23:53             ` Guennadi Liakhovetski
@ 2009-11-05 22:44               ` Antonio Ospite
  -1 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-05 22:44 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-arm-kernel, Eric Miao, openezx-devel, Bart Visscher,
	Linux Media Mailing List

[-- Attachment #1: Type: text/plain, Size: 5891 bytes --]

On Thu, 5 Nov 2009 00:53:46 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Wed, 4 Nov 2009, Antonio Ospite wrote:
> 
> > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> > Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> 
> Is this patch going via Bart? Or should this be an Acked-by?
>

Bart did the initial research and wrote a first, partially working,
version of the patch for A780, then I made it work and refactored it,
adding code for A910. So I put two SOBs here as we are both the
authors, in a sense.

> > Changes since previous version:
> >   Addressed all the comments from Eric and Guennadi.
> 
> I said I still wanted to have a better look at it, so, basically, I just 
> think you have a typo in two comments:
>

Or the code is wrong, even if it works :)
Let's sort this out.

[...] 
> > +/* camera */
> > +static int a780_pxacamera_init(struct device *dev)
> > +{
> > +	int err;
> > +
> > +	/*
> > +	 * GPIO50_nCAM_EN is active low
> > +	 * GPIO19_GEN1_CAM_RST is active high
> > +	 */
> > +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> > +	if (err) {
> > +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> > +		goto fail;
> > +	}
> > +
> > +	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> > +	if (err) {
> > +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> > +		goto fail_gpio_cam_rst;
> > +	}
> > +
> > +	gpio_direction_output(GPIO50_nCAM_EN, 0);
> > +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 1);
> 
> Don't understand this, are you sure your comments are correct? This would 
> mean, that in init() you enable the camera and hold it in reset.
>

I am pretty confident the comments are right,
they came from runtime analysis with gpiotool on original firmware.

The reset happens when bringing the signal from low to high, so
holding it high or low it's basically the same here, and given how 
a780_pxacamera_reset() works I decided to keep it high.

I also need to put CAM_EN active in init(), because of how
soc_camera_probe() works, adding some debug I get this call sequence
(with CAM_EN not active):

Linux video capture interface: v2.00
pxa27x-camera pxa27x-camera.0: Limiting master clock to 26000000
pxa27x-camera pxa27x-camera.0: LCD clock 104000000Hz, target freq 26000000Hz, divisor 1
pxa27x-camera pxa27x-camera.0: got DMA channel 1
pxa27x-camera pxa27x-camera.0: got DMA channel (U) 2
pxa27x-camera pxa27x-camera.0: got DMA channel (V) 3
camera 0-0: Probing 0-0
camera 0-0: soc_camera_probe: power 1
--> a780_pxacamera_power: called. on: 1  !on: 0
camera 0-0: soc_camera_probe: reset
--> a780_pxacamera_reset: called
pxa27x-camera pxa27x-camera.0: Registered platform device at cc8a5380 data c03a40a8
pxa27x-camera pxa27x-camera.0: pxa_camera_activate: Init gpios
--> a780_pxacamera_init: called
pxa27x-camera pxa27x-camera.0: PXA Camera driver attached to camera 0
camera 0-0: mt9m111_video_probe: called
i2c: error: exhausted retries
i2c: msg_num: 0 msg_idx: -2000 msg_ptr: 0
i2c: ICR: 000007e0 ISR: 00000002
i2c: log: [00000446:000007e0] 
mt9m111 0-005d: read  reg.00d -> ffffff87
mt9m111 0-005d: mt9m11x init failed: -121
mt9m111: probe of 0-005d failed with error -121
pxa27x-camera pxa27x-camera.0: PXA Camera driver detached from camera 0
camera 0-0: soc_camera_probe: power 0
a780_pxacamera_power: called. on: 0  !on: 1
camera: probe of 0-0 failed with error -12

See? It's power(), reset(), init().
Maybe the problem is in soc_camera_probe()?

> > +
> > +	return 0;
> > +
> > +fail_gpio_cam_rst:
> > +	gpio_free(GPIO50_nCAM_EN);
> > +fail:
> > +	return err;
> > +}
> > +
> > +static int a780_pxacamera_power(struct device *dev, int on)
> > +{
> > +	gpio_set_value(GPIO50_nCAM_EN, !on);
> 
> This agrees with the comment above, but then why do you enable it 
> immediately in init?
>

See above.

> > +	return 0;
> > +}
> > +
> > +static int a780_pxacamera_reset(struct device *dev)
> > +{
> > +	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> > +	msleep(10);
> > +	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
> 
> This, however, seems to contradict the comment and confirm the code above 
> - looks like your reset pin is active low too?
>

Well, reset happens when bringing the GPIO to HIGH but only after some
time it was LOW, so I consider it "active high" but maybe I am messing up
with terminology here?

[...]
> > +static struct soc_camera_link a780_iclink = {
> > +	.bus_id         = 0,
> > +	.flags          = SOCAM_SENSOR_INVERT_PCLK,
> 
> Do you have schematics or have you found this out experimentally? What 
> happens if you don't invert pclk?
>

I've found this experimentally, and I think I was the reason why you
introduced SOCAM_SENSOR_INVERT_PCLK, see
http://thread.gmane.org/gmane.comp.video.video4linux/40592

If I don't invert pixelclock I get a picture like this:
http://people.openezx.org/ao2/a780-not-yet.jpg

[...]
> 
> A general question for the ezx.c: wouldn't it be better to convert that 
> full-of-ifdef's file to a mach-pxa/ezx/ directory?
>

Actually we are fine using a single file, there are many parts shared
between different platform generations and different phones, and often
when we change something for a phone we had to do a similar change for
the others, so living into a single file is a little bit easier.

Sure that the ifdefs can be reorganized and reduced, and I will do
that when most of the out-of-tree stuff is in.

BTW, many thanks again for the review.

Ciao ciao,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-05 22:44               ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-05 22:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 5 Nov 2009 00:53:46 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Wed, 4 Nov 2009, Antonio Ospite wrote:
> 
> > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> > Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> 
> Is this patch going via Bart? Or should this be an Acked-by?
>

Bart did the initial research and wrote a first, partially working,
version of the patch for A780, then I made it work and refactored it,
adding code for A910. So I put two SOBs here as we are both the
authors, in a sense.

> > Changes since previous version:
> >   Addressed all the comments from Eric and Guennadi.
> 
> I said I still wanted to have a better look at it, so, basically, I just 
> think you have a typo in two comments:
>

Or the code is wrong, even if it works :)
Let's sort this out.

[...] 
> > +/* camera */
> > +static int a780_pxacamera_init(struct device *dev)
> > +{
> > +	int err;
> > +
> > +	/*
> > +	 * GPIO50_nCAM_EN is active low
> > +	 * GPIO19_GEN1_CAM_RST is active high
> > +	 */
> > +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> > +	if (err) {
> > +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> > +		goto fail;
> > +	}
> > +
> > +	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> > +	if (err) {
> > +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> > +		goto fail_gpio_cam_rst;
> > +	}
> > +
> > +	gpio_direction_output(GPIO50_nCAM_EN, 0);
> > +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 1);
> 
> Don't understand this, are you sure your comments are correct? This would 
> mean, that in init() you enable the camera and hold it in reset.
>

I am pretty confident the comments are right,
they came from runtime analysis with gpiotool on original firmware.

The reset happens when bringing the signal from low to high, so
holding it high or low it's basically the same here, and given how 
a780_pxacamera_reset() works I decided to keep it high.

I also need to put CAM_EN active in init(), because of how
soc_camera_probe() works, adding some debug I get this call sequence
(with CAM_EN not active):

Linux video capture interface: v2.00
pxa27x-camera pxa27x-camera.0: Limiting master clock to 26000000
pxa27x-camera pxa27x-camera.0: LCD clock 104000000Hz, target freq 26000000Hz, divisor 1
pxa27x-camera pxa27x-camera.0: got DMA channel 1
pxa27x-camera pxa27x-camera.0: got DMA channel (U) 2
pxa27x-camera pxa27x-camera.0: got DMA channel (V) 3
camera 0-0: Probing 0-0
camera 0-0: soc_camera_probe: power 1
--> a780_pxacamera_power: called. on: 1  !on: 0
camera 0-0: soc_camera_probe: reset
--> a780_pxacamera_reset: called
pxa27x-camera pxa27x-camera.0: Registered platform device at cc8a5380 data c03a40a8
pxa27x-camera pxa27x-camera.0: pxa_camera_activate: Init gpios
--> a780_pxacamera_init: called
pxa27x-camera pxa27x-camera.0: PXA Camera driver attached to camera 0
camera 0-0: mt9m111_video_probe: called
i2c: error: exhausted retries
i2c: msg_num: 0 msg_idx: -2000 msg_ptr: 0
i2c: ICR: 000007e0 ISR: 00000002
i2c: log: [00000446:000007e0] 
mt9m111 0-005d: read  reg.00d -> ffffff87
mt9m111 0-005d: mt9m11x init failed: -121
mt9m111: probe of 0-005d failed with error -121
pxa27x-camera pxa27x-camera.0: PXA Camera driver detached from camera 0
camera 0-0: soc_camera_probe: power 0
a780_pxacamera_power: called. on: 0  !on: 1
camera: probe of 0-0 failed with error -12

See? It's power(), reset(), init().
Maybe the problem is in soc_camera_probe()?

> > +
> > +	return 0;
> > +
> > +fail_gpio_cam_rst:
> > +	gpio_free(GPIO50_nCAM_EN);
> > +fail:
> > +	return err;
> > +}
> > +
> > +static int a780_pxacamera_power(struct device *dev, int on)
> > +{
> > +	gpio_set_value(GPIO50_nCAM_EN, !on);
> 
> This agrees with the comment above, but then why do you enable it 
> immediately in init?
>

See above.

> > +	return 0;
> > +}
> > +
> > +static int a780_pxacamera_reset(struct device *dev)
> > +{
> > +	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> > +	msleep(10);
> > +	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
> 
> This, however, seems to contradict the comment and confirm the code above 
> - looks like your reset pin is active low too?
>

Well, reset happens when bringing the GPIO to HIGH but only after some
time it was LOW, so I consider it "active high" but maybe I am messing up
with terminology here?

[...]
> > +static struct soc_camera_link a780_iclink = {
> > +	.bus_id         = 0,
> > +	.flags          = SOCAM_SENSOR_INVERT_PCLK,
> 
> Do you have schematics or have you found this out experimentally? What 
> happens if you don't invert pclk?
>

I've found this experimentally, and I think I was the reason why you
introduced SOCAM_SENSOR_INVERT_PCLK, see
http://thread.gmane.org/gmane.comp.video.video4linux/40592

If I don't invert pixelclock I get a picture like this:
http://people.openezx.org/ao2/a780-not-yet.jpg

[...]
> 
> A general question for the ezx.c: wouldn't it be better to convert that 
> full-of-ifdef's file to a mach-pxa/ezx/ directory?
>

Actually we are fine using a single file, there are many parts shared
between different platform generations and different phones, and often
when we change something for a phone we had to do a similar change for
the others, so living into a single file is a little bit easier.

Sure that the ifdefs can be reorganized and reduced, and I will do
that when most of the out-of-tree stuff is in.

BTW, many thanks again for the review.

Ciao ciao,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091105/3dd86b09/attachment.sig>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-05 22:44               ` Antonio Ospite
@ 2009-11-06 14:11                 ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-06 14:11 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: linux-arm-kernel, Eric Miao, openezx-devel, Bart Visscher,
	Linux Media Mailing List

On Thu, 5 Nov 2009, Antonio Ospite wrote:

> On Thu, 5 Nov 2009 00:53:46 +0100 (CET)
> Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> 
> > On Wed, 4 Nov 2009, Antonio Ospite wrote:
> > 
> > > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> > > Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> > 
> > Is this patch going via Bart? Or should this be an Acked-by?
> >
> 
> Bart did the initial research and wrote a first, partially working,
> version of the patch for A780, then I made it work and refactored it,
> adding code for A910. So I put two SOBs here as we are both the
> authors, in a sense.

Then, I think, his Sob should be the first.

> > > Changes since previous version:
> > >   Addressed all the comments from Eric and Guennadi.
> > 
> > I said I still wanted to have a better look at it, so, basically, I just 
> > think you have a typo in two comments:
> >
> 
> Or the code is wrong, even if it works :)
> Let's sort this out.
> 
> [...] 
> > > +/* camera */
> > > +static int a780_pxacamera_init(struct device *dev)
> > > +{
> > > +	int err;
> > > +
> > > +	/*
> > > +	 * GPIO50_nCAM_EN is active low
> > > +	 * GPIO19_GEN1_CAM_RST is active high
> > > +	 */
> > > +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> > > +	if (err) {
> > > +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> > > +		goto fail;
> > > +	}
> > > +
> > > +	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> > > +	if (err) {
> > > +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> > > +		goto fail_gpio_cam_rst;
> > > +	}
> > > +
> > > +	gpio_direction_output(GPIO50_nCAM_EN, 0);
> > > +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 1);
> > 
> > Don't understand this, are you sure your comments are correct? This would 
> > mean, that in init() you enable the camera and hold it in reset.
> >
> 
> I am pretty confident the comments are right,
> they came from runtime analysis with gpiotool on original firmware.
> 
> The reset happens when bringing the signal from low to high, so
> holding it high or low it's basically the same here, and given how 
> a780_pxacamera_reset() works I decided to keep it high.

Then it is not level- but edge-sensitive. Maybe put reset - rising edge to 
activate, or something like that.

> I also need to put CAM_EN active in init(), because of how
> soc_camera_probe() works, adding some debug I get this call sequence
> (with CAM_EN not active):
> 
> Linux video capture interface: v2.00
> pxa27x-camera pxa27x-camera.0: Limiting master clock to 26000000
> pxa27x-camera pxa27x-camera.0: LCD clock 104000000Hz, target freq 26000000Hz, divisor 1
> pxa27x-camera pxa27x-camera.0: got DMA channel 1
> pxa27x-camera pxa27x-camera.0: got DMA channel (U) 2
> pxa27x-camera pxa27x-camera.0: got DMA channel (V) 3
> camera 0-0: Probing 0-0
> camera 0-0: soc_camera_probe: power 1
> --> a780_pxacamera_power: called. on: 1  !on: 0
> camera 0-0: soc_camera_probe: reset
> --> a780_pxacamera_reset: called
> pxa27x-camera pxa27x-camera.0: Registered platform device at cc8a5380 data c03a40a8
> pxa27x-camera pxa27x-camera.0: pxa_camera_activate: Init gpios
> --> a780_pxacamera_init: called
> pxa27x-camera pxa27x-camera.0: PXA Camera driver attached to camera 0
> camera 0-0: mt9m111_video_probe: called
> i2c: error: exhausted retries
> i2c: msg_num: 0 msg_idx: -2000 msg_ptr: 0
> i2c: ICR: 000007e0 ISR: 00000002
> i2c: log: [00000446:000007e0] 
> mt9m111 0-005d: read  reg.00d -> ffffff87
> mt9m111 0-005d: mt9m11x init failed: -121
> mt9m111: probe of 0-005d failed with error -121
> pxa27x-camera pxa27x-camera.0: PXA Camera driver detached from camera 0
> camera 0-0: soc_camera_probe: power 0
> a780_pxacamera_power: called. on: 0  !on: 1
> camera: probe of 0-0 failed with error -12
> 
> See? It's power(), reset(), init().
> Maybe the problem is in soc_camera_probe()?

Sorry, you'd have to elaborate more on this. So, what's wrong with that 
sequence? it doesn't make sense to reset a powered down device or reset 
after init or whatever...

> > > +
> > > +	return 0;
> > > +
> > > +fail_gpio_cam_rst:
> > > +	gpio_free(GPIO50_nCAM_EN);
> > > +fail:
> > > +	return err;
> > > +}
> > > +
> > > +static int a780_pxacamera_power(struct device *dev, int on)
> > > +{
> > > +	gpio_set_value(GPIO50_nCAM_EN, !on);
> > 
> > This agrees with the comment above, but then why do you enable it 
> > immediately in init?
> >
> 
> See above.
> 
> > > +	return 0;
> > > +}
> > > +
> > > +static int a780_pxacamera_reset(struct device *dev)
> > > +{
> > > +	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> > > +	msleep(10);
> > > +	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
> > 
> > This, however, seems to contradict the comment and confirm the code above 
> > - looks like your reset pin is active low too?
> >
> 
> Well, reset happens when bringing the GPIO to HIGH but only after some
> time it was LOW, so I consider it "active high" but maybe I am messing up
> with terminology here?

As I said, I'd suggest switching from level- to edge-terminology.

> [...]
> > > +static struct soc_camera_link a780_iclink = {
> > > +	.bus_id         = 0,
> > > +	.flags          = SOCAM_SENSOR_INVERT_PCLK,
> > 
> > Do you have schematics or have you found this out experimentally? What 
> > happens if you don't invert pclk?
> >
> 
> I've found this experimentally, and I think I was the reason why you
> introduced SOCAM_SENSOR_INVERT_PCLK, see
> http://thread.gmane.org/gmane.comp.video.video4linux/40592
> 
> If I don't invert pixelclock I get a picture like this:
> http://people.openezx.org/ao2/a780-not-yet.jpg

Ok, understand.

> 
> [...]
> > 
> > A general question for the ezx.c: wouldn't it be better to convert that 
> > full-of-ifdef's file to a mach-pxa/ezx/ directory?
> >
> 
> Actually we are fine using a single file, there are many parts shared
> between different platform generations and different phones, and often
> when we change something for a phone we had to do a similar change for
> the others, so living into a single file is a little bit easier.
> 
> Sure that the ifdefs can be reorganized and reduced, and I will do
> that when most of the out-of-tree stuff is in.

Well, that's your area, but I would've thought, an ezx directory with some 
function-specific files, common for some boards and one file per board 
with board-specific configuration would be easier to manage. But that's up 
to you and other EZX developers (and Eric), really:-)

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-06 14:11                 ` Guennadi Liakhovetski
  0 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-06 14:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 5 Nov 2009, Antonio Ospite wrote:

> On Thu, 5 Nov 2009 00:53:46 +0100 (CET)
> Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> 
> > On Wed, 4 Nov 2009, Antonio Ospite wrote:
> > 
> > > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> > > Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> > 
> > Is this patch going via Bart? Or should this be an Acked-by?
> >
> 
> Bart did the initial research and wrote a first, partially working,
> version of the patch for A780, then I made it work and refactored it,
> adding code for A910. So I put two SOBs here as we are both the
> authors, in a sense.

Then, I think, his Sob should be the first.

> > > Changes since previous version:
> > >   Addressed all the comments from Eric and Guennadi.
> > 
> > I said I still wanted to have a better look at it, so, basically, I just 
> > think you have a typo in two comments:
> >
> 
> Or the code is wrong, even if it works :)
> Let's sort this out.
> 
> [...] 
> > > +/* camera */
> > > +static int a780_pxacamera_init(struct device *dev)
> > > +{
> > > +	int err;
> > > +
> > > +	/*
> > > +	 * GPIO50_nCAM_EN is active low
> > > +	 * GPIO19_GEN1_CAM_RST is active high
> > > +	 */
> > > +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> > > +	if (err) {
> > > +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> > > +		goto fail;
> > > +	}
> > > +
> > > +	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> > > +	if (err) {
> > > +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> > > +		goto fail_gpio_cam_rst;
> > > +	}
> > > +
> > > +	gpio_direction_output(GPIO50_nCAM_EN, 0);
> > > +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 1);
> > 
> > Don't understand this, are you sure your comments are correct? This would 
> > mean, that in init() you enable the camera and hold it in reset.
> >
> 
> I am pretty confident the comments are right,
> they came from runtime analysis with gpiotool on original firmware.
> 
> The reset happens when bringing the signal from low to high, so
> holding it high or low it's basically the same here, and given how 
> a780_pxacamera_reset() works I decided to keep it high.

Then it is not level- but edge-sensitive. Maybe put reset - rising edge to 
activate, or something like that.

> I also need to put CAM_EN active in init(), because of how
> soc_camera_probe() works, adding some debug I get this call sequence
> (with CAM_EN not active):
> 
> Linux video capture interface: v2.00
> pxa27x-camera pxa27x-camera.0: Limiting master clock to 26000000
> pxa27x-camera pxa27x-camera.0: LCD clock 104000000Hz, target freq 26000000Hz, divisor 1
> pxa27x-camera pxa27x-camera.0: got DMA channel 1
> pxa27x-camera pxa27x-camera.0: got DMA channel (U) 2
> pxa27x-camera pxa27x-camera.0: got DMA channel (V) 3
> camera 0-0: Probing 0-0
> camera 0-0: soc_camera_probe: power 1
> --> a780_pxacamera_power: called. on: 1  !on: 0
> camera 0-0: soc_camera_probe: reset
> --> a780_pxacamera_reset: called
> pxa27x-camera pxa27x-camera.0: Registered platform device at cc8a5380 data c03a40a8
> pxa27x-camera pxa27x-camera.0: pxa_camera_activate: Init gpios
> --> a780_pxacamera_init: called
> pxa27x-camera pxa27x-camera.0: PXA Camera driver attached to camera 0
> camera 0-0: mt9m111_video_probe: called
> i2c: error: exhausted retries
> i2c: msg_num: 0 msg_idx: -2000 msg_ptr: 0
> i2c: ICR: 000007e0 ISR: 00000002
> i2c: log: [00000446:000007e0] 
> mt9m111 0-005d: read  reg.00d -> ffffff87
> mt9m111 0-005d: mt9m11x init failed: -121
> mt9m111: probe of 0-005d failed with error -121
> pxa27x-camera pxa27x-camera.0: PXA Camera driver detached from camera 0
> camera 0-0: soc_camera_probe: power 0
> a780_pxacamera_power: called. on: 0  !on: 1
> camera: probe of 0-0 failed with error -12
> 
> See? It's power(), reset(), init().
> Maybe the problem is in soc_camera_probe()?

Sorry, you'd have to elaborate more on this. So, what's wrong with that 
sequence? it doesn't make sense to reset a powered down device or reset 
after init or whatever...

> > > +
> > > +	return 0;
> > > +
> > > +fail_gpio_cam_rst:
> > > +	gpio_free(GPIO50_nCAM_EN);
> > > +fail:
> > > +	return err;
> > > +}
> > > +
> > > +static int a780_pxacamera_power(struct device *dev, int on)
> > > +{
> > > +	gpio_set_value(GPIO50_nCAM_EN, !on);
> > 
> > This agrees with the comment above, but then why do you enable it 
> > immediately in init?
> >
> 
> See above.
> 
> > > +	return 0;
> > > +}
> > > +
> > > +static int a780_pxacamera_reset(struct device *dev)
> > > +{
> > > +	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> > > +	msleep(10);
> > > +	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
> > 
> > This, however, seems to contradict the comment and confirm the code above 
> > - looks like your reset pin is active low too?
> >
> 
> Well, reset happens when bringing the GPIO to HIGH but only after some
> time it was LOW, so I consider it "active high" but maybe I am messing up
> with terminology here?

As I said, I'd suggest switching from level- to edge-terminology.

> [...]
> > > +static struct soc_camera_link a780_iclink = {
> > > +	.bus_id         = 0,
> > > +	.flags          = SOCAM_SENSOR_INVERT_PCLK,
> > 
> > Do you have schematics or have you found this out experimentally? What 
> > happens if you don't invert pclk?
> >
> 
> I've found this experimentally, and I think I was the reason why you
> introduced SOCAM_SENSOR_INVERT_PCLK, see
> http://thread.gmane.org/gmane.comp.video.video4linux/40592
> 
> If I don't invert pixelclock I get a picture like this:
> http://people.openezx.org/ao2/a780-not-yet.jpg

Ok, understand.

> 
> [...]
> > 
> > A general question for the ezx.c: wouldn't it be better to convert that 
> > full-of-ifdef's file to a mach-pxa/ezx/ directory?
> >
> 
> Actually we are fine using a single file, there are many parts shared
> between different platform generations and different phones, and often
> when we change something for a phone we had to do a similar change for
> the others, so living into a single file is a little bit easier.
> 
> Sure that the ifdefs can be reorganized and reduced, and I will do
> that when most of the out-of-tree stuff is in.

Well, that's your area, but I would've thought, an ezx directory with some 
function-specific files, common for some boards and one file per board 
with board-specific configuration would be easier to manage. But that's up 
to you and other EZX developers (and Eric), really:-)

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-04 11:35         ` Antonio Ospite
@ 2009-11-06 16:40           ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-06 16:40 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: Eric Miao, linux-arm-kernel, openezx-devel, Bart Visscher,
	Linux Media Mailing List, Robert Jarzmik

(added Robert to CC)

On Wed, 4 Nov 2009, Antonio Ospite wrote:

> On Wed, 4 Nov 2009 09:13:16 +0100 (CET)
> Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> 
> > > > +/* camera */
> > > > +static int a780_pxacamera_init(struct device *dev)
> > > > +{
> > > > +       int err;
> > > > +
> > > > +       /*
> > > > +        * GPIO50_GPIO is CAM_EN: active low
> > > > +        * GPIO19_GPIO is CAM_RST: active high
> > > > +        */
> > > > +       err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> > > 
> > > Mmm... MFP != GPIO, so this probably should be written simply as:
> > > 
> > > #define GPIO_nCAM_EN	(50)
> > 
> > ...but without parenthesis, please:
> > 
> > #define GPIO_nCAM_EN	50
> > 
> > same everywhere below
> >
> 
> OK.
> 
> BTW, Guennadi, shouldn't the pxa_camera platform_data expose also an
> exit() method for symmetry with the init() one, where we can free the
> requested resources?

Good that you mentioned this. In fact, I think, that .init should go. So 
far it is used in pcm990-baseboard.c to initialise pins. You're doing 
essentially the same - requesting and configuring GPIOs. And it has been 
agreed, that there is so far no real case, where a static 
GPIO-configuration wouldn't work. So, I would suggest you remove .init, 
configure GPIOs statically. And then submit a patch to remove .init 
completely from struct pxacamera_platform_data. Robert, do you agree?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-06 16:40           ` Guennadi Liakhovetski
  0 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-06 16:40 UTC (permalink / raw)
  To: linux-arm-kernel

(added Robert to CC)

On Wed, 4 Nov 2009, Antonio Ospite wrote:

> On Wed, 4 Nov 2009 09:13:16 +0100 (CET)
> Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> 
> > > > +/* camera */
> > > > +static int a780_pxacamera_init(struct device *dev)
> > > > +{
> > > > + ? ? ? int err;
> > > > +
> > > > + ? ? ? /*
> > > > + ? ? ? ?* GPIO50_GPIO is CAM_EN: active low
> > > > + ? ? ? ?* GPIO19_GPIO is CAM_RST: active high
> > > > + ? ? ? ?*/
> > > > + ? ? ? err = gpio_request(MFP_PIN_GPIO50, "nCAM_EN");
> > > 
> > > Mmm... MFP != GPIO, so this probably should be written simply as:
> > > 
> > > #define GPIO_nCAM_EN	(50)
> > 
> > ...but without parenthesis, please:
> > 
> > #define GPIO_nCAM_EN	50
> > 
> > same everywhere below
> >
> 
> OK.
> 
> BTW, Guennadi, shouldn't the pxa_camera platform_data expose also an
> exit() method for symmetry with the init() one, where we can free the
> requested resources?

Good that you mentioned this. In fact, I think, that .init should go. So 
far it is used in pcm990-baseboard.c to initialise pins. You're doing 
essentially the same - requesting and configuring GPIOs. And it has been 
agreed, that there is so far no real case, where a static 
GPIO-configuration wouldn't work. So, I would suggest you remove .init, 
configure GPIOs statically. And then submit a patch to remove .init 
completely from struct pxacamera_platform_data. Robert, do you agree?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-06 16:40           ` Guennadi Liakhovetski
@ 2009-11-06 17:05             ` Robert Jarzmik
  -1 siblings, 0 replies; 63+ messages in thread
From: Robert Jarzmik @ 2009-11-06 17:05 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Antonio Ospite, Eric Miao, linux-arm-kernel, openezx-devel,
	Bart Visscher, Linux Media Mailing List

Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:

> Good that you mentioned this. In fact, I think, that .init should go. So 
> far it is used in pcm990-baseboard.c to initialise pins. You're doing 
> essentially the same - requesting and configuring GPIOs. And it has been 
> agreed, that there is so far no real case, where a static 
> GPIO-configuration wouldn't work. So, I would suggest you remove .init, 
> configure GPIOs statically. And then submit a patch to remove .init 
> completely from struct pxacamera_platform_data. Robert, do you agree?

Yes, fully agree, I think too that GPIO should be static.

Cheers.

--
Robert

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-06 17:05             ` Robert Jarzmik
  0 siblings, 0 replies; 63+ messages in thread
From: Robert Jarzmik @ 2009-11-06 17:05 UTC (permalink / raw)
  To: linux-arm-kernel

Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:

> Good that you mentioned this. In fact, I think, that .init should go. So 
> far it is used in pcm990-baseboard.c to initialise pins. You're doing 
> essentially the same - requesting and configuring GPIOs. And it has been 
> agreed, that there is so far no real case, where a static 
> GPIO-configuration wouldn't work. So, I would suggest you remove .init, 
> configure GPIOs statically. And then submit a patch to remove .init 
> completely from struct pxacamera_platform_data. Robert, do you agree?

Yes, fully agree, I think too that GPIO should be static.

Cheers.

--
Robert

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-06 14:11                 ` Guennadi Liakhovetski
@ 2009-11-06 17:29                   ` Antonio Ospite
  -1 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-06 17:29 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-arm-kernel, Eric Miao, openezx-devel, Bart Visscher,
	Linux Media Mailing List

[-- Attachment #1: Type: text/plain, Size: 6699 bytes --]

On Fri, 6 Nov 2009 15:11:55 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Thu, 5 Nov 2009, Antonio Ospite wrote:
> 
> > On Thu, 5 Nov 2009 00:53:46 +0100 (CET)
> > Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> > 
> > > On Wed, 4 Nov 2009, Antonio Ospite wrote:
> > > 
> > > > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> > > > Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> > > 
> > > Is this patch going via Bart? Or should this be an Acked-by?
> > >
> > 
> > Bart did the initial research and wrote a first, partially working,
> > version of the patch for A780, then I made it work and refactored it,
> > adding code for A910. So I put two SOBs here as we are both the
> > authors, in a sense.
> 
> Then, I think, his Sob should be the first.
>

Ok.

> > [...] 
> > > > +/* camera */
> > > > +static int a780_pxacamera_init(struct device *dev)
> > > > +{
> > > > +	int err;
> > > > +
> > > > +	/*
> > > > +	 * GPIO50_nCAM_EN is active low
> > > > +	 * GPIO19_GEN1_CAM_RST is active high
> > > > +	 */
[...]
> > > > +	gpio_direction_output(GPIO50_nCAM_EN, 0);
> > > > +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 1);
> > > 
[...]
> > The reset happens when bringing the signal from low to high, so
> > holding it high or low it's basically the same here, and given how 
> > a780_pxacamera_reset() works I decided to keep it high.
> 
> Then it is not level- but edge-sensitive. Maybe put reset - rising edge to 
> activate, or something like that.
>

You mean I fix the comment, right?

> > I also need to put CAM_EN active in init(), because of how
> > soc_camera_probe() works, adding some debug I get this call sequence
> > (with CAM_EN not active):
> > 
> > Linux video capture interface: v2.00
> > pxa27x-camera pxa27x-camera.0: Limiting master clock to 26000000
> > pxa27x-camera pxa27x-camera.0: LCD clock 104000000Hz, target freq 26000000Hz, divisor 1
> > pxa27x-camera pxa27x-camera.0: got DMA channel 1
> > pxa27x-camera pxa27x-camera.0: got DMA channel (U) 2
> > pxa27x-camera pxa27x-camera.0: got DMA channel (V) 3
> > camera 0-0: Probing 0-0
> > camera 0-0: soc_camera_probe: power 1
> > --> a780_pxacamera_power: called. on: 1  !on: 0
> > camera 0-0: soc_camera_probe: reset
> > --> a780_pxacamera_reset: called
> > pxa27x-camera pxa27x-camera.0: Registered platform device at cc8a5380 data c03a40a8
> > pxa27x-camera pxa27x-camera.0: pxa_camera_activate: Init gpios
> > --> a780_pxacamera_init: called
> > pxa27x-camera pxa27x-camera.0: PXA Camera driver attached to camera 0
> > camera 0-0: mt9m111_video_probe: called
> > i2c: error: exhausted retries
> > i2c: msg_num: 0 msg_idx: -2000 msg_ptr: 0
> > i2c: ICR: 000007e0 ISR: 00000002
> > i2c: log: [00000446:000007e0] 
> > mt9m111 0-005d: read  reg.00d -> ffffff87
> > mt9m111 0-005d: mt9m11x init failed: -121
> > mt9m111: probe of 0-005d failed with error -121
> > pxa27x-camera pxa27x-camera.0: PXA Camera driver detached from camera 0
> > camera 0-0: soc_camera_probe: power 0
> > a780_pxacamera_power: called. on: 0  !on: 1
> > camera: probe of 0-0 failed with error -12
> > 
> > See? It's power(), reset(), init().
> > Maybe the problem is in soc_camera_probe()?
> 
> Sorry, you'd have to elaborate more on this. So, what's wrong with that 
> sequence? it doesn't make sense to reset a powered down device or reset 
> after init or whatever...
>

I mean, when probing (or even opening) the device, pxacamera.init()
is now called *after* the power ON and reset. If I kept disabled (high)
nCAM_EN in init(), as it should've been, this would have overridden
the previous power(1) call.

Isn't init() in pxacamera platform data meant to initialize the device
before it can be powered ON? In fact I am requesting the gpios in
a780_pxacamera_init, and if power() or reset() are called before it, then
they will be invalid, because the gpios have not been requested yet.

Moreover, pxacamera.init() is called in pxa_camera_activate, which is
called in pxa_camera_add_device, which in turn is invoked by
soc_camera_open() every time.
Shouldn't the init() method, where I request gpios, be called
only on probe?

Let me be more schematic, when probing the camera we have:

soc_camera_probe()         /* same in soc_camera_open! */
|-	icl->power(1)
|-	icl->reset()
|-	icd->ops->add()
	|-	pxacamera.init()  /* requesting gpios here! */
|-	video_dev_create(icd)
|-	...

Maybe we should have something like:

pxacamera.init()           /* request gpios only once! on probe. */
soc_camera_probe()         /* same in soc_camera_open */
|-	icl->power(1)
|-	icl->reset()
|-	icd->ops->add()
|-	video_dev_create(icd)
|-	...

Or, I'm missing what init() is supposed to do :)
Does a patch like this make sense to you?
(I've read the other mail about removing .init just before hitting Send,
this can be an alternative to removing it, having GPIOs setup in the
user driver seems clearer to me.)

diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 6952e96..3101bcb 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -881,18 +882,8 @@ static void recalculate_fifo_timeout(struct pxa_camera_dev *pcdev,
 
 static void pxa_camera_activate(struct pxa_camera_dev *pcdev)
 {
-	struct pxacamera_platform_data *pdata = pcdev->pdata;
-	struct device *dev = pcdev->soc_host.v4l2_dev.dev;
 	u32 cicr4 = 0;
 
-	dev_dbg(dev, "Registered platform device at %p data %p\n",
-		pcdev, pdata);
-
-	if (pdata && pdata->init) {
-		dev_dbg(dev, "%s: Init gpios\n", __func__);
-		pdata->init(dev);
-	}
-
 	/* disable all interrupts */
 	__raw_writel(0x3ff, pcdev->base + CICR0);
 
@@ -1651,6 +1644,17 @@ static int __devinit pxa_camera_probe(struct platform_device *pdev)
 	pcdev->res = res;
 
 	pcdev->pdata = pdev->dev.platform_data;
+
+	dev_dbg(&pdev->dev, "Registered platform device at %p data %p\n",
+		pcdev, pcdev->pdata);
+
+	if (pcdev->pdata && pcdev->pdata->init) {
+		dev_dbg(&pdev->dev, "%s: Init gpios\n", __func__);
+		err = pcdev->pdata->init(&pdev->dev);
+		if (err)
+			goto exit_clk;
+	}
+
 	pcdev->platform_flags = pcdev->pdata->flags;
 	if (!(pcdev->platform_flags & (PXA_CAMERA_DATAWIDTH_8 |
 			PXA_CAMERA_DATAWIDTH_9 | PXA_CAMERA_DATAWIDTH_10))) {

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-06 17:29                   ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-06 17:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 6 Nov 2009 15:11:55 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> On Thu, 5 Nov 2009, Antonio Ospite wrote:
> 
> > On Thu, 5 Nov 2009 00:53:46 +0100 (CET)
> > Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> > 
> > > On Wed, 4 Nov 2009, Antonio Ospite wrote:
> > > 
> > > > Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> > > > Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> > > 
> > > Is this patch going via Bart? Or should this be an Acked-by?
> > >
> > 
> > Bart did the initial research and wrote a first, partially working,
> > version of the patch for A780, then I made it work and refactored it,
> > adding code for A910. So I put two SOBs here as we are both the
> > authors, in a sense.
> 
> Then, I think, his Sob should be the first.
>

Ok.

> > [...] 
> > > > +/* camera */
> > > > +static int a780_pxacamera_init(struct device *dev)
> > > > +{
> > > > +	int err;
> > > > +
> > > > +	/*
> > > > +	 * GPIO50_nCAM_EN is active low
> > > > +	 * GPIO19_GEN1_CAM_RST is active high
> > > > +	 */
[...]
> > > > +	gpio_direction_output(GPIO50_nCAM_EN, 0);
> > > > +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 1);
> > > 
[...]
> > The reset happens when bringing the signal from low to high, so
> > holding it high or low it's basically the same here, and given how 
> > a780_pxacamera_reset() works I decided to keep it high.
> 
> Then it is not level- but edge-sensitive. Maybe put reset - rising edge to 
> activate, or something like that.
>

You mean I fix the comment, right?

> > I also need to put CAM_EN active in init(), because of how
> > soc_camera_probe() works, adding some debug I get this call sequence
> > (with CAM_EN not active):
> > 
> > Linux video capture interface: v2.00
> > pxa27x-camera pxa27x-camera.0: Limiting master clock to 26000000
> > pxa27x-camera pxa27x-camera.0: LCD clock 104000000Hz, target freq 26000000Hz, divisor 1
> > pxa27x-camera pxa27x-camera.0: got DMA channel 1
> > pxa27x-camera pxa27x-camera.0: got DMA channel (U) 2
> > pxa27x-camera pxa27x-camera.0: got DMA channel (V) 3
> > camera 0-0: Probing 0-0
> > camera 0-0: soc_camera_probe: power 1
> > --> a780_pxacamera_power: called. on: 1  !on: 0
> > camera 0-0: soc_camera_probe: reset
> > --> a780_pxacamera_reset: called
> > pxa27x-camera pxa27x-camera.0: Registered platform device at cc8a5380 data c03a40a8
> > pxa27x-camera pxa27x-camera.0: pxa_camera_activate: Init gpios
> > --> a780_pxacamera_init: called
> > pxa27x-camera pxa27x-camera.0: PXA Camera driver attached to camera 0
> > camera 0-0: mt9m111_video_probe: called
> > i2c: error: exhausted retries
> > i2c: msg_num: 0 msg_idx: -2000 msg_ptr: 0
> > i2c: ICR: 000007e0 ISR: 00000002
> > i2c: log: [00000446:000007e0] 
> > mt9m111 0-005d: read  reg.00d -> ffffff87
> > mt9m111 0-005d: mt9m11x init failed: -121
> > mt9m111: probe of 0-005d failed with error -121
> > pxa27x-camera pxa27x-camera.0: PXA Camera driver detached from camera 0
> > camera 0-0: soc_camera_probe: power 0
> > a780_pxacamera_power: called. on: 0  !on: 1
> > camera: probe of 0-0 failed with error -12
> > 
> > See? It's power(), reset(), init().
> > Maybe the problem is in soc_camera_probe()?
> 
> Sorry, you'd have to elaborate more on this. So, what's wrong with that 
> sequence? it doesn't make sense to reset a powered down device or reset 
> after init or whatever...
>

I mean, when probing (or even opening) the device, pxacamera.init()
is now called *after* the power ON and reset. If I kept disabled (high)
nCAM_EN in init(), as it should've been, this would have overridden
the previous power(1) call.

Isn't init() in pxacamera platform data meant to initialize the device
before it can be powered ON? In fact I am requesting the gpios in
a780_pxacamera_init, and if power() or reset() are called before it, then
they will be invalid, because the gpios have not been requested yet.

Moreover, pxacamera.init() is called in pxa_camera_activate, which is
called in pxa_camera_add_device, which in turn is invoked by
soc_camera_open() every time.
Shouldn't the init() method, where I request gpios, be called
only on probe?

Let me be more schematic, when probing the camera we have:

soc_camera_probe()         /* same in soc_camera_open! */
|-	icl->power(1)
|-	icl->reset()
|-	icd->ops->add()
	|-	pxacamera.init()  /* requesting gpios here! */
|-	video_dev_create(icd)
|-	...

Maybe we should have something like:

pxacamera.init()           /* request gpios only once! on probe. */
soc_camera_probe()         /* same in soc_camera_open */
|-	icl->power(1)
|-	icl->reset()
|-	icd->ops->add()
|-	video_dev_create(icd)
|-	...

Or, I'm missing what init() is supposed to do :)
Does a patch like this make sense to you?
(I've read the other mail about removing .init just before hitting Send,
this can be an alternative to removing it, having GPIOs setup in the
user driver seems clearer to me.)

diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 6952e96..3101bcb 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -881,18 +882,8 @@ static void recalculate_fifo_timeout(struct pxa_camera_dev *pcdev,
 
 static void pxa_camera_activate(struct pxa_camera_dev *pcdev)
 {
-	struct pxacamera_platform_data *pdata = pcdev->pdata;
-	struct device *dev = pcdev->soc_host.v4l2_dev.dev;
 	u32 cicr4 = 0;
 
-	dev_dbg(dev, "Registered platform device at %p data %p\n",
-		pcdev, pdata);
-
-	if (pdata && pdata->init) {
-		dev_dbg(dev, "%s: Init gpios\n", __func__);
-		pdata->init(dev);
-	}
-
 	/* disable all interrupts */
 	__raw_writel(0x3ff, pcdev->base + CICR0);
 
@@ -1651,6 +1644,17 @@ static int __devinit pxa_camera_probe(struct platform_device *pdev)
 	pcdev->res = res;
 
 	pcdev->pdata = pdev->dev.platform_data;
+
+	dev_dbg(&pdev->dev, "Registered platform device at %p data %p\n",
+		pcdev, pcdev->pdata);
+
+	if (pcdev->pdata && pcdev->pdata->init) {
+		dev_dbg(&pdev->dev, "%s: Init gpios\n", __func__);
+		err = pcdev->pdata->init(&pdev->dev);
+		if (err)
+			goto exit_clk;
+	}
+
 	pcdev->platform_flags = pcdev->pdata->flags;
 	if (!(pcdev->platform_flags & (PXA_CAMERA_DATAWIDTH_8 |
 			PXA_CAMERA_DATAWIDTH_9 | PXA_CAMERA_DATAWIDTH_10))) {

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091106/3e43f2e4/attachment.sig>

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-06 17:05             ` Robert Jarzmik
@ 2009-11-06 17:39               ` Antonio Ospite
  -1 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-06 17:39 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: Guennadi Liakhovetski, Eric Miao, linux-arm-kernel,
	openezx-devel, Bart Visscher, Linux Media Mailing List

[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]

On Fri, 06 Nov 2009 18:05:57 +0100
Robert Jarzmik <robert.jarzmik@free.fr> wrote:

> Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:
> 
> > Good that you mentioned this. In fact, I think, that .init should go. So 
> > far it is used in pcm990-baseboard.c to initialise pins. You're doing 
> > essentially the same - requesting and configuring GPIOs. And it has been 
> > agreed, that there is so far no real case, where a static 
> > GPIO-configuration wouldn't work. So, I would suggest you remove .init, 
> > configure GPIOs statically. And then submit a patch to remove .init 
> > completely from struct pxacamera_platform_data. Robert, do you agree?
> 
> Yes, fully agree, I think too that GPIO should be static.
>

Well, the other drivers I am using (pxamci, ezx-pcap, gpio-keys,
to mention some) request and configure GPIOs during their own
init/probe, they don't require the *board* init code to configure them.

But if you really like the static way I'll bend to your will.

Regards,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-06 17:39               ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-06 17:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 06 Nov 2009 18:05:57 +0100
Robert Jarzmik <robert.jarzmik@free.fr> wrote:

> Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:
> 
> > Good that you mentioned this. In fact, I think, that .init should go. So 
> > far it is used in pcm990-baseboard.c to initialise pins. You're doing 
> > essentially the same - requesting and configuring GPIOs. And it has been 
> > agreed, that there is so far no real case, where a static 
> > GPIO-configuration wouldn't work. So, I would suggest you remove .init, 
> > configure GPIOs statically. And then submit a patch to remove .init 
> > completely from struct pxacamera_platform_data. Robert, do you agree?
> 
> Yes, fully agree, I think too that GPIO should be static.
>

Well, the other drivers I am using (pxamci, ezx-pcap, gpio-keys,
to mention some) request and configure GPIOs during their own
init/probe, they don't require the *board* init code to configure them.

But if you really like the static way I'll bend to your will.

Regards,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091106/f278ad15/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-06 17:29                   ` Antonio Ospite
@ 2009-11-10  9:29                     ` Antonio Ospite
  -1 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-10  9:29 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-arm-kernel, Eric Miao, openezx-devel, Bart Visscher,
	Linux Media Mailing List

[-- Attachment #1: Type: text/plain, Size: 4205 bytes --]

Ping.

Guennadi, did you see the patch below? Or I should completely remove
the .init() callback like you said in another message?
As I said, my humble preference would be to keep GPIOs setup local to
the driver somehow, but you just tell me what to do :)

On Fri, 6 Nov 2009 18:29:10 +0100
Antonio Ospite <ospite@studenti.unina.it> wrote:

> On Fri, 6 Nov 2009 15:11:55 +0100 (CET)
> Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> 
> > On Thu, 5 Nov 2009, Antonio Ospite wrote:
> > 
> > > See? It's power(), reset(), init().
> > > Maybe the problem is in soc_camera_probe()?
> > 
> > Sorry, you'd have to elaborate more on this. So, what's wrong with that 
> > sequence? it doesn't make sense to reset a powered down device or reset 
> > after init or whatever...
> >
> 
> I mean, when probing (or even opening) the device, pxacamera.init()
> is now called *after* the power ON and reset. If I kept disabled (high)
> nCAM_EN in init(), as it should've been, this would have overridden
> the previous power(1) call.
> 
> Isn't init() in pxacamera platform data meant to initialize the device
> before it can be powered ON? In fact I am requesting the gpios in
> a780_pxacamera_init, and if power() or reset() are called before it, then
> they will be invalid, because the gpios have not been requested yet.
> 
> Moreover, pxacamera.init() is called in pxa_camera_activate, which is
> called in pxa_camera_add_device, which in turn is invoked by
> soc_camera_open() every time.
> Shouldn't the init() method, where I request gpios, be called
> only on probe?
> 
> Let me be more schematic, when probing the camera we have:
> 
> soc_camera_probe()         /* same in soc_camera_open! */
> |-	icl->power(1)
> |-	icl->reset()
> |-	icd->ops->add()
> 	|-	pxacamera.init()  /* requesting gpios here! */
> |-	video_dev_create(icd)
> |-	...
> 
> Maybe we should have something like:
> 
> pxacamera.init()           /* request gpios only once! on probe. */
> soc_camera_probe()         /* same in soc_camera_open */
> |-	icl->power(1)
> |-	icl->reset()
> |-	icd->ops->add()
> |-	video_dev_create(icd)
> |-	...
> 
> Or, I'm missing what init() is supposed to do :)
> Does a patch like this make sense to you?
> (I've read the other mail about removing .init just before hitting Send,
> this can be an alternative to removing it, having GPIOs setup in the
> user driver seems clearer to me.)
> 
> diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
> index 6952e96..3101bcb 100644
> --- a/drivers/media/video/pxa_camera.c
> +++ b/drivers/media/video/pxa_camera.c
> @@ -881,18 +882,8 @@ static void recalculate_fifo_timeout(struct pxa_camera_dev *pcdev,
>  
>  static void pxa_camera_activate(struct pxa_camera_dev *pcdev)
>  {
> -	struct pxacamera_platform_data *pdata = pcdev->pdata;
> -	struct device *dev = pcdev->soc_host.v4l2_dev.dev;
>  	u32 cicr4 = 0;
>  
> -	dev_dbg(dev, "Registered platform device at %p data %p\n",
> -		pcdev, pdata);
> -
> -	if (pdata && pdata->init) {
> -		dev_dbg(dev, "%s: Init gpios\n", __func__);
> -		pdata->init(dev);
> -	}
> -
>  	/* disable all interrupts */
>  	__raw_writel(0x3ff, pcdev->base + CICR0);
>  
> @@ -1651,6 +1644,17 @@ static int __devinit pxa_camera_probe(struct platform_device *pdev)
>  	pcdev->res = res;
>  
>  	pcdev->pdata = pdev->dev.platform_data;
> +
> +	dev_dbg(&pdev->dev, "Registered platform device at %p data %p\n",
> +		pcdev, pcdev->pdata);
> +
> +	if (pcdev->pdata && pcdev->pdata->init) {
> +		dev_dbg(&pdev->dev, "%s: Init gpios\n", __func__);
> +		err = pcdev->pdata->init(&pdev->dev);
> +		if (err)
> +			goto exit_clk;
> +	}
> +
>  	pcdev->platform_flags = pcdev->pdata->flags;
>  	if (!(pcdev->platform_flags & (PXA_CAMERA_DATAWIDTH_8 |
>  			PXA_CAMERA_DATAWIDTH_9 | PXA_CAMERA_DATAWIDTH_10))) {

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-10  9:29                     ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-10  9:29 UTC (permalink / raw)
  To: linux-arm-kernel

Ping.

Guennadi, did you see the patch below? Or I should completely remove
the .init() callback like you said in another message?
As I said, my humble preference would be to keep GPIOs setup local to
the driver somehow, but you just tell me what to do :)

On Fri, 6 Nov 2009 18:29:10 +0100
Antonio Ospite <ospite@studenti.unina.it> wrote:

> On Fri, 6 Nov 2009 15:11:55 +0100 (CET)
> Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> 
> > On Thu, 5 Nov 2009, Antonio Ospite wrote:
> > 
> > > See? It's power(), reset(), init().
> > > Maybe the problem is in soc_camera_probe()?
> > 
> > Sorry, you'd have to elaborate more on this. So, what's wrong with that 
> > sequence? it doesn't make sense to reset a powered down device or reset 
> > after init or whatever...
> >
> 
> I mean, when probing (or even opening) the device, pxacamera.init()
> is now called *after* the power ON and reset. If I kept disabled (high)
> nCAM_EN in init(), as it should've been, this would have overridden
> the previous power(1) call.
> 
> Isn't init() in pxacamera platform data meant to initialize the device
> before it can be powered ON? In fact I am requesting the gpios in
> a780_pxacamera_init, and if power() or reset() are called before it, then
> they will be invalid, because the gpios have not been requested yet.
> 
> Moreover, pxacamera.init() is called in pxa_camera_activate, which is
> called in pxa_camera_add_device, which in turn is invoked by
> soc_camera_open() every time.
> Shouldn't the init() method, where I request gpios, be called
> only on probe?
> 
> Let me be more schematic, when probing the camera we have:
> 
> soc_camera_probe()         /* same in soc_camera_open! */
> |-	icl->power(1)
> |-	icl->reset()
> |-	icd->ops->add()
> 	|-	pxacamera.init()  /* requesting gpios here! */
> |-	video_dev_create(icd)
> |-	...
> 
> Maybe we should have something like:
> 
> pxacamera.init()           /* request gpios only once! on probe. */
> soc_camera_probe()         /* same in soc_camera_open */
> |-	icl->power(1)
> |-	icl->reset()
> |-	icd->ops->add()
> |-	video_dev_create(icd)
> |-	...
> 
> Or, I'm missing what init() is supposed to do :)
> Does a patch like this make sense to you?
> (I've read the other mail about removing .init just before hitting Send,
> this can be an alternative to removing it, having GPIOs setup in the
> user driver seems clearer to me.)
> 
> diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
> index 6952e96..3101bcb 100644
> --- a/drivers/media/video/pxa_camera.c
> +++ b/drivers/media/video/pxa_camera.c
> @@ -881,18 +882,8 @@ static void recalculate_fifo_timeout(struct pxa_camera_dev *pcdev,
>  
>  static void pxa_camera_activate(struct pxa_camera_dev *pcdev)
>  {
> -	struct pxacamera_platform_data *pdata = pcdev->pdata;
> -	struct device *dev = pcdev->soc_host.v4l2_dev.dev;
>  	u32 cicr4 = 0;
>  
> -	dev_dbg(dev, "Registered platform device at %p data %p\n",
> -		pcdev, pdata);
> -
> -	if (pdata && pdata->init) {
> -		dev_dbg(dev, "%s: Init gpios\n", __func__);
> -		pdata->init(dev);
> -	}
> -
>  	/* disable all interrupts */
>  	__raw_writel(0x3ff, pcdev->base + CICR0);
>  
> @@ -1651,6 +1644,17 @@ static int __devinit pxa_camera_probe(struct platform_device *pdev)
>  	pcdev->res = res;
>  
>  	pcdev->pdata = pdev->dev.platform_data;
> +
> +	dev_dbg(&pdev->dev, "Registered platform device at %p data %p\n",
> +		pcdev, pcdev->pdata);
> +
> +	if (pcdev->pdata && pcdev->pdata->init) {
> +		dev_dbg(&pdev->dev, "%s: Init gpios\n", __func__);
> +		err = pcdev->pdata->init(&pdev->dev);
> +		if (err)
> +			goto exit_clk;
> +	}
> +
>  	pcdev->platform_flags = pcdev->pdata->flags;
>  	if (!(pcdev->platform_flags & (PXA_CAMERA_DATAWIDTH_8 |
>  			PXA_CAMERA_DATAWIDTH_9 | PXA_CAMERA_DATAWIDTH_10))) {

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091110/11001d25/attachment.sig>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-10  9:29                     ` Antonio Ospite
@ 2009-11-10  9:39                       ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-10  9:39 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: linux-arm-kernel, Eric Miao, openezx-devel, Bart Visscher,
	Linux Media Mailing List

On Tue, 10 Nov 2009, Antonio Ospite wrote:

> Ping.
> 
> Guennadi, did you see the patch below? Or I should completely remove
> the .init() callback like you said in another message?
> As I said, my humble preference would be to keep GPIOs setup local to
> the driver somehow, but you just tell me what to do :)

Yes, please make GPIO config static and remove .init.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v2] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-10  9:39                       ` Guennadi Liakhovetski
  0 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-10  9:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 10 Nov 2009, Antonio Ospite wrote:

> Ping.
> 
> Guennadi, did you see the patch below? Or I should completely remove
> the .init() callback like you said in another message?
> As I said, my humble preference would be to keep GPIOs setup local to
> the driver somehow, but you just tell me what to do :)

Yes, please make GPIO config static and remove .init.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-04  6:38     ` Eric Miao
@ 2009-11-10 12:48       ` Antonio Ospite
  -1 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-10 12:48 UTC (permalink / raw)
  To: Eric Miao
  Cc: linux-arm-kernel, openezx-devel, Bart Visscher, linux-media,
	Guennadi Liakhovetski

[-- Attachment #1: Type: text/plain, Size: 2018 bytes --]

On Wed, 4 Nov 2009 14:38:40 +0800
Eric Miao <eric.y.miao@gmail.com> wrote:

> Hi Antonio,
> 
> Patch looks generally OK except for the MFP/GPIO usage...

Eric,

while I was at it I also checked the original code Motorola released.

It has:
     PGSR(GPIO_CAM_EN) |= GPIO_bit(GPIO_CAM_EN);
     PGSR(GPIO_CAM_RST)|= GPIO_bit(GPIO_CAM_RST);

After checking PXA manual and arch/arm/mach-pxa/mfp-pxa2xx.c,
I'd translate this to:

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 77286a2..6a47a9d 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -281,8 +281,8 @@ static unsigned long gen1_pin_config[] __initdata = {
        GPIO94_CIF_DD_5,
        GPIO17_CIF_DD_6,
        GPIO108_CIF_DD_7,
-       GPIO50_GPIO,                            /* CAM_EN */
-       GPIO19_GPIO,                            /* CAM_RST */
+       GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_EN */
+       GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_RST */

        /* EMU */
        GPIO120_GPIO,                           /* EMU_MUX1 */
@@ -338,8 +338,8 @@ static unsigned long gen2_pin_config[] __initdata = {
        GPIO48_CIF_DD_5,
        GPIO93_CIF_DD_6,
        GPIO12_CIF_DD_7,
-       GPIO50_GPIO,                            /* CAM_EN */
-       GPIO28_GPIO,                            /* CAM_RST */
+       GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_EN */
+       GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_RST */
        GPIO17_GPIO,                            /* CAM_FLASH */
 };
 #endif


Is that right?
I am putting also this into the next version I am going to send for
submission, if you don't object.

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-10 12:48       ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-10 12:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 4 Nov 2009 14:38:40 +0800
Eric Miao <eric.y.miao@gmail.com> wrote:

> Hi Antonio,
> 
> Patch looks generally OK except for the MFP/GPIO usage...

Eric,

while I was at it I also checked the original code Motorola released.

It has:
     PGSR(GPIO_CAM_EN) |= GPIO_bit(GPIO_CAM_EN);
     PGSR(GPIO_CAM_RST)|= GPIO_bit(GPIO_CAM_RST);

After checking PXA manual and arch/arm/mach-pxa/mfp-pxa2xx.c,
I'd translate this to:

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 77286a2..6a47a9d 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -281,8 +281,8 @@ static unsigned long gen1_pin_config[] __initdata = {
        GPIO94_CIF_DD_5,
        GPIO17_CIF_DD_6,
        GPIO108_CIF_DD_7,
-       GPIO50_GPIO,                            /* CAM_EN */
-       GPIO19_GPIO,                            /* CAM_RST */
+       GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_EN */
+       GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_RST */

        /* EMU */
        GPIO120_GPIO,                           /* EMU_MUX1 */
@@ -338,8 +338,8 @@ static unsigned long gen2_pin_config[] __initdata = {
        GPIO48_CIF_DD_5,
        GPIO93_CIF_DD_6,
        GPIO12_CIF_DD_7,
-       GPIO50_GPIO,                            /* CAM_EN */
-       GPIO28_GPIO,                            /* CAM_RST */
+       GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_EN */
+       GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_RST */
        GPIO17_GPIO,                            /* CAM_FLASH */
 };
 #endif


Is that right?
I am putting also this into the next version I am going to send for
submission, if you don't object.

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091110/651d22ec/attachment.sig>

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
  2009-11-10 12:48       ` Antonio Ospite
@ 2009-11-10 15:13         ` Eric Miao
  -1 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-10 15:13 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: linux-arm-kernel, openezx-devel, Bart Visscher, linux-media,
	Guennadi Liakhovetski

On Tue, Nov 10, 2009 at 8:48 PM, Antonio Ospite
<ospite@studenti.unina.it> wrote:
> On Wed, 4 Nov 2009 14:38:40 +0800
> Eric Miao <eric.y.miao@gmail.com> wrote:
>
>> Hi Antonio,
>>
>> Patch looks generally OK except for the MFP/GPIO usage...
>
> Eric,
>
> while I was at it I also checked the original code Motorola released.
>
> It has:
>     PGSR(GPIO_CAM_EN) |= GPIO_bit(GPIO_CAM_EN);
>     PGSR(GPIO_CAM_RST)|= GPIO_bit(GPIO_CAM_RST);
>
> After checking PXA manual and arch/arm/mach-pxa/mfp-pxa2xx.c,
> I'd translate this to:
>
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index 77286a2..6a47a9d 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -281,8 +281,8 @@ static unsigned long gen1_pin_config[] __initdata = {
>        GPIO94_CIF_DD_5,
>        GPIO17_CIF_DD_6,
>        GPIO108_CIF_DD_7,
> -       GPIO50_GPIO,                            /* CAM_EN */
> -       GPIO19_GPIO,                            /* CAM_RST */
> +       GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_EN */
> +       GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_RST */
>
>        /* EMU */
>        GPIO120_GPIO,                           /* EMU_MUX1 */
> @@ -338,8 +338,8 @@ static unsigned long gen2_pin_config[] __initdata = {
>        GPIO48_CIF_DD_5,
>        GPIO93_CIF_DD_6,
>        GPIO12_CIF_DD_7,
> -       GPIO50_GPIO,                            /* CAM_EN */
> -       GPIO28_GPIO,                            /* CAM_RST */
> +       GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_EN */
> +       GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_RST */
>        GPIO17_GPIO,                            /* CAM_FLASH */
>  };
>  #endif
>
>
> Is that right?

That's right.

> I am putting also this into the next version I am going to send for
> submission, if you don't object.

No I won't, feel free to.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones
@ 2009-11-10 15:13         ` Eric Miao
  0 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-10 15:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 10, 2009 at 8:48 PM, Antonio Ospite
<ospite@studenti.unina.it> wrote:
> On Wed, 4 Nov 2009 14:38:40 +0800
> Eric Miao <eric.y.miao@gmail.com> wrote:
>
>> Hi Antonio,
>>
>> Patch looks generally OK except for the MFP/GPIO usage...
>
> Eric,
>
> while I was at it I also checked the original code Motorola released.
>
> It has:
> ? ? PGSR(GPIO_CAM_EN) |= GPIO_bit(GPIO_CAM_EN);
> ? ? PGSR(GPIO_CAM_RST)|= GPIO_bit(GPIO_CAM_RST);
>
> After checking PXA manual and arch/arm/mach-pxa/mfp-pxa2xx.c,
> I'd translate this to:
>
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index 77286a2..6a47a9d 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -281,8 +281,8 @@ static unsigned long gen1_pin_config[] __initdata = {
> ? ? ? ?GPIO94_CIF_DD_5,
> ? ? ? ?GPIO17_CIF_DD_6,
> ? ? ? ?GPIO108_CIF_DD_7,
> - ? ? ? GPIO50_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* CAM_EN */
> - ? ? ? GPIO19_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* CAM_RST */
> + ? ? ? GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, ? ? ? /* CAM_EN */
> + ? ? ? GPIO19_GPIO | MFP_LPM_DRIVE_HIGH, ? ? ? /* CAM_RST */
>
> ? ? ? ?/* EMU */
> ? ? ? ?GPIO120_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? /* EMU_MUX1 */
> @@ -338,8 +338,8 @@ static unsigned long gen2_pin_config[] __initdata = {
> ? ? ? ?GPIO48_CIF_DD_5,
> ? ? ? ?GPIO93_CIF_DD_6,
> ? ? ? ?GPIO12_CIF_DD_7,
> - ? ? ? GPIO50_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* CAM_EN */
> - ? ? ? GPIO28_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* CAM_RST */
> + ? ? ? GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, ? ? ? /* CAM_EN */
> + ? ? ? GPIO28_GPIO | MFP_LPM_DRIVE_HIGH, ? ? ? /* CAM_RST */
> ? ? ? ?GPIO17_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* CAM_FLASH */
> ?};
> ?#endif
>
>
> Is that right?

That's right.

> I am putting also this into the next version I am going to send for
> submission, if you don't object.

No I won't, feel free to.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v3] Add camera support for A780 and A910 EZX phones
  2009-11-10  9:39                       ` Guennadi Liakhovetski
@ 2009-11-11 11:01                         ` Antonio Ospite
  -1 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-11 11:01 UTC (permalink / raw)
  To: linux-arm-kernel, linux-arm-kernel
  Cc: Antonio Ospite, Eric Miao, openezx-devel, Bart Visscher,
	linux-media, Guennadi Liakhovetski

Signed-off-by: Bart Visscher <bartv@thisnet.nl>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

---
Changes since v2:

 - Bart's SOB goes first, as he is the original author.
 - Add MFP_LPM_DRIVE_HIGH to camera gpios, as per Motorola original
   code.
 - s/pxacamera/camera/ in function names, as they are not used in
   pxacamera_platform_data
 - Adjust comments about CAM_RST which is active on rising edge
 - Saner default values for nCAM_EN and CAM_RST gpios
 - Setup gpios statically at board init.

Eric, if it is easier for you I can send the three patches together again.

Thanks,
   Antonio
 
 arch/arm/mach-pxa/ezx.c |  172 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 168 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 588b265..74423a6 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -17,8 +17,11 @@
 #include <linux/delay.h>
 #include <linux/pwm_backlight.h>
 #include <linux/input.h>
+#include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 
+#include <media/soc_camera.h>
+
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -29,6 +32,7 @@
 #include <plat/i2c.h>
 #include <mach/hardware.h>
 #include <mach/pxa27x_keypad.h>
+#include <mach/camera.h>
 
 #include "devices.h"
 #include "generic.h"
@@ -38,6 +42,9 @@
 #define GPIO15_A910_FLIP_LID 		15
 #define GPIO12_E680_LOCK_SWITCH 	12
 #define GPIO15_E6_LOCK_SWITCH 		15
+#define GPIO50_nCAM_EN			50
+#define GPIO19_GEN1_CAM_RST		19
+#define GPIO28_GEN2_CAM_RST		28
 
 static struct platform_pwm_backlight_data ezx_backlight_data = {
 	.pwm_id		= 0,
@@ -191,8 +198,8 @@ static unsigned long gen1_pin_config[] __initdata = {
 	GPIO94_CIF_DD_5,
 	GPIO17_CIF_DD_6,
 	GPIO108_CIF_DD_7,
-	GPIO50_GPIO,				/* CAM_EN */
-	GPIO19_GPIO,				/* CAM_RST */
+	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
+	GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
 
 	/* EMU */
 	GPIO120_GPIO,				/* EMU_MUX1 */
@@ -248,8 +255,8 @@ static unsigned long gen2_pin_config[] __initdata = {
 	GPIO48_CIF_DD_5,
 	GPIO93_CIF_DD_6,
 	GPIO12_CIF_DD_7,
-	GPIO50_GPIO,				/* CAM_EN */
-	GPIO28_GPIO,				/* CAM_RST */
+	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
+	GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
 	GPIO17_GPIO,				/* CAM_FLASH */
 };
 #endif
@@ -683,8 +690,84 @@ static struct platform_device a780_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a780_camera_init(void)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO19_GEN1_CAM_RST is active on rising edge
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 1);
+	gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a780_camera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a780_camera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a780_pxacamera_platform_data = {
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a780_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a780_iclink = {
+	.bus_id         = 0,
+	.flags          = SOCAM_SENSOR_INVERT_PCLK,
+	.i2c_adapter_id = 0,
+	.board_info     = &a780_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a780_camera_power,
+	.reset          = a780_camera_reset,
+};
+
+static struct platform_device a780_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a780_iclink,
+	},
+};
+
 static struct platform_device *a780_devices[] __initdata = {
 	&a780_gpio_keys,
+	&a780_camera,
 };
 
 static void __init a780_init(void)
@@ -699,6 +782,9 @@ static void __init a780_init(void)
 
 	pxa_set_keypad_info(&a780_keypad_platform_data);
 
+	a780_camera_init();
+	pxa_set_camera_info(&a780_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
 }
@@ -864,8 +950,83 @@ static struct platform_device a910_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a910_camera_init(void)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO28_GEN2_CAM_RST is active on rising edge
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 1);
+	gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a910_camera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a910_camera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a910_pxacamera_platform_data = {
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a910_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a910_iclink = {
+	.bus_id         = 0,
+	.i2c_adapter_id = 0,
+	.board_info     = &a910_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a910_camera_power,
+	.reset          = a910_camera_reset,
+};
+
+static struct platform_device a910_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a910_iclink,
+	},
+};
+
 static struct platform_device *a910_devices[] __initdata = {
 	&a910_gpio_keys,
+	&a910_camera,
 };
 
 static void __init a910_init(void)
@@ -880,6 +1041,9 @@ static void __init a910_init(void)
 
 	pxa_set_keypad_info(&a910_keypad_platform_data);
 
+	a910_camera_init();
+	pxa_set_camera_info(&a910_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
 }
-- 
tg: (639a58f..) ezx/mach/camera_new (depends on: master)

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v3] Add camera support for A780 and A910 EZX phones
@ 2009-11-11 11:01                         ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-11 11:01 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Bart Visscher <bartv@thisnet.nl>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

---
Changes since v2:

 - Bart's SOB goes first, as he is the original author.
 - Add MFP_LPM_DRIVE_HIGH to camera gpios, as per Motorola original
   code.
 - s/pxacamera/camera/ in function names, as they are not used in
   pxacamera_platform_data
 - Adjust comments about CAM_RST which is active on rising edge
 - Saner default values for nCAM_EN and CAM_RST gpios
 - Setup gpios statically at board init.

Eric, if it is easier for you I can send the three patches together again.

Thanks,
   Antonio
 
 arch/arm/mach-pxa/ezx.c |  172 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 168 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 588b265..74423a6 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -17,8 +17,11 @@
 #include <linux/delay.h>
 #include <linux/pwm_backlight.h>
 #include <linux/input.h>
+#include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 
+#include <media/soc_camera.h>
+
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -29,6 +32,7 @@
 #include <plat/i2c.h>
 #include <mach/hardware.h>
 #include <mach/pxa27x_keypad.h>
+#include <mach/camera.h>
 
 #include "devices.h"
 #include "generic.h"
@@ -38,6 +42,9 @@
 #define GPIO15_A910_FLIP_LID 		15
 #define GPIO12_E680_LOCK_SWITCH 	12
 #define GPIO15_E6_LOCK_SWITCH 		15
+#define GPIO50_nCAM_EN			50
+#define GPIO19_GEN1_CAM_RST		19
+#define GPIO28_GEN2_CAM_RST		28
 
 static struct platform_pwm_backlight_data ezx_backlight_data = {
 	.pwm_id		= 0,
@@ -191,8 +198,8 @@ static unsigned long gen1_pin_config[] __initdata = {
 	GPIO94_CIF_DD_5,
 	GPIO17_CIF_DD_6,
 	GPIO108_CIF_DD_7,
-	GPIO50_GPIO,				/* CAM_EN */
-	GPIO19_GPIO,				/* CAM_RST */
+	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
+	GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
 
 	/* EMU */
 	GPIO120_GPIO,				/* EMU_MUX1 */
@@ -248,8 +255,8 @@ static unsigned long gen2_pin_config[] __initdata = {
 	GPIO48_CIF_DD_5,
 	GPIO93_CIF_DD_6,
 	GPIO12_CIF_DD_7,
-	GPIO50_GPIO,				/* CAM_EN */
-	GPIO28_GPIO,				/* CAM_RST */
+	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
+	GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
 	GPIO17_GPIO,				/* CAM_FLASH */
 };
 #endif
@@ -683,8 +690,84 @@ static struct platform_device a780_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a780_camera_init(void)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO19_GEN1_CAM_RST is active on rising edge
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 1);
+	gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a780_camera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a780_camera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a780_pxacamera_platform_data = {
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a780_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a780_iclink = {
+	.bus_id         = 0,
+	.flags          = SOCAM_SENSOR_INVERT_PCLK,
+	.i2c_adapter_id = 0,
+	.board_info     = &a780_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a780_camera_power,
+	.reset          = a780_camera_reset,
+};
+
+static struct platform_device a780_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a780_iclink,
+	},
+};
+
 static struct platform_device *a780_devices[] __initdata = {
 	&a780_gpio_keys,
+	&a780_camera,
 };
 
 static void __init a780_init(void)
@@ -699,6 +782,9 @@ static void __init a780_init(void)
 
 	pxa_set_keypad_info(&a780_keypad_platform_data);
 
+	a780_camera_init();
+	pxa_set_camera_info(&a780_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
 }
@@ -864,8 +950,83 @@ static struct platform_device a910_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a910_camera_init(void)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO28_GEN2_CAM_RST is active on rising edge
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 1);
+	gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a910_camera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a910_camera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a910_pxacamera_platform_data = {
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a910_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a910_iclink = {
+	.bus_id         = 0,
+	.i2c_adapter_id = 0,
+	.board_info     = &a910_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a910_camera_power,
+	.reset          = a910_camera_reset,
+};
+
+static struct platform_device a910_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a910_iclink,
+	},
+};
+
 static struct platform_device *a910_devices[] __initdata = {
 	&a910_gpio_keys,
+	&a910_camera,
 };
 
 static void __init a910_init(void)
@@ -880,6 +1041,9 @@ static void __init a910_init(void)
 
 	pxa_set_keypad_info(&a910_keypad_platform_data);
 
+	a910_camera_init();
+	pxa_set_camera_info(&a910_pxacamera_platform_data);
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
 }
-- 
tg: (639a58f..) ezx/mach/camera_new (depends on: master)

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v3] Add camera support for A780 and A910 EZX phones
  2009-11-11 11:01                         ` Antonio Ospite
@ 2009-11-11 13:55                           ` Eric Miao
  -1 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-11 13:55 UTC (permalink / raw)
  To: Guennadi Liakhovetski, Antonio Ospite
  Cc: linux-arm-kernel, openezx-devel, Bart Visscher, linux-media

On Wed, Nov 11, 2009 at 7:01 PM, Antonio Ospite
<ospite@studenti.unina.it> wrote:
> Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
>
> ---
> Changes since v2:
>
>  - Bart's SOB goes first, as he is the original author.
>  - Add MFP_LPM_DRIVE_HIGH to camera gpios, as per Motorola original
>   code.
>  - s/pxacamera/camera/ in function names, as they are not used in
>   pxacamera_platform_data
>  - Adjust comments about CAM_RST which is active on rising edge
>  - Saner default values for nCAM_EN and CAM_RST gpios
>  - Setup gpios statically at board init.
>
> Eric, if it is easier for you I can send the three patches together again.
>

That's OK, I can find the rest two :)

Guennadi,

I need your Acked-by or Reviewed-by please.

> Thanks,
>   Antonio
>
>  arch/arm/mach-pxa/ezx.c |  172 +++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 168 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index 588b265..74423a6 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -17,8 +17,11 @@
>  #include <linux/delay.h>
>  #include <linux/pwm_backlight.h>
>  #include <linux/input.h>
> +#include <linux/gpio.h>
>  #include <linux/gpio_keys.h>
>
> +#include <media/soc_camera.h>
> +
>  #include <asm/setup.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> @@ -29,6 +32,7 @@
>  #include <plat/i2c.h>
>  #include <mach/hardware.h>
>  #include <mach/pxa27x_keypad.h>
> +#include <mach/camera.h>
>
>  #include "devices.h"
>  #include "generic.h"
> @@ -38,6 +42,9 @@
>  #define GPIO15_A910_FLIP_LID           15
>  #define GPIO12_E680_LOCK_SWITCH        12
>  #define GPIO15_E6_LOCK_SWITCH          15
> +#define GPIO50_nCAM_EN                 50
> +#define GPIO19_GEN1_CAM_RST            19
> +#define GPIO28_GEN2_CAM_RST            28
>
>  static struct platform_pwm_backlight_data ezx_backlight_data = {
>        .pwm_id         = 0,
> @@ -191,8 +198,8 @@ static unsigned long gen1_pin_config[] __initdata = {
>        GPIO94_CIF_DD_5,
>        GPIO17_CIF_DD_6,
>        GPIO108_CIF_DD_7,
> -       GPIO50_GPIO,                            /* CAM_EN */
> -       GPIO19_GPIO,                            /* CAM_RST */
> +       GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_EN */
> +       GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_RST */
>
>        /* EMU */
>        GPIO120_GPIO,                           /* EMU_MUX1 */
> @@ -248,8 +255,8 @@ static unsigned long gen2_pin_config[] __initdata = {
>        GPIO48_CIF_DD_5,
>        GPIO93_CIF_DD_6,
>        GPIO12_CIF_DD_7,
> -       GPIO50_GPIO,                            /* CAM_EN */
> -       GPIO28_GPIO,                            /* CAM_RST */
> +       GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_EN */
> +       GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,       /* CAM_RST */
>        GPIO17_GPIO,                            /* CAM_FLASH */
>  };
>  #endif
> @@ -683,8 +690,84 @@ static struct platform_device a780_gpio_keys = {
>        },
>  };
>
> +/* camera */
> +static int a780_camera_init(void)
> +{
> +       int err;
> +
> +       /*
> +        * GPIO50_nCAM_EN is active low
> +        * GPIO19_GEN1_CAM_RST is active on rising edge
> +        */
> +       err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +       if (err) {
> +               pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +               goto fail;
> +       }
> +
> +       err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> +       if (err) {
> +               pr_err("%s: Failed to request CAM_RST\n", __func__);
> +               goto fail_gpio_cam_rst;
> +       }
> +
> +       gpio_direction_output(GPIO50_nCAM_EN, 1);
> +       gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
> +
> +       return 0;
> +
> +fail_gpio_cam_rst:
> +       gpio_free(GPIO50_nCAM_EN);
> +fail:
> +       return err;
> +}
> +
> +static int a780_camera_power(struct device *dev, int on)
> +{
> +       gpio_set_value(GPIO50_nCAM_EN, !on);
> +       return 0;
> +}
> +
> +static int a780_camera_reset(struct device *dev)
> +{
> +       gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> +       msleep(10);
> +       gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
> +
> +       return 0;
> +}
> +
> +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> +       .flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +               PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +       .mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a780_camera_i2c_board_info = {
> +       I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a780_iclink = {
> +       .bus_id         = 0,
> +       .flags          = SOCAM_SENSOR_INVERT_PCLK,
> +       .i2c_adapter_id = 0,
> +       .board_info     = &a780_camera_i2c_board_info,
> +       .module_name    = "mt9m111",
> +       .power          = a780_camera_power,
> +       .reset          = a780_camera_reset,
> +};
> +
> +static struct platform_device a780_camera = {
> +       .name   = "soc-camera-pdrv",
> +       .id     = 0,
> +       .dev    = {
> +               .platform_data = &a780_iclink,
> +       },
> +};
> +
>  static struct platform_device *a780_devices[] __initdata = {
>        &a780_gpio_keys,
> +       &a780_camera,
>  };
>
>  static void __init a780_init(void)
> @@ -699,6 +782,9 @@ static void __init a780_init(void)
>
>        pxa_set_keypad_info(&a780_keypad_platform_data);
>
> +       a780_camera_init();
> +       pxa_set_camera_info(&a780_pxacamera_platform_data);
> +
>        platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>        platform_add_devices(ARRAY_AND_SIZE(a780_devices));
>  }
> @@ -864,8 +950,83 @@ static struct platform_device a910_gpio_keys = {
>        },
>  };
>
> +/* camera */
> +static int a910_camera_init(void)
> +{
> +       int err;
> +
> +       /*
> +        * GPIO50_nCAM_EN is active low
> +        * GPIO28_GEN2_CAM_RST is active on rising edge
> +        */
> +       err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +       if (err) {
> +               pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +               goto fail;
> +       }
> +
> +       err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
> +       if (err) {
> +               pr_err("%s: Failed to request CAM_RST\n", __func__);
> +               goto fail_gpio_cam_rst;
> +       }
> +
> +       gpio_direction_output(GPIO50_nCAM_EN, 1);
> +       gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
> +
> +       return 0;
> +
> +fail_gpio_cam_rst:
> +       gpio_free(GPIO50_nCAM_EN);
> +fail:
> +       return err;
> +}
> +
> +static int a910_camera_power(struct device *dev, int on)
> +{
> +       gpio_set_value(GPIO50_nCAM_EN, !on);
> +       return 0;
> +}
> +
> +static int a910_camera_reset(struct device *dev)
> +{
> +       gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
> +       msleep(10);
> +       gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
> +
> +       return 0;
> +}
> +
> +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> +       .flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +               PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +       .mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a910_camera_i2c_board_info = {
> +       I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a910_iclink = {
> +       .bus_id         = 0,
> +       .i2c_adapter_id = 0,
> +       .board_info     = &a910_camera_i2c_board_info,
> +       .module_name    = "mt9m111",
> +       .power          = a910_camera_power,
> +       .reset          = a910_camera_reset,
> +};
> +
> +static struct platform_device a910_camera = {
> +       .name   = "soc-camera-pdrv",
> +       .id     = 0,
> +       .dev    = {
> +               .platform_data = &a910_iclink,
> +       },
> +};
> +
>  static struct platform_device *a910_devices[] __initdata = {
>        &a910_gpio_keys,
> +       &a910_camera,
>  };
>
>  static void __init a910_init(void)
> @@ -880,6 +1041,9 @@ static void __init a910_init(void)
>
>        pxa_set_keypad_info(&a910_keypad_platform_data);
>
> +       a910_camera_init();
> +       pxa_set_camera_info(&a910_pxacamera_platform_data);
> +
>        platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>        platform_add_devices(ARRAY_AND_SIZE(a910_devices));
>  }
> --
> tg: (639a58f..) ezx/mach/camera_new (depends on: master)
>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v3] Add camera support for A780 and A910 EZX phones
@ 2009-11-11 13:55                           ` Eric Miao
  0 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-11 13:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 11, 2009 at 7:01 PM, Antonio Ospite
<ospite@studenti.unina.it> wrote:
> Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
>
> ---
> Changes since v2:
>
> ?- Bart's SOB goes first, as he is the original author.
> ?- Add MFP_LPM_DRIVE_HIGH to camera gpios, as per Motorola original
> ? code.
> ?- s/pxacamera/camera/ in function names, as they are not used in
> ? pxacamera_platform_data
> ?- Adjust comments about CAM_RST which is active on rising edge
> ?- Saner default values for nCAM_EN and CAM_RST gpios
> ?- Setup gpios statically at board init.
>
> Eric, if it is easier for you I can send the three patches together again.
>

That's OK, I can find the rest two :)

Guennadi,

I need your Acked-by or Reviewed-by please.

> Thanks,
> ? Antonio
>
> ?arch/arm/mach-pxa/ezx.c | ?172 +++++++++++++++++++++++++++++++++++++++++++++-
> ?1 files changed, 168 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index 588b265..74423a6 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -17,8 +17,11 @@
> ?#include <linux/delay.h>
> ?#include <linux/pwm_backlight.h>
> ?#include <linux/input.h>
> +#include <linux/gpio.h>
> ?#include <linux/gpio_keys.h>
>
> +#include <media/soc_camera.h>
> +
> ?#include <asm/setup.h>
> ?#include <asm/mach-types.h>
> ?#include <asm/mach/arch.h>
> @@ -29,6 +32,7 @@
> ?#include <plat/i2c.h>
> ?#include <mach/hardware.h>
> ?#include <mach/pxa27x_keypad.h>
> +#include <mach/camera.h>
>
> ?#include "devices.h"
> ?#include "generic.h"
> @@ -38,6 +42,9 @@
> ?#define GPIO15_A910_FLIP_LID ? ? ? ? ? 15
> ?#define GPIO12_E680_LOCK_SWITCH ? ? ? ?12
> ?#define GPIO15_E6_LOCK_SWITCH ? ? ? ? ?15
> +#define GPIO50_nCAM_EN ? ? ? ? ? ? ? ? 50
> +#define GPIO19_GEN1_CAM_RST ? ? ? ? ? ?19
> +#define GPIO28_GEN2_CAM_RST ? ? ? ? ? ?28
>
> ?static struct platform_pwm_backlight_data ezx_backlight_data = {
> ? ? ? ?.pwm_id ? ? ? ? = 0,
> @@ -191,8 +198,8 @@ static unsigned long gen1_pin_config[] __initdata = {
> ? ? ? ?GPIO94_CIF_DD_5,
> ? ? ? ?GPIO17_CIF_DD_6,
> ? ? ? ?GPIO108_CIF_DD_7,
> - ? ? ? GPIO50_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* CAM_EN */
> - ? ? ? GPIO19_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* CAM_RST */
> + ? ? ? GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, ? ? ? /* CAM_EN */
> + ? ? ? GPIO19_GPIO | MFP_LPM_DRIVE_HIGH, ? ? ? /* CAM_RST */
>
> ? ? ? ?/* EMU */
> ? ? ? ?GPIO120_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? /* EMU_MUX1 */
> @@ -248,8 +255,8 @@ static unsigned long gen2_pin_config[] __initdata = {
> ? ? ? ?GPIO48_CIF_DD_5,
> ? ? ? ?GPIO93_CIF_DD_6,
> ? ? ? ?GPIO12_CIF_DD_7,
> - ? ? ? GPIO50_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* CAM_EN */
> - ? ? ? GPIO28_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* CAM_RST */
> + ? ? ? GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, ? ? ? /* CAM_EN */
> + ? ? ? GPIO28_GPIO | MFP_LPM_DRIVE_HIGH, ? ? ? /* CAM_RST */
> ? ? ? ?GPIO17_GPIO, ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* CAM_FLASH */
> ?};
> ?#endif
> @@ -683,8 +690,84 @@ static struct platform_device a780_gpio_keys = {
> ? ? ? ?},
> ?};
>
> +/* camera */
> +static int a780_camera_init(void)
> +{
> + ? ? ? int err;
> +
> + ? ? ? /*
> + ? ? ? ?* GPIO50_nCAM_EN is active low
> + ? ? ? ?* GPIO19_GEN1_CAM_RST is active on rising edge
> + ? ? ? ?*/
> + ? ? ? err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> + ? ? ? if (err) {
> + ? ? ? ? ? ? ? pr_err("%s: Failed to request nCAM_EN\n", __func__);
> + ? ? ? ? ? ? ? goto fail;
> + ? ? ? }
> +
> + ? ? ? err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> + ? ? ? if (err) {
> + ? ? ? ? ? ? ? pr_err("%s: Failed to request CAM_RST\n", __func__);
> + ? ? ? ? ? ? ? goto fail_gpio_cam_rst;
> + ? ? ? }
> +
> + ? ? ? gpio_direction_output(GPIO50_nCAM_EN, 1);
> + ? ? ? gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
> +
> + ? ? ? return 0;
> +
> +fail_gpio_cam_rst:
> + ? ? ? gpio_free(GPIO50_nCAM_EN);
> +fail:
> + ? ? ? return err;
> +}
> +
> +static int a780_camera_power(struct device *dev, int on)
> +{
> + ? ? ? gpio_set_value(GPIO50_nCAM_EN, !on);
> + ? ? ? return 0;
> +}
> +
> +static int a780_camera_reset(struct device *dev)
> +{
> + ? ? ? gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> + ? ? ? msleep(10);
> + ? ? ? gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
> +
> + ? ? ? return 0;
> +}
> +
> +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> + ? ? ? .flags ?= PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> + ? ? ? ? ? ? ? PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> + ? ? ? .mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a780_camera_i2c_board_info = {
> + ? ? ? I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a780_iclink = {
> + ? ? ? .bus_id ? ? ? ? = 0,
> + ? ? ? .flags ? ? ? ? ?= SOCAM_SENSOR_INVERT_PCLK,
> + ? ? ? .i2c_adapter_id = 0,
> + ? ? ? .board_info ? ? = &a780_camera_i2c_board_info,
> + ? ? ? .module_name ? ?= "mt9m111",
> + ? ? ? .power ? ? ? ? ?= a780_camera_power,
> + ? ? ? .reset ? ? ? ? ?= a780_camera_reset,
> +};
> +
> +static struct platform_device a780_camera = {
> + ? ? ? .name ? = "soc-camera-pdrv",
> + ? ? ? .id ? ? = 0,
> + ? ? ? .dev ? ?= {
> + ? ? ? ? ? ? ? .platform_data = &a780_iclink,
> + ? ? ? },
> +};
> +
> ?static struct platform_device *a780_devices[] __initdata = {
> ? ? ? ?&a780_gpio_keys,
> + ? ? ? &a780_camera,
> ?};
>
> ?static void __init a780_init(void)
> @@ -699,6 +782,9 @@ static void __init a780_init(void)
>
> ? ? ? ?pxa_set_keypad_info(&a780_keypad_platform_data);
>
> + ? ? ? a780_camera_init();
> + ? ? ? pxa_set_camera_info(&a780_pxacamera_platform_data);
> +
> ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
> ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(a780_devices));
> ?}
> @@ -864,8 +950,83 @@ static struct platform_device a910_gpio_keys = {
> ? ? ? ?},
> ?};
>
> +/* camera */
> +static int a910_camera_init(void)
> +{
> + ? ? ? int err;
> +
> + ? ? ? /*
> + ? ? ? ?* GPIO50_nCAM_EN is active low
> + ? ? ? ?* GPIO28_GEN2_CAM_RST is active on rising edge
> + ? ? ? ?*/
> + ? ? ? err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> + ? ? ? if (err) {
> + ? ? ? ? ? ? ? pr_err("%s: Failed to request nCAM_EN\n", __func__);
> + ? ? ? ? ? ? ? goto fail;
> + ? ? ? }
> +
> + ? ? ? err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
> + ? ? ? if (err) {
> + ? ? ? ? ? ? ? pr_err("%s: Failed to request CAM_RST\n", __func__);
> + ? ? ? ? ? ? ? goto fail_gpio_cam_rst;
> + ? ? ? }
> +
> + ? ? ? gpio_direction_output(GPIO50_nCAM_EN, 1);
> + ? ? ? gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
> +
> + ? ? ? return 0;
> +
> +fail_gpio_cam_rst:
> + ? ? ? gpio_free(GPIO50_nCAM_EN);
> +fail:
> + ? ? ? return err;
> +}
> +
> +static int a910_camera_power(struct device *dev, int on)
> +{
> + ? ? ? gpio_set_value(GPIO50_nCAM_EN, !on);
> + ? ? ? return 0;
> +}
> +
> +static int a910_camera_reset(struct device *dev)
> +{
> + ? ? ? gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
> + ? ? ? msleep(10);
> + ? ? ? gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
> +
> + ? ? ? return 0;
> +}
> +
> +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> + ? ? ? .flags ?= PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> + ? ? ? ? ? ? ? PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> + ? ? ? .mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a910_camera_i2c_board_info = {
> + ? ? ? I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a910_iclink = {
> + ? ? ? .bus_id ? ? ? ? = 0,
> + ? ? ? .i2c_adapter_id = 0,
> + ? ? ? .board_info ? ? = &a910_camera_i2c_board_info,
> + ? ? ? .module_name ? ?= "mt9m111",
> + ? ? ? .power ? ? ? ? ?= a910_camera_power,
> + ? ? ? .reset ? ? ? ? ?= a910_camera_reset,
> +};
> +
> +static struct platform_device a910_camera = {
> + ? ? ? .name ? = "soc-camera-pdrv",
> + ? ? ? .id ? ? = 0,
> + ? ? ? .dev ? ?= {
> + ? ? ? ? ? ? ? .platform_data = &a910_iclink,
> + ? ? ? },
> +};
> +
> ?static struct platform_device *a910_devices[] __initdata = {
> ? ? ? ?&a910_gpio_keys,
> + ? ? ? &a910_camera,
> ?};
>
> ?static void __init a910_init(void)
> @@ -880,6 +1041,9 @@ static void __init a910_init(void)
>
> ? ? ? ?pxa_set_keypad_info(&a910_keypad_platform_data);
>
> + ? ? ? a910_camera_init();
> + ? ? ? pxa_set_camera_info(&a910_pxacamera_platform_data);
> +
> ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
> ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(a910_devices));
> ?}
> --
> tg: (639a58f..) ezx/mach/camera_new (depends on: master)
>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in
  2009-11-04 21:35 ` [PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in Antonio Ospite
@ 2009-11-11 14:08   ` Antonio Ospite
  2009-11-13  8:25   ` Eric Miao
  1 sibling, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-11 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed,  4 Nov 2009 22:35:01 +0100
Antonio Ospite <ospite@studenti.unina.it> wrote:

> ---

Ah, missed the SOB line here, sorry:

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

> Resent from another place, since it looks like the previous copy has been
> lost by my ISP...
>
>  arch/arm/configs/ezx_defconfig |  947 ++++++++++++++++++++++++++++------------
>  1 files changed, 667 insertions(+), 280 deletions(-)
> 
> diff --git a/arch/arm/configs/ezx_defconfig b/arch/arm/configs/ezx_defconfig
> index d5ee16e..492f29a 100644
> --- a/arch/arm/configs/ezx_defconfig
> +++ b/arch/arm/configs/ezx_defconfig
> @@ -1,7 +1,7 @@
>  #
>  # Automatically generated make config: don't edit
> -# Linux kernel version: 2.6.26-rc3
> -# Mon Jul  7 17:52:21 2008
> +# Linux kernel version: 2.6.32-rc5
> +# Mon Nov  2 13:18:50 2009
[...]

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091111/a3c3247a/attachment.sig>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v3] Add camera support for A780 and A910 EZX phones
  2009-11-11 11:01                         ` Antonio Ospite
@ 2009-11-11 18:02                           ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-11 18:02 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: linux-arm-kernel, linux-arm-kernel, Eric Miao, openezx-devel,
	Bart Visscher, Linux Media Mailing List

Hi Antonio

Still one more nitpick:

On Wed, 11 Nov 2009, Antonio Ospite wrote:

> Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> 
> ---
> Changes since v2:
> 
>  - Bart's SOB goes first, as he is the original author.
>  - Add MFP_LPM_DRIVE_HIGH to camera gpios, as per Motorola original
>    code.
>  - s/pxacamera/camera/ in function names, as they are not used in
>    pxacamera_platform_data
>  - Adjust comments about CAM_RST which is active on rising edge
>  - Saner default values for nCAM_EN and CAM_RST gpios
>  - Setup gpios statically at board init.
> 
> Eric, if it is easier for you I can send the three patches together again.
> 
> Thanks,
>    Antonio
>  
>  arch/arm/mach-pxa/ezx.c |  172 +++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 168 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index 588b265..74423a6 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -17,8 +17,11 @@
>  #include <linux/delay.h>
>  #include <linux/pwm_backlight.h>
>  #include <linux/input.h>
> +#include <linux/gpio.h>
>  #include <linux/gpio_keys.h>
>  
> +#include <media/soc_camera.h>
> +
>  #include <asm/setup.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> @@ -29,6 +32,7 @@
>  #include <plat/i2c.h>
>  #include <mach/hardware.h>
>  #include <mach/pxa27x_keypad.h>
> +#include <mach/camera.h>
>  
>  #include "devices.h"
>  #include "generic.h"
> @@ -38,6 +42,9 @@
>  #define GPIO15_A910_FLIP_LID 		15
>  #define GPIO12_E680_LOCK_SWITCH 	12
>  #define GPIO15_E6_LOCK_SWITCH 		15
> +#define GPIO50_nCAM_EN			50
> +#define GPIO19_GEN1_CAM_RST		19
> +#define GPIO28_GEN2_CAM_RST		28
>  
>  static struct platform_pwm_backlight_data ezx_backlight_data = {
>  	.pwm_id		= 0,
> @@ -191,8 +198,8 @@ static unsigned long gen1_pin_config[] __initdata = {
>  	GPIO94_CIF_DD_5,
>  	GPIO17_CIF_DD_6,
>  	GPIO108_CIF_DD_7,
> -	GPIO50_GPIO,				/* CAM_EN */
> -	GPIO19_GPIO,				/* CAM_RST */
> +	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
> +	GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
>  
>  	/* EMU */
>  	GPIO120_GPIO,				/* EMU_MUX1 */
> @@ -248,8 +255,8 @@ static unsigned long gen2_pin_config[] __initdata = {
>  	GPIO48_CIF_DD_5,
>  	GPIO93_CIF_DD_6,
>  	GPIO12_CIF_DD_7,
> -	GPIO50_GPIO,				/* CAM_EN */
> -	GPIO28_GPIO,				/* CAM_RST */
> +	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
> +	GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
>  	GPIO17_GPIO,				/* CAM_FLASH */
>  };
>  #endif
> @@ -683,8 +690,84 @@ static struct platform_device a780_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a780_camera_init(void)

This function returns an error but...

> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO19_GEN1_CAM_RST is active on rising edge
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 1);
> +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a780_camera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);
> +	return 0;
> +}
> +
> +static int a780_camera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a780_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a780_iclink = {
> +	.bus_id         = 0,
> +	.flags          = SOCAM_SENSOR_INVERT_PCLK,
> +	.i2c_adapter_id = 0,
> +	.board_info     = &a780_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a780_camera_power,
> +	.reset          = a780_camera_reset,
> +};
> +
> +static struct platform_device a780_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a780_iclink,
> +	},
> +};
> +
>  static struct platform_device *a780_devices[] __initdata = {
>  	&a780_gpio_keys,
> +	&a780_camera,
>  };
>  
>  static void __init a780_init(void)
> @@ -699,6 +782,9 @@ static void __init a780_init(void)
>  
>  	pxa_set_keypad_info(&a780_keypad_platform_data);
>  
> +	a780_camera_init();

...it is not used. So, I would either make it void, or check the return 
code, and maybe even not register the camera since it's going to be 
useless anyway? Same for a910.

> +	pxa_set_camera_info(&a780_pxacamera_platform_data);
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
>  }
> @@ -864,8 +950,83 @@ static struct platform_device a910_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a910_camera_init(void)
> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO28_GEN2_CAM_RST is active on rising edge
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 1);
> +	gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a910_camera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);
> +	return 0;
> +}
> +
> +static int a910_camera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a910_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a910_iclink = {
> +	.bus_id         = 0,
> +	.i2c_adapter_id = 0,
> +	.board_info     = &a910_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a910_camera_power,
> +	.reset          = a910_camera_reset,
> +};
> +
> +static struct platform_device a910_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a910_iclink,
> +	},
> +};
> +
>  static struct platform_device *a910_devices[] __initdata = {
>  	&a910_gpio_keys,
> +	&a910_camera,
>  };
>  
>  static void __init a910_init(void)
> @@ -880,6 +1041,9 @@ static void __init a910_init(void)
>  
>  	pxa_set_keypad_info(&a910_keypad_platform_data);
>  
> +	a910_camera_init();
> +	pxa_set_camera_info(&a910_pxacamera_platform_data);
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
>  }
> -- 
> tg: (639a58f..) ezx/mach/camera_new (depends on: master)
> 

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v3] Add camera support for A780 and A910 EZX phones
@ 2009-11-11 18:02                           ` Guennadi Liakhovetski
  0 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-11 18:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Antonio

Still one more nitpick:

On Wed, 11 Nov 2009, Antonio Ospite wrote:

> Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> 
> ---
> Changes since v2:
> 
>  - Bart's SOB goes first, as he is the original author.
>  - Add MFP_LPM_DRIVE_HIGH to camera gpios, as per Motorola original
>    code.
>  - s/pxacamera/camera/ in function names, as they are not used in
>    pxacamera_platform_data
>  - Adjust comments about CAM_RST which is active on rising edge
>  - Saner default values for nCAM_EN and CAM_RST gpios
>  - Setup gpios statically at board init.
> 
> Eric, if it is easier for you I can send the three patches together again.
> 
> Thanks,
>    Antonio
>  
>  arch/arm/mach-pxa/ezx.c |  172 +++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 168 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index 588b265..74423a6 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -17,8 +17,11 @@
>  #include <linux/delay.h>
>  #include <linux/pwm_backlight.h>
>  #include <linux/input.h>
> +#include <linux/gpio.h>
>  #include <linux/gpio_keys.h>
>  
> +#include <media/soc_camera.h>
> +
>  #include <asm/setup.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> @@ -29,6 +32,7 @@
>  #include <plat/i2c.h>
>  #include <mach/hardware.h>
>  #include <mach/pxa27x_keypad.h>
> +#include <mach/camera.h>
>  
>  #include "devices.h"
>  #include "generic.h"
> @@ -38,6 +42,9 @@
>  #define GPIO15_A910_FLIP_LID 		15
>  #define GPIO12_E680_LOCK_SWITCH 	12
>  #define GPIO15_E6_LOCK_SWITCH 		15
> +#define GPIO50_nCAM_EN			50
> +#define GPIO19_GEN1_CAM_RST		19
> +#define GPIO28_GEN2_CAM_RST		28
>  
>  static struct platform_pwm_backlight_data ezx_backlight_data = {
>  	.pwm_id		= 0,
> @@ -191,8 +198,8 @@ static unsigned long gen1_pin_config[] __initdata = {
>  	GPIO94_CIF_DD_5,
>  	GPIO17_CIF_DD_6,
>  	GPIO108_CIF_DD_7,
> -	GPIO50_GPIO,				/* CAM_EN */
> -	GPIO19_GPIO,				/* CAM_RST */
> +	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
> +	GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
>  
>  	/* EMU */
>  	GPIO120_GPIO,				/* EMU_MUX1 */
> @@ -248,8 +255,8 @@ static unsigned long gen2_pin_config[] __initdata = {
>  	GPIO48_CIF_DD_5,
>  	GPIO93_CIF_DD_6,
>  	GPIO12_CIF_DD_7,
> -	GPIO50_GPIO,				/* CAM_EN */
> -	GPIO28_GPIO,				/* CAM_RST */
> +	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
> +	GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
>  	GPIO17_GPIO,				/* CAM_FLASH */
>  };
>  #endif
> @@ -683,8 +690,84 @@ static struct platform_device a780_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a780_camera_init(void)

This function returns an error but...

> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO19_GEN1_CAM_RST is active on rising edge
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 1);
> +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a780_camera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);
> +	return 0;
> +}
> +
> +static int a780_camera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a780_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a780_iclink = {
> +	.bus_id         = 0,
> +	.flags          = SOCAM_SENSOR_INVERT_PCLK,
> +	.i2c_adapter_id = 0,
> +	.board_info     = &a780_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a780_camera_power,
> +	.reset          = a780_camera_reset,
> +};
> +
> +static struct platform_device a780_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a780_iclink,
> +	},
> +};
> +
>  static struct platform_device *a780_devices[] __initdata = {
>  	&a780_gpio_keys,
> +	&a780_camera,
>  };
>  
>  static void __init a780_init(void)
> @@ -699,6 +782,9 @@ static void __init a780_init(void)
>  
>  	pxa_set_keypad_info(&a780_keypad_platform_data);
>  
> +	a780_camera_init();

...it is not used. So, I would either make it void, or check the return 
code, and maybe even not register the camera since it's going to be 
useless anyway? Same for a910.

> +	pxa_set_camera_info(&a780_pxacamera_platform_data);
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
>  }
> @@ -864,8 +950,83 @@ static struct platform_device a910_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a910_camera_init(void)
> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO28_GEN2_CAM_RST is active on rising edge
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 1);
> +	gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a910_camera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);
> +	return 0;
> +}
> +
> +static int a910_camera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a910_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a910_iclink = {
> +	.bus_id         = 0,
> +	.i2c_adapter_id = 0,
> +	.board_info     = &a910_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a910_camera_power,
> +	.reset          = a910_camera_reset,
> +};
> +
> +static struct platform_device a910_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a910_iclink,
> +	},
> +};
> +
>  static struct platform_device *a910_devices[] __initdata = {
>  	&a910_gpio_keys,
> +	&a910_camera,
>  };
>  
>  static void __init a910_init(void)
> @@ -880,6 +1041,9 @@ static void __init a910_init(void)
>  
>  	pxa_set_keypad_info(&a910_keypad_platform_data);
>  
> +	a910_camera_init();
> +	pxa_set_camera_info(&a910_pxacamera_platform_data);
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
>  }
> -- 
> tg: (639a58f..) ezx/mach/camera_new (depends on: master)
> 

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v3] Add camera support for A780 and A910 EZX phones
  2009-11-11 18:02                           ` Guennadi Liakhovetski
@ 2009-11-12 14:41                             ` Antonio Ospite
  -1 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-12 14:41 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-arm-kernel, Eric Miao, openezx-devel, Bart Visscher,
	Linux Media Mailing List

[-- Attachment #1: Type: text/plain, Size: 3329 bytes --]

On Wed, 11 Nov 2009 19:02:11 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> Hi Antonio
> 
> Still one more nitpick:
>

Comments below.

> On Wed, 11 Nov 2009, Antonio Ospite wrote:
> 
[...]
> >  
> > +/* camera */
> > +static int a780_camera_init(void)
> 
> This function returns an error but...
> 
> > +{
> > +	int err;
> > +
> > +	/*
> > +	 * GPIO50_nCAM_EN is active low
> > +	 * GPIO19_GEN1_CAM_RST is active on rising edge
> > +	 */
> > +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> > +	if (err) {
> > +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> > +		goto fail;
> > +	}
[...]
> > +	return err;
> > +}
> > +
[...]
> >  static void __init a780_init(void)
> > @@ -699,6 +782,9 @@ static void __init a780_init(void)
> >  
> >  	pxa_set_keypad_info(&a780_keypad_platform_data);
> >  
> > +	a780_camera_init();
> 
> ...it is not used. So, I would either make it void, or check the return 
> code, and maybe even not register the camera since it's going to be 
> useless anyway? Same for a910.
>

Actually I was keeping returning an error just in case there would be a
soc-camera .init() someday. But it's indeed a good idea to check the
return value once that we have it.

I am inlining here only the incremental change for a faster review,
I am going to send v4 of the patch separately for you ACK, hopefully :).

Note, now the return value of platform_device_register is ignored but
this is not grave, I guess.

Thanks for your time,
   Antonio

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 74423a6..1a73b7b 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -767,7 +767,6 @@ static struct platform_device a780_camera = {
 
 static struct platform_device *a780_devices[] __initdata = {
 	&a780_gpio_keys,
-	&a780_camera,
 };
 
 static void __init a780_init(void)
@@ -782,8 +781,10 @@ static void __init a780_init(void)
 
 	pxa_set_keypad_info(&a780_keypad_platform_data);
 
-	a780_camera_init();
-	pxa_set_camera_info(&a780_pxacamera_platform_data);
+	if (a780_camera_init() == 0) {
+		pxa_set_camera_info(&a780_pxacamera_platform_data);
+		platform_device_register(&a780_camera);
+	}
 
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
@@ -1026,7 +1027,6 @@ static struct platform_device a910_camera = {
 
 static struct platform_device *a910_devices[] __initdata = {
 	&a910_gpio_keys,
-	&a910_camera,
 };
 
 static void __init a910_init(void)
@@ -1041,8 +1041,10 @@ static void __init a910_init(void)
 
 	pxa_set_keypad_info(&a910_keypad_platform_data);
 
-	a910_camera_init();
-	pxa_set_camera_info(&a910_pxacamera_platform_data);
+	if (a910_camera_init() == 0) {
+		pxa_set_camera_info(&a910_pxacamera_platform_data);
+		platform_device_register(&a910_camera);
+	}
 
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a910_devices));


-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v3] Add camera support for A780 and A910 EZX phones
@ 2009-11-12 14:41                             ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-12 14:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 11 Nov 2009 19:02:11 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> Hi Antonio
> 
> Still one more nitpick:
>

Comments below.

> On Wed, 11 Nov 2009, Antonio Ospite wrote:
> 
[...]
> >  
> > +/* camera */
> > +static int a780_camera_init(void)
> 
> This function returns an error but...
> 
> > +{
> > +	int err;
> > +
> > +	/*
> > +	 * GPIO50_nCAM_EN is active low
> > +	 * GPIO19_GEN1_CAM_RST is active on rising edge
> > +	 */
> > +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> > +	if (err) {
> > +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> > +		goto fail;
> > +	}
[...]
> > +	return err;
> > +}
> > +
[...]
> >  static void __init a780_init(void)
> > @@ -699,6 +782,9 @@ static void __init a780_init(void)
> >  
> >  	pxa_set_keypad_info(&a780_keypad_platform_data);
> >  
> > +	a780_camera_init();
> 
> ...it is not used. So, I would either make it void, or check the return 
> code, and maybe even not register the camera since it's going to be 
> useless anyway? Same for a910.
>

Actually I was keeping returning an error just in case there would be a
soc-camera .init() someday. But it's indeed a good idea to check the
return value once that we have it.

I am inlining here only the incremental change for a faster review,
I am going to send v4 of the patch separately for you ACK, hopefully :).

Note, now the return value of platform_device_register is ignored but
this is not grave, I guess.

Thanks for your time,
   Antonio

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 74423a6..1a73b7b 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -767,7 +767,6 @@ static struct platform_device a780_camera = {
 
 static struct platform_device *a780_devices[] __initdata = {
 	&a780_gpio_keys,
-	&a780_camera,
 };
 
 static void __init a780_init(void)
@@ -782,8 +781,10 @@ static void __init a780_init(void)
 
 	pxa_set_keypad_info(&a780_keypad_platform_data);
 
-	a780_camera_init();
-	pxa_set_camera_info(&a780_pxacamera_platform_data);
+	if (a780_camera_init() == 0) {
+		pxa_set_camera_info(&a780_pxacamera_platform_data);
+		platform_device_register(&a780_camera);
+	}
 
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
@@ -1026,7 +1027,6 @@ static struct platform_device a910_camera = {
 
 static struct platform_device *a910_devices[] __initdata = {
 	&a910_gpio_keys,
-	&a910_camera,
 };
 
 static void __init a910_init(void)
@@ -1041,8 +1041,10 @@ static void __init a910_init(void)
 
 	pxa_set_keypad_info(&a910_keypad_platform_data);
 
-	a910_camera_init();
-	pxa_set_camera_info(&a910_pxacamera_platform_data);
+	if (a910_camera_init() == 0) {
+		pxa_set_camera_info(&a910_pxacamera_platform_data);
+		platform_device_register(&a910_camera);
+	}
 
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a910_devices));


-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091112/ff2fa21b/attachment.sig>

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v4] Add camera support for A780 and A910 EZX phones
  2009-11-11 18:02                           ` Guennadi Liakhovetski
@ 2009-11-12 14:47                             ` Antonio Ospite
  -1 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-12 14:47 UTC (permalink / raw)
  To: linux-arm-kernel, linux-arm-kernel
  Cc: Antonio Ospite, Eric Miao, openezx-devel, Bart Visscher,
	linux-media, Guennadi Liakhovetski

Signed-off-by: Bart Visscher <bartv@thisnet.nl>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
Changes since v3:
 - Check {a780,a910}_camera_init() return value, and register camera
   conditionally.

 arch/arm/mach-pxa/ezx.c |  174 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 170 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 588b265..46c32cf 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -17,8 +17,11 @@
 #include <linux/delay.h>
 #include <linux/pwm_backlight.h>
 #include <linux/input.h>
+#include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 
+#include <media/soc_camera.h>
+
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -29,6 +32,7 @@
 #include <plat/i2c.h>
 #include <mach/hardware.h>
 #include <mach/pxa27x_keypad.h>
+#include <mach/camera.h>
 
 #include "devices.h"
 #include "generic.h"
@@ -38,6 +42,9 @@
 #define GPIO15_A910_FLIP_LID 		15
 #define GPIO12_E680_LOCK_SWITCH 	12
 #define GPIO15_E6_LOCK_SWITCH 		15
+#define GPIO50_nCAM_EN			50
+#define GPIO19_GEN1_CAM_RST		19
+#define GPIO28_GEN2_CAM_RST		28
 
 static struct platform_pwm_backlight_data ezx_backlight_data = {
 	.pwm_id		= 0,
@@ -191,8 +198,8 @@ static unsigned long gen1_pin_config[] __initdata = {
 	GPIO94_CIF_DD_5,
 	GPIO17_CIF_DD_6,
 	GPIO108_CIF_DD_7,
-	GPIO50_GPIO,				/* CAM_EN */
-	GPIO19_GPIO,				/* CAM_RST */
+	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
+	GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
 
 	/* EMU */
 	GPIO120_GPIO,				/* EMU_MUX1 */
@@ -248,8 +255,8 @@ static unsigned long gen2_pin_config[] __initdata = {
 	GPIO48_CIF_DD_5,
 	GPIO93_CIF_DD_6,
 	GPIO12_CIF_DD_7,
-	GPIO50_GPIO,				/* CAM_EN */
-	GPIO28_GPIO,				/* CAM_RST */
+	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
+	GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
 	GPIO17_GPIO,				/* CAM_FLASH */
 };
 #endif
@@ -683,6 +690,81 @@ static struct platform_device a780_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a780_camera_init(void)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO19_GEN1_CAM_RST is active on rising edge
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 1);
+	gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a780_camera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a780_camera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a780_pxacamera_platform_data = {
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a780_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a780_iclink = {
+	.bus_id         = 0,
+	.flags          = SOCAM_SENSOR_INVERT_PCLK,
+	.i2c_adapter_id = 0,
+	.board_info     = &a780_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a780_camera_power,
+	.reset          = a780_camera_reset,
+};
+
+static struct platform_device a780_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a780_iclink,
+	},
+};
+
 static struct platform_device *a780_devices[] __initdata = {
 	&a780_gpio_keys,
 };
@@ -699,6 +781,11 @@ static void __init a780_init(void)
 
 	pxa_set_keypad_info(&a780_keypad_platform_data);
 
+	if (a780_camera_init() == 0) {
+		pxa_set_camera_info(&a780_pxacamera_platform_data);
+		platform_device_register(&a780_camera);
+	}
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
 }
@@ -864,6 +951,80 @@ static struct platform_device a910_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a910_camera_init(void)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO28_GEN2_CAM_RST is active on rising edge
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 1);
+	gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a910_camera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a910_camera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a910_pxacamera_platform_data = {
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a910_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a910_iclink = {
+	.bus_id         = 0,
+	.i2c_adapter_id = 0,
+	.board_info     = &a910_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a910_camera_power,
+	.reset          = a910_camera_reset,
+};
+
+static struct platform_device a910_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a910_iclink,
+	},
+};
+
 static struct platform_device *a910_devices[] __initdata = {
 	&a910_gpio_keys,
 };
@@ -880,6 +1041,11 @@ static void __init a910_init(void)
 
 	pxa_set_keypad_info(&a910_keypad_platform_data);
 
+	if (a910_camera_init() == 0) {
+		pxa_set_camera_info(&a910_pxacamera_platform_data);
+		platform_device_register(&a910_camera);
+	}
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
 }
-- 
tg: (639a58f..) ezx/mach/camera_new (depends on: master)

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v4] Add camera support for A780 and A910 EZX phones
@ 2009-11-12 14:47                             ` Antonio Ospite
  0 siblings, 0 replies; 63+ messages in thread
From: Antonio Ospite @ 2009-11-12 14:47 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Bart Visscher <bartv@thisnet.nl>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
Changes since v3:
 - Check {a780,a910}_camera_init() return value, and register camera
   conditionally.

 arch/arm/mach-pxa/ezx.c |  174 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 170 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 588b265..46c32cf 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -17,8 +17,11 @@
 #include <linux/delay.h>
 #include <linux/pwm_backlight.h>
 #include <linux/input.h>
+#include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 
+#include <media/soc_camera.h>
+
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -29,6 +32,7 @@
 #include <plat/i2c.h>
 #include <mach/hardware.h>
 #include <mach/pxa27x_keypad.h>
+#include <mach/camera.h>
 
 #include "devices.h"
 #include "generic.h"
@@ -38,6 +42,9 @@
 #define GPIO15_A910_FLIP_LID 		15
 #define GPIO12_E680_LOCK_SWITCH 	12
 #define GPIO15_E6_LOCK_SWITCH 		15
+#define GPIO50_nCAM_EN			50
+#define GPIO19_GEN1_CAM_RST		19
+#define GPIO28_GEN2_CAM_RST		28
 
 static struct platform_pwm_backlight_data ezx_backlight_data = {
 	.pwm_id		= 0,
@@ -191,8 +198,8 @@ static unsigned long gen1_pin_config[] __initdata = {
 	GPIO94_CIF_DD_5,
 	GPIO17_CIF_DD_6,
 	GPIO108_CIF_DD_7,
-	GPIO50_GPIO,				/* CAM_EN */
-	GPIO19_GPIO,				/* CAM_RST */
+	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
+	GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
 
 	/* EMU */
 	GPIO120_GPIO,				/* EMU_MUX1 */
@@ -248,8 +255,8 @@ static unsigned long gen2_pin_config[] __initdata = {
 	GPIO48_CIF_DD_5,
 	GPIO93_CIF_DD_6,
 	GPIO12_CIF_DD_7,
-	GPIO50_GPIO,				/* CAM_EN */
-	GPIO28_GPIO,				/* CAM_RST */
+	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
+	GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
 	GPIO17_GPIO,				/* CAM_FLASH */
 };
 #endif
@@ -683,6 +690,81 @@ static struct platform_device a780_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a780_camera_init(void)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO19_GEN1_CAM_RST is active on rising edge
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 1);
+	gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a780_camera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a780_camera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a780_pxacamera_platform_data = {
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a780_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a780_iclink = {
+	.bus_id         = 0,
+	.flags          = SOCAM_SENSOR_INVERT_PCLK,
+	.i2c_adapter_id = 0,
+	.board_info     = &a780_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a780_camera_power,
+	.reset          = a780_camera_reset,
+};
+
+static struct platform_device a780_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a780_iclink,
+	},
+};
+
 static struct platform_device *a780_devices[] __initdata = {
 	&a780_gpio_keys,
 };
@@ -699,6 +781,11 @@ static void __init a780_init(void)
 
 	pxa_set_keypad_info(&a780_keypad_platform_data);
 
+	if (a780_camera_init() == 0) {
+		pxa_set_camera_info(&a780_pxacamera_platform_data);
+		platform_device_register(&a780_camera);
+	}
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
 }
@@ -864,6 +951,80 @@ static struct platform_device a910_gpio_keys = {
 	},
 };
 
+/* camera */
+static int a910_camera_init(void)
+{
+	int err;
+
+	/*
+	 * GPIO50_nCAM_EN is active low
+	 * GPIO28_GEN2_CAM_RST is active on rising edge
+	 */
+	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
+	if (err) {
+		pr_err("%s: Failed to request nCAM_EN\n", __func__);
+		goto fail;
+	}
+
+	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
+	if (err) {
+		pr_err("%s: Failed to request CAM_RST\n", __func__);
+		goto fail_gpio_cam_rst;
+	}
+
+	gpio_direction_output(GPIO50_nCAM_EN, 1);
+	gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
+
+	return 0;
+
+fail_gpio_cam_rst:
+	gpio_free(GPIO50_nCAM_EN);
+fail:
+	return err;
+}
+
+static int a910_camera_power(struct device *dev, int on)
+{
+	gpio_set_value(GPIO50_nCAM_EN, !on);
+	return 0;
+}
+
+static int a910_camera_reset(struct device *dev)
+{
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
+	msleep(10);
+	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
+
+	return 0;
+}
+
+struct pxacamera_platform_data a910_pxacamera_platform_data = {
+	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+	.mclk_10khz = 5000,
+};
+
+static struct i2c_board_info a910_camera_i2c_board_info = {
+	I2C_BOARD_INFO("mt9m111", 0x5d),
+};
+
+static struct soc_camera_link a910_iclink = {
+	.bus_id         = 0,
+	.i2c_adapter_id = 0,
+	.board_info     = &a910_camera_i2c_board_info,
+	.module_name    = "mt9m111",
+	.power          = a910_camera_power,
+	.reset          = a910_camera_reset,
+};
+
+static struct platform_device a910_camera = {
+	.name   = "soc-camera-pdrv",
+	.id     = 0,
+	.dev    = {
+		.platform_data = &a910_iclink,
+	},
+};
+
 static struct platform_device *a910_devices[] __initdata = {
 	&a910_gpio_keys,
 };
@@ -880,6 +1041,11 @@ static void __init a910_init(void)
 
 	pxa_set_keypad_info(&a910_keypad_platform_data);
 
+	if (a910_camera_init() == 0) {
+		pxa_set_camera_info(&a910_pxacamera_platform_data);
+		platform_device_register(&a910_camera);
+	}
+
 	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
 	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
 }
-- 
tg: (639a58f..) ezx/mach/camera_new (depends on: master)

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v4] Add camera support for A780 and A910 EZX phones
  2009-11-12 14:47                             ` Antonio Ospite
@ 2009-11-12 20:49                               ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-12 20:49 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: linux-arm-kernel, linux-arm-kernel, Eric Miao, openezx-devel,
	Bart Visscher, Linux Media Mailing List

On Thu, 12 Nov 2009, Antonio Ospite wrote:

> Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Thanks
Guennadi

> ---
> Changes since v3:
>  - Check {a780,a910}_camera_init() return value, and register camera
>    conditionally.
> 
>  arch/arm/mach-pxa/ezx.c |  174 +++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 170 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index 588b265..46c32cf 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -17,8 +17,11 @@
>  #include <linux/delay.h>
>  #include <linux/pwm_backlight.h>
>  #include <linux/input.h>
> +#include <linux/gpio.h>
>  #include <linux/gpio_keys.h>
>  
> +#include <media/soc_camera.h>
> +
>  #include <asm/setup.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> @@ -29,6 +32,7 @@
>  #include <plat/i2c.h>
>  #include <mach/hardware.h>
>  #include <mach/pxa27x_keypad.h>
> +#include <mach/camera.h>
>  
>  #include "devices.h"
>  #include "generic.h"
> @@ -38,6 +42,9 @@
>  #define GPIO15_A910_FLIP_LID 		15
>  #define GPIO12_E680_LOCK_SWITCH 	12
>  #define GPIO15_E6_LOCK_SWITCH 		15
> +#define GPIO50_nCAM_EN			50
> +#define GPIO19_GEN1_CAM_RST		19
> +#define GPIO28_GEN2_CAM_RST		28
>  
>  static struct platform_pwm_backlight_data ezx_backlight_data = {
>  	.pwm_id		= 0,
> @@ -191,8 +198,8 @@ static unsigned long gen1_pin_config[] __initdata = {
>  	GPIO94_CIF_DD_5,
>  	GPIO17_CIF_DD_6,
>  	GPIO108_CIF_DD_7,
> -	GPIO50_GPIO,				/* CAM_EN */
> -	GPIO19_GPIO,				/* CAM_RST */
> +	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
> +	GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
>  
>  	/* EMU */
>  	GPIO120_GPIO,				/* EMU_MUX1 */
> @@ -248,8 +255,8 @@ static unsigned long gen2_pin_config[] __initdata = {
>  	GPIO48_CIF_DD_5,
>  	GPIO93_CIF_DD_6,
>  	GPIO12_CIF_DD_7,
> -	GPIO50_GPIO,				/* CAM_EN */
> -	GPIO28_GPIO,				/* CAM_RST */
> +	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
> +	GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
>  	GPIO17_GPIO,				/* CAM_FLASH */
>  };
>  #endif
> @@ -683,6 +690,81 @@ static struct platform_device a780_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a780_camera_init(void)
> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO19_GEN1_CAM_RST is active on rising edge
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 1);
> +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a780_camera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);
> +	return 0;
> +}
> +
> +static int a780_camera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a780_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a780_iclink = {
> +	.bus_id         = 0,
> +	.flags          = SOCAM_SENSOR_INVERT_PCLK,
> +	.i2c_adapter_id = 0,
> +	.board_info     = &a780_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a780_camera_power,
> +	.reset          = a780_camera_reset,
> +};
> +
> +static struct platform_device a780_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a780_iclink,
> +	},
> +};
> +
>  static struct platform_device *a780_devices[] __initdata = {
>  	&a780_gpio_keys,
>  };
> @@ -699,6 +781,11 @@ static void __init a780_init(void)
>  
>  	pxa_set_keypad_info(&a780_keypad_platform_data);
>  
> +	if (a780_camera_init() == 0) {
> +		pxa_set_camera_info(&a780_pxacamera_platform_data);
> +		platform_device_register(&a780_camera);
> +	}
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
>  }
> @@ -864,6 +951,80 @@ static struct platform_device a910_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a910_camera_init(void)
> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO28_GEN2_CAM_RST is active on rising edge
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 1);
> +	gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a910_camera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);
> +	return 0;
> +}
> +
> +static int a910_camera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a910_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a910_iclink = {
> +	.bus_id         = 0,
> +	.i2c_adapter_id = 0,
> +	.board_info     = &a910_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a910_camera_power,
> +	.reset          = a910_camera_reset,
> +};
> +
> +static struct platform_device a910_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a910_iclink,
> +	},
> +};
> +
>  static struct platform_device *a910_devices[] __initdata = {
>  	&a910_gpio_keys,
>  };
> @@ -880,6 +1041,11 @@ static void __init a910_init(void)
>  
>  	pxa_set_keypad_info(&a910_keypad_platform_data);
>  
> +	if (a910_camera_init() == 0) {
> +		pxa_set_camera_info(&a910_pxacamera_platform_data);
> +		platform_device_register(&a910_camera);
> +	}
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
>  }
> -- 
> tg: (639a58f..) ezx/mach/camera_new (depends on: master)
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v4] Add camera support for A780 and A910 EZX phones
@ 2009-11-12 20:49                               ` Guennadi Liakhovetski
  0 siblings, 0 replies; 63+ messages in thread
From: Guennadi Liakhovetski @ 2009-11-12 20:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 12 Nov 2009, Antonio Ospite wrote:

> Signed-off-by: Bart Visscher <bartv@thisnet.nl>
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Thanks
Guennadi

> ---
> Changes since v3:
>  - Check {a780,a910}_camera_init() return value, and register camera
>    conditionally.
> 
>  arch/arm/mach-pxa/ezx.c |  174 +++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 170 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index 588b265..46c32cf 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -17,8 +17,11 @@
>  #include <linux/delay.h>
>  #include <linux/pwm_backlight.h>
>  #include <linux/input.h>
> +#include <linux/gpio.h>
>  #include <linux/gpio_keys.h>
>  
> +#include <media/soc_camera.h>
> +
>  #include <asm/setup.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> @@ -29,6 +32,7 @@
>  #include <plat/i2c.h>
>  #include <mach/hardware.h>
>  #include <mach/pxa27x_keypad.h>
> +#include <mach/camera.h>
>  
>  #include "devices.h"
>  #include "generic.h"
> @@ -38,6 +42,9 @@
>  #define GPIO15_A910_FLIP_LID 		15
>  #define GPIO12_E680_LOCK_SWITCH 	12
>  #define GPIO15_E6_LOCK_SWITCH 		15
> +#define GPIO50_nCAM_EN			50
> +#define GPIO19_GEN1_CAM_RST		19
> +#define GPIO28_GEN2_CAM_RST		28
>  
>  static struct platform_pwm_backlight_data ezx_backlight_data = {
>  	.pwm_id		= 0,
> @@ -191,8 +198,8 @@ static unsigned long gen1_pin_config[] __initdata = {
>  	GPIO94_CIF_DD_5,
>  	GPIO17_CIF_DD_6,
>  	GPIO108_CIF_DD_7,
> -	GPIO50_GPIO,				/* CAM_EN */
> -	GPIO19_GPIO,				/* CAM_RST */
> +	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
> +	GPIO19_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
>  
>  	/* EMU */
>  	GPIO120_GPIO,				/* EMU_MUX1 */
> @@ -248,8 +255,8 @@ static unsigned long gen2_pin_config[] __initdata = {
>  	GPIO48_CIF_DD_5,
>  	GPIO93_CIF_DD_6,
>  	GPIO12_CIF_DD_7,
> -	GPIO50_GPIO,				/* CAM_EN */
> -	GPIO28_GPIO,				/* CAM_RST */
> +	GPIO50_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_EN */
> +	GPIO28_GPIO | MFP_LPM_DRIVE_HIGH,	/* CAM_RST */
>  	GPIO17_GPIO,				/* CAM_FLASH */
>  };
>  #endif
> @@ -683,6 +690,81 @@ static struct platform_device a780_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a780_camera_init(void)
> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO19_GEN1_CAM_RST is active on rising edge
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 1);
> +	gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a780_camera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);
> +	return 0;
> +}
> +
> +static int a780_camera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a780_pxacamera_platform_data = {
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a780_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a780_iclink = {
> +	.bus_id         = 0,
> +	.flags          = SOCAM_SENSOR_INVERT_PCLK,
> +	.i2c_adapter_id = 0,
> +	.board_info     = &a780_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a780_camera_power,
> +	.reset          = a780_camera_reset,
> +};
> +
> +static struct platform_device a780_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a780_iclink,
> +	},
> +};
> +
>  static struct platform_device *a780_devices[] __initdata = {
>  	&a780_gpio_keys,
>  };
> @@ -699,6 +781,11 @@ static void __init a780_init(void)
>  
>  	pxa_set_keypad_info(&a780_keypad_platform_data);
>  
> +	if (a780_camera_init() == 0) {
> +		pxa_set_camera_info(&a780_pxacamera_platform_data);
> +		platform_device_register(&a780_camera);
> +	}
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a780_devices));
>  }
> @@ -864,6 +951,80 @@ static struct platform_device a910_gpio_keys = {
>  	},
>  };
>  
> +/* camera */
> +static int a910_camera_init(void)
> +{
> +	int err;
> +
> +	/*
> +	 * GPIO50_nCAM_EN is active low
> +	 * GPIO28_GEN2_CAM_RST is active on rising edge
> +	 */
> +	err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
> +	if (err) {
> +		pr_err("%s: Failed to request nCAM_EN\n", __func__);
> +		goto fail;
> +	}
> +
> +	err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
> +	if (err) {
> +		pr_err("%s: Failed to request CAM_RST\n", __func__);
> +		goto fail_gpio_cam_rst;
> +	}
> +
> +	gpio_direction_output(GPIO50_nCAM_EN, 1);
> +	gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
> +
> +	return 0;
> +
> +fail_gpio_cam_rst:
> +	gpio_free(GPIO50_nCAM_EN);
> +fail:
> +	return err;
> +}
> +
> +static int a910_camera_power(struct device *dev, int on)
> +{
> +	gpio_set_value(GPIO50_nCAM_EN, !on);
> +	return 0;
> +}
> +
> +static int a910_camera_reset(struct device *dev)
> +{
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
> +	msleep(10);
> +	gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
> +
> +	return 0;
> +}
> +
> +struct pxacamera_platform_data a910_pxacamera_platform_data = {
> +	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
> +		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
> +	.mclk_10khz = 5000,
> +};
> +
> +static struct i2c_board_info a910_camera_i2c_board_info = {
> +	I2C_BOARD_INFO("mt9m111", 0x5d),
> +};
> +
> +static struct soc_camera_link a910_iclink = {
> +	.bus_id         = 0,
> +	.i2c_adapter_id = 0,
> +	.board_info     = &a910_camera_i2c_board_info,
> +	.module_name    = "mt9m111",
> +	.power          = a910_camera_power,
> +	.reset          = a910_camera_reset,
> +};
> +
> +static struct platform_device a910_camera = {
> +	.name   = "soc-camera-pdrv",
> +	.id     = 0,
> +	.dev    = {
> +		.platform_data = &a910_iclink,
> +	},
> +};
> +
>  static struct platform_device *a910_devices[] __initdata = {
>  	&a910_gpio_keys,
>  };
> @@ -880,6 +1041,11 @@ static void __init a910_init(void)
>  
>  	pxa_set_keypad_info(&a910_keypad_platform_data);
>  
> +	if (a910_camera_init() == 0) {
> +		pxa_set_camera_info(&a910_pxacamera_platform_data);
> +		platform_device_register(&a910_camera);
> +	}
> +
>  	platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
>  	platform_add_devices(ARRAY_AND_SIZE(a910_devices));
>  }
> -- 
> tg: (639a58f..) ezx/mach/camera_new (depends on: master)
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 1/3 v4] Add camera support for A780 and A910 EZX phones
  2009-11-12 20:49                               ` Guennadi Liakhovetski
@ 2009-11-13  8:23                                 ` Eric Miao
  -1 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-13  8:23 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Antonio Ospite, linux-arm-kernel, openezx-devel, Bart Visscher,
	Linux Media Mailing List

On Fri, Nov 13, 2009 at 4:49 AM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Thu, 12 Nov 2009, Antonio Ospite wrote:
>
>> Signed-off-by: Bart Visscher <bartv@thisnet.nl>
>> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>

Applied, thanks.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 1/3 v4] Add camera support for A780 and A910 EZX phones
@ 2009-11-13  8:23                                 ` Eric Miao
  0 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-13  8:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 13, 2009 at 4:49 AM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Thu, 12 Nov 2009, Antonio Ospite wrote:
>
>> Signed-off-by: Bart Visscher <bartv@thisnet.nl>
>> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>

Applied, thanks.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 2/3] ezx: Add leds-lp3944 support for A910 EZX phone
  2009-11-04  6:40     ` Eric Miao
@ 2009-11-13  8:24       ` Eric Miao
  0 siblings, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-13  8:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 4, 2009 at 2:40 PM, Eric Miao <eric.y.miao@gmail.com> wrote:
> This patch looks good, will apply later.
>
> On Wed, Nov 4, 2009 at 12:45 AM, Antonio Ospite
> <ospite@studenti.unina.it> wrote:
>> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

Applied to 'devel', thanks.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in
  2009-11-04 21:35 ` [PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in Antonio Ospite
  2009-11-11 14:08   ` Antonio Ospite
@ 2009-11-13  8:25   ` Eric Miao
  1 sibling, 0 replies; 63+ messages in thread
From: Eric Miao @ 2009-11-13  8:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 5, 2009 at 5:35 AM, Antonio Ospite <ospite@studenti.unina.it> wrote:
> ---
> Resent from another place, since it looks like the previous copy has been
> lost by my ISP...
>

Applied to 'devel' with your SOB.

^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2009-11-13  8:25 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-03 16:45 [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update Antonio Ospite
2009-11-03 16:45 ` [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones Antonio Ospite
2009-11-03 16:45   ` Antonio Ospite
2009-11-03 16:45   ` [PATCH 2/3] ezx: Add leds-lp3944 support for A910 EZX phone Antonio Ospite
2009-11-04  6:40     ` Eric Miao
2009-11-13  8:24       ` Eric Miao
2009-11-04  6:38   ` [PATCH 1/3] ezx: Add camera support for A780 and A910 EZX phones Eric Miao
2009-11-04  6:38     ` Eric Miao
2009-11-04  8:13     ` Guennadi Liakhovetski
2009-11-04  8:13       ` Guennadi Liakhovetski
2009-11-04 11:35       ` Antonio Ospite
2009-11-04 11:35         ` Antonio Ospite
2009-11-06 16:40         ` Guennadi Liakhovetski
2009-11-06 16:40           ` Guennadi Liakhovetski
2009-11-06 17:05           ` Robert Jarzmik
2009-11-06 17:05             ` Robert Jarzmik
2009-11-06 17:39             ` Antonio Ospite
2009-11-06 17:39               ` Antonio Ospite
2009-11-04  9:14     ` Antonio Ospite
2009-11-04  9:14       ` Antonio Ospite
2009-11-04  9:19       ` Eric Miao
2009-11-04  9:19         ` Eric Miao
2009-11-04 20:47         ` [PATCH 1/3 v2] " Antonio Ospite
2009-11-04 20:47           ` Antonio Ospite
2009-11-04 23:53           ` Guennadi Liakhovetski
2009-11-04 23:53             ` Guennadi Liakhovetski
2009-11-05  2:48             ` Eric Miao
2009-11-05  2:48               ` Eric Miao
2009-11-05 22:44             ` Antonio Ospite
2009-11-05 22:44               ` Antonio Ospite
2009-11-06 14:11               ` Guennadi Liakhovetski
2009-11-06 14:11                 ` Guennadi Liakhovetski
2009-11-06 17:29                 ` Antonio Ospite
2009-11-06 17:29                   ` Antonio Ospite
2009-11-10  9:29                   ` Antonio Ospite
2009-11-10  9:29                     ` Antonio Ospite
2009-11-10  9:39                     ` Guennadi Liakhovetski
2009-11-10  9:39                       ` Guennadi Liakhovetski
2009-11-11 11:01                       ` [PATCH 1/3 v3] " Antonio Ospite
2009-11-11 11:01                         ` Antonio Ospite
2009-11-11 13:55                         ` Eric Miao
2009-11-11 13:55                           ` Eric Miao
2009-11-11 18:02                         ` Guennadi Liakhovetski
2009-11-11 18:02                           ` Guennadi Liakhovetski
2009-11-12 14:41                           ` Antonio Ospite
2009-11-12 14:41                             ` Antonio Ospite
2009-11-12 14:47                           ` [PATCH 1/3 v4] " Antonio Ospite
2009-11-12 14:47                             ` Antonio Ospite
2009-11-12 20:49                             ` Guennadi Liakhovetski
2009-11-12 20:49                               ` Guennadi Liakhovetski
2009-11-13  8:23                               ` Eric Miao
2009-11-13  8:23                                 ` Eric Miao
2009-11-10 12:48     ` [PATCH 1/3] ezx: " Antonio Ospite
2009-11-10 12:48       ` Antonio Ospite
2009-11-10 15:13       ` Eric Miao
2009-11-10 15:13         ` Eric Miao
2009-11-03 17:44 ` [PATCH 0/3] ezx: A780/A910 camera, A910 leds, ezx_defconfig update Stefan Schmidt
2009-11-03 20:40   ` Antonio Ospite
2009-11-04  6:42     ` Eric Miao
2009-11-04  7:42       ` Antonio Ospite
2009-11-04 21:35 ` [PATCH 3/3] ezx: Update ezx_defconfig now that ezx-pcap is in Antonio Ospite
2009-11-11 14:08   ` Antonio Ospite
2009-11-13  8:25   ` Eric Miao

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.