Re: [PATCH v8 1/2] Add driver for Aptina Micron mt9p031 sensor.

2011-07-07 Thread javier Martin
On 7 July 2011 01:22, Laurent Pinchart
laurent.pinch...@ideasonboard.com wrote:
 Hi Javier,

 On Monday 04 July 2011 13:25:10 javier Martin wrote:
 Hi, Laurent.
 How is it going?

 Is there any chance these changes to be included for next release?
 We are afraid that changes in the framework may turn the patches useless.

 I've applied the patch to my tree and I'm working on a couple of fixes. I'll
 try to finish that ASAP, but I'm quite busy at the moment :-S

Ok, thank you Laurent.

I feel more comfortable now you have it applied to your tree.

Regards.

-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 1/2] Add driver for Aptina Micron mt9p031 sensor.

2011-07-06 Thread Laurent Pinchart
Hi Javier,

On Monday 04 July 2011 13:25:10 javier Martin wrote:
 Hi, Laurent.
 How is it going?
 
 Is there any chance these changes to be included for next release?
 We are afraid that changes in the framework may turn the patches useless.

I've applied the patch to my tree and I'm working on a couple of fixes. I'll 
try to finish that ASAP, but I'm quite busy at the moment :-S

-- 
Regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 1/2] Add driver for Aptina Micron mt9p031 sensor.

2011-07-04 Thread javier Martin
Hi, Laurent.
How is it going?

Is there any chance these changes to be included for next release?
We are afraid that changes in the framework may turn the patches useless.

Thank you.

-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v8 1/2] Add driver for Aptina Micron mt9p031 sensor.

2011-06-20 Thread Javier Martin
Fix BUG with output_control register and frequency calculation problems.

- Output control register was being smashed, thus causing pixclk to have
a high slew rate.

- We cannot assume that we will always have a 20MHz input freq,
so a table has been added so that the user can specify input freq
and desired freq.

Signed-off-by: Javier Martin javier.mar...@vista-silicon.com
---
 drivers/media/video/Kconfig   |7 +
 drivers/media/video/Makefile  |1 +
 drivers/media/video/mt9p031.c |  928 +
 include/media/mt9p031.h   |   19 +
 4 files changed, 955 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/mt9p031.c
 create mode 100644 include/media/mt9p031.h

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 00f51dd..5f851f0 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -329,6 +329,13 @@ config VIDEO_OV7670
  OV7670 VGA camera.  It currently only works with the M88ALP01
  controller.
 
+config VIDEO_MT9P031
+   tristate Aptina MT9P031 support
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ This is a Video4Linux2 sensor-level driver for the Aptina
+ (Micron) mt9p031 5 Mpixel camera.
+
 config VIDEO_MT9V011
tristate Micron mt9v011 sensor support
depends on I2C  VIDEO_V4L2
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index ace5d8b..912b29b 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -65,6 +65,7 @@ obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
 obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
 obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
 obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
+obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o
 obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
 obj-$(CONFIG_VIDEO_SR030PC30)  += sr030pc30.o
 obj-$(CONFIG_VIDEO_NOON010PC30)+= noon010pc30.o
diff --git a/drivers/media/video/mt9p031.c b/drivers/media/video/mt9p031.c
new file mode 100644
index 000..6b25a1b
--- /dev/null
+++ b/drivers/media/video/mt9p031.c
@@ -0,0 +1,928 @@
+/*
+ * Driver for MT9P031 CMOS Image Sensor from Aptina
+ *
+ * Copyright (C) 2011, Javier Martin javier.mar...@vista-silicon.com
+ *
+ * Copyright (C) 2011, Guennadi Liakhovetski g.liakhovet...@gmx.de
+ *
+ * Based on the MT9V032 driver and Bastian Hecht's code.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/delay.h
+#include linux/device.h
+#include linux/i2c.h
+#include linux/log2.h
+#include linux/pm.h
+#include linux/slab.h
+#include media/v4l2-subdev.h
+#include linux/videodev2.h
+
+#include media/mt9p031.h
+#include media/v4l2-chip-ident.h
+#include media/v4l2-ctrls.h
+#include media/v4l2-device.h
+#include media/v4l2-subdev.h
+
+#define MT9P031_CHIP_VERSION   0x00
+#defineMT9P031_CHIP_VERSION_VALUE  0x1801
+#define MT9P031_ROW_START  0x01
+#defineMT9P031_ROW_START_MIN   1
+#defineMT9P031_ROW_START_MAX   2004
+#defineMT9P031_ROW_START_DEF   54
+#define MT9P031_COLUMN_START   0x02
+#defineMT9P031_COLUMN_START_MIN1
+#defineMT9P031_COLUMN_START_MAX2750
+#defineMT9P031_COLUMN_START_DEF16
+#define MT9P031_WINDOW_HEIGHT  0x03
+#defineMT9P031_WINDOW_HEIGHT_MIN   2
+#defineMT9P031_WINDOW_HEIGHT_MAX   2003
+#defineMT9P031_WINDOW_HEIGHT_DEF   2003
+#define MT9P031_WINDOW_WIDTH   0x04
+#defineMT9P031_WINDOW_WIDTH_MIN18
+#defineMT9P031_WINDOW_WIDTH_MAX2751
+#defineMT9P031_WINDOW_WIDTH_DEF2751
+#define MT9P031_H_BLANKING 0x05
+#defineMT9P031_H_BLANKING_VALUE0
+#define MT9P031_V_BLANKING 0x06
+#defineMT9P031_V_BLANKING_VALUE25
+#define MT9P031_OUTPUT_CONTROL 0x07
+#defineMT9P031_OUTPUT_CONTROL_CEN  2
+#defineMT9P031_OUTPUT_CONTROL_SYN  1
+#defineMT9P031_OUTPUT_CONTROL_DEF  0x1f82
+#define MT9P031_SHUTTER_WIDTH_UPPER0x08
+#define MT9P031_SHUTTER_WIDTH_LOWER0x09
+#defineMT9P031_SHUTTER_WIDTH_MIN   0x0001
+#defineMT9P031_SHUTTER_WIDTH_MAX   0x7ff
+#defineMT9P031_SHUTTER_WIDTH_DEF   0x0797
+#defineMT9P031_PLL_CONTROL 0x10
+#defineMT9P031_PLL_CONTROL_PWROFF  0x0050
+#defineMT9P031_PLL_CONTROL_PWRON   0x0051
+#defineMT9P031_PLL_CONTROL_USEPLL  0x0052
+#define