Re: [PATCH v2] Add support for M5MO-LS 8 Mega Pixel camera

2011-01-23 Thread Kim HeungJun
Hi Sylwester,

Oh. Very thanks to reviewing.

It's almost not a big deal to change and I'll fix this and resend.
 
2011. 1. 23., 오후 1:16, Sylwester Nawrocki 작성:

> HeungJun,
> 
> as I didn't really get a chance to review this patch in its current
> form before, please let me now add some further comments.  
> 
> On 01/22/2011 11:12 AM, Kim, HeungJun wrote:
>> Hello,
>> 
>> This is second patch of I2C/V4L2 subdev driver for M5MOLS 8 Mega Pixel camera
>> sensor using MIPI interface.
>> 
>> The first version patch is here:
>> http://www.spinics.net/lists/linux-media/msg26246.html
>> 
>> And the first verion's issues was corrected referencing with quick reviews of
>> Hans Verkuil and Sylwester Nawrocki.
>> 
>> The main issues is below:
>> 1. remove I2C function macro, and use static inline for type-safe.
>> 2. use the v4l2 control framework documented at v4l2-control.txt.
>> 3. Add regulator enable/disable functions
>> 4. fix any coding problems
>> 
>> The driver supports currently that:
>> 1. Preview enables on each resolution and format code 
>> V4L2_MBUS_FMT_VYUY8_2X8.
>> 2. The 5 kind of control was working well.
>> 
>> This driver is tested on s5pc210 board using s5p-fimc driver.
>> 
>> Thanks to any ideas.
>> 
>> Regrads,
>>  Heungjun Kim
>> 
>> Signed-off-by: Heungjun Kim
>> Signed-off-by: Sylwester Nawrocki
>> Signed-off-by: Kyungmin Park
>> ---
>>  drivers/media/video/Kconfig  |2 +
>>  drivers/media/video/Makefile |1 +
>>  drivers/media/video/m5mols/Kconfig   |6 +
>>  drivers/media/video/m5mols/Makefile  |3 +
>>  drivers/media/video/m5mols/m5mols.h  |  257 
>>  drivers/media/video/m5mols/m5mols_controls.c |  173 +
>>  drivers/media/video/m5mols/m5mols_core.c |  898 
>> ++
>>  drivers/media/video/m5mols/m5mols_reg.h  |  103 +++
>>  8 files changed, 1443 insertions(+), 0 deletions(-)
>>  create mode 100644 drivers/media/video/m5mols/Kconfig
>>  create mode 100644 drivers/media/video/m5mols/Makefile
>>  create mode 100644 drivers/media/video/m5mols/m5mols.h
>>  create mode 100644 drivers/media/video/m5mols/m5mols_controls.c
>>  create mode 100644 drivers/media/video/m5mols/m5mols_core.c
>>  create mode 100644 drivers/media/video/m5mols/m5mols_reg.h
>> 
>> diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
>> index ce3555a..fd3130a 100644
>> --- a/drivers/media/video/Kconfig
>> +++ b/drivers/media/video/Kconfig
>> @@ -746,6 +746,8 @@ config VIDEO_NOON010PC30
>>  ---help---
>>This driver supports NOON010PC30 CIF camera from Siliconfile
>> 
>> +source "drivers/media/video/m5mols/Kconfig"
>> +
>>  config SOC_CAMERA
>>  tristate "SoC camera support"
>>  depends on VIDEO_V4L2&&  HAS_DMA&&  I2C
>> diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
>> index 251b7ca..adb9361 100644
>> --- a/drivers/media/video/Makefile
>> +++ b/drivers/media/video/Makefile
>> @@ -68,6 +68,7 @@ obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
>>  obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
>>  obj-$(CONFIG_VIDEO_SR030PC30)   += sr030pc30.o
>>  obj-$(CONFIG_VIDEO_NOON010PC30) += noon010pc30.o
>> +obj-$(CONFIG_VIDEO_M5MOLS)  += m5mols/
>> 
>>  obj-$(CONFIG_SOC_CAMERA_IMX074) += imx074.o
>>  obj-$(CONFIG_SOC_CAMERA_MT9M001)+= mt9m001.o
>> diff --git a/drivers/media/video/m5mols/Kconfig 
>> b/drivers/media/video/m5mols/Kconfig
>> new file mode 100644
>> index 000..387425b
>> --- /dev/null
>> +++ b/drivers/media/video/m5mols/Kconfig
>> @@ -0,0 +1,6 @@
>> +config VIDEO_M5MOLS
>> +tristate "Fujitsu M5MO-LS 8MP sensor support"
>> +depends on I2C&&  VIDEO_V4L2
>> +---help---
>> +  This driver supports Fujitsu M5MO-LS camera sensor with ISP
>> +
>> diff --git a/drivers/media/video/m5mols/Makefile 
>> b/drivers/media/video/m5mols/Makefile
>> new file mode 100644
>> index 000..b5d19bf
>> --- /dev/null
>> +++ b/drivers/media/video/m5mols/Makefile
>> @@ -0,0 +1,3 @@
>> +m5mols-objs := m5mols_core.o m5mols_controls.o
>> +
>> +obj-$(CONFIG_VIDEO_M5MOLS)  += m5mols.o
>> diff --git a/drivers/media/video/m5mols/m5mols.h 
>> b/drivers/media/video/m5mols/m5mols.h
>> new file mode 100644
>> index 000..eaeb7ca
>> --- /dev/null
>> +++ b/drivers/media/video/m5mols/m5mols.h
>> @@ -0,0 +1,257 @@
>> +/*
>> + * Header for M5MOLS 8M Pixel camera sensor with ISP
>> + *
>> + * Copyright (C) 2011 Samsung Electronics Co., Ltd
>> + * Author: HeungJun Kim, riverful@samsung.com
>> + *
>> + * Copyright (C) 2009 Samsung Electronics Co., Ltd
>> + * Author: Dongsoo Nathaniel Kim, dongsoo45@samsung.com
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> + */
>> +
>> +#ifndef M5MOLS_H
>> +#define M5MOLS_H
>> +
>> +

Re: [PATCH v2] Add support for M5MO-LS 8 Mega Pixel camera

2011-01-22 Thread Sylwester Nawrocki
HeungJun,

as I didn't really get a chance to review this patch in its current
form before, please let me now add some further comments.  

On 01/22/2011 11:12 AM, Kim, HeungJun wrote:
> Hello,
> 
> This is second patch of I2C/V4L2 subdev driver for M5MOLS 8 Mega Pixel camera
> sensor using MIPI interface.
> 
> The first version patch is here:
> http://www.spinics.net/lists/linux-media/msg26246.html
> 
> And the first verion's issues was corrected referencing with quick reviews of
> Hans Verkuil and Sylwester Nawrocki.
> 
> The main issues is below:
> 1. remove I2C function macro, and use static inline for type-safe.
> 2. use the v4l2 control framework documented at v4l2-control.txt.
> 3. Add regulator enable/disable functions
> 4. fix any coding problems
> 
> The driver supports currently that:
> 1. Preview enables on each resolution and format code V4L2_MBUS_FMT_VYUY8_2X8.
> 2. The 5 kind of control was working well.
> 
> This driver is tested on s5pc210 board using s5p-fimc driver.
> 
> Thanks to any ideas.
> 
> Regrads,
>   Heungjun Kim
> 
> Signed-off-by: Heungjun Kim
> Signed-off-by: Sylwester Nawrocki
> Signed-off-by: Kyungmin Park
> ---
>   drivers/media/video/Kconfig  |2 +
>   drivers/media/video/Makefile |1 +
>   drivers/media/video/m5mols/Kconfig   |6 +
>   drivers/media/video/m5mols/Makefile  |3 +
>   drivers/media/video/m5mols/m5mols.h  |  257 
>   drivers/media/video/m5mols/m5mols_controls.c |  173 +
>   drivers/media/video/m5mols/m5mols_core.c |  898 
> ++
>   drivers/media/video/m5mols/m5mols_reg.h  |  103 +++
>   8 files changed, 1443 insertions(+), 0 deletions(-)
>   create mode 100644 drivers/media/video/m5mols/Kconfig
>   create mode 100644 drivers/media/video/m5mols/Makefile
>   create mode 100644 drivers/media/video/m5mols/m5mols.h
>   create mode 100644 drivers/media/video/m5mols/m5mols_controls.c
>   create mode 100644 drivers/media/video/m5mols/m5mols_core.c
>   create mode 100644 drivers/media/video/m5mols/m5mols_reg.h
> 
> diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
> index ce3555a..fd3130a 100644
> --- a/drivers/media/video/Kconfig
> +++ b/drivers/media/video/Kconfig
> @@ -746,6 +746,8 @@ config VIDEO_NOON010PC30
>   ---help---
> This driver supports NOON010PC30 CIF camera from Siliconfile
> 
> +source "drivers/media/video/m5mols/Kconfig"
> +
>   config SOC_CAMERA
>   tristate "SoC camera support"
>   depends on VIDEO_V4L2&&  HAS_DMA&&  I2C
> diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
> index 251b7ca..adb9361 100644
> --- a/drivers/media/video/Makefile
> +++ b/drivers/media/video/Makefile
> @@ -68,6 +68,7 @@ obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
>   obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
>   obj-$(CONFIG_VIDEO_SR030PC30)   += sr030pc30.o
>   obj-$(CONFIG_VIDEO_NOON010PC30) += noon010pc30.o
> +obj-$(CONFIG_VIDEO_M5MOLS)   += m5mols/
> 
>   obj-$(CONFIG_SOC_CAMERA_IMX074) += imx074.o
>   obj-$(CONFIG_SOC_CAMERA_MT9M001)+= mt9m001.o
> diff --git a/drivers/media/video/m5mols/Kconfig 
> b/drivers/media/video/m5mols/Kconfig
> new file mode 100644
> index 000..387425b
> --- /dev/null
> +++ b/drivers/media/video/m5mols/Kconfig
> @@ -0,0 +1,6 @@
> +config VIDEO_M5MOLS
> + tristate "Fujitsu M5MO-LS 8MP sensor support"
> + depends on I2C&&  VIDEO_V4L2
> + ---help---
> +   This driver supports Fujitsu M5MO-LS camera sensor with ISP
> +
> diff --git a/drivers/media/video/m5mols/Makefile 
> b/drivers/media/video/m5mols/Makefile
> new file mode 100644
> index 000..b5d19bf
> --- /dev/null
> +++ b/drivers/media/video/m5mols/Makefile
> @@ -0,0 +1,3 @@
> +m5mols-objs  := m5mols_core.o m5mols_controls.o
> +
> +obj-$(CONFIG_VIDEO_M5MOLS)   += m5mols.o
> diff --git a/drivers/media/video/m5mols/m5mols.h 
> b/drivers/media/video/m5mols/m5mols.h
> new file mode 100644
> index 000..eaeb7ca
> --- /dev/null
> +++ b/drivers/media/video/m5mols/m5mols.h
> @@ -0,0 +1,257 @@
> +/*
> + * Header for M5MOLS 8M Pixel camera sensor with ISP
> + *
> + * Copyright (C) 2011 Samsung Electronics Co., Ltd
> + * Author: HeungJun Kim, riverful@samsung.com
> + *
> + * Copyright (C) 2009 Samsung Electronics Co., Ltd
> + * Author: Dongsoo Nathaniel Kim, dongsoo45@samsung.com
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + */
> +
> +#ifndef M5MOLS_H
> +#define M5MOLS_H
> +
> +#include
> +#include "m5mols_reg.h"
> +
> +#define v4l2msg(fmt, arg...) do {\
> + v4l2_dbg(1, m5mols_debug,&info->sd, fmt, ## arg);   \
> +} while (0)
> +
> +extern int m5mols_debug;
> +
> +enum m5mols_mode {
> + MODE_SYSINIT,
>

[PATCH v2] Add support for M5MO-LS 8 Mega Pixel camera

2011-01-22 Thread Kim, HeungJun
Hello,

This is second patch of I2C/V4L2 subdev driver for M5MOLS 8 Mega Pixel camera
sensor using MIPI interface.

The first version patch is here:
http://www.spinics.net/lists/linux-media/msg26246.html

And the first verion's issues was corrected referencing with quick reviews of
Hans Verkuil and Sylwester Nawrocki.

The main issues is below:
1. remove I2C function macro, and use static inline for type-safe.
2. use the v4l2 control framework documented at v4l2-control.txt.
3. Add regulator enable/disable functions
4. fix any coding problems

The driver supports currently that:
1. Preview enables on each resolution and format code V4L2_MBUS_FMT_VYUY8_2X8.
2. The 5 kind of control was working well.

This driver is tested on s5pc210 board using s5p-fimc driver.

Thanks to any ideas.

Regrads,
Heungjun Kim

Signed-off-by: Heungjun Kim 
Signed-off-by: Sylwester Nawrocki 
Signed-off-by: Kyungmin Park 
---
 drivers/media/video/Kconfig  |2 +
 drivers/media/video/Makefile |1 +
 drivers/media/video/m5mols/Kconfig   |6 +
 drivers/media/video/m5mols/Makefile  |3 +
 drivers/media/video/m5mols/m5mols.h  |  257 
 drivers/media/video/m5mols/m5mols_controls.c |  173 +
 drivers/media/video/m5mols/m5mols_core.c |  898 ++
 drivers/media/video/m5mols/m5mols_reg.h  |  103 +++
 8 files changed, 1443 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/m5mols/Kconfig
 create mode 100644 drivers/media/video/m5mols/Makefile
 create mode 100644 drivers/media/video/m5mols/m5mols.h
 create mode 100644 drivers/media/video/m5mols/m5mols_controls.c
 create mode 100644 drivers/media/video/m5mols/m5mols_core.c
 create mode 100644 drivers/media/video/m5mols/m5mols_reg.h

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index ce3555a..fd3130a 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -746,6 +746,8 @@ config VIDEO_NOON010PC30
---help---
  This driver supports NOON010PC30 CIF camera from Siliconfile
 
+source "drivers/media/video/m5mols/Kconfig"
+
 config SOC_CAMERA
tristate "SoC camera support"
depends on VIDEO_V4L2 && HAS_DMA && I2C
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index 251b7ca..adb9361 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -68,6 +68,7 @@ obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
 obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
 obj-$(CONFIG_VIDEO_SR030PC30)  += sr030pc30.o
 obj-$(CONFIG_VIDEO_NOON010PC30)+= noon010pc30.o
+obj-$(CONFIG_VIDEO_M5MOLS) += m5mols/
 
 obj-$(CONFIG_SOC_CAMERA_IMX074)+= imx074.o
 obj-$(CONFIG_SOC_CAMERA_MT9M001)   += mt9m001.o
diff --git a/drivers/media/video/m5mols/Kconfig 
b/drivers/media/video/m5mols/Kconfig
new file mode 100644
index 000..387425b
--- /dev/null
+++ b/drivers/media/video/m5mols/Kconfig
@@ -0,0 +1,6 @@
+config VIDEO_M5MOLS
+   tristate "Fujitsu M5MO-LS 8MP sensor support"
+   depends on I2C && VIDEO_V4L2
+   ---help---
+ This driver supports Fujitsu M5MO-LS camera sensor with ISP
+
diff --git a/drivers/media/video/m5mols/Makefile 
b/drivers/media/video/m5mols/Makefile
new file mode 100644
index 000..b5d19bf
--- /dev/null
+++ b/drivers/media/video/m5mols/Makefile
@@ -0,0 +1,3 @@
+m5mols-objs:= m5mols_core.o m5mols_controls.o
+
+obj-$(CONFIG_VIDEO_M5MOLS) += m5mols.o
diff --git a/drivers/media/video/m5mols/m5mols.h 
b/drivers/media/video/m5mols/m5mols.h
new file mode 100644
index 000..eaeb7ca
--- /dev/null
+++ b/drivers/media/video/m5mols/m5mols.h
@@ -0,0 +1,257 @@
+/*
+ * Header for M5MOLS 8M Pixel camera sensor with ISP
+ *
+ * Copyright (C) 2011 Samsung Electronics Co., Ltd
+ * Author: HeungJun Kim, riverful@samsung.com
+ *
+ * Copyright (C) 2009 Samsung Electronics Co., Ltd
+ * Author: Dongsoo Nathaniel Kim, dongsoo45@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef M5MOLS_H
+#define M5MOLS_H
+
+#include 
+#include "m5mols_reg.h"
+
+#define v4l2msg(fmt, arg...)   do {\
+   v4l2_dbg(1, m5mols_debug, &info->sd, fmt, ## arg);  \
+} while (0)
+
+extern int m5mols_debug;
+
+enum m5mols_mode {
+   MODE_SYSINIT,
+   MODE_PARMSET,
+   MODE_MONITOR,
+   MODE_UNKNOWN,
+};
+
+enum m5mols_i2c_size {
+   I2C_8BIT= 1,
+   I2C_16BIT   = 2,
+   I2C_32BIT   = 4,
+   I2C_MAX = 4,
+};
+
+enum m5mols_fps {
+   M5MOLS_FPS_AUTO = 0,
+   M5MOLS_FPS_10   = 10,
+   M5MOLS_FPS_12   = 12,
+   M5MOLS_FPS_15   = 15,
+   M5MOLS_FPS_20   = 20,
+   M5MOLS_FPS_21   = 21,
+   M5MOLS_FPS