Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-02-10 Thread Benoit Parrot
Laurent Pinchart laurent.pinch...@ideasonboard.com wrote on Thu [2015-Feb-05 
16:52:22 +0200]:
 Hi Prabhakar,
 
 (CC'ing Benoit Parrot)
 
 On Thursday 05 February 2015 11:55:28 Lad, Prabhakar wrote:
  On Thu, Feb 5, 2015 at 11:53 AM, Laurent Pinchart wrote:
   On Wednesday 04 February 2015 20:55:02 Lad, Prabhakar wrote:
   On Wed, Feb 4, 2015 at 5:03 PM, Laurent Pinchart wrote:
On Thursday 15 January 2015 23:39:23 Lad, Prabhakar wrote:
From: Benoit Parrot bpar...@ti.com

this patch adds support for omnivision's ov2659
sensor.

Signed-off-by: Benoit Parrot bpar...@ti.com
Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
---

 .../devicetree/bindings/media/i2c/ov2659.txt   |   33 +
 .../devicetree/bindings/vendor-prefixes.txt|1 +
 MAINTAINERS|   10 +
 drivers/media/i2c/Kconfig  |   11 +
 drivers/media/i2c/Makefile |1 +
 drivers/media/i2c/ov2659.c | 1623 +++
 include/media/ov2659.h |   33 +
 7 files changed, 1712 insertions(+)
 create mode 100644
 Documentation/devicetree/bindings/media/i2c/ov2659.txt
 create mode 100644 drivers/media/i2c/ov2659.c
 create mode 100644 include/media/ov2659.h
   
   [snip]
   
diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
new file mode 100644
index 000..ce8ec8d
--- /dev/null
+++ b/drivers/media/i2c/ov2659.c
@@ -0,0 +1,1623 @@
   
   [snip]
   
+static const struct ov2659_framesize ov2659_framesizes[] = {
+ { /* QVGA */
+ .width  = 320,
+ .height = 240,
+ .regs   = ov2659_qvga,
+ .max_exp_lines  = 248,
+ }, { /* VGA */
+ .width  = 640,
+ .height = 480,
+ .regs   = ov2659_vga,
+ .max_exp_lines  = 498,
+ }, { /* SVGA */
+ .width  = 800,
+ .height = 600,
+ .regs   = ov2659_svga,
+ .max_exp_lines  = 498,
+ }, { /* XGA */
+ .width  = 1024,
+ .height = 768,
+ .regs   = ov2659_xga,
+ .max_exp_lines  = 498,
+ }, { /* 720P */
+ .width  = 1280,
+ .height = 720,
+ .regs   = ov2659_720p,
+ .max_exp_lines  = 498,
+ }, { /* SXGA */
+ .width  = 1280,
+ .height = 1024,
+ .regs   = ov2659_sxga,
+ .max_exp_lines  = 1048,
+ }, { /* UXGA */
+ .width  = 1600,
+ .height = 1200,
+ .regs   = ov2659_uxga,
+ .max_exp_lines  = 498,
+ },
+};

That's what bothers me the most about drivers for Omnivision sensors.
For some reason (I'd bet on lack of proper documentation) they list a
couple of supported resolutions with corresponding register values,
instead of computing the register values from the format configured by
userspace. That's not the way we want to go. Prabhakar, do you have
enough documentation to fix that ?
   
   I am afraid I have limited documentation here.
   
   How limited ? :-) I assume someone has documentation, given that the patch
   contains a larger number of #define's with register names.
  
  Yea I don’t have NDA signed with TI/Omnivision :( because I which I
  lack the documentation.
 
 And a quick online search doesn't show any leaked datasheet. Wikileaks isn't 
 doing a good job ;-)
 
 Benoit, do you think this is something that can be fixed ?

Laurent,

I did spend several days (many moons ago) to try and derive a generic
way to set the output resolution dynamically. However even though
the data sheet is somewhat useful, the various working example config
from the vendor make use of several un-documented registers which
make this pretty much unfeasible.

I am afraid we are stuck with this method for the time being.

Regards,
Benoit Parrot

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


Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-02-05 Thread Laurent Pinchart
Hi Prabhakar,

(CC'ing Benoit Parrot)

On Thursday 05 February 2015 11:55:28 Lad, Prabhakar wrote:
 On Thu, Feb 5, 2015 at 11:53 AM, Laurent Pinchart wrote:
  On Wednesday 04 February 2015 20:55:02 Lad, Prabhakar wrote:
  On Wed, Feb 4, 2015 at 5:03 PM, Laurent Pinchart wrote:
   On Thursday 15 January 2015 23:39:23 Lad, Prabhakar wrote:
   From: Benoit Parrot bpar...@ti.com
   
   this patch adds support for omnivision's ov2659
   sensor.
   
   Signed-off-by: Benoit Parrot bpar...@ti.com
   Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
   ---
   
.../devicetree/bindings/media/i2c/ov2659.txt   |   33 +
.../devicetree/bindings/vendor-prefixes.txt|1 +
MAINTAINERS|   10 +
drivers/media/i2c/Kconfig  |   11 +
drivers/media/i2c/Makefile |1 +
drivers/media/i2c/ov2659.c | 1623 +++
include/media/ov2659.h |   33 +
7 files changed, 1712 insertions(+)
create mode 100644
Documentation/devicetree/bindings/media/i2c/ov2659.txt
create mode 100644 drivers/media/i2c/ov2659.c
create mode 100644 include/media/ov2659.h
  
  [snip]
  
   diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
   new file mode 100644
   index 000..ce8ec8d
   --- /dev/null
   +++ b/drivers/media/i2c/ov2659.c
   @@ -0,0 +1,1623 @@
  
  [snip]
  
   +static const struct ov2659_framesize ov2659_framesizes[] = {
   + { /* QVGA */
   + .width  = 320,
   + .height = 240,
   + .regs   = ov2659_qvga,
   + .max_exp_lines  = 248,
   + }, { /* VGA */
   + .width  = 640,
   + .height = 480,
   + .regs   = ov2659_vga,
   + .max_exp_lines  = 498,
   + }, { /* SVGA */
   + .width  = 800,
   + .height = 600,
   + .regs   = ov2659_svga,
   + .max_exp_lines  = 498,
   + }, { /* XGA */
   + .width  = 1024,
   + .height = 768,
   + .regs   = ov2659_xga,
   + .max_exp_lines  = 498,
   + }, { /* 720P */
   + .width  = 1280,
   + .height = 720,
   + .regs   = ov2659_720p,
   + .max_exp_lines  = 498,
   + }, { /* SXGA */
   + .width  = 1280,
   + .height = 1024,
   + .regs   = ov2659_sxga,
   + .max_exp_lines  = 1048,
   + }, { /* UXGA */
   + .width  = 1600,
   + .height = 1200,
   + .regs   = ov2659_uxga,
   + .max_exp_lines  = 498,
   + },
   +};
   
   That's what bothers me the most about drivers for Omnivision sensors.
   For some reason (I'd bet on lack of proper documentation) they list a
   couple of supported resolutions with corresponding register values,
   instead of computing the register values from the format configured by
   userspace. That's not the way we want to go. Prabhakar, do you have
   enough documentation to fix that ?
  
  I am afraid I have limited documentation here.
  
  How limited ? :-) I assume someone has documentation, given that the patch
  contains a larger number of #define's with register names.
 
 Yea I don’t have NDA signed with TI/Omnivision :( because I which I
 lack the documentation.

And a quick online search doesn't show any leaked datasheet. Wikileaks isn't 
doing a good job ;-)

Benoit, do you think this is something that can be fixed ?

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-02-05 Thread Lad, Prabhakar
Hi Laurent,

On Thu, Feb 5, 2015 at 11:53 AM, Laurent Pinchart
laurent.pinch...@ideasonboard.com wrote:
 Hi Prabhakar,

 On Wednesday 04 February 2015 20:55:02 Lad, Prabhakar wrote:
 On Wed, Feb 4, 2015 at 5:03 PM, Laurent Pinchart wrote:
  On Thursday 15 January 2015 23:39:23 Lad, Prabhakar wrote:
  From: Benoit Parrot bpar...@ti.com
 
  this patch adds support for omnivision's ov2659
  sensor.
 
  Signed-off-by: Benoit Parrot bpar...@ti.com
  Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
  ---
 
   .../devicetree/bindings/media/i2c/ov2659.txt   |   33 +
   .../devicetree/bindings/vendor-prefixes.txt|1 +
   MAINTAINERS|   10 +
   drivers/media/i2c/Kconfig  |   11 +
   drivers/media/i2c/Makefile |1 +
   drivers/media/i2c/ov2659.c | 1623
   +
   include/media/ov2659.h |   33 +
   7 files changed, 1712 insertions(+)
   create mode 100644
   Documentation/devicetree/bindings/media/i2c/ov2659.txt
   create mode 100644 drivers/media/i2c/ov2659.c
   create mode 100644 include/media/ov2659.h

 [snip]

  diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
  new file mode 100644
  index 000..ce8ec8d
  --- /dev/null
  +++ b/drivers/media/i2c/ov2659.c
  @@ -0,0 +1,1623 @@

 [snip]

  +static const struct ov2659_framesize ov2659_framesizes[] = {
  + { /* QVGA */
  + .width  = 320,
  + .height = 240,
  + .regs   = ov2659_qvga,
  + .max_exp_lines  = 248,
  + }, { /* VGA */
  + .width  = 640,
  + .height = 480,
  + .regs   = ov2659_vga,
  + .max_exp_lines  = 498,
  + }, { /* SVGA */
  + .width  = 800,
  + .height = 600,
  + .regs   = ov2659_svga,
  + .max_exp_lines  = 498,
  + }, { /* XGA */
  + .width  = 1024,
  + .height = 768,
  + .regs   = ov2659_xga,
  + .max_exp_lines  = 498,
  + }, { /* 720P */
  + .width  = 1280,
  + .height = 720,
  + .regs   = ov2659_720p,
  + .max_exp_lines  = 498,
  + }, { /* SXGA */
  + .width  = 1280,
  + .height = 1024,
  + .regs   = ov2659_sxga,
  + .max_exp_lines  = 1048,
  + }, { /* UXGA */
  + .width  = 1600,
  + .height = 1200,
  + .regs   = ov2659_uxga,
  + .max_exp_lines  = 498,
  + },
  +};
 
  That's what bothers me the most about drivers for Omnivision sensors. For
  some reason (I'd bet on lack of proper documentation) they list a couple
  of supported resolutions with corresponding register values, instead of
  computing the register values from the format configured by userspace.
  That's not the way we want to go. Prabhakar, do you have enough
  documentation to fix that ?

 I am afraid I have limited documentation here.

 How limited ? :-) I assume someone has documentation, given that the patch
 contains a larger number of #define's with register names.

Yea I don’t have NDA signed with TI/Omnivision :( because I which I
lack the documentation.

Regards,
--Prabhakar
--
To unsubscribe from this list: send the line unsubscribe devicetree in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-02-05 Thread Laurent Pinchart
Hi Prabhakar,

On Wednesday 04 February 2015 20:55:02 Lad, Prabhakar wrote:
 On Wed, Feb 4, 2015 at 5:03 PM, Laurent Pinchart wrote:
  On Thursday 15 January 2015 23:39:23 Lad, Prabhakar wrote:
  From: Benoit Parrot bpar...@ti.com
  
  this patch adds support for omnivision's ov2659
  sensor.
  
  Signed-off-by: Benoit Parrot bpar...@ti.com
  Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
  ---
  
   .../devicetree/bindings/media/i2c/ov2659.txt   |   33 +
   .../devicetree/bindings/vendor-prefixes.txt|1 +
   MAINTAINERS|   10 +
   drivers/media/i2c/Kconfig  |   11 +
   drivers/media/i2c/Makefile |1 +
   drivers/media/i2c/ov2659.c | 1623
   +
   include/media/ov2659.h |   33 +
   7 files changed, 1712 insertions(+)
   create mode 100644
   Documentation/devicetree/bindings/media/i2c/ov2659.txt
   create mode 100644 drivers/media/i2c/ov2659.c
   create mode 100644 include/media/ov2659.h

[snip]

  diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
  new file mode 100644
  index 000..ce8ec8d
  --- /dev/null
  +++ b/drivers/media/i2c/ov2659.c
  @@ -0,0 +1,1623 @@

[snip]

  +static const struct ov2659_framesize ov2659_framesizes[] = {
  + { /* QVGA */
  + .width  = 320,
  + .height = 240,
  + .regs   = ov2659_qvga,
  + .max_exp_lines  = 248,
  + }, { /* VGA */
  + .width  = 640,
  + .height = 480,
  + .regs   = ov2659_vga,
  + .max_exp_lines  = 498,
  + }, { /* SVGA */
  + .width  = 800,
  + .height = 600,
  + .regs   = ov2659_svga,
  + .max_exp_lines  = 498,
  + }, { /* XGA */
  + .width  = 1024,
  + .height = 768,
  + .regs   = ov2659_xga,
  + .max_exp_lines  = 498,
  + }, { /* 720P */
  + .width  = 1280,
  + .height = 720,
  + .regs   = ov2659_720p,
  + .max_exp_lines  = 498,
  + }, { /* SXGA */
  + .width  = 1280,
  + .height = 1024,
  + .regs   = ov2659_sxga,
  + .max_exp_lines  = 1048,
  + }, { /* UXGA */
  + .width  = 1600,
  + .height = 1200,
  + .regs   = ov2659_uxga,
  + .max_exp_lines  = 498,
  + },
  +};
  
  That's what bothers me the most about drivers for Omnivision sensors. For
  some reason (I'd bet on lack of proper documentation) they list a couple
  of supported resolutions with corresponding register values, instead of
  computing the register values from the format configured by userspace.
  That's not the way we want to go. Prabhakar, do you have enough
  documentation to fix that ?

 I am afraid I have limited documentation here.

How limited ? :-) I assume someone has documentation, given that the patch 
contains a larger number of #define's with register names.

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-02-04 Thread Laurent Pinchart
Hi Prabhakar,

Thank you for the patch. Here's a partial review.

On Thursday 15 January 2015 23:39:23 Lad, Prabhakar wrote:
 From: Benoit Parrot bpar...@ti.com
 
 this patch adds support for omnivision's ov2659
 sensor.
 
 Signed-off-by: Benoit Parrot bpar...@ti.com
 Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
 ---
  .../devicetree/bindings/media/i2c/ov2659.txt   |   33 +
  .../devicetree/bindings/vendor-prefixes.txt|1 +
  MAINTAINERS|   10 +
  drivers/media/i2c/Kconfig  |   11 +
  drivers/media/i2c/Makefile |1 +
  drivers/media/i2c/ov2659.c | 1623 +
  include/media/ov2659.h |   33 +
  7 files changed, 1712 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/media/i2c/ov2659.txt
  create mode 100644 drivers/media/i2c/ov2659.c
  create mode 100644 include/media/ov2659.h
 
 diff --git a/Documentation/devicetree/bindings/media/i2c/ov2659.txt
 b/Documentation/devicetree/bindings/media/i2c/ov2659.txt new file mode
 100644
 index 000..fc49f44
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/media/i2c/ov2659.txt
 @@ -0,0 +1,33 @@
 +* OV2659 1/5-Inch 2Mp SOC Camera
 +
 +The OV2659 is a 1/5-inch SOC camera, with an active array size of 1632H x
 1212V.
 +It is programmable through a SCCB.
 +
 +Required Properties:
 +- compatible: Must be ovt,ov2659
 +
 +- reg: I2C slave address
 +
 +- clock-frequency: Input clock frequency.
 +
 +For further reading on port node refer to
 +Documentation/devicetree/bindings/media/video-interfaces.txt.
 +
 +Example:
 +
 + i2c0@1c22000 {
 + ...
 + ...
 +  ov2659@30 {
 + compatible = ovt,ov2659;
 + reg = 0x30;
 +
 + port {
 + ov2659_0: endpoint {
 + clock-frequency = 1200;
 + remote-endpoint = vpfe_ep;
 + };
 + };
 + };
 + ...
 + };

[snip]

 diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
 new file mode 100644
 index 000..ce8ec8d
 --- /dev/null
 +++ b/drivers/media/i2c/ov2659.c
 @@ -0,0 +1,1623 @@

[snip]

 +static int debug;
 +module_param(debug, int, 0644);
 +MODULE_PARM_DESC(debug, Debug level (0-2));

The debug parameter is printed in the probe function and then unused. You can 
remove it.

[snip]

 +struct ov2659 {
 + struct v4l2_subdev sd;
 + struct media_pad pad;
 + enum v4l2_mbus_type bus_type;
 + const struct ov2659_platform_data *pdata;
 +
 + /* Protects the struct fields below */
 + struct mutex lock;
 +
 + struct i2c_client *client;
 +
 + unsigned short id;

The id field is only used at probe time, you can make it a local variable.

 + const struct ov2659_framesize *frame_size;
 + /* Current Output format Register Value (REG_FORMAT_CTRL00) */
 + struct sensor_register *format_ctrl_regs;
 +
 + struct v4l2_mbus_framefmt format;
 +
 + /* Sensor specific feq/pll config */
 + struct ov2659_pll_ctrl pll;
 +
 + int streaming;
 + int power;
 +};

[snip]

 +static const struct ov2659_framesize ov2659_framesizes[] = {
 + { /* QVGA */
 + .width  = 320,
 + .height = 240,
 + .regs   = ov2659_qvga,
 + .max_exp_lines  = 248,
 + }, { /* VGA */
 + .width  = 640,
 + .height = 480,
 + .regs   = ov2659_vga,
 + .max_exp_lines  = 498,
 + }, { /* SVGA */
 + .width  = 800,
 + .height = 600,
 + .regs   = ov2659_svga,
 + .max_exp_lines  = 498,
 + }, { /* XGA */
 + .width  = 1024,
 + .height = 768,
 + .regs   = ov2659_xga,
 + .max_exp_lines  = 498,
 + }, { /* 720P */
 + .width  = 1280,
 + .height = 720,
 + .regs   = ov2659_720p,
 + .max_exp_lines  = 498,
 + }, { /* SXGA */
 + .width  = 1280,
 + .height = 1024,
 + .regs   = ov2659_sxga,
 + .max_exp_lines  = 1048,
 + }, { /* UXGA */
 + .width  = 1600,
 + .height = 1200,
 + .regs   = ov2659_uxga,
 + .max_exp_lines  = 498,
 + },
 +};

That's what bothers me the most about drivers for Omnivision sensors. For some 
reason (I'd bet on lack of proper documentation) they list a couple of 
supported resolutions with corresponding register values, instead of computing 
the register values from the format configured by userspace. That's not the 
way we want to 

Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-02-04 Thread Rob Herring
On Wed, Feb 4, 2015 at 9:23 AM, Fabio Estevam feste...@gmail.com wrote:
 Rob,

 On Wed, Feb 4, 2015 at 12:55 PM, Rob Herring robherri...@gmail.com wrote:

 I'm surprised there are not already compatible strings with
 OmniVision. There are some examples using omnivision, but no dts
 files and examples don't count.

 The stock ticker is ovti, so please use that.

 That's what I sent:
 http://patchwork.ozlabs.org/patch/416685/

 Could you apply it?

Yes. Now applied.

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


Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-02-04 Thread Lad, Prabhakar
Hi Laurent,

Thanks for the review.

On Wed, Feb 4, 2015 at 5:03 PM, Laurent Pinchart
laurent.pinch...@ideasonboard.com wrote:
 Hi Prabhakar,

 Thank you for the patch. Here's a partial review.

 On Thursday 15 January 2015 23:39:23 Lad, Prabhakar wrote:
 From: Benoit Parrot bpar...@ti.com

 this patch adds support for omnivision's ov2659
 sensor.

 Signed-off-by: Benoit Parrot bpar...@ti.com
 Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
 ---
  .../devicetree/bindings/media/i2c/ov2659.txt   |   33 +
  .../devicetree/bindings/vendor-prefixes.txt|1 +
  MAINTAINERS|   10 +
  drivers/media/i2c/Kconfig  |   11 +
  drivers/media/i2c/Makefile |1 +
  drivers/media/i2c/ov2659.c | 1623 +
  include/media/ov2659.h |   33 +
  7 files changed, 1712 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/media/i2c/ov2659.txt
  create mode 100644 drivers/media/i2c/ov2659.c
  create mode 100644 include/media/ov2659.h

 diff --git a/Documentation/devicetree/bindings/media/i2c/ov2659.txt
 b/Documentation/devicetree/bindings/media/i2c/ov2659.txt new file mode
 100644
 index 000..fc49f44
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/media/i2c/ov2659.txt
 @@ -0,0 +1,33 @@
 +* OV2659 1/5-Inch 2Mp SOC Camera
 +
 +The OV2659 is a 1/5-inch SOC camera, with an active array size of 1632H x
 1212V.
 +It is programmable through a SCCB.
 +
 +Required Properties:
 +- compatible: Must be ovt,ov2659
 +
 +- reg: I2C slave address
 +
 +- clock-frequency: Input clock frequency.
 +
 +For further reading on port node refer to
 +Documentation/devicetree/bindings/media/video-interfaces.txt.
 +
 +Example:
 +
 + i2c0@1c22000 {
 + ...
 + ...
 +  ov2659@30 {
 + compatible = ovt,ov2659;
 + reg = 0x30;
 +
 + port {
 + ov2659_0: endpoint {
 + clock-frequency = 1200;
 + remote-endpoint = vpfe_ep;
 + };
 + };
 + };
 + ...
 + };

 [snip]

 diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
 new file mode 100644
 index 000..ce8ec8d
 --- /dev/null
 +++ b/drivers/media/i2c/ov2659.c
 @@ -0,0 +1,1623 @@

 [snip]

 +static int debug;
 +module_param(debug, int, 0644);
 +MODULE_PARM_DESC(debug, Debug level (0-2));

 The debug parameter is printed in the probe function and then unused. You can
 remove it.

OK will drop it.

 [snip]

 +struct ov2659 {
 + struct v4l2_subdev sd;
 + struct media_pad pad;
 + enum v4l2_mbus_type bus_type;
 + const struct ov2659_platform_data *pdata;
 +
 + /* Protects the struct fields below */
 + struct mutex lock;
 +
 + struct i2c_client *client;
 +
 + unsigned short id;

 The id field is only used at probe time, you can make it a local variable.

OK will make local.

 + const struct ov2659_framesize *frame_size;
 + /* Current Output format Register Value (REG_FORMAT_CTRL00) */
 + struct sensor_register *format_ctrl_regs;
 +
 + struct v4l2_mbus_framefmt format;
 +
 + /* Sensor specific feq/pll config */
 + struct ov2659_pll_ctrl pll;
 +
 + int streaming;
 + int power;
 +};

 [snip]

 +static const struct ov2659_framesize ov2659_framesizes[] = {
 + { /* QVGA */
 + .width  = 320,
 + .height = 240,
 + .regs   = ov2659_qvga,
 + .max_exp_lines  = 248,
 + }, { /* VGA */
 + .width  = 640,
 + .height = 480,
 + .regs   = ov2659_vga,
 + .max_exp_lines  = 498,
 + }, { /* SVGA */
 + .width  = 800,
 + .height = 600,
 + .regs   = ov2659_svga,
 + .max_exp_lines  = 498,
 + }, { /* XGA */
 + .width  = 1024,
 + .height = 768,
 + .regs   = ov2659_xga,
 + .max_exp_lines  = 498,
 + }, { /* 720P */
 + .width  = 1280,
 + .height = 720,
 + .regs   = ov2659_720p,
 + .max_exp_lines  = 498,
 + }, { /* SXGA */
 + .width  = 1280,
 + .height = 1024,
 + .regs   = ov2659_sxga,
 + .max_exp_lines  = 1048,
 + }, { /* UXGA */
 + .width  = 1600,
 + .height = 1200,
 + .regs   = ov2659_uxga,
 + .max_exp_lines  = 498,
 + },
 +};

 That's what bothers me the most about drivers for Omnivision sensors. For some
 reason (I'd bet on lack of proper documentation) they list a couple of
 

Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-02-04 Thread Lad, Prabhakar
Hi Rob,

Thanks for the review.

On Wed, Feb 4, 2015 at 2:55 PM, Rob Herring robherri...@gmail.com wrote:
 On Thu, Jan 15, 2015 at 5:39 PM, Lad, Prabhakar
 prabhakar.cse...@gmail.com wrote:
 From: Benoit Parrot bpar...@ti.com

 this patch adds support for omnivision's ov2659
 sensor.

 Signed-off-by: Benoit Parrot bpar...@ti.com
 Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
 ---

 [...]

 diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
 b/Documentation/devicetree/bindings/vendor-prefixes.txt
 index b1df0ad..153cd92 100644
 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt
 +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
 @@ -118,6 +118,7 @@ nvidia  NVIDIA
  nxpNXP Semiconductors
  onnn   ON Semiconductor Corp.
  opencores  OpenCores.org
 +ovtOmniVision Technologies

 I'm surprised there are not already compatible strings with
 OmniVision. There are some examples using omnivision, but no dts
 files and examples don't count.

 The stock ticker is ovti, so please use that.

OK will update in the v2 version, I went with website which was ovt [1].

[1] http://www.ovt.com/

Regards,
--Prabhakar Lad
--
To unsubscribe from this list: send the line unsubscribe devicetree in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-02-04 Thread Rob Herring
On Thu, Jan 15, 2015 at 5:39 PM, Lad, Prabhakar
prabhakar.cse...@gmail.com wrote:
 From: Benoit Parrot bpar...@ti.com

 this patch adds support for omnivision's ov2659
 sensor.

 Signed-off-by: Benoit Parrot bpar...@ti.com
 Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
 ---

[...]

 diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
 b/Documentation/devicetree/bindings/vendor-prefixes.txt
 index b1df0ad..153cd92 100644
 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt
 +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
 @@ -118,6 +118,7 @@ nvidia  NVIDIA
  nxpNXP Semiconductors
  onnn   ON Semiconductor Corp.
  opencores  OpenCores.org
 +ovtOmniVision Technologies

I'm surprised there are not already compatible strings with
OmniVision. There are some examples using omnivision, but no dts
files and examples don't count.

The stock ticker is ovti, so please use that.

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


Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-02-04 Thread Lad, Prabhakar
On Wed, Feb 4, 2015 at 3:23 PM, Fabio Estevam feste...@gmail.com wrote:
 Rob,

 On Wed, Feb 4, 2015 at 12:55 PM, Rob Herring robherri...@gmail.com wrote:

 I'm surprised there are not already compatible strings with
 OmniVision. There are some examples using omnivision, but no dts
 files and examples don't count.

 The stock ticker is ovti, so please use that.

 That's what I sent:
 http://patchwork.ozlabs.org/patch/416685/

Great I'll rebase the v2 on it.

Cheers,
--Prabhakar Lad
--
To unsubscribe from this list: send the line unsubscribe devicetree in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-02-04 Thread Fabio Estevam
Rob,

On Wed, Feb 4, 2015 at 12:55 PM, Rob Herring robherri...@gmail.com wrote:

 I'm surprised there are not already compatible strings with
 OmniVision. There are some examples using omnivision, but no dts
 files and examples don't count.

 The stock ticker is ovti, so please use that.

That's what I sent:
http://patchwork.ozlabs.org/patch/416685/

Could you apply it?
--
To unsubscribe from this list: send the line unsubscribe devicetree in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-01-30 Thread Lad, Prabhakar
Hello,

On Thu, Jan 15, 2015 at 11:39 PM, Lad, Prabhakar
prabhakar.cse...@gmail.com wrote:
 From: Benoit Parrot bpar...@ti.com

 this patch adds support for omnivision's ov2659
 sensor.

 Signed-off-by: Benoit Parrot bpar...@ti.com
 Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
 ---
  .../devicetree/bindings/media/i2c/ov2659.txt   |   33 +
  .../devicetree/bindings/vendor-prefixes.txt|1 +
  MAINTAINERS|   10 +
  drivers/media/i2c/Kconfig  |   11 +
  drivers/media/i2c/Makefile |1 +
  drivers/media/i2c/ov2659.c | 1623 
 
  include/media/ov2659.h |   33 +
  7 files changed, 1712 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/media/i2c/ov2659.txt
  create mode 100644 drivers/media/i2c/ov2659.c
  create mode 100644 include/media/ov2659.h

gentle ping for review comments.

Cheers,
--Prabhakar Lad
--
To unsubscribe from this list: send the line unsubscribe devicetree in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] media: i2c: add support for omnivision's ov2659 sensor

2015-01-15 Thread Lad, Prabhakar
From: Benoit Parrot bpar...@ti.com

this patch adds support for omnivision's ov2659
sensor.

Signed-off-by: Benoit Parrot bpar...@ti.com
Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
---
 .../devicetree/bindings/media/i2c/ov2659.txt   |   33 +
 .../devicetree/bindings/vendor-prefixes.txt|1 +
 MAINTAINERS|   10 +
 drivers/media/i2c/Kconfig  |   11 +
 drivers/media/i2c/Makefile |1 +
 drivers/media/i2c/ov2659.c | 1623 
 include/media/ov2659.h |   33 +
 7 files changed, 1712 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov2659.txt
 create mode 100644 drivers/media/i2c/ov2659.c
 create mode 100644 include/media/ov2659.h

diff --git a/Documentation/devicetree/bindings/media/i2c/ov2659.txt 
b/Documentation/devicetree/bindings/media/i2c/ov2659.txt
new file mode 100644
index 000..fc49f44
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ov2659.txt
@@ -0,0 +1,33 @@
+* OV2659 1/5-Inch 2Mp SOC Camera
+
+The OV2659 is a 1/5-inch SOC camera, with an active array size of 1632H x 
1212V.
+It is programmable through a SCCB.
+
+Required Properties:
+- compatible: Must be ovt,ov2659
+
+- reg: I2C slave address
+
+- clock-frequency: Input clock frequency.
+
+For further reading on port node refer to
+Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+Example:
+
+   i2c0@1c22000 {
+   ...
+   ...
+ov2659@30 {
+   compatible = ovt,ov2659;
+   reg = 0x30;
+
+   port {
+   ov2659_0: endpoint {
+   clock-frequency = 1200;
+   remote-endpoint = vpfe_ep;
+   };
+   };
+   };
+   ...
+   };
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index b1df0ad..153cd92 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -118,6 +118,7 @@ nvidia  NVIDIA
 nxpNXP Semiconductors
 onnn   ON Semiconductor Corp.
 opencores  OpenCores.org
+ovtOmniVision Technologies
 panasonic  Panasonic Corporation
 pericomPericom Technology Inc.
 phytec PHYTEC Messtechnik GmbH
diff --git a/MAINTAINERS b/MAINTAINERS
index 4318f34..fa62c91 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8754,6 +8754,16 @@ T:   git 
git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
 S: Maintained
 F: drivers/media/platform/am437x/
 
+OV2659 OMNIVISION SENSOR DRIVER
+M: Lad, Prabhakar prabhakar.cse...@gmail.com
+L: linux-me...@vger.kernel.org
+W: http://linuxtv.org/
+Q: http://patchwork.linuxtv.org/project/linux-media/list/
+T: git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
+S: Maintained
+F: drivers/media/i2c/ov2659.c
+F: include/media/ov2659.h
+
 SIS 190 ETHERNET DRIVER
 M: Francois Romieu rom...@fr.zoreil.com
 L: net...@vger.kernel.org
diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index ca84543..47f5042 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -465,6 +465,17 @@ config VIDEO_APTINA_PLL
 config VIDEO_SMIAPP_PLL
tristate
 
+config VIDEO_OV2659
+   tristate OmniVision OV2659 sensor support
+   depends on VIDEO_V4L2  I2C
+   depends on MEDIA_CAMERA_SUPPORT
+   ---help---
+ This is a Video4Linux2 sensor-level driver for the OmniVision
+ OV2659 camera.
+
+ To compile this driver as a module, choose M here: the
+ module will be called ov2659.
+
 config VIDEO_OV7640
tristate OmniVision OV7640 sensor support
depends on I2C  VIDEO_V4L2
diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
index 98589001..f165fae 100644
--- a/drivers/media/i2c/Makefile
+++ b/drivers/media/i2c/Makefile
@@ -77,3 +77,4 @@ obj-$(CONFIG_VIDEO_SMIAPP_PLL)+= smiapp-pll.o
 obj-$(CONFIG_VIDEO_AK881X) += ak881x.o
 obj-$(CONFIG_VIDEO_IR_I2C)  += ir-kbd-i2c.o
 obj-$(CONFIG_VIDEO_ML86V7667)  += ml86v7667.o
+obj-$(CONFIG_VIDEO_OV2659) += ov2659.o
diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
new file mode 100644
index 000..ce8ec8d
--- /dev/null
+++ b/drivers/media/i2c/ov2659.c
@@ -0,0 +1,1623 @@
+/*
+ * Omnivision OV2659 CMOS Image Sensor driver
+ *
+ * Copyright (C) 2015 Texas Instruments, Inc.
+ *
+ * Benoit Parrot bpar...@ti.com
+ * Lad, Prabhakar prabhakar.cse...@gmail.com
+ *
+ * This program is free software; you may redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2