Re: [REVIEW PATCH 3/3] omap_vout: fix compiler warning

2013-06-20 Thread Prabhakar Lad
Hi Hans,

Thanks for the patch.

On Fri, Jun 21, 2013 at 1:58 AM, Hans Verkuil  wrote:
> From: Hans Verkuil 
>
> media-git/drivers/media/platform/omap/omap_vout.c: In function ‘omapvid_init’:
> media-git/drivers/media/platform/omap/omap_vout.c:382:17: warning: ‘mode’ may 
> be used uninitialized in this function [-Wmaybe-uninitialized]
>   vout->dss_mode = video_mode_to_dss_mode(vout);
>  ^
> media-git/drivers/media/platform/omap/omap_vout.c:332:23: note: ‘mode’ was 
> declared here
>   enum omap_color_mode mode;
>^
>
> Signed-off-by: Hans Verkuil 
> Cc: Laurent Pinchart 
> Cc: Prabhakar Lad 

Acked-by: Lad, Prabhakar 

Regards,
--Prabhakar Lad
--
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] [media] tvp514x: Fix init seqeunce

2013-06-21 Thread Prabhakar Lad
Hi Lars-Peter,

On Sun, Jun 16, 2013 at 3:41 PM, Prabhakar Lad
 wrote:
> Hi Lars-Peter,
>
> Thanks for the patch.
>
> On Sat, Jun 15, 2013 at 8:04 PM, Lars-Peter Clausen  wrote:
>> client->driver->id_table will always point to the first entry in the device 
>> id
>> table. So all devices will use the same init sequence. Use the id table entry
>> that gets passed to the driver's probe() function to get the right init
>> sequence.
>>
> The patch looks OK, but it causes following two warnings,
>
> drivers/media/i2c/tvp514x.c: In function 'tvp514x_s_stream':
> drivers/media/i2c/tvp514x.c:868: warning: unused variable 'client'
> drivers/media/i2c/tvp514x.c: In function 'tvp514x_probe':
> drivers/media/i2c/tvp514x.c:1092: warning: assignment makes pointer
> from integer without a cast
>
Do you plan to post a v2 ? or shall I take care of it ?

Regards,
--Prabhakar Lad
--
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: [GIT PULL FOR v3.11] Conversions to v4l-async

2013-06-21 Thread Prabhakar Lad
Hi Hans,

On Sat, Jun 22, 2013 at 1:38 AM, Hans Verkuil  wrote:
> Now that the v4l-async patches have been merged, these patches can be merged
> as well.
>
> Hans
>
> The following changes since commit ee17608d6aa04a86e253a9130d6c6d00892f132b:
>
>   [media] imx074: support asynchronous probing (2013-06-21 16:36:15 -0300)
>
> are available in the git repository at:
>
>   git://linuxtv.org/hverkuil/media_tree.git for-v3.11
>
> for you to fetch changes up to a6277614fa957a3c26a3160e2fc662838d185c70:
>
>   media: i2c: ths8200: add support v4l-async (2013-06-21 22:00:47 +0200)
>
> 
> Lad, Prabhakar (3):
>   media: i2c: tvp7002: add support for asynchronous probing
>   media: i2c: tvp7002: add OF support
>   media: i2c: ths8200: add support v4l-async
>
These patches needs to be reworked on.These patches were based on
earlier version
of v4l-async, the v4l-async got changed in last version due to which
there is a little
bit of rework which I'll work on them today and repost.

Mauro, please don’t pull these patches.

Regards,
--Prabhakar Lad
--
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 0/2] media: i2c: ths8200: Feature enhancement

2013-06-22 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

The first patch of the series adds supports for asynchronous subdev
registration for ths8200 driver, and the second patch of the series
adds OF support the driver.

Lad, Prabhakar (2):
  media: i2c: ths8200: support asynchronous probing
  media: i2c: ths8200: add OF support

 .../devicetree/bindings/media/i2c/ths8200.txt  |   19 +++
 drivers/media/i2c/ths8200.c|   18 +-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ths8200.txt

-- 
1.7.9.5

--
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 1/2] media: i2c: ths8200: support asynchronous probing

2013-06-22 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

This patch supports both synchronous and asynchronous
ths8200 subdevice probing.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/i2c/ths8200.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index a24f90c..cc1339a 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include "ths8200_regs.h"
@@ -500,6 +501,7 @@ static int ths8200_probe(struct i2c_client *client,
 {
struct ths8200_state *state;
struct v4l2_subdev *sd;
+   int error;
 
/* Check if the adapter supports the needed features */
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
@@ -517,6 +519,10 @@ static int ths8200_probe(struct i2c_client *client,
 
ths8200_core_init(sd);
 
+   error = v4l2_async_register_subdev(&state->sd);
+   if (error)
+   return error;
+
v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name,
  client->addr << 1, client->adapter->name);
 
@@ -526,12 +532,13 @@ static int ths8200_probe(struct i2c_client *client,
 static int ths8200_remove(struct i2c_client *client)
 {
struct v4l2_subdev *sd = i2c_get_clientdata(client);
+   struct ths8200_state *decoder = to_state(sd);
 
v4l2_dbg(1, debug, sd, "%s removed @ 0x%x (%s)\n", client->name,
 client->addr << 1, client->adapter->name);
 
ths8200_s_power(sd, false);
-
+   v4l2_async_unregister_subdev(&decoder->sd);
v4l2_device_unregister_subdev(sd);
 
return 0;
-- 
1.7.9.5

--
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 2/2] media: i2c: ths8200: add OF support

2013-06-22 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

add OF support for the ths8200 driver.

Signed-off-by: Lad, Prabhakar 
---
 .../devicetree/bindings/media/i2c/ths8200.txt  |   19 +++
 drivers/media/i2c/ths8200.c|9 +
 2 files changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ths8200.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/ths8200.txt 
b/Documentation/devicetree/bindings/media/i2c/ths8200.txt
new file mode 100644
index 000..285f6ae
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ths8200.txt
@@ -0,0 +1,19 @@
+* Texas Instruments THS8200 video encoder
+
+The ths8200 device is a digital to analog converter used in DVD players, video
+recorders, set-top boxes.
+
+Required Properties :
+- compatible : value must be "ti,ths8200"
+
+Example:
+
+   i2c0@1c22000 {
+   ...
+   ...
+   ths8200@5c {
+   compatible = "ti,ths8200";
+   reg = <0x5c>;
+   };
+   ...
+   };
diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index cc1339a..8a29810 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -550,10 +550,19 @@ static struct i2c_device_id ths8200_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, ths8200_id);
 
+#if IS_ENABLED(CONFIG_OF)
+static const struct of_device_id ths8200_of_match[] = {
+   { .compatible = "ti,ths8200", },
+   { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, ths8200_of_match);
+#endif
+
 static struct i2c_driver ths8200_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "ths8200",
+   .of_match_table = of_match_ptr(ths8200_of_match),
},
.probe = ths8200_probe,
.remove = ths8200_remove,
-- 
1.7.9.5

--
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] media: i2c: adv7343: add support for asynchronous probing

2013-06-22 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Both synchronous and asynchronous adv7343 subdevice probing is supported by
this patch.

Signed-off-by: Lad, Prabhakar 
Cc: Guennadi Liakhovetski 
Cc: Laurent Pinchart 
Cc: Hans Verkuil 
Cc: Sakari Ailus 
Cc: Mauro Carvalho Chehab 
---
 drivers/media/i2c/adv7343.c |   15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c
index 7606218..8080c2c 100644
--- a/drivers/media/i2c/adv7343.c
+++ b/drivers/media/i2c/adv7343.c
@@ -27,6 +27,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -445,16 +446,21 @@ static int adv7343_probe(struct i2c_client *client,
   ADV7343_GAIN_DEF);
state->sd.ctrl_handler = &state->hdl;
if (state->hdl.error) {
-   int err = state->hdl.error;
-
-   v4l2_ctrl_handler_free(&state->hdl);
-   return err;
+   err = state->hdl.error;
+   goto done;
}
v4l2_ctrl_handler_setup(&state->hdl);
 
err = adv7343_initialize(&state->sd);
if (err)
+   goto done;
+
+   err = v4l2_async_register_subdev(&state->sd);
+
+done:
+   if (err < 0)
v4l2_ctrl_handler_free(&state->hdl);
+
return err;
 }
 
@@ -463,6 +469,7 @@ static int adv7343_remove(struct i2c_client *client)
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct adv7343_state *state = to_state(sd);
 
+   v4l2_async_unregister_subdev(&state->sd);
v4l2_device_unregister_subdev(sd);
v4l2_ctrl_handler_free(&state->hdl);
 
-- 
1.7.9.5

--
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] media: i2c: tvp514x: add support for asynchronous probing

2013-06-22 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Both synchronous and asynchronous tvp514x subdevice probing is supported by
this patch.

Signed-off-by: Prabhakar Lad 
Cc: Guennadi Liakhovetski 
Cc: Laurent Pinchart 
Cc: Hans Verkuil 
Cc: Sakari Ailus 
Cc: Mauro Carvalho Chehab 
---
 drivers/media/i2c/tvp514x.c |   22 +++---
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index 864eb14..d090caf 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -1148,9 +1149,9 @@ tvp514x_probe(struct i2c_client *client, const struct 
i2c_device_id *id)
/* Register with V4L2 layer as slave device */
sd = &decoder->sd;
v4l2_i2c_subdev_init(sd, client, &tvp514x_ops);
-   strlcpy(sd->name, TVP514X_MODULE_NAME, sizeof(sd->name));
 
 #if defined(CONFIG_MEDIA_CONTROLLER)
+   strlcpy(sd->name, TVP514X_MODULE_NAME, sizeof(sd->name));
decoder->pad.flags = MEDIA_PAD_FL_SOURCE;
decoder->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
decoder->sd.entity.flags |= MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
@@ -1176,16 +1177,22 @@ tvp514x_probe(struct i2c_client *client, const struct 
i2c_device_id *id)
sd->ctrl_handler = &decoder->hdl;
if (decoder->hdl.error) {
ret = decoder->hdl.error;
-
-   v4l2_ctrl_handler_free(&decoder->hdl);
-   return ret;
+   goto done;
}
v4l2_ctrl_handler_setup(&decoder->hdl);
 
-   v4l2_info(sd, "%s decoder driver registered !!\n", sd->name);
-
-   return 0;
+   ret = v4l2_async_register_subdev(&decoder->sd);
+   if (!ret)
+   v4l2_info(sd, "%s decoder driver registered !!\n", sd->name);
 
+done:
+   if (ret < 0) {
+   v4l2_ctrl_handler_free(&decoder->hdl);
+#if defined(CONFIG_MEDIA_CONTROLLER)
+   media_entity_cleanup(&decoder->sd.entity);
+#endif
+   }
+   return ret;
 }
 
 /**
@@ -1200,6 +1207,7 @@ static int tvp514x_remove(struct i2c_client *client)
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct tvp514x_decoder *decoder = to_decoder(sd);
 
+   v4l2_async_unregister_subdev(&decoder->sd);
v4l2_device_unregister_subdev(sd);
 #if defined(CONFIG_MEDIA_CONTROLLER)
media_entity_cleanup(&decoder->sd.entity);
-- 
1.7.9.5

--
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 RFC v3] media: OF: add video sync endpoint property

2013-06-22 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

This patch adds video sync properties as part of endpoint
properties and also support to parse them in the parser.

Signed-off-by: Lad, Prabhakar 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Mauro Carvalho Chehab 
Cc: Guennadi Liakhovetski 
Cc: Sylwester Nawrocki 
Cc: Sakari Ailus 
Cc: Grant Likely 
Cc: Rob Herring 
Cc: Rob Landley 
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Cc: davinci-linux-open-sou...@linux.davincidsp.com
Cc: Kyungmin Park 
---
 This patch has 10 warnings for line over 80 characters
 for which I think can be ignored.
 
 RFC v2 https://patchwork.kernel.org/patch/2578091/
 RFC V1 https://patchwork.kernel.org/patch/2572341/
 Changes for v3:
 1: Fixed review comments pointed by Laurent and Sylwester.
 
 .../devicetree/bindings/media/video-interfaces.txt |1 +
 drivers/media/v4l2-core/v4l2-of.c  |   20 ++
 include/dt-bindings/media/video-interfaces.h   |   17 +++
 include/media/v4l2-mediabus.h  |   22 +++-
 4 files changed, 50 insertions(+), 10 deletions(-)
 create mode 100644 include/dt-bindings/media/video-interfaces.h

diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt 
b/Documentation/devicetree/bindings/media/video-interfaces.txt
index e022d2d..2081278 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -101,6 +101,7 @@ Optional endpoint properties
   array contains only one entry.
 - clock-noncontinuous: a boolean property to allow MIPI CSI-2 non-continuous
   clock mode.
+- video-sync: property indicating to sync the video on a signal in RGB.
 
 
 Example
diff --git a/drivers/media/v4l2-core/v4l2-of.c 
b/drivers/media/v4l2-core/v4l2-of.c
index aa59639..1a54530 100644
--- a/drivers/media/v4l2-core/v4l2-of.c
+++ b/drivers/media/v4l2-core/v4l2-of.c
@@ -100,6 +100,26 @@ static void v4l2_of_parse_parallel_bus(const struct 
device_node *node,
if (!of_property_read_u32(node, "data-shift", &v))
bus->data_shift = v;
 
+   if (!of_property_read_u32(node, "video-sync", &v)) {
+   switch (v) {
+   case V4L2_MBUS_VIDEO_SEPARATE_SYNC:
+   flags |= V4L2_MBUS_VIDEO_SEPARATE_SYNC;
+   break;
+   case V4L2_MBUS_VIDEO_COMPOSITE_SYNC:
+   flags |= V4L2_MBUS_VIDEO_COMPOSITE_SYNC;
+   break;
+   case V4L2_MBUS_VIDEO_SYNC_ON_COMPOSITE:
+   flags |= V4L2_MBUS_VIDEO_SYNC_ON_COMPOSITE;
+   break;
+   case V4L2_MBUS_VIDEO_SYNC_ON_GREEN:
+   flags |= V4L2_MBUS_VIDEO_SYNC_ON_GREEN;
+   break;
+   case V4L2_MBUS_VIDEO_SYNC_ON_LUMINANCE:
+   flags |= V4L2_MBUS_VIDEO_SYNC_ON_LUMINANCE;
+   break;
+   }
+   }
+
bus->flags = flags;
 
 }
diff --git a/include/dt-bindings/media/video-interfaces.h 
b/include/dt-bindings/media/video-interfaces.h
new file mode 100644
index 000..1a083dd
--- /dev/null
+++ b/include/dt-bindings/media/video-interfaces.h
@@ -0,0 +1,17 @@
+/*
+ * This header provides constants for video interface.
+ *
+ */
+
+#ifndef _DT_BINDINGS_VIDEO_INTERFACES_H
+#define _DT_BINDINGS_VIDEO_INTERFACES_H
+
+#define V4L2_MBUS_VIDEO_SEPARATE_SYNC  (1 << 2)
+#define V4L2_MBUS_VIDEO_COMPOSITE_SYNC (1 << 3)
+#define V4L2_MBUS_VIDEO_SYNC_ON_COMPOSITE  (1 << 4)
+#define V4L2_MBUS_VIDEO_SYNC_ON_GREEN  (1 << 5)
+#define V4L2_MBUS_VIDEO_SYNC_ON_LUMINANCE  (1 << 6)
+
+#define V4L2_MBUS_VIDEO_INTERFACES_END 6
+
+#endif
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 83ae07e..a4676dd 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -11,6 +11,8 @@
 #ifndef V4L2_MEDIABUS_H
 #define V4L2_MEDIABUS_H
 
+#include 
+
 #include 
 
 /* Parallel flags */
@@ -28,18 +30,18 @@
  * V4L2_MBUS_[HV]SYNC* flags should be also used for specifying
  * configuration of hardware that uses [HV]REF signals
  */
-#define V4L2_MBUS_HSYNC_ACTIVE_HIGH(1 << 2)
-#define V4L2_MBUS_HSYNC_ACTIVE_LOW (1 << 3)
-#define V4L2_MBUS_VSYNC_ACTIVE_HIGH(1 << 4)
-#define V4L2_MBUS_VSYNC_ACTIVE_LOW (1 << 5)
-#define V4L2_MBUS_PCLK_SAMPLE_RISING   (1 << 6)
-#define V4L2_MBUS_PCLK_SAMPLE_FALLING  (1 << 7)
-#define V4L2_MBUS_DATA_ACTIVE_HIGH (1 << 8)
-#define V4L2_MBUS_DATA_ACTIVE_LOW  (1 << 9)
+#define V4L2_MBUS_HSYNC_ACTIVE_HIGH(1 << 
(V4L2_MBUS_VIDEO_INTERFACES_END + 1))
+#define V4L2_MBUS_HSYNC_ACTIVE_LOW (1 << 
(V4L2_MBUS_VIDEO_INTERFACES_END + 2))
+#define V4L2_MBUS_VSYNC_ACTIVE_HIGH(1 << 
(V4L2_MBUS_VIDEO_INTERFACES_END + 3))
+#define 

[PATCH v2 0/2] media: i2c: tvp7002: feature enhancement

2013-06-22 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

The first patch of the series add support for asynchronous probing
and the second patch adds OF support to tvp7002 driver.

Lad, Prabhakar (2):
  media: i2c: tvp7002: add support for asynchronous probing
  media: i2c: tvp7002: add OF support

 .../devicetree/bindings/media/i2c/tvp7002.txt  |   43 
 drivers/media/i2c/tvp7002.c|   73 ++--
 2 files changed, 109 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/tvp7002.txt

-- 
1.7.9.5

--
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 v2 1/2] media: i2c: tvp7002: add support for asynchronous probing

2013-06-22 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Both synchronous and asynchronous tvp7002 subdevice probing
is supported by this patch.

Signed-off-by: Lad, Prabhakar 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Mauro Carvalho Chehab 
Cc: Guennadi Liakhovetski 
Cc: Sylwester Nawrocki 
Cc: Sakari Ailus 
Cc: linux-ker...@vger.kernel.org
Cc: davinci-linux-open-sou...@linux.davincidsp.com
---
 drivers/media/i2c/tvp7002.c |6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index 36ad565..b577548 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1040,6 +1041,10 @@ static int tvp7002_probe(struct i2c_client *c, const 
struct i2c_device_id *id)
}
v4l2_ctrl_handler_setup(&device->hdl);
 
+   error = v4l2_async_register_subdev(&device->sd);
+   if (error)
+   goto error;
+
return 0;
 
 error:
@@ -1064,6 +1069,7 @@ static int tvp7002_remove(struct i2c_client *c)
 
v4l2_dbg(1, debug, sd, "Removing tvp7002 adapter"
"on address 0x%x\n", c->addr);
+   v4l2_async_unregister_subdev(&device->sd);
 #if defined(CONFIG_MEDIA_CONTROLLER)
media_entity_cleanup(&device->sd.entity);
 #endif
-- 
1.7.9.5

--
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 v2 2/2] media: i2c: tvp7002: add OF support

2013-06-22 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

add OF support for the tvp7002 driver.

Signed-off-by: Lad, Prabhakar 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Mauro Carvalho Chehab 
Cc: Guennadi Liakhovetski 
Cc: Sylwester Nawrocki 
Cc: Sakari Ailus 
Cc: Grant Likely 
Cc: Rob Herring 
Cc: Rob Landley 
Cc: devicetree-disc...@lists.ozlabs.org
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Cc: davinci-linux-open-sou...@linux.davincidsp.com
---
 Depends on patch https://patchwork.kernel.org/patch/2765851/
 
 .../devicetree/bindings/media/i2c/tvp7002.txt  |   43 +
 drivers/media/i2c/tvp7002.c|   67 ++--
 2 files changed, 103 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/tvp7002.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/tvp7002.txt 
b/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
new file mode 100644
index 000..9daebe1
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
@@ -0,0 +1,43 @@
+* Texas Instruments TV7002 video decoder
+
+The TVP7002 device supports digitizing of video and graphics signal in RGB and
+YPbPr color space.
+
+Required Properties :
+- compatible : Must be "ti,tvp7002"
+
+- hsync-active: HSYNC Polarity configuration for endpoint.
+
+- vsync-active: VSYNC Polarity configuration for endpoint.
+
+- pclk-sample: Clock polarity of the endpoint.
+
+- video-sync: Video sync property of the endpoint.
+
+- ti,tvp7002-fid-polarity: Active-high Field ID polarity of the endpoint.
+
+
+For further reading of port node refer Documentation/devicetree/bindings/media/
+video-interfaces.txt.
+
+Example:
+
+   i2c0@1c22000 {
+   ...
+   ...
+   tvp7002@5c {
+   compatible = "ti,tvp7002";
+   reg = <0x5c>;
+
+   port {
+   tvp7002_1: endpoint {
+   hsync-active = <1>;
+   vsync-active = <1>;
+   pclk-sample = <0>;
+   video-sync = 
;
+   ti,tvp7002-fid-polarity;
+   };
+   };
+   };
+   ...
+   };
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index b577548..4896024 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -35,6 +35,8 @@
 #include 
 #include 
 #include 
+#include 
+
 #include "tvp7002_reg.h"
 
 MODULE_DESCRIPTION("TI TVP7002 Video and Graphics Digitizer driver");
@@ -943,6 +945,48 @@ static const struct v4l2_subdev_ops tvp7002_ops = {
.pad = &tvp7002_pad_ops,
 };
 
+static struct tvp7002_config *
+tvp7002_get_pdata(struct i2c_client *client)
+{
+   struct v4l2_of_endpoint bus_cfg;
+   struct tvp7002_config *pdata;
+   struct device_node *endpoint;
+   unsigned int flags;
+
+   if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
+   return client->dev.platform_data;
+
+   endpoint = v4l2_of_get_next_endpoint(client->dev.of_node, NULL);
+   if (!endpoint)
+   return NULL;
+
+   pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata)
+   goto done;
+
+   v4l2_of_parse_endpoint(endpoint, &bus_cfg);
+   flags = bus_cfg.bus.parallel.flags;
+
+   if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
+   pdata->hs_polarity = 1;
+
+   if (flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
+   pdata->vs_polarity = 1;
+
+   if (flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
+   pdata->clk_polarity = 1;
+
+   if (flags & V4L2_MBUS_VIDEO_SYNC_ON_GREEN)
+   pdata->sog_polarity = 1;
+
+   pdata->fid_polarity = of_property_read_bool(endpoint,
+   "ti,tvp7002-fid-polarity");
+
+done:
+   of_node_put(endpoint);
+   return pdata;
+}
+
 /*
  * tvp7002_probe - Probe a TVP7002 device
  * @c: ptr to i2c_client struct
@@ -954,32 +998,32 @@ static const struct v4l2_subdev_ops tvp7002_ops = {
  */
 static int tvp7002_probe(struct i2c_client *c, const struct i2c_device_id *id)
 {
+   struct tvp7002_config *pdata = tvp7002_get_pdata(c);
struct v4l2_subdev *sd;
struct tvp7002 *device;
struct v4l2_dv_timings timings;
int polarity_a;
int polarity_b;
u8 revision;
-
int error;
 
+   if (pdata == NULL) {
+   dev_err(&c->dev, "No platform data\n");
+   return -EINVAL;
+   }
+
/* Check if the adapter supports the needed features */
if (!i2c_check_functionality(c->adapter,
I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
return -EIO;
 
-   if (!c->dev.platform_data) {
-   v4l_err(c, "No platform 

Re: [PATCH] media: i2c: tvp514x: add support for asynchronous probing

2013-06-23 Thread Prabhakar Lad
Hi Guennadi,

Thanks for the review.

On Sun, Jun 23, 2013 at 8:49 PM, Guennadi Liakhovetski
 wrote:
> On Sat, 22 Jun 2013, Prabhakar Lad wrote:
>
>> From: "Lad, Prabhakar" 
>>
>> Both synchronous and asynchronous tvp514x subdevice probing is supported by
>> this patch.
>>
>> Signed-off-by: Prabhakar Lad 
>> Cc: Guennadi Liakhovetski 
>> Cc: Laurent Pinchart 
>> Cc: Hans Verkuil 
>> Cc: Sakari Ailus 
>> Cc: Mauro Carvalho Chehab 
>> ---
>>  drivers/media/i2c/tvp514x.c |   22 +++---
>>  1 file changed, 15 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
>> index 864eb14..d090caf 100644
>> --- a/drivers/media/i2c/tvp514x.c
>> +++ b/drivers/media/i2c/tvp514x.c
>> @@ -36,6 +36,7 @@
>>  #include 
>>  #include 
>>
>> +#include 
>>  #include 
>>  #include 
>>  #include 
>
> Ok, but this one really does too many things in one patch:
>
>> @@ -1148,9 +1149,9 @@ tvp514x_probe(struct i2c_client *client, const struct 
>> i2c_device_id *id)
>>   /* Register with V4L2 layer as slave device */
>>   sd = &decoder->sd;
>>   v4l2_i2c_subdev_init(sd, client, &tvp514x_ops);
>> - strlcpy(sd->name, TVP514X_MODULE_NAME, sizeof(sd->name));
>>
>>  #if defined(CONFIG_MEDIA_CONTROLLER)
>> + strlcpy(sd->name, TVP514X_MODULE_NAME, sizeof(sd->name));
>
> This is unrelated
>
OK I'll split the patch or may be a line in a commit message can do ?

>>   decoder->pad.flags = MEDIA_PAD_FL_SOURCE;
>>   decoder->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
>>   decoder->sd.entity.flags |= MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
>> @@ -1176,16 +1177,22 @@ tvp514x_probe(struct i2c_client *client, const 
>> struct i2c_device_id *id)
>>   sd->ctrl_handler = &decoder->hdl;
>>   if (decoder->hdl.error) {
>>   ret = decoder->hdl.error;
>> -
>> - v4l2_ctrl_handler_free(&decoder->hdl);
>> - return ret;
>> + goto done;
>>   }
>>   v4l2_ctrl_handler_setup(&decoder->hdl);
>>
>> - v4l2_info(sd, "%s decoder driver registered !!\n", sd->name);
>> -
>> - return 0;
>> + ret = v4l2_async_register_subdev(&decoder->sd);
>> + if (!ret)
>> + v4l2_info(sd, "%s decoder driver registered !!\n", sd->name);
>>
>> +done:
>> + if (ret < 0) {
>> + v4l2_ctrl_handler_free(&decoder->hdl);
>> +#if defined(CONFIG_MEDIA_CONTROLLER)
>> + media_entity_cleanup(&decoder->sd.entity);
>
> So is this - it wasn't called before in the "if (decoder->hdl.error)" case
> above.
>
Yes so fixed it up here.

Regards,
--Prabhakar Lad
--
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 v2] [media] tvp514x: Fix init seqeunce

2013-06-23 Thread Prabhakar Lad
On Sun, Jun 23, 2013 at 7:31 PM, Lars-Peter Clausen  wrote:
> client->driver->id_table will always point to the first entry in the device id
> table. So all devices will use the same init sequence. Use the id table entry
> that gets passed to the driver's probe() function to get the right init
> sequence.
>
> Signed-off-by: Lars-Peter Clausen 

Acked-by: Lad, Prabhakar 
Tested-by: Lad, Prabhakar 

Regards,
--Prabhakar Lad
--
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 v2 1/2] media: i2c: tvp7002: add support for asynchronous probing

2013-06-24 Thread Prabhakar Lad
Hi Hans,

On Mon, Jun 24, 2013 at 12:44 PM, Hans Verkuil  wrote:
> On Sat June 22 2013 19:44:14 Prabhakar Lad wrote:
>> From: "Lad, Prabhakar" 
>>
>> Both synchronous and asynchronous tvp7002 subdevice probing
>> is supported by this patch.
>
> Can I merge this patch without patch 2/2? Or should I wait with both until
> the video sync properties have been approved?
>
You can go ahead and merge this one no need to wait for 2/2, I know
the video sync will take more time :)

Regards,
--Prabhakar Lad
--
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] media: i2c: tvp514x: add support for asynchronous probing

2013-06-24 Thread Prabhakar Lad
Hi Hans,

On Mon, Jun 24, 2013 at 12:41 PM, Hans Verkuil  wrote:
> On Sun June 23 2013 17:48:20 Prabhakar Lad wrote:
>> Hi Guennadi,
>>
>> Thanks for the review.
>>
>> On Sun, Jun 23, 2013 at 8:49 PM, Guennadi Liakhovetski
>>  wrote:
>> > On Sat, 22 Jun 2013, Prabhakar Lad wrote:
>> >
>> >> From: "Lad, Prabhakar" 
>> >>
>> >> Both synchronous and asynchronous tvp514x subdevice probing is supported 
>> >> by
>> >> this patch.
>> >>
>> >> Signed-off-by: Prabhakar Lad 
>> >> Cc: Guennadi Liakhovetski 
>> >> Cc: Laurent Pinchart 
>> >> Cc: Hans Verkuil 
>> >> Cc: Sakari Ailus 
>> >> Cc: Mauro Carvalho Chehab 
>> >> ---
>> >>  drivers/media/i2c/tvp514x.c |   22 +++---
>> >>  1 file changed, 15 insertions(+), 7 deletions(-)
>> >>
>> >> diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
>> >> index 864eb14..d090caf 100644
>> >> --- a/drivers/media/i2c/tvp514x.c
>> >> +++ b/drivers/media/i2c/tvp514x.c
>> >> @@ -36,6 +36,7 @@
>> >>  #include 
>> >>  #include 
>> >>
>> >> +#include 
>> >>  #include 
>> >>  #include 
>> >>  #include 
>> >
>> > Ok, but this one really does too many things in one patch:
>> >
>> >> @@ -1148,9 +1149,9 @@ tvp514x_probe(struct i2c_client *client, const 
>> >> struct i2c_device_id *id)
>> >>   /* Register with V4L2 layer as slave device */
>> >>   sd = &decoder->sd;
>> >>   v4l2_i2c_subdev_init(sd, client, &tvp514x_ops);
>> >> - strlcpy(sd->name, TVP514X_MODULE_NAME, sizeof(sd->name));
>> >>
>> >>  #if defined(CONFIG_MEDIA_CONTROLLER)
>> >> + strlcpy(sd->name, TVP514X_MODULE_NAME, sizeof(sd->name));
>> >
>> > This is unrelated
>> >
>> OK I'll split the patch or may be a line in a commit message can do ?
>
> Please split it up in two patches.
>
> Why is sd->name set anyway? And why is it moved under CONFIG_MEDIA_CONTROLLER?
> It's not obvious to me.
>
while using tvp514x subdev with media controller based drivers, when we
enumerate entities (MEDIA_IOC_ENUM_ENTITIES) to get the index id
of the entity we compare the entity name with "tvp514x", So I moved it
under CONFIG_MEDIA_CONTROLLER config. I hope you are OK with
moving this in a separate patch.

Regards,
--Prabhakar Lad
--
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] media: i2c: tvp514x: add support for asynchronous probing

2013-06-24 Thread Prabhakar Lad
Hi Hans,

On Mon, Jun 24, 2013 at 2:09 PM, Hans Verkuil  wrote:
> On Mon June 24 2013 10:24:02 Prabhakar Lad wrote:
>> Hi Hans,
>>
>> On Mon, Jun 24, 2013 at 12:41 PM, Hans Verkuil  wrote:
>> > On Sun June 23 2013 17:48:20 Prabhakar Lad wrote:
>> >> Hi Guennadi,
>> >>
>> >> Thanks for the review.
>> >>
>> >> On Sun, Jun 23, 2013 at 8:49 PM, Guennadi Liakhovetski
>> >>  wrote:
>> >> > On Sat, 22 Jun 2013, Prabhakar Lad wrote:
>> >> >
>> >> >> From: "Lad, Prabhakar" 
>> >> >>
>> >> >> Both synchronous and asynchronous tvp514x subdevice probing is 
>> >> >> supported by
>> >> >> this patch.
>> >> >>
>> >> >> Signed-off-by: Prabhakar Lad 
>> >> >> Cc: Guennadi Liakhovetski 
>> >> >> Cc: Laurent Pinchart 
>> >> >> Cc: Hans Verkuil 
>> >> >> Cc: Sakari Ailus 
>> >> >> Cc: Mauro Carvalho Chehab 
>> >> >> ---
>> >> >>  drivers/media/i2c/tvp514x.c |   22 +++---
>> >> >>  1 file changed, 15 insertions(+), 7 deletions(-)
>> >> >>
>> >> >> diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
>> >> >> index 864eb14..d090caf 100644
>> >> >> --- a/drivers/media/i2c/tvp514x.c
>> >> >> +++ b/drivers/media/i2c/tvp514x.c
>> >> >> @@ -36,6 +36,7 @@
>> >> >>  #include 
>> >> >>  #include 
>> >> >>
>> >> >> +#include 
>> >> >>  #include 
>> >> >>  #include 
>> >> >>  #include 
>> >> >
>> >> > Ok, but this one really does too many things in one patch:
>> >> >
>> >> >> @@ -1148,9 +1149,9 @@ tvp514x_probe(struct i2c_client *client, const 
>> >> >> struct i2c_device_id *id)
>> >> >>   /* Register with V4L2 layer as slave device */
>> >> >>   sd = &decoder->sd;
>> >> >>   v4l2_i2c_subdev_init(sd, client, &tvp514x_ops);
>> >> >> - strlcpy(sd->name, TVP514X_MODULE_NAME, sizeof(sd->name));
>> >> >>
>> >> >>  #if defined(CONFIG_MEDIA_CONTROLLER)
>> >> >> + strlcpy(sd->name, TVP514X_MODULE_NAME, sizeof(sd->name));
>> >> >
>> >> > This is unrelated
>> >> >
>> >> OK I'll split the patch or may be a line in a commit message can do ?
>> >
>> > Please split it up in two patches.
>> >
>> > Why is sd->name set anyway? And why is it moved under 
>> > CONFIG_MEDIA_CONTROLLER?
>> > It's not obvious to me.
>> >
>> while using tvp514x subdev with media controller based drivers, when we
>> enumerate entities (MEDIA_IOC_ENUM_ENTITIES) to get the index id
>> of the entity we compare the entity name with "tvp514x", So I moved it
>> under CONFIG_MEDIA_CONTROLLER config. I hope you are OK with
>> moving this in a separate patch.
>
> Sorry, but this approach is wrong. sd->name must be a unique name, so manually
> setting sd->name will fail if you have two tvp514x devices.
>
> There is no reason to override sd->name here, and it is actually a bug. I see
> that tvp7002 has the same problem (and a bunch of others as well).
>
> When trying to find a tvp514x you can just use strstr() in your application.
> That will work all the time as long as there is only one tvp514x.

OK, then I will send out a cleanup patch removing sd->name from this driver
and others too.

Regards,
--Prabhakar Lad
--
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 2/2] media: i2c: tvp514x: remove manual setting of subdev name

2013-06-24 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

This patch removes manual setting of subdev name in the
probe, ideally subdev names must be unique.

Signed-off-by: Lad, Prabhakar 
Cc: Hans Verkuil 
---
 drivers/media/i2c/tvp514x.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index 864eb14..6578976 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -1148,7 +1148,6 @@ tvp514x_probe(struct i2c_client *client, const struct 
i2c_device_id *id)
/* Register with V4L2 layer as slave device */
sd = &decoder->sd;
v4l2_i2c_subdev_init(sd, client, &tvp514x_ops);
-   strlcpy(sd->name, TVP514X_MODULE_NAME, sizeof(sd->name));
 
 #if defined(CONFIG_MEDIA_CONTROLLER)
decoder->pad.flags = MEDIA_PAD_FL_SOURCE;
-- 
1.7.9.5

--
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 0/2] tvp514x/tvp7002 remove manual setting of subdev names

2013-06-24 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

This patch series removes manual setting of subdev names, as
ideally the subdev names must be unique and this would not be
the case if there are two devices.

Lad, Prabhakar (2):
  media: i2c: tvp7002: remove manual setting of subdev name
  media: i2c: tvp514x: remove manual setting of subdev name

 drivers/media/i2c/tvp514x.c |1 -
 drivers/media/i2c/tvp7002.c |1 -
 2 files changed, 2 deletions(-)

-- 
1.7.9.5

--
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 1/2] media: i2c: tvp7002: remove manual setting of subdev name

2013-06-24 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

This patch removes manual setting of subdev name in the
probe, ideally subdev names must be unique.

Signed-off-by: Lad, Prabhakar 
Cc: Hans Verkuil 
---
 drivers/media/i2c/tvp7002.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index 4896024..ba8a7b5 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -1065,7 +1065,6 @@ static int tvp7002_probe(struct i2c_client *c, const 
struct i2c_device_id *id)
error = tvp7002_s_dv_timings(sd, &timings);
 
 #if defined(CONFIG_MEDIA_CONTROLLER)
-   strlcpy(sd->name, TVP7002_MODULE_NAME, sizeof(sd->name));
device->pad.flags = MEDIA_PAD_FL_SOURCE;
device->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
device->sd.entity.flags |= MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
-- 
1.7.9.5

--
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 v2] media: i2c: tvp514x: add support for asynchronous probing

2013-06-24 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Both synchronous and asynchronous tvp514x subdevice probing
is supported by this patch.
This patch also fixes the error path by calling
media_entity_cleanup() on failure in probe when
CONFIG_MEDIA_CONTROLLER is enabled.

Signed-off-by: Prabhakar Lad 
Cc: Guennadi Liakhovetski 
Cc: Laurent Pinchart 
Cc: Hans Verkuil 
Cc: Sakari Ailus 
Cc: Mauro Carvalho Chehab 
---
 Changes for v2:
 1: Fixed review comments pointed by Hans and Guennadi.
 
 drivers/media/i2c/tvp514x.c |   20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index 6578976..b9e621b 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -1175,16 +1176,22 @@ tvp514x_probe(struct i2c_client *client, const struct 
i2c_device_id *id)
sd->ctrl_handler = &decoder->hdl;
if (decoder->hdl.error) {
ret = decoder->hdl.error;
-
-   v4l2_ctrl_handler_free(&decoder->hdl);
-   return ret;
+   goto done;
}
v4l2_ctrl_handler_setup(&decoder->hdl);
 
-   v4l2_info(sd, "%s decoder driver registered !!\n", sd->name);
-
-   return 0;
+   ret = v4l2_async_register_subdev(&decoder->sd);
+   if (!ret)
+   v4l2_info(sd, "%s decoder driver registered !!\n", sd->name);
 
+done:
+   if (ret < 0) {
+   v4l2_ctrl_handler_free(&decoder->hdl);
+#if defined(CONFIG_MEDIA_CONTROLLER)
+   media_entity_cleanup(&decoder->sd.entity);
+#endif
+   }
+   return ret;
 }
 
 /**
@@ -1199,6 +1206,7 @@ static int tvp514x_remove(struct i2c_client *client)
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct tvp514x_decoder *decoder = to_decoder(sd);
 
+   v4l2_async_unregister_subdev(&decoder->sd);
v4l2_device_unregister_subdev(sd);
 #if defined(CONFIG_MEDIA_CONTROLLER)
media_entity_cleanup(&decoder->sd.entity);
-- 
1.7.9.5

--
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 RFC v3] media: OF: add video sync endpoint property

2013-06-24 Thread Prabhakar Lad
Hi Hans,

Thanks for the review.

On Mon, Jun 24, 2013 at 1:21 PM, Hans Verkuil  wrote:
> Hi Prabhakar,
>
> On Sat June 22 2013 17:03:03 Prabhakar Lad wrote:
>> From: "Lad, Prabhakar" 
>>
>> This patch adds video sync properties as part of endpoint
>> properties and also support to parse them in the parser.
>>
>> Signed-off-by: Lad, Prabhakar 
>> Cc: Hans Verkuil 
>
> FYI: using my private email when CC-ing me generally works better.
> I often skip v4l2-related emails to my work address since I assume those
> have either been CC-ed to my private email and/or linux-media.
>
OK hence forth I'll take care of it.

> I wondered why I never saw RFC v1/2, now I know :-)
[Snip]
>>clock mode.
>> +- video-sync: property indicating to sync the video on a signal in RGB.
>
> Please document what the various syncs actually mean.
>
OK

>>
>>
>>  Example
>> diff --git a/drivers/media/v4l2-core/v4l2-of.c 
>> b/drivers/media/v4l2-core/v4l2-of.c
>> index aa59639..1a54530 100644
>> --- a/drivers/media/v4l2-core/v4l2-of.c
>> +++ b/drivers/media/v4l2-core/v4l2-of.c
>> @@ -100,6 +100,26 @@ static void v4l2_of_parse_parallel_bus(const struct 
>> device_node *node,
>>   if (!of_property_read_u32(node, "data-shift", &v))
>>   bus->data_shift = v;
>>
>> + if (!of_property_read_u32(node, "video-sync", &v)) {
>> + switch (v) {
>> + case V4L2_MBUS_VIDEO_SEPARATE_SYNC:
>> + flags |= V4L2_MBUS_VIDEO_SEPARATE_SYNC;
>> + break;
>> + case V4L2_MBUS_VIDEO_COMPOSITE_SYNC:
>> + flags |= V4L2_MBUS_VIDEO_COMPOSITE_SYNC;
>> + break;
>> + case V4L2_MBUS_VIDEO_SYNC_ON_COMPOSITE:
>> + flags |= V4L2_MBUS_VIDEO_SYNC_ON_COMPOSITE;
>> + break;
>> + case V4L2_MBUS_VIDEO_SYNC_ON_GREEN:
>> + flags |= V4L2_MBUS_VIDEO_SYNC_ON_GREEN;
>> + break;
>> + case V4L2_MBUS_VIDEO_SYNC_ON_LUMINANCE:
>> + flags |= V4L2_MBUS_VIDEO_SYNC_ON_LUMINANCE;
>> + break;
>> + }
>> + }
>> +
>>   bus->flags = flags;
>>
>>  }
>> diff --git a/include/dt-bindings/media/video-interfaces.h 
>> b/include/dt-bindings/media/video-interfaces.h
>> new file mode 100644
>> index 000..1a083dd
>> --- /dev/null
>> +++ b/include/dt-bindings/media/video-interfaces.h
>> @@ -0,0 +1,17 @@
>> +/*
>> + * This header provides constants for video interface.
>> + *
>> + */
>> +
>> +#ifndef _DT_BINDINGS_VIDEO_INTERFACES_H
>> +#define _DT_BINDINGS_VIDEO_INTERFACES_H
>> +
>> +#define V4L2_MBUS_VIDEO_SEPARATE_SYNC(1 << 2)
>> +#define V4L2_MBUS_VIDEO_COMPOSITE_SYNC   (1 << 3)
>> +#define V4L2_MBUS_VIDEO_SYNC_ON_COMPOSITE(1 << 4)
>
> What on earth is the difference between "COMPOSITE_SYNC" and 
> "SYNC_ON_COMPOSITE"?!
>
Ahh my bad.

>> +#define V4L2_MBUS_VIDEO_SYNC_ON_GREEN(1 << 5)
>> +#define V4L2_MBUS_VIDEO_SYNC_ON_LUMINANCE(1 << 6)
>> +
>> +#define V4L2_MBUS_VIDEO_INTERFACES_END   6
>> +
>> +#endif
>
> Why would this be here? It isn't Device Tree specific, the same defines can
> be used without DT as well.
>
This is in here because we cannot include header files from other folder in
device tree files.

>> diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
>> index 83ae07e..a4676dd 100644
>> --- a/include/media/v4l2-mediabus.h
>> +++ b/include/media/v4l2-mediabus.h
>> @@ -11,6 +11,8 @@
>>  #ifndef V4L2_MEDIABUS_H
>>  #define V4L2_MEDIABUS_H
>>
>> +#include 
>> +
>>  #include 
>>
>>  /* Parallel flags */
>> @@ -28,18 +30,18 @@
>>   * V4L2_MBUS_[HV]SYNC* flags should be also used for specifying
>>   * configuration of hardware that uses [HV]REF signals
>>   */
>> -#define V4L2_MBUS_HSYNC_ACTIVE_HIGH  (1 << 2)
>> -#define V4L2_MBUS_HSYNC_ACTIVE_LOW   (1 << 3)
>> -#define V4L2_MBUS_VSYNC_ACTIVE_HIGH  (1 << 4)
>> -#define V4L2_MBUS_VSYNC_ACTIVE_LOW   (1 << 5)
>> -#define V4L2_MBUS_PCLK_SAMPLE_RISING (1 << 6)
>> -#define V4L2_MBUS_PCLK_SAMPLE_FALLING(1 << 7)
>> -#define V4L2_MBUS_DATA_ACTIVE_HIGH   (1 <

Re: [PATCH RFC v3] media: OF: add video sync endpoint property

2013-06-25 Thread Prabhakar Lad
Hi Hans,

On Mon, Jun 24, 2013 at 1:21 PM, Hans Verkuil  wrote:
> Hi Prabhakar,
>
> On Sat June 22 2013 17:03:03 Prabhakar Lad wrote:
>> From: "Lad, Prabhakar" 
>>
[snip]
>> +#ifndef _DT_BINDINGS_VIDEO_INTERFACES_H
>> +#define _DT_BINDINGS_VIDEO_INTERFACES_H
>> +
>> +#define V4L2_MBUS_VIDEO_SEPARATE_SYNC(1 << 2)
>> +#define V4L2_MBUS_VIDEO_COMPOSITE_SYNC   (1 << 3)
>> +#define V4L2_MBUS_VIDEO_SYNC_ON_COMPOSITE(1 << 4)
>
> What on earth is the difference between "COMPOSITE_SYNC" and 
> "SYNC_ON_COMPOSITE"?!
>
This link http://en.wikipedia.org/wiki/Component_video_sync
would give a better explanation about it.

Regards,
--Prabhakar Lad
--
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 1/2] media: davinci: vpif: capture: add V4L2-async support

2013-06-25 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Add support for asynchronous subdevice probing, using the v4l2-async API.
The legacy synchronous mode is still supported too, which allows to
gradually update drivers and platforms.

Signed-off-by: Prabhakar Lad 
Cc: Guennadi Liakhovetski 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Sakari Ailus 
Cc: Mauro Carvalho Chehab 
---
 drivers/media/platform/davinci/vpif_capture.c |  151 +
 drivers/media/platform/davinci/vpif_capture.h |2 +
 include/media/davinci/vpif_types.h|2 +
 3 files changed, 107 insertions(+), 48 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index 5514175..b11d7a7 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1979,6 +1979,76 @@ vpif_init_free_channel_objects:
return err;
 }
 
+static int vpif_async_bound(struct v4l2_async_notifier *notifier,
+   struct v4l2_subdev *subdev,
+   struct v4l2_async_subdev *asd)
+{
+   int i;
+
+   for (i = 0; i < vpif_obj.config->subdev_count; i++)
+   if (!strcmp(vpif_obj.config->subdev_info[i].name,
+   subdev->name)) {
+   vpif_obj.sd[i] = subdev;
+   return 0;
+   }
+
+   return -EINVAL;
+}
+
+static int vpif_probe_complete(void)
+{
+   struct common_obj *common;
+   struct channel_obj *ch;
+   int i, j, err, k;
+
+   for (j = 0; j < VPIF_CAPTURE_MAX_DEVICES; j++) {
+   ch = vpif_obj.dev[j];
+   ch->channel_id = j;
+   common = &(ch->common[VPIF_VIDEO_INDEX]);
+   spin_lock_init(&common->irqlock);
+   mutex_init(&common->lock);
+   ch->video_dev->lock = &common->lock;
+   /* Initialize prio member of channel object */
+   v4l2_prio_init(&ch->prio);
+   video_set_drvdata(ch->video_dev, ch);
+
+   /* select input 0 */
+   err = vpif_set_input(vpif_obj.config, ch, 0);
+   if (err)
+   goto probe_out;
+
+   err = video_register_device(ch->video_dev,
+   VFL_TYPE_GRABBER, (j ? 1 : 0));
+   if (err)
+   goto probe_out;
+   }
+
+   v4l2_info(&vpif_obj.v4l2_dev, "VPIF capture driver initialized\n");
+   return 0;
+
+probe_out:
+   for (k = 0; k < j; k++) {
+   /* Get the pointer to the channel object */
+   ch = vpif_obj.dev[k];
+   /* Unregister video device */
+   video_unregister_device(ch->video_dev);
+   }
+   kfree(vpif_obj.sd);
+   for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) {
+   ch = vpif_obj.dev[i];
+   /* Note: does nothing if ch->video_dev == NULL */
+   video_device_release(ch->video_dev);
+   }
+   v4l2_device_unregister(&vpif_obj.v4l2_dev);
+
+   return err;
+}
+
+static int vpif_async_complete(struct v4l2_async_notifier *notifier)
+{
+   return vpif_probe_complete();
+}
+
 /**
  * vpif_probe : This function probes the vpif capture driver
  * @pdev: platform device pointer
@@ -1989,12 +2059,10 @@ vpif_init_free_channel_objects:
 static __init int vpif_probe(struct platform_device *pdev)
 {
struct vpif_subdev_info *subdevdata;
-   struct vpif_capture_config *config;
-   int i, j, k, err;
+   int i, j, err;
int res_idx = 0;
struct i2c_adapter *i2c_adap;
struct channel_obj *ch;
-   struct common_obj *common;
struct video_device *vfd;
struct resource *res;
int subdev_count;
@@ -2068,10 +2136,9 @@ static __init int vpif_probe(struct platform_device 
*pdev)
}
}
 
-   i2c_adap = i2c_get_adapter(1);
-   config = pdev->dev.platform_data;
+   vpif_obj.config = pdev->dev.platform_data;
 
-   subdev_count = config->subdev_count;
+   subdev_count = vpif_obj.config->subdev_count;
vpif_obj.sd = kzalloc(sizeof(struct v4l2_subdev *) * subdev_count,
GFP_KERNEL);
if (vpif_obj.sd == NULL) {
@@ -2080,54 +2147,42 @@ static __init int vpif_probe(struct platform_device 
*pdev)
goto vpif_sd_error;
}
 
-   for (i = 0; i < subdev_count; i++) {
-   subdevdata = &config->subdev_info[i];
-   vpif_obj.sd[i] =
-   v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev,
- i2c_adap,
- &subdevdata->board_info,
- NULL);
-
-  

[PATCH 2/2] media: davinci: vpif: display: add V4L2-async support

2013-06-25 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Add support for asynchronous subdevice probing, using the v4l2-async API.
The legacy synchronous mode is still supported too, which allows to
gradually update drivers and platforms.

Signed-off-by: Lad, Prabhakar 
Cc: Guennadi Liakhovetski 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Sakari Ailus 
Cc: Mauro Carvalho Chehab 
---
 drivers/media/platform/davinci/vpif_display.c |  210 +++--
 drivers/media/platform/davinci/vpif_display.h |3 +-
 include/media/davinci/vpif_types.h|2 +
 3 files changed, 132 insertions(+), 83 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_display.c 
b/drivers/media/platform/davinci/vpif_display.c
index e6e5736..c2ff067 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1618,6 +1618,102 @@ vpif_init_free_channel_objects:
return err;
 }
 
+static int vpif_async_bound(struct v4l2_async_notifier *notifier,
+   struct v4l2_subdev *subdev,
+   struct v4l2_async_subdev *asd)
+{
+   int i;
+
+   for (i = 0; i < vpif_obj.config->subdev_count; i++)
+   if (!strcmp(vpif_obj.config->subdevinfo[i].name,
+   subdev->name)) {
+   vpif_obj.sd[i] = subdev;
+   vpif_obj.sd[i]->grp_id = 1 << i;
+   return 0;
+   }
+
+   return -EINVAL;
+}
+
+static int vpif_probe_complete(void)
+{
+   struct common_obj *common;
+   struct channel_obj *ch;
+   int j, err, k;
+
+   for (j = 0; j < VPIF_DISPLAY_MAX_DEVICES; j++) {
+   ch = vpif_obj.dev[j];
+   /* Initialize field of the channel objects */
+   atomic_set(&ch->usrs, 0);
+   for (k = 0; k < VPIF_NUMOBJECTS; k++) {
+   ch->common[k].numbuffers = 0;
+   common = &ch->common[k];
+   common->io_usrs = 0;
+   common->started = 0;
+   spin_lock_init(&common->irqlock);
+   mutex_init(&common->lock);
+   common->numbuffers = 0;
+   common->set_addr = NULL;
+   common->ytop_off = 0;
+   common->ybtm_off = 0;
+   common->ctop_off = 0;
+   common->cbtm_off = 0;
+   common->cur_frm = NULL;
+   common->next_frm = NULL;
+   memset(&common->fmt, 0, sizeof(common->fmt));
+   common->numbuffers = config_params.numbuffers[k];
+   }
+   ch->initialized = 0;
+   if (vpif_obj.config->subdev_count)
+   ch->sd = vpif_obj.sd[0];
+   ch->channel_id = j;
+   if (j < 2)
+   ch->common[VPIF_VIDEO_INDEX].numbuffers =
+   config_params.numbuffers[ch->channel_id];
+   else
+   ch->common[VPIF_VIDEO_INDEX].numbuffers = 0;
+
+   memset(&ch->vpifparams, 0, sizeof(ch->vpifparams));
+
+   /* Initialize prio member of channel object */
+   v4l2_prio_init(&ch->prio);
+   ch->common[VPIF_VIDEO_INDEX].fmt.type =
+   V4L2_BUF_TYPE_VIDEO_OUTPUT;
+   ch->video_dev->lock = &common->lock;
+   video_set_drvdata(ch->video_dev, ch);
+
+   /* select output 0 */
+   err = vpif_set_output(vpif_obj.config, ch, 0);
+   if (err)
+   goto probe_out;
+
+   /* register video device */
+   vpif_dbg(1, debug, "channel=%x,channel->video_dev=%x\n",
+(int)ch, (int)&ch->video_dev);
+
+   err = video_register_device(ch->video_dev,
+ VFL_TYPE_GRABBER, (j ? 3 : 2));
+   if (err < 0)
+   goto probe_out;
+   }
+
+   return 0;
+
+probe_out:
+   for (k = 0; k < j; k++) {
+   ch = vpif_obj.dev[k];
+   video_unregister_device(ch->video_dev);
+   video_device_release(ch->video_dev);
+   ch->video_dev = NULL;
+   }
+   return err;
+}
+
+static int vpif_async_complete(struct v4l2_async_notifier *notifier)
+{
+   return vpif_probe_complete();
+}
+
 /*
  * vpif_probe: This function creates device entries by register itself to the
  * V4L2 driver and initializes fields of each channel objects
@@ -1625,11 +1721,9 @@ vpif_init_free_channel_objects:
 static __init int vpif_probe(struct platform_device *pdev)
 {
struct vpif_subdev_info *subdevdata;
-   struct vpif_display_config *config;
-   int i, j = 0, k, err = 0;
+   int i, j = 0, err = 0;
int res_idx = 0;
struct i2c_adapter *i2c_adap

[PATCH 0/2] media: davinci: vpif: capture/display support for async subdevice probing

2013-06-25 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

This patch series adds support for vpif capture and display
driver to support asynchronously register subdevices.

Need for this support:
Currently bridge device drivers register devices for all subdevices
synchronously, typically, during their probing. E.g. if an I2C CMOS sensor
is attached to a video bridge device, the bridge driver will create an I2C
device and wait for the respective I2C driver to probe. This makes linking
of devices straight forward, but this approach cannot be used with
intrinsically asynchronous and unordered device registration systems like
the Flattened Device Tree.

This is the NON RFC version, following are previous RFC versions,
RFC V1: 
http://us.generation-nt.com/answer/patch-rfc-0-3-vpif-capture-support-async-subdevice-probing-help-210037922.html
RFC V2: https://lkml.org/lkml/2013/4/22/159
RFC V3: http://lkml.indiana.edu/hypermail/linux/kernel/1305.1/03180.html

Lad, Prabhakar (2):
  media: davinci: vpif: capture: add V4L2-async support
  media: davinci: vpif: display: add V4L2-async support

 drivers/media/platform/davinci/vpif_capture.c |  151 --
 drivers/media/platform/davinci/vpif_capture.h |2 +
 drivers/media/platform/davinci/vpif_display.c |  210 +++--
 drivers/media/platform/davinci/vpif_display.h |3 +-
 include/media/davinci/vpif_types.h|4 +
 5 files changed, 239 insertions(+), 131 deletions(-)

-- 
1.7.9.5

--
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 1/2] media: davinci: vpif: capture: add V4L2-async support

2013-06-26 Thread Prabhakar Lad
Hi Hans,

Thanks for the review.

On Thu, Jun 27, 2013 at 11:27 AM, Hans Verkuil  wrote:
> On Tue June 25 2013 17:17:34 Prabhakar Lad wrote:
>> From: "Lad, Prabhakar" 
>>
>> Add support for asynchronous subdevice probing, using the v4l2-async API.
>> The legacy synchronous mode is still supported too, which allows to
>> gradually update drivers and platforms.
>>
>> Signed-off-by: Prabhakar Lad 
>> Cc: Guennadi Liakhovetski 
>> Cc: Hans Verkuil 
>> Cc: Laurent Pinchart 
>> Cc: Sakari Ailus 
>> Cc: Mauro Carvalho Chehab 
>> ---
>>  drivers/media/platform/davinci/vpif_capture.c |  151 
>> +
>>  drivers/media/platform/davinci/vpif_capture.h |2 +
>>  include/media/davinci/vpif_types.h|2 +
>>  3 files changed, 107 insertions(+), 48 deletions(-)
>>
>> diff --git a/drivers/media/platform/davinci/vpif_capture.c 
>> b/drivers/media/platform/davinci/vpif_capture.c
>> index 5514175..b11d7a7 100644
>> --- a/drivers/media/platform/davinci/vpif_capture.c
>> +++ b/drivers/media/platform/davinci/vpif_capture.c
>> @@ -1979,6 +1979,76 @@ vpif_init_free_channel_objects:
>>   return err;
>>  }
>>
>> +static int vpif_async_bound(struct v4l2_async_notifier *notifier,
>> + struct v4l2_subdev *subdev,
>> + struct v4l2_async_subdev *asd)
>> +{
>> + int i;
>> +
>> + for (i = 0; i < vpif_obj.config->subdev_count; i++)
>> + if (!strcmp(vpif_obj.config->subdev_info[i].name,
>> + subdev->name)) {
>
> Since the subdev name is now prefixed with the i2c bus identifier instead of
> just the chip name, does this code still work? Shouldn't it be 'strstr' 
> instead
> of strcmp? Ditto for vpif_display and possibly others where the same
> mechanism might be used.
>
This is because the DA850-EVM has two tvp514x devices and assigning
the tvp514x device to appropriate channel is important, In this case strstr()
wont work so I used strcmp instead to match it appropriately.

Yes the code still works tested on DA850-EVM, with this patch [1].

[1] 
http://git.linuxtv.org/mhadli/v4l-dvb-davinci_devices.git/commitdiff/c906a89762541361158cf73e9494fa2f1ff8ba02

Regards,
--Prabhakar Lad
--
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 RFC v3] media: OF: add video sync endpoint property

2013-07-11 Thread Prabhakar Lad
Hi Sylwester,

Oops some how missed this mail, sorry for the late response.

On Sun, Jun 30, 2013 at 9:23 PM, Sylwester Nawrocki
 wrote:
> Hi,
>
>
> On 06/22/2013 05:03 PM, Prabhakar Lad wrote:
>>
>> From: "Lad, Prabhakar"
>>
>> This patch adds video sync properties as part of endpoint
>> properties and also support to parse them in the parser.
>>
>> Signed-off-by: Lad, Prabhakar
>> Cc: Hans Verkuil
>> Cc: Laurent Pinchart
>> Cc: Mauro Carvalho Chehab
>> Cc: Guennadi Liakhovetski
>> Cc: Sylwester Nawrocki
>> Cc: Sakari Ailus
>> Cc: Grant Likely
>> Cc: Rob Herring
>> Cc: Rob Landley
>> Cc: devicetree-disc...@lists.ozlabs.org
>> Cc: linux-...@vger.kernel.org
>> Cc: linux-ker...@vger.kernel.org
>> Cc: davinci-linux-open-sou...@linux.davincidsp.com
>> Cc: Kyungmin Park
>
>
> Do you really need such a long Cc list here ? I think it would be better
> to just add relevant e-mail addresses when sending the patch, otherwise
> when this patch is applied in this form all those addresses are going to
> be spammed with the patch management notifications, which might not be
> what some ones are really interested in.
>
>
Ok I'll take care of it in the next version.

>> ---
>>   This patch has 10 warnings for line over 80 characters
>>   for which I think can be ignored.
>>
>>   RFC v2 https://patchwork.kernel.org/patch/2578091/
>>   RFC V1 https://patchwork.kernel.org/patch/2572341/
>>   Changes for v3:
>>   1: Fixed review comments pointed by Laurent and Sylwester.
>>
>>   .../devicetree/bindings/media/video-interfaces.txt |1 +
>>   drivers/media/v4l2-core/v4l2-of.c  |   20
>> ++
>>   include/dt-bindings/media/video-interfaces.h   |   17
>> +++
>>   include/media/v4l2-mediabus.h  |   22
>> +++-
>>   4 files changed, 50 insertions(+), 10 deletions(-)
>>   create mode 100644 include/dt-bindings/media/video-interfaces.h
>>
>> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt
>> b/Documentation/devicetree/bindings/media/video-interfaces.txt
>> index e022d2d..2081278 100644
>> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
>> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
>> @@ -101,6 +101,7 @@ Optional endpoint properties
>> array contains only one entry.
>>   - clock-noncontinuous: a boolean property to allow MIPI CSI-2
>> non-continuous
>> clock mode.
>> +- video-sync: property indicating to sync the video on a signal in RGB.
>>
>>
>>   Example
>> diff --git a/drivers/media/v4l2-core/v4l2-of.c
>> b/drivers/media/v4l2-core/v4l2-of.c
>> index aa59639..1a54530 100644
>> --- a/drivers/media/v4l2-core/v4l2-of.c
>> +++ b/drivers/media/v4l2-core/v4l2-of.c
>> @@ -100,6 +100,26 @@ static void v4l2_of_parse_parallel_bus(const struct
>> device_node *node,
>> if (!of_property_read_u32(node, "data-shift",&v))
>> bus->data_shift = v;
>>
>> +   if (!of_property_read_u32(node, "video-sync",&v)) {
>> +   switch (v) {
>> +   case V4L2_MBUS_VIDEO_SEPARATE_SYNC:
>> +   flags |= V4L2_MBUS_VIDEO_SEPARATE_SYNC;
>
>
> I'm not convinced all those video sync types is something that really
> belongs
> to the flags field. In my understanding this field is supposed to hold only
> the _signal polarity_ information.
>
>
Ok, so there should be a function say v4l2_of_parse_signal_polarity()
to get the polarity alone then.

>> +   break;
>> +   case V4L2_MBUS_VIDEO_COMPOSITE_SYNC:
>> +   flags |= V4L2_MBUS_VIDEO_COMPOSITE_SYNC;
>> +   break;
>> +   case V4L2_MBUS_VIDEO_SYNC_ON_COMPOSITE:
>> +   flags |= V4L2_MBUS_VIDEO_SYNC_ON_COMPOSITE;
>> +   break;
>> +   case V4L2_MBUS_VIDEO_SYNC_ON_GREEN:
>> +   flags |= V4L2_MBUS_VIDEO_SYNC_ON_GREEN;
>> +   break;
>> +   case V4L2_MBUS_VIDEO_SYNC_ON_LUMINANCE:
>> +   flags |= V4L2_MBUS_VIDEO_SYNC_ON_LUMINANCE;
>> +   break;
>> +   }
>> +   }
>> +
>> bus->flags = flags;
>>
>>   }
>> diff --git a/include/dt-bindings/media/video-interfaces.h
>> b/include/dt-bindings/media/video-interfaces.h
>> n

Re: [PATCH v2 2/2] media: i2c: tvp7002: add OF support

2013-07-11 Thread Prabhakar Lad
Hi Sylwester,

Thanks for the review.

On Sun, Jun 30, 2013 at 9:27 PM, Sylwester Nawrocki
 wrote:
> Hi,
>
>
> On 06/22/2013 07:44 PM, Prabhakar Lad wrote:
>>
>> From: "Lad, Prabhakar"
>>
>> add OF support for the tvp7002 driver.
>>
>> Signed-off-by: Lad, Prabhakar
>> Cc: Hans Verkuil
>> Cc: Laurent Pinchart
>> Cc: Mauro Carvalho Chehab
>> Cc: Guennadi Liakhovetski
>> Cc: Sylwester Nawrocki
>> Cc: Sakari Ailus
>> Cc: Grant Likely
>> Cc: Rob Herring
>> Cc: Rob Landley
>> Cc: devicetree-disc...@lists.ozlabs.org
>> Cc: linux-...@vger.kernel.org
>> Cc: linux-ker...@vger.kernel.org
>> Cc: davinci-linux-open-sou...@linux.davincidsp.com

Will take care of this as mentioned in earlier patch.

>> ---
>>   Depends on patch https://patchwork.kernel.org/patch/2765851/
>>
>>   .../devicetree/bindings/media/i2c/tvp7002.txt  |   43 +
>>   drivers/media/i2c/tvp7002.c|   67
>> ++--
>>   2 files changed, 103 insertions(+), 7 deletions(-)
>>   create mode 100644
>> Documentation/devicetree/bindings/media/i2c/tvp7002.txt
>>
>> diff --git a/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
>> b/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
>> new file mode 100644
>> index 000..9daebe1
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
>> @@ -0,0 +1,43 @@
>> +* Texas Instruments TV7002 video decoder
>> +
>> +The TVP7002 device supports digitizing of video and graphics signal in
>> RGB and
>> +YPbPr color space.
>> +
>> +Required Properties :
>> +- compatible : Must be "ti,tvp7002"
>> +
>> +- hsync-active: HSYNC Polarity configuration for endpoint.
>> +
>> +- vsync-active: VSYNC Polarity configuration for endpoint.
>> +
>> +- pclk-sample: Clock polarity of the endpoint.
>> +
>> +- video-sync: Video sync property of the endpoint.
>> +
>> +- ti,tvp7002-fid-polarity: Active-high Field ID polarity of the endpoint.
>
>
> I thought it was agreed 'field-even-active' would be used instead of
> this device specific property. Did you run into any issues with that ?
>
>
Argh I some how missed it out, sorry this should be 'field-even-active'

>> +
>> +For further reading of port node refer
>> Documentation/devicetree/bindings/media/
>> +video-interfaces.txt.
>> +
>> +Example:
>> +
>> +   i2c0@1c22000 {
>> +   ...
>> +   ...
>> +   tvp7002@5c {
>> +   compatible = "ti,tvp7002";
>> +   reg =<0x5c>;
>> +
>> +   port {
>> +   tvp7002_1: endpoint {
>> +   hsync-active =<1>;
>> +   vsync-active =<1>;
>> +   pclk-sample =<0>;
>> +   video-sync
>> =;
>> +   ti,tvp7002-fid-polarity;
>> +   };
>> +   };
>> +   };
>> +   ...
>> +   };
>> diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
>> index b577548..4896024 100644
>> --- a/drivers/media/i2c/tvp7002.c
>> +++ b/drivers/media/i2c/tvp7002.c
>> @@ -35,6 +35,8 @@
>>   #include
>>   #include
>>   #include
>> +#include
>> +
>>   #include "tvp7002_reg.h"
>>
>>   MODULE_DESCRIPTION("TI TVP7002 Video and Graphics Digitizer driver");
>> @@ -943,6 +945,48 @@ static const struct v4l2_subdev_ops tvp7002_ops = {
>> .pad =&tvp7002_pad_ops,
>>   };
>>
>> +static struct tvp7002_config *
>> +tvp7002_get_pdata(struct i2c_client *client)
>
>
> nit: unnecessary line break
>

Ok

>> +{
>> +   struct v4l2_of_endpoint bus_cfg;
>> +   struct tvp7002_config *pdata;
>> +   struct device_node *endpoint;
>> +   unsigned int flags;
>> +
>> +   if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
>> +   return client->dev.platform_data;
>> +
>> +   endpoint = v4l2_of_get_next_endpoint(client->dev.of_node, NULL);
>> +   if (!endpoint)
>> +   return NULL;
>> +
>> +   pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
>&

Re: [GIT PULL FOR v3.11]

2013-07-11 Thread Prabhakar Lad
Hi Hans,

On Thu, Jun 27, 2013 at 12:25 PM, Hans Verkuil  wrote:
> (Same as my previous git pull message, but with more cleanup patches and
[snip]
> Lad, Prabhakar (9):
>   media: i2c: ths8200: support asynchronous probing
>   media: i2c: ths8200: add OF support
>   media: i2c: adv7343: add support for asynchronous probing
>   media: i2c: tvp7002: add support for asynchronous probing
>   media: i2c: tvp7002: remove manual setting of subdev name
>   media: i2c: tvp514x: remove manual setting of subdev name
>   media: i2c: tvp514x: add support for asynchronous probing
>   media: davinci: vpif: capture: add V4L2-async support
>   media: davinci: vpif: display: add V4L2-async support
>
I see last two patches missing in Mauro's pull request for v3.11 and v3.11-rc1.

Regards,
--Prabhakar Lad
--
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 RFC v3] media: OF: add video sync endpoint property

2013-07-11 Thread Prabhakar Lad
Hi Sylwester,

On Fri, Jul 12, 2013 at 2:45 AM, Sylwester Nawrocki
 wrote:
> On 07/11/2013 01:41 PM, Prabhakar Lad wrote:
> [...]
>
>>>> diff --git a/drivers/media/v4l2-core/v4l2-of.c
>>>> b/drivers/media/v4l2-core/v4l2-of.c
>>>> index aa59639..1a54530 100644
>>>> --- a/drivers/media/v4l2-core/v4l2-of.c
>>>> +++ b/drivers/media/v4l2-core/v4l2-of.c
>>>> @@ -100,6 +100,26 @@ static void v4l2_of_parse_parallel_bus(const struct
>>>> device_node *node,
>>>>  if (!of_property_read_u32(node, "data-shift",&v))
>>>>  bus->data_shift = v;
>>>>
>>>> +   if (!of_property_read_u32(node, "video-sync",&v)) {
>>>> +   switch (v) {
>>>> +   case V4L2_MBUS_VIDEO_SEPARATE_SYNC:
>>>> +   flags |= V4L2_MBUS_VIDEO_SEPARATE_SYNC;
>>>
>>>
>>>
>>> I'm not convinced all those video sync types is something that really
>>> belongs
>>> to the flags field. In my understanding this field is supposed to hold
>>> only
>>> the _signal polarity_ information.
>>>
>>>
>> Ok, so there should be a function say v4l2_of_parse_signal_polarity()
>> to get the polarity alone then.
>
>
> I don't think this is required, I would just extend
> v4l2_of_parse_parallel_bus()
> function to also handle sync-on-green-active property.
>
If that is the case than I have to add a member say 'signal_polarity'
in struct v4l2_of_bus_parallel and assign the polarity to it.
Let me know if you are OK with it.

Regards,
--Prabhakar Lad
--
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 v2 2/2] media: i2c: tvp7002: add OF support

2013-07-11 Thread Prabhakar Lad
On Fri, Jul 12, 2013 at 3:34 AM, Sylwester Nawrocki
 wrote:
> On 07/11/2013 07:09 PM, Prabhakar Lad wrote:
> [...]
>
>>>> diff --git a/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
>>>> b/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
>>>> new file mode 100644
>>>> index 000..9daebe1
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
>>>> @@ -0,0 +1,43 @@
>>>> +* Texas Instruments TV7002 video decoder
>>>> +
>
> [...]
>
>>>> +
>>>> +- ti,tvp7002-fid-polarity: Active-high Field ID polarity of the
>>>> endpoint.
>>>
>>>
>>> I thought it was agreed 'field-even-active' would be used instead of
>>> this device specific property. Did you run into any issues with that ?
>>>
>>>
>> Argh I some how missed it out, sorry this should be 'field-even-active'
>
>
> OK.
>
>
>>> And include/media/tvp70002.h:
>>>
>>>   * fid_polarity:
>>>   *  0 ->  the field ID output is set to logic 1 for
>>> an
>>> odd
>>>   *   field (field 1) and set to logic 0 for an
>>> even
>>>   *   field (field 0).
>>>   *  1 ->  operation with polarity inverted.
>>>
>>>
>>> Do you know if the chip automatically selects video sync source
>>> (sync-on-green
>>> vs. VSYNC/HSYNC) and there is no need to configure this on the analogue
>>> input
>>> side ? At least the driver seems to always select the default SOGIN_1
>>> input
>>> (TVP7002_IN_MUX_SEL_1 register is set only at initialization time).
>>>
>> Yes the driver is selecting the default SOGIN_1 input.
>>
>>> Or perhaps it just outputs on SOGOUT, VSOUT, HSOUT lines whatever is fed
>>> to
>>> its analogue inputs, and any further processing unit need to determine
>>> what
>>> synchronization signal is present and should be used ?
>>>
>>
>> Yes that correct, there is a register (Sync Detect Status) which
>> detects the sync for you.
>>
>>> I suspect that we don't need, e.g. another endpoint node to specify the
>>> configuration of the TVP7002 analogue input interface, that would contain
>>> a property like video-sync.
>>>
>>>
>> If I understand correctly you mean if there are two tvp7002 devices
>> connected
>> we don’t need to specify video-sync property, but my question how do we
>> specify this property in common then ?
>
>
> No, I thought about two port sub-nodes of a single device node, one for the
> TVP7002 video input and one for the output. But it seems there is no need
> for that, i.e. to specify the input configuration statically in the
> firmware.
> The chip detects the signals automatically, i.e. it uses whatever is
> available,
> and it allows querying the selection status at run time. What would really
> need to be configured statically in DT in that case then ? Some initial
> video
> sync configuration ? I guess it could be well hard coded in the driver,
> since
> the hardware does run time detection anyway.
>
Yes the chip detects the signal automatically, What I want to configure in
the DT case is say if SOG signal is detected, I want to invert the polarity
of it this is what I am trying to set in DT case whether to invert or not.
0 = Normal operation (default)
1 = SOG output polarity inverted

Something similar to fid_polarity.

Regards,
--Prabhakar Lad
--
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 0/5] Davinci VPBE use devres and some cleanup

2013-07-13 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

This patch series replaces existing resource handling in the
driver with managed device resource.

Lad, Prabhakar (5):
  media: davinci: vpbe_venc: convert to devm_* api
  media: davinci: vpbe_osd: convert to devm_* api
  media: davinci: vpbe_display: convert to devm* api
  media: davinci: vpss: convert to devm* api
  media: davinci: vpbe: Replace printk with dev_*

 drivers/media/platform/davinci/vpbe.c |6 +-
 drivers/media/platform/davinci/vpbe_display.c |   23 ++
 drivers/media/platform/davinci/vpbe_osd.c |   45 +++-
 drivers/media/platform/davinci/vpbe_venc.c|   97 +
 drivers/media/platform/davinci/vpss.c |   62 
 5 files changed, 52 insertions(+), 181 deletions(-)

-- 
1.7.9.5

--
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 1/5] media: davinci: vpbe_venc: convert to devm_* api

2013-07-13 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Replace existing resource handling in the driver with managed
device resource, this ensures more consistent error values and
simplifies error paths.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/platform/davinci/vpbe_venc.c |   97 ++--
 1 file changed, 19 insertions(+), 78 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe_venc.c 
b/drivers/media/platform/davinci/vpbe_venc.c
index 87eef9b..14a023a 100644
--- a/drivers/media/platform/davinci/vpbe_venc.c
+++ b/drivers/media/platform/davinci/vpbe_venc.c
@@ -639,105 +639,46 @@ static int venc_probe(struct platform_device *pdev)
const struct platform_device_id *pdev_id;
struct venc_state *venc;
struct resource *res;
-   int ret;
 
-   venc = kzalloc(sizeof(struct venc_state), GFP_KERNEL);
+   if (!pdev->dev.platform_data) {
+   dev_err(&pdev->dev, "No platform data for VENC sub device");
+   return -EINVAL;
+   }
+
+   pdev_id = platform_get_device_id(pdev);
+   if (!pdev_id)
+   return -EINVAL;
+
+   venc = devm_kzalloc(&pdev->dev, sizeof(struct venc_state), GFP_KERNEL);
if (venc == NULL)
return -ENOMEM;
 
-   pdev_id = platform_get_device_id(pdev);
-   if (!pdev_id) {
-   ret = -EINVAL;
-   goto free_mem;
-   }
venc->venc_type = pdev_id->driver_data;
venc->pdev = &pdev->dev;
venc->pdata = pdev->dev.platform_data;
-   if (NULL == venc->pdata) {
-   dev_err(venc->pdev, "Unable to get platform data for"
-   " VENC sub device");
-   ret = -ENOENT;
-   goto free_mem;
-   }
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(venc->pdev,
-   "Unable to get VENC register address map\n");
-   ret = -ENODEV;
-   goto free_mem;
-   }
 
-   if (!request_mem_region(res->start, resource_size(res), "venc")) {
-   dev_err(venc->pdev, "Unable to reserve VENC MMIO region\n");
-   ret = -ENODEV;
-   goto free_mem;
-   }
-
-   venc->venc_base = ioremap_nocache(res->start, resource_size(res));
-   if (!venc->venc_base) {
-   dev_err(venc->pdev, "Unable to map VENC IO space\n");
-   ret = -ENODEV;
-   goto release_venc_mem_region;
-   }
+   venc->venc_base = devm_ioremap_resource(&pdev->dev, res);
+   if (IS_ERR(venc->venc_base))
+   return PTR_ERR(venc->venc_base);
 
if (venc->venc_type != VPBE_VERSION_1) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-   if (!res) {
-   dev_err(venc->pdev,
-   "Unable to get VDAC_CONFIG address map\n");
-   ret = -ENODEV;
-   goto unmap_venc_io;
-   }
-
-   if (!request_mem_region(res->start,
-   resource_size(res), "venc")) {
-   dev_err(venc->pdev,
-   "Unable to reserve VDAC_CONFIG  MMIO region\n");
-   ret = -ENODEV;
-   goto unmap_venc_io;
-   }
-
-   venc->vdaccfg_reg = ioremap_nocache(res->start,
-   resource_size(res));
-   if (!venc->vdaccfg_reg) {
-   dev_err(venc->pdev,
-   "Unable to map VDAC_CONFIG IO space\n");
-   ret = -ENODEV;
-   goto release_vdaccfg_mem_region;
-   }
+
+   venc->vdaccfg_reg = devm_ioremap_resource(&pdev->dev, res);
+   if (IS_ERR(venc->vdaccfg_reg))
+   return PTR_ERR(venc->vdaccfg_reg);
}
spin_lock_init(&venc->lock);
platform_set_drvdata(pdev, venc);
dev_notice(venc->pdev, "VENC sub device probe success\n");
-   return 0;
 
-release_vdaccfg_mem_region:
-   release_mem_region(res->start, resource_size(res));
-unmap_venc_io:
-   iounmap(venc->venc_base);
-release_venc_mem_region:
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   release_mem_region(res->start, resource_size(res));
-free_mem:
-   kfree(venc);
-   return ret;
+   return 0;
 }
 
 static int venc_remove(struct platform_device *pdev)
 {
-   struct venc_state *venc = platform_get_drvdata(pdev);
-   struct resource *res;
-
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   iounmap((void *)venc->venc_base);
-   release_mem_region(res->start, resource_size(res));
-   if (venc->venc_type != VPBE_VERSION_1) {
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-   iounmap((void *)venc->vdaccfg_reg);
-  

[PATCH 2/5] media: davinci: vpbe_osd: convert to devm_* api

2013-07-13 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Replace existing resource handling in the driver with managed
device resource, this ensures more consistent error values and
simplifies error paths.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/platform/davinci/vpbe_osd.c |   45 +++--
 1 file changed, 10 insertions(+), 35 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe_osd.c 
b/drivers/media/platform/davinci/vpbe_osd.c
index 6ed82e8..d053c26 100644
--- a/drivers/media/platform/davinci/vpbe_osd.c
+++ b/drivers/media/platform/davinci/vpbe_osd.c
@@ -1547,61 +1547,36 @@ static int osd_probe(struct platform_device *pdev)
const struct platform_device_id *pdev_id;
struct osd_state *osd;
struct resource *res;
-   int ret = 0;
 
-   osd = kzalloc(sizeof(struct osd_state), GFP_KERNEL);
+   pdev_id = platform_get_device_id(pdev);
+   if (!pdev_id)
+   return -EINVAL;
+
+   osd = devm_kzalloc(&pdev->dev, sizeof(struct osd_state), GFP_KERNEL);
if (osd == NULL)
return -ENOMEM;
 
-   pdev_id = platform_get_device_id(pdev);
-   if (!pdev_id) {
-   ret = -EINVAL;
-   goto free_mem;
-   }
 
osd->dev = &pdev->dev;
osd->vpbe_type = pdev_id->driver_data;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(osd->dev, "Unable to get OSD register address map\n");
-   ret = -ENODEV;
-   goto free_mem;
-   }
+   osd->osd_base = devm_ioremap_resource(&pdev->dev, res);
+   if (IS_ERR(osd->osd_base))
+   return PTR_ERR(osd->osd_base);
+
osd->osd_base_phys = res->start;
osd->osd_size = resource_size(res);
-   if (!request_mem_region(osd->osd_base_phys, osd->osd_size,
-   MODULE_NAME)) {
-   dev_err(osd->dev, "Unable to reserve OSD MMIO region\n");
-   ret = -ENODEV;
-   goto free_mem;
-   }
-   osd->osd_base = ioremap_nocache(res->start, osd->osd_size);
-   if (!osd->osd_base) {
-   dev_err(osd->dev, "Unable to map the OSD region\n");
-   ret = -ENODEV;
-   goto release_mem_region;
-   }
spin_lock_init(&osd->lock);
osd->ops = osd_ops;
platform_set_drvdata(pdev, osd);
dev_notice(osd->dev, "OSD sub device probe success\n");
-   return ret;
 
-release_mem_region:
-   release_mem_region(osd->osd_base_phys, osd->osd_size);
-free_mem:
-   kfree(osd);
-   return ret;
+   return 0;
 }
 
 static int osd_remove(struct platform_device *pdev)
 {
-   struct osd_state *osd = platform_get_drvdata(pdev);
-
-   iounmap((void *)osd->osd_base);
-   release_mem_region(osd->osd_base_phys, osd->osd_size);
-   kfree(osd);
return 0;
 }
 
-- 
1.7.9.5

--
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 4/5] media: davinci: vpss: convert to devm* api

2013-07-13 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Replace existing resource handling in the driver with managed
device resource, this ensures more consistent error values and
simplifies error paths.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/platform/davinci/vpss.c |   62 +++--
 1 file changed, 13 insertions(+), 49 deletions(-)

diff --git a/drivers/media/platform/davinci/vpss.c 
b/drivers/media/platform/davinci/vpss.c
index 8a2f01e..31120b4 100644
--- a/drivers/media/platform/davinci/vpss.c
+++ b/drivers/media/platform/davinci/vpss.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -404,9 +405,8 @@ EXPORT_SYMBOL(dm365_vpss_set_pg_frame_size);
 
 static int vpss_probe(struct platform_device *pdev)
 {
-   struct resource *r1, *r2;
+   struct resource *res;
char *platform_name;
-   int status;
 
if (!pdev->dev.platform_data) {
dev_err(&pdev->dev, "no platform data\n");
@@ -427,38 +427,19 @@ static int vpss_probe(struct platform_device *pdev)
}
 
dev_info(&pdev->dev, "%s vpss probed\n", platform_name);
-   r1 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!r1)
-   return -ENOENT;
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
-   r1 = request_mem_region(r1->start, resource_size(r1), r1->name);
-   if (!r1)
-   return -EBUSY;
-
-   oper_cfg.vpss_regs_base0 = ioremap(r1->start, resource_size(r1));
-   if (!oper_cfg.vpss_regs_base0) {
-   status = -EBUSY;
-   goto fail1;
-   }
+   oper_cfg.vpss_regs_base0 = devm_ioremap_resource(&pdev->dev, res);
+   if (IS_ERR(oper_cfg.vpss_regs_base0))
+   return PTR_ERR(oper_cfg.vpss_regs_base0);
 
if (oper_cfg.platform == DM355 || oper_cfg.platform == DM365) {
-   r2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-   if (!r2) {
-   status = -ENOENT;
-   goto fail2;
-   }
-   r2 = request_mem_region(r2->start, resource_size(r2), r2->name);
-   if (!r2) {
-   status = -EBUSY;
-   goto fail2;
-   }
-
-   oper_cfg.vpss_regs_base1 = ioremap(r2->start,
-  resource_size(r2));
-   if (!oper_cfg.vpss_regs_base1) {
-   status = -EBUSY;
-   goto fail3;
-   }
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+
+   oper_cfg.vpss_regs_base1 = devm_ioremap_resource(&pdev->dev,
+res);
+   if (IS_ERR(oper_cfg.vpss_regs_base1))
+   return PTR_ERR(oper_cfg.vpss_regs_base1);
}
 
if (oper_cfg.platform == DM355) {
@@ -493,30 +474,13 @@ static int vpss_probe(struct platform_device *pdev)
 
spin_lock_init(&oper_cfg.vpss_lock);
dev_info(&pdev->dev, "%s vpss probe success\n", platform_name);
-   return 0;
 
-fail3:
-   release_mem_region(r2->start, resource_size(r2));
-fail2:
-   iounmap(oper_cfg.vpss_regs_base0);
-fail1:
-   release_mem_region(r1->start, resource_size(r1));
-   return status;
+   return 0;
 }
 
 static int vpss_remove(struct platform_device *pdev)
 {
-   struct resource *res;
-
pm_runtime_disable(&pdev->dev);
-   iounmap(oper_cfg.vpss_regs_base0);
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   release_mem_region(res->start, resource_size(res));
-   if (oper_cfg.platform == DM355 || oper_cfg.platform == DM365) {
-   iounmap(oper_cfg.vpss_regs_base1);
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-   release_mem_region(res->start, resource_size(res));
-   }
return 0;
 }
 
-- 
1.7.9.5

--
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 5/5] media: davinci: vpbe: Replace printk with dev_*

2013-07-13 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Use the dev_* message logging API instead of raw printk.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/platform/davinci/vpbe.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe.c 
b/drivers/media/platform/davinci/vpbe.c
index 33b9660..3f32184 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -595,7 +595,7 @@ static int vpbe_initialize(struct device *dev, struct 
vpbe_device *vpbe_dev)
 * matching with device name
 */
if (NULL == vpbe_dev || NULL == dev) {
-   printk(KERN_ERR "Null device pointers.\n");
+   dev_err(dev, "Null device pointers.\n");
return -ENODEV;
}
 
@@ -735,7 +735,7 @@ static int vpbe_initialize(struct device *dev, struct 
vpbe_device *vpbe_dev)
 
mutex_unlock(&vpbe_dev->lock);
 
-   printk(KERN_NOTICE "Setting default output to %s\n", def_output);
+   dev_info(dev, "Setting default output to %s\n", def_output);
ret = vpbe_set_default_output(vpbe_dev);
if (ret) {
v4l2_err(&vpbe_dev->v4l2_dev, "Failed to set default output %s",
@@ -743,7 +743,7 @@ static int vpbe_initialize(struct device *dev, struct 
vpbe_device *vpbe_dev)
return ret;
}
 
-   printk(KERN_NOTICE "Setting default mode to %s\n", def_mode);
+   dev_info(dev, "Setting default mode to %s\n", def_mode);
ret = vpbe_set_default_mode(vpbe_dev);
if (ret) {
v4l2_err(&vpbe_dev->v4l2_dev, "Failed to set default mode %s",
-- 
1.7.9.5

--
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 3/5] media: davinci: vpbe_display: convert to devm* api

2013-07-13 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Replace existing resource handling in the driver with managed
device resource, this ensures more consistent error values and
simplifies error paths.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/platform/davinci/vpbe_display.c |   23 +++
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe_display.c 
b/drivers/media/platform/davinci/vpbe_display.c
index e180ff7..04609cc6 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -1743,11 +1743,10 @@ static int vpbe_display_probe(struct platform_device 
*pdev)
 
printk(KERN_DEBUG "vpbe_display_probe\n");
/* Allocate memory for vpbe_display */
-   disp_dev = kzalloc(sizeof(struct vpbe_display), GFP_KERNEL);
-   if (!disp_dev) {
-   printk(KERN_ERR "ran out of memory\n");
+   disp_dev = devm_kzalloc(&pdev->dev, sizeof(struct vpbe_display),
+   GFP_KERNEL);
+   if (!disp_dev)
return -ENOMEM;
-   }
 
spin_lock_init(&disp_dev->dma_queue_lock);
/*
@@ -1786,26 +1785,24 @@ static int vpbe_display_probe(struct platform_device 
*pdev)
}
 
irq = res->start;
-   if (request_irq(irq, venc_isr,  IRQF_DISABLED, VPBE_DISPLAY_DRIVER,
-   disp_dev)) {
+   err = devm_request_irq(&pdev->dev, irq, venc_isr, IRQF_DISABLED,
+  VPBE_DISPLAY_DRIVER, disp_dev);
+   if (err) {
v4l2_err(&disp_dev->vpbe_dev->v4l2_dev,
"Unable to request interrupt\n");
-   err = -ENODEV;
goto probe_out;
}
 
for (i = 0; i < VPBE_DISPLAY_MAX_DEVICES; i++) {
if (register_device(disp_dev->dev[i], disp_dev, pdev)) {
err = -ENODEV;
-   goto probe_out_irq;
+   goto probe_out;
}
}
 
printk(KERN_DEBUG "Successfully completed the probing of vpbe v4l2 
device\n");
return 0;
 
-probe_out_irq:
-   free_irq(res->start, disp_dev);
 probe_out:
for (k = 0; k < VPBE_DISPLAY_MAX_DEVICES; k++) {
/* Get the pointer to the layer object */
@@ -1817,7 +1814,6 @@ probe_out:
kfree(disp_dev->dev[k]);
}
}
-   kfree(disp_dev);
return err;
 }
 
@@ -1830,15 +1826,10 @@ static int vpbe_display_remove(struct platform_device 
*pdev)
struct vpbe_layer *vpbe_display_layer;
struct vpbe_display *disp_dev = platform_get_drvdata(pdev);
struct vpbe_device *vpbe_dev = disp_dev->vpbe_dev;
-   struct resource *res;
int i;
 
v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev, "vpbe_display_remove\n");
 
-   /* unregister irq */
-   res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-   free_irq(res->start, disp_dev);
-
/* deinitialize the vpbe display controller */
if (NULL != vpbe_dev->ops.deinitialize)
vpbe_dev->ops.deinitialize(&pdev->dev, vpbe_dev);
-- 
1.7.9.5

--
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 v2] media: i2c: adv7343: add OF support

2013-07-13 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

add OF support for the adv7343 driver.

Signed-off-by: Lad, Prabhakar 
---
 Changes for v2:
 1: Fixed naming of properties.
 
 .../devicetree/bindings/media/i2c/adv7343.txt  |   54 
 drivers/media/i2c/adv7343.c|   65 +++-
 2 files changed, 118 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/adv7343.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/adv7343.txt 
b/Documentation/devicetree/bindings/media/i2c/adv7343.txt
new file mode 100644
index 000..1d2e854
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/adv7343.txt
@@ -0,0 +1,54 @@
+* Analog Devices adv7343 video encoder
+
+The ADV7343 are high speed, digital-to-analog video encoders in a 64-lead LQFP
+package. Six high speed, 3.3 V, 11-bit video DACs provide support for composite
+(CVBS), S-Video (Y-C), and component (YPrPb/RGB) analog outputs in standard
+definition (SD), enhanced definition (ED), or high definition (HD) video
+formats.
+
+Required Properties :
+- compatible: Must be "ad,adv7343"
+
+Optional Properties :
+- ad,adv7343-power-mode-sleep-mode: on enable the current consumption is
+reduced to micro ampere level. All DACs and
+the internal PLL circuit are disabled.
+- ad,adv7343-power-mode-pll-ctrl: PLL and oversampling control. This control
+  allows internal PLL 1 circuit to be powered
+  down and the oversampling to beswitched off.
+- ad,adv7343-power-mode-dac-1: power on/off DAC 1, 0 = OFF and 1 = ON.
+- ad,adv7343-power-mode-dac-2: power on/off DAC 2, 0 = OFF and 1 = ON.
+- ad,adv7343-power-mode-dac-3: power on/off DAC 3, 0 = OFF and 1 = ON.
+- ad,adv7343-power-mode-dac-4: power on/off DAC 4, 0 = OFF and 1 = ON.
+- ad,adv7343-power-mode-dac-5: power on/off DAC 5, 0 = OFF and 1 = ON.
+- ad,adv7343-power-mode-dac-6: power on/off DAC 6, 0 = OFF and 1 = ON.
+- ad,adv7343-sd-config-dac-out-1: Configure SD DAC Output 1.
+- ad,adv7343-sd-config-dac-out-2: Configure SD DAC Output 2.
+
+Example:
+
+i2c0@1c22000 {
+   ...
+   ...
+
+   adv7343@2a {
+   compatible = "ad,adv7343";
+   reg = <0x2a>;
+
+   port {
+   adv7343_1: endpoint {
+   ad,adv7343-power-mode-sleep-mode;
+   ad,adv7343-power-mode-pll-ctrl;
+   ad,adv7343-power-mode-dac-1;
+   ad,adv7343-power-mode-dac-2;
+   ad,adv7343-power-mode-dac-3;
+   ad,adv7343-power-mode-dac-4;
+   ad,adv7343-power-mode-dac-5;
+   ad,adv7343-power-mode-dac-6;
+   ad,adv7343-sd-config-dac-out-1;
+   ad,adv7343-sd-config-dac-out-2;
+   };
+   };
+   };
+   ...
+};
diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c
index 7606218..22ee6f4 100644
--- a/drivers/media/i2c/adv7343.c
+++ b/drivers/media/i2c/adv7343.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "adv7343_regs.h"
 
@@ -398,6 +399,59 @@ static int adv7343_initialize(struct v4l2_subdev *sd)
return err;
 }
 
+static struct adv7343_platform_data *
+adv7343_get_pdata(struct i2c_client *client)
+{
+   struct adv7343_platform_data *pdata;
+   struct device_node *np;
+
+   if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
+   return client->dev.platform_data;
+
+   np = v4l2_of_get_next_endpoint(client->dev.of_node, NULL);
+   if (!np)
+   return NULL;
+
+   pdata = devm_kzalloc(&client->dev, sizeof(struct adv7343_platform_data),
+GFP_KERNEL);
+   if (!pdata)
+   goto done;
+
+   pdata->mode_config.sleep_mode =
+   of_property_read_bool(np, "ad,adv7343-power-mode-sleep-mode");
+
+   pdata->mode_config.pll_control =
+   of_property_read_bool(np, "ad,adv7343-power-mode-pll-ctrl");
+
+   pdata->mode_config.dac_1 =
+   of_property_read_bool(np, "ad,adv7343-power-mode-dac-1");
+
+   pdata->mode_config.dac_2 =
+   of_property_read_bool(np, "ad,adv7343-power-mode-dac-2");
+
+   pdata->mode_config.dac_3 =
+   of_property_read_bool(np, "ad,adv7343-power-mode-dac-3");
+
+   pdata->mode_config.dac_4 =
+   of_property_read_bool(np, "ad,adv7343-power-mode-dac-4");
+
+   pdata->mode_config.dac_5 =
+   of_property_read_bool(np, "ad,adv7343-power-mode-dac-5");
+
+   pdata->mode_config.dac_6 =
+   of_property_read_bool(np, "ad,adv7343-power-mode-dac

Re: [PATCH v2] media: i2c: adv7343: add OF support

2013-07-15 Thread Prabhakar Lad
Hi Sylwester,

Thanks for the review.

On Mon, Jul 15, 2013 at 2:03 AM, Sylwester Nawrocki
 wrote:
> Hi Prabhakar,
>
>
> On 07/13/2013 01:12 PM, Prabhakar Lad wrote:
>>
>> From: "Lad, Prabhakar"
>>
>> add OF support for the adv7343 driver.
>>
>> Signed-off-by: Lad, Prabhakar
>> ---
>>   Changes for v2:
>>   1: Fixed naming of properties.
>>
>>   .../devicetree/bindings/media/i2c/adv7343.txt  |   54
>> 
>>   drivers/media/i2c/adv7343.c|   65
>> +++-
>>   2 files changed, 118 insertions(+), 1 deletion(-)
>>   create mode 100644
>> Documentation/devicetree/bindings/media/i2c/adv7343.txt
>>
>> diff --git a/Documentation/devicetree/bindings/media/i2c/adv7343.txt
>> b/Documentation/devicetree/bindings/media/i2c/adv7343.txt
>> new file mode 100644
>> index 000..1d2e854
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/media/i2c/adv7343.txt
>> @@ -0,0 +1,54 @@
>> +* Analog Devices adv7343 video encoder
>> +
>> +The ADV7343 are high speed, digital-to-analog video encoders in a 64-lead
>> LQFP
>> +package. Six high speed, 3.3 V, 11-bit video DACs provide support for
>> composite
>> +(CVBS), S-Video (Y-C), and component (YPrPb/RGB) analog outputs in
>> standard
>> +definition (SD), enhanced definition (ED), or high definition (HD) video
>> +formats.
>> +
>> +Required Properties :
>> +- compatible: Must be "ad,adv7343"
>
>
> Please have a look at Documentation/devicetree/bindings/vendor-prefixes.txt.
> 'ad' is a vendor prefix reserved for "Avionic Design GmbH".
> For "Analog Devices, Inc." 'adi' should be used.
>
> If I would have to draft a new DT binding proposal checklist checking
> vendor-prefixes.txt would certainly be one of the first steps.
>
That makes it easier I wasn’t aware of this file thanks :)

>
>> +Optional Properties :
>> +- ad,adv7343-power-mode-sleep-mode: on enable the current consumption is
>> +reduced to micro ampere level. All
>> DACs and
>> +the internal PLL circuit are
>> disabled.
>> +- ad,adv7343-power-mode-pll-ctrl: PLL and oversampling control. This
>> control
>> +  allows internal PLL 1 circuit to be
>> powered
>> +  down and the oversampling to beswitched
>> off.
>> +- ad,adv7343-power-mode-dac-1: power on/off DAC 1, 0 = OFF and 1 = ON.
>> +- ad,adv7343-power-mode-dac-2: power on/off DAC 2, 0 = OFF and 1 = ON.
>> +- ad,adv7343-power-mode-dac-3: power on/off DAC 3, 0 = OFF and 1 = ON.
>> +- ad,adv7343-power-mode-dac-4: power on/off DAC 4, 0 = OFF and 1 = ON.
>> +- ad,adv7343-power-mode-dac-5: power on/off DAC 5, 0 = OFF and 1 = ON.
>> +- ad,adv7343-power-mode-dac-6: power on/off DAC 6, 0 = OFF and 1 = ON.
>> +- ad,adv7343-sd-config-dac-out-1: Configure SD DAC Output 1.
>> +- ad,adv7343-sd-config-dac-out-2: Configure SD DAC Output 2.
>
>
> All these properties look more like hardware configuration, rather than
> hardware description. So at first sight I would say none of these properties
> is suitable for the device tree.
>
> sleep mode and pll ctrl should likely only have default values in the
> driver.
> sleep-mode disables all DAC, while power-mode-dac-? does power on/off
> (enables / disables?) individual DACs. How those properties interact, what's
> going on here exactly ? :)
>
Agreed the device tree is meant to describe the hardware, basically the the need
had arrived since the adv7343 is present on DM6467 EVM and also on the
OMAP-L138 EVM, the configuration of this two register's differs on these
two evm's mentioned, because of which this is now being passed as part of
the device tree.

> That said, how about only leaving the properties indicating which DACs
> (including SD DACs) should be enabled ? E.g.
>
> adi,dac-enable - an array indicating which DACs are enabled, in order
> DAC1...DAC6, 1 to enable DAC, 0 to disable.
>
OK

> adi,sd-dac-enable - an array indicating which SD DACs are enabled, in order
> DAC1...DAC2, 1 to enable SD DAC, 0 to disable.
>
OK

> Please note you don't need ",adv7343-" prefix in each single property
> for that device.
>
Agreed.

>
>> +Example:
>> +
>> +i2c0@1c22000 {
>> +   ...
>> +   ...
>> +
>> +   adv7343@2a {
>> +   compatible = "ad,adv7343";
>> 

Re: [PATCH v2 2/2] media: i2c: tvp7002: add OF support

2013-07-15 Thread Prabhakar Lad
Hi Sylwester,

On Mon, Jul 15, 2013 at 1:12 AM, Sylwester Nawrocki
 wrote:
> Hi Prabhakar,
>
[Snip]
>> Something similar to fid_polarity.
>
>
> Then as I suggested earlier, let's just add 'sync-on-green-active' DT
> property for that. I wouldn't expect the DT properties to be directly
> replacing your driver platform_data members. Saying in the binding that
> this is a normal operation and that is an inverted one is not very useful
> in general, as you would need to dig in the binding's description what
> "normal" exactly means. sync-on-green-active = <1>; seems much more
> explicit than, e.g. sync-on-green-inverted. By looking at the
> sync-on-green-active property each device driver would determine whether
> it means normal or inverted operation for its device.
>
Ok so I'll add 'sync-on-green-active' property and parse it in
v4l2_of_parse_parallel_bus()
and add it as part of flags. and define the following flags in mediabus.h

V4L2_MBUS_VIDEO_SOG_ACTIVE_{HIGH,LOW}.

Hope you are OK with it.

--
Regards,
Prabhakar Lad
--
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 RFC v4] media: OF: add "sync-on-green-active" property

2013-07-16 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

This patch adds 'sync-on-green-active' property as part
of endpoint property.

Signed-off-by: Lad, Prabhakar 
---
  Changes for v4:
  1: Fixed review comments pointed by Sylwester.
  
  Changes for v3:
  1: Fixed review comments pointed by Laurent and Sylwester.

  RFC v2 https://patchwork.kernel.org/patch/2578091/
  
  RFC V1 https://patchwork.kernel.org/patch/2572341/
  
 .../devicetree/bindings/media/video-interfaces.txt |3 +++
 drivers/media/v4l2-core/v4l2-of.c  |4 
 include/media/v4l2-mediabus.h  |2 ++
 3 files changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt 
b/Documentation/devicetree/bindings/media/video-interfaces.txt
index e022d2d..5186c7e 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -101,6 +101,9 @@ Optional endpoint properties
   array contains only one entry.
 - clock-noncontinuous: a boolean property to allow MIPI CSI-2 non-continuous
   clock mode.
+- sync-on-green-active: polarity field when video synchronization is
+  Sync-On-Green. When set the driver determines whether it's a normal operation
+  or inverted operation.
 
 
 Example
diff --git a/drivers/media/v4l2-core/v4l2-of.c 
b/drivers/media/v4l2-core/v4l2-of.c
index aa59639..5c4c9f0 100644
--- a/drivers/media/v4l2-core/v4l2-of.c
+++ b/drivers/media/v4l2-core/v4l2-of.c
@@ -100,6 +100,10 @@ static void v4l2_of_parse_parallel_bus(const struct 
device_node *node,
if (!of_property_read_u32(node, "data-shift", &v))
bus->data_shift = v;
 
+   if (!of_property_read_u32(node, "sync-on-green-active", &v))
+   flags |= v ? V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH :
+   V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW;
+
bus->flags = flags;
 
 }
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 83ae07e..d47eb81 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -40,6 +40,8 @@
 #define V4L2_MBUS_FIELD_EVEN_HIGH  (1 << 10)
 /* FIELD = 1/0 - Field1 (odd)/Field2 (even) */
 #define V4L2_MBUS_FIELD_EVEN_LOW   (1 << 11)
+#define V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH(1 << 12)
+#define V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW (1 << 13)
 
 /* Serial flags */
 /* How many lanes the client can use */
-- 
1.7.9.5

--
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 RFC v4] media: OF: add "sync-on-green-active" property

2013-07-17 Thread Prabhakar Lad
Hi Sylwester,

Thanks for the review.

On Wed, Jul 17, 2013 at 2:08 AM, Sylwester Nawrocki
 wrote:
> Hi Prabhakar,
>
>
[snip]
>> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt
>> b/Documentation/devicetree/bindings/media/video-interfaces.txt
>> index e022d2d..5186c7e 100644
>> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
>> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
>> @@ -101,6 +101,9 @@ Optional endpoint properties
>> array contains only one entry.
>>   - clock-noncontinuous: a boolean property to allow MIPI CSI-2
>> non-continuous
>> clock mode.
>> +- sync-on-green-active: polarity field when video synchronization is
>> +  Sync-On-Green. When set the driver determines whether it's a normal
>> operation
>> +  or inverted operation.
>
>
> Would you mind adding this entry after pclk-sample property description ?

OK.

> And how about describing it a bit more precisely and similarly to
> VSYNC/HSYNC,
> e.g.
>
> - sync-on-green-active: active state of Sync-on-green (SoG) signal,
>   0/1 for LOW/HIGH respectively.
>
OK I'll paste the above one itself :-)

--
Regards,
Prabhakar Lad
--
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 RFC FINAL v5] media: OF: add "sync-on-green-active" property

2013-07-17 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

This patch adds 'sync-on-green-active' property as part
of endpoint property.

Signed-off-by: Lad, Prabhakar 
---
  Changes for v5:
  1: Changed description for sync-on-green-active property in
 documentation file as suggested by Sylwester.
  
  Changes for v4:
  1: Fixed review comments pointed by Sylwester.

  Changes for v3:
  1: Fixed review comments pointed by Laurent and Sylwester.

  RFC v2 https://patchwork.kernel.org/patch/2578091/

  RFC V1 https://patchwork.kernel.org/patch/2572341/

 .../devicetree/bindings/media/video-interfaces.txt |2 ++
 drivers/media/v4l2-core/v4l2-of.c  |4 
 include/media/v4l2-mediabus.h  |2 ++
 3 files changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt 
b/Documentation/devicetree/bindings/media/video-interfaces.txt
index e022d2d..ce719f8 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -88,6 +88,8 @@ Optional endpoint properties
 - field-even-active: field signal level during the even field data 
transmission.
 - pclk-sample: sample data on rising (1) or falling (0) edge of the pixel clock
   signal.
+- sync-on-green-active: active state of Sync-on-green (SoG) signal, 0/1 for
+  LOW/HIGH respectively.
 - data-lanes: an array of physical data lane indexes. Position of an entry
   determines the logical lane number, while the value of an entry indicates
   physical lane, e.g. for 2-lane MIPI CSI-2 bus we could have
diff --git a/drivers/media/v4l2-core/v4l2-of.c 
b/drivers/media/v4l2-core/v4l2-of.c
index aa59639..5c4c9f0 100644
--- a/drivers/media/v4l2-core/v4l2-of.c
+++ b/drivers/media/v4l2-core/v4l2-of.c
@@ -100,6 +100,10 @@ static void v4l2_of_parse_parallel_bus(const struct 
device_node *node,
if (!of_property_read_u32(node, "data-shift", &v))
bus->data_shift = v;
 
+   if (!of_property_read_u32(node, "sync-on-green-active", &v))
+   flags |= v ? V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH :
+   V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW;
+
bus->flags = flags;
 
 }
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 83ae07e..d47eb81 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -40,6 +40,8 @@
 #define V4L2_MBUS_FIELD_EVEN_HIGH  (1 << 10)
 /* FIELD = 1/0 - Field1 (odd)/Field2 (even) */
 #define V4L2_MBUS_FIELD_EVEN_LOW   (1 << 11)
+#define V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH(1 << 12)
+#define V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW (1 << 13)
 
 /* Serial flags */
 /* How many lanes the client can use */
-- 
1.7.9.5

--
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 v3] media: i2c: tvp7002: add OF support

2013-07-17 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

add OF support for the tvp7002 driver.

Signed-off-by: Lad, Prabhakar 
---
 This patch depends on https://patchwork.kernel.org/patch/2828800/
 
 Changes for v3:
 1: Fixed review comments pointed by Sylwester.
 
 .../devicetree/bindings/media/i2c/tvp7002.txt  |   43 +
 drivers/media/i2c/tvp7002.c|   67 ++--
 2 files changed, 103 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/tvp7002.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/tvp7002.txt 
b/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
new file mode 100644
index 000..744125f
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
@@ -0,0 +1,43 @@
+* Texas Instruments TV7002 video decoder
+
+The TVP7002 device supports digitizing of video and graphics signal in RGB and
+YPbPr color space.
+
+Required Properties :
+- compatible : Must be "ti,tvp7002"
+
+- hsync-active: HSYNC Polarity configuration for endpoint.
+
+- vsync-active: VSYNC Polarity configuration for endpoint.
+
+- pclk-sample: Clock polarity of the endpoint.
+
+- sync-on-green-active: Active state of Sync-on-green signal property of the
+  endpoint, 0/1 for normal/inverted operation respectively.
+
+- field-even-active: Active-high Field ID polarity of the endpoint.
+
+For further reading of port node refer Documentation/devicetree/bindings/media/
+video-interfaces.txt.
+
+Example:
+
+   i2c0@1c22000 {
+   ...
+   ...
+   tvp7002@5c {
+   compatible = "ti,tvp7002";
+   reg = <0x5c>;
+
+   port {
+   tvp7002_1: endpoint {
+   hsync-active = <1>;
+   vsync-active = <1>;
+   pclk-sample = <0>;
+   sync-on-green-active = <1>;
+   field-even-active = <0>;
+   };
+   };
+   };
+   ...
+   };
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index f6b1f3f..24a08fa 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -35,6 +35,8 @@
 #include 
 #include 
 #include 
+#include 
+
 #include "tvp7002_reg.h"
 
 MODULE_DESCRIPTION("TI TVP7002 Video and Graphics Digitizer driver");
@@ -943,6 +945,48 @@ static const struct v4l2_subdev_ops tvp7002_ops = {
.pad = &tvp7002_pad_ops,
 };
 
+static struct tvp7002_config *
+tvp7002_get_pdata(struct i2c_client *client)
+{
+   struct v4l2_of_endpoint bus_cfg;
+   struct tvp7002_config *pdata;
+   struct device_node *endpoint;
+   unsigned int flags;
+
+   if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
+   return client->dev.platform_data;
+
+   endpoint = v4l2_of_get_next_endpoint(client->dev.of_node, NULL);
+   if (!endpoint)
+   return NULL;
+
+   pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata)
+   goto done;
+
+   v4l2_of_parse_endpoint(endpoint, &bus_cfg);
+   flags = bus_cfg.bus.parallel.flags;
+
+   if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
+   pdata->hs_polarity = 1;
+
+   if (flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
+   pdata->vs_polarity = 1;
+
+   if (flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
+   pdata->clk_polarity = 1;
+
+   if (flags & V4L2_MBUS_FIELD_EVEN_HIGH)
+   pdata->fid_polarity = 1;
+
+   if (flags & V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH)
+   pdata->sog_polarity = 1;
+
+done:
+   of_node_put(endpoint);
+   return pdata;
+}
+
 /*
  * tvp7002_probe - Probe a TVP7002 device
  * @c: ptr to i2c_client struct
@@ -954,32 +998,32 @@ static const struct v4l2_subdev_ops tvp7002_ops = {
  */
 static int tvp7002_probe(struct i2c_client *c, const struct i2c_device_id *id)
 {
+   struct tvp7002_config *pdata = tvp7002_get_pdata(c);
struct v4l2_subdev *sd;
struct tvp7002 *device;
struct v4l2_dv_timings timings;
int polarity_a;
int polarity_b;
u8 revision;
-
int error;
 
+   if (pdata == NULL) {
+   dev_err(&c->dev, "No platform data\n");
+   return -EINVAL;
+   }
+
/* Check if the adapter supports the needed features */
if (!i2c_check_functionality(c->adapter,
I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
return -EIO;
 
-   if (!c->dev.platform_data) {
-   v4l_err(c, "No platform data!!\n");
-   return -ENODEV;
-   }
-
device = devm_kzalloc(&c->dev, sizeof(struct tvp7002), GFP_KERNEL);
 
if (!device)
return -ENOMEM;
 
sd = &device->sd;
-   device->

Re: [PATCH RFC FINAL v5] media: OF: add "sync-on-green-active" property

2013-07-17 Thread Prabhakar Lad
Hi Sylwester,

On Wed, Jul 17, 2013 at 9:50 PM, Sylwester Nawrocki
 wrote:
> On 07/17/2013 05:47 PM, Prabhakar Lad wrote:
>> From: "Lad, Prabhakar" 
>>
>> This patch adds 'sync-on-green-active' property as part
>> of endpoint property.
>>
>> Signed-off-by: Lad, Prabhakar 
>
> Thanks Prabhakar, it looks good to me.
> Just a side note, the 'From' tag above isn't needed. It wasn't
> added automatically, was it ?

Yes this was added automatically.

> Unless there are comments from others I think this patch should
> be merged together with the users of this new property.
>
> Acked-by: Sylwester Nawrocki 
>
Thanks for the Ack.

--
Regards,
Prabhakar Lad
--
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 0/5] Davinci VPBE use devres and some cleanup

2013-07-17 Thread Prabhakar Lad
Hi Laurent,

On Wed, Jul 17, 2013 at 5:51 PM, Laurent Pinchart
 wrote:
> Hi Prabhakar,
>
> On Saturday 13 July 2013 14:20:26 Prabhakar Lad wrote:
>> From: "Lad, Prabhakar" 
>>
>> This patch series replaces existing resource handling in the
>> driver with managed device resource.
>
> Thank you for the patches. They greatly simplify the probe/remove functions, I
> like that. For patches 1 to 4,
>
> Acked-by: Laurent Pinchart 
>
Thanks for the ACK.

> I have the same concern as Joe Perches for patch 5.
>
Ok I'll fix it and repost the alone patch 5/5.

--
Regards,
Prabhakar Lad
--
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 v3] media: i2c: tvp7002: add OF support

2013-07-17 Thread Prabhakar Lad
Hi Sylwester,

Thanks for the quick review.

On Wed, Jul 17, 2013 at 10:09 PM, Sylwester Nawrocki
 wrote:
> On 07/17/2013 06:20 PM, Prabhakar Lad wrote:
>> From: "Lad, Prabhakar" 
>>
>> add OF support for the tvp7002 driver.
>>
>> Signed-off-by: Lad, Prabhakar 
>> ---
>>  This patch depends on https://patchwork.kernel.org/patch/2828800/
>>
>>  Changes for v3:
>>  1: Fixed review comments pointed by Sylwester.
>>
>>  .../devicetree/bindings/media/i2c/tvp7002.txt  |   43 +
>>  drivers/media/i2c/tvp7002.c|   67 
>> ++--
>>  2 files changed, 103 insertions(+), 7 deletions(-)
>>  create mode 100644 Documentation/devicetree/bindings/media/i2c/tvp7002.txt
>>
>> diff --git a/Documentation/devicetree/bindings/media/i2c/tvp7002.txt 
>> b/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
>> new file mode 100644
>> index 000..744125f
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/media/i2c/tvp7002.txt
>> @@ -0,0 +1,43 @@
>> +* Texas Instruments TV7002 video decoder
>> +
>> +The TVP7002 device supports digitizing of video and graphics signal in RGB 
>> and
>> +YPbPr color space.
>> +
>> +Required Properties :
>> +- compatible : Must be "ti,tvp7002"
>> +
>> +- hsync-active: HSYNC Polarity configuration for endpoint.
>> +
>> +- vsync-active: VSYNC Polarity configuration for endpoint.
>
> I woudn't refer to "endpoint" here, perhaps to the specific hardware
> bus instead ? So it is clear what part of the device it refers to ?
>
OK, I'll refer to bus instead.

>> +- pclk-sample: Clock polarity of the endpoint.
>
> This description is not very useful, my feeling is that this property
> is better described in video-interfaces.txt.
>
agreed its just a one liner, and below I have mentioned a link
to video-interfaces.txt for better understanding of this generic
properties.

>> +- sync-on-green-active: Active state of Sync-on-green signal property of the
>> +  endpoint, 0/1 for normal/inverted operation respectively.
>> +
>> +- field-even-active: Active-high Field ID polarity of the endpoint.
>
> I find it hard to understand what this property is about exactly.
> Not sure if you need to repeat detailed description of the signal
> polarity properties. Perhaps its sufficient to list which properties
> are relevant for this device, but I'm not opposed to having
> supplementary description here. I would just make it more specific
> to the TVP7002 chip.

How about the below description ?

Active-high Field ID output polarity control. Under normal operation, the
field ID output is set to logic 1 for an odd field (field 1)
and set to logic 0 for an even field (field 0).
0 = Normal operation (default)
1 = FID output polarity inverted

> Also please note that only 'compatible' property is required, all
> other are optional. And it probably makes sense to specify what are
> default values for each property when it is not specified.
>
Agreed I'll add them to optional list, and mention their default values too.

--
Regards,
Prabhakar Lad
--
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 v2 5/5] media: davinci: vpbe: Replace printk with dev_*

2013-07-18 Thread Prabhakar Lad
From: "Lad, Prabhakar" 

Use the dev_* message logging API instead of raw printk.

Signed-off-by: Lad, Prabhakar 
---
 Posting independent patch of the series,
 http://www.spinics.net/lists/linux-media/msg65701.html
 
 Changes for v2:
 1: Fixed logging levels.
 
 drivers/media/platform/davinci/vpbe.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe.c 
b/drivers/media/platform/davinci/vpbe.c
index 33b9660..a3a36e0 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -595,7 +595,7 @@ static int vpbe_initialize(struct device *dev, struct 
vpbe_device *vpbe_dev)
 * matching with device name
 */
if (NULL == vpbe_dev || NULL == dev) {
-   printk(KERN_ERR "Null device pointers.\n");
+   dev_err(dev, "Null device pointers.\n");
return -ENODEV;
}
 
@@ -735,7 +735,7 @@ static int vpbe_initialize(struct device *dev, struct 
vpbe_device *vpbe_dev)
 
mutex_unlock(&vpbe_dev->lock);
 
-   printk(KERN_NOTICE "Setting default output to %s\n", def_output);
+   dev_notice(dev, "Setting default output to %s\n", def_output);
ret = vpbe_set_default_output(vpbe_dev);
if (ret) {
v4l2_err(&vpbe_dev->v4l2_dev, "Failed to set default output %s",
@@ -743,7 +743,7 @@ static int vpbe_initialize(struct device *dev, struct 
vpbe_device *vpbe_dev)
return ret;
}
 
-   printk(KERN_NOTICE "Setting default mode to %s\n", def_mode);
+   dev_notice(dev, "Setting default mode to %s\n", def_mode);
ret = vpbe_set_default_mode(vpbe_dev);
if (ret) {
v4l2_err(&vpbe_dev->v4l2_dev, "Failed to set default mode %s",
-- 
1.7.9.5

--
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 v2 5/5] media: davinci: vpbe: Replace printk with dev_*

2013-07-18 Thread Prabhakar Lad
Hi Joe,

On Thu, Jul 18, 2013 at 9:10 PM, Joe Perches  wrote:
> On Thu, 2013-07-18 at 20:59 +0530, Prabhakar Lad wrote:
>> Use the dev_* message logging API instead of raw printk.
> []
>> diff --git a/drivers/media/platform/davinci/vpbe.c 
>> b/drivers/media/platform/davinci/vpbe.c
> []
>> @@ -595,7 +595,7 @@ static int vpbe_initialize(struct device *dev, struct 
>> vpbe_device *vpbe_dev)
>>* matching with device name
>>*/
>>   if (NULL == vpbe_dev || NULL == dev) {
>> - printk(KERN_ERR "Null device pointers.\n");
>> + dev_err(dev, "Null device pointers.\n");
>
> And if dev actually is NULL?
>
Ah nice catch, I overlooked it, I'll fix it.

Regards,
--Prabhakar
--
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


Few Doubts on adding DT nodes for bridge driver

2013-07-20 Thread Prabhakar Lad
Hi Sylwester, Guennadi,

I am working on adding DT support for VPIF driver, initially to get
some hands dirty
on working on Capture driver and later will move ahead to add for the display.
I have added asynchronous probing support for the both the bridge and subdevs
which works perfectly like on a charm with passing pdata as usually,
but doing the
same with DT I have few doubts on building the pdata in the bridge driver.


This is a snippet of my subdes in i2c node:-

i2c0: i2c@1c22000 {
status = "okay";
clock-frequency = <10>;
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;

tvp514x@5c {
compatible = "ti,tvp5146";
reg = <0x5c>;

port {
tvp514x_1: endpoint {
remote-endpoint = 
<&vpif_capture0_1>;
hsync-active = <1>;
vsync-active = <1>;
pclk-sample = <0>;
};
};
};

tvp514x@5d {
compatible = "ti,tvp5146";
reg = <0x5d>;

port {
tvp514x_2: endpoint {
remote-endpoint = 
<&vpif_capture0_0>;
hsync-active = <1>;
vsync-active = <1>;
pclk-sample = <0>;
};
};
};
 ..
};

Here tvp514x are the subdevs the platform has two of them one at 0x5c and 0x5d,
so I have added two nodes for them.

Following is DT node for the bridge driver:-

vpif_capture@0 {
status = "okay";
port {
vpif_capture0_1: endpoint@1 {
remote = <&tvp514x_1>;
};
vpif_capture0_0: endpoint@0 {
remote = <&tvp514x_2>;
};
};
};
I have added two endpoints for the bridge driver. In the bridge driver
to build the pdata from DT node,I do the following,

np = v4l2_of_get_next_endpoint(pdev->dev.of_node, NULL);
The above will give the first endpoint ie, endpoint@1
>From here is it possible to get the tvp514x_1 endpoint node and the
parent of it?
so that I  build the asynchronous subdev list for the bridge driver.


+static struct v4l2_async_subdev tvp1_sd = {
+   .hw = {
+   .bus_type = V4L2_ASYNC_BUS_I2C,
+   .match.i2c = {
+   .adapter_id = 1,
+   .address = 0x5c,
+   },
+   },
+};

For building the asd subdev list in the bridge driver I can get the
address easily,
how do I get the adapter_id ? should this be a property subdev ? And also same
with bustype.

Regards,
--Prabhakar
--
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: Few Doubts on adding DT nodes for bridge driver

2013-07-21 Thread Prabhakar Lad
Hi Sylwester,

On Sun, Jul 21, 2013 at 2:54 PM, Sylwester Nawrocki
 wrote:
> Hi Prabhakar,
>
>
> On 07/21/2013 08:20 AM, Prabhakar Lad wrote:
>>
>> Hi Sylwester, Guennadi,
>>
>> I am working on adding DT support for VPIF driver, initially to get
>> some hands dirty
>> on working on Capture driver and later will move ahead to add for the
>> display.
>> I have added asynchronous probing support for the both the bridge and
>> subdevs
>> which works perfectly like on a charm with passing pdata as usually,
>> but doing the
>> same with DT I have few doubts on building the pdata in the bridge driver.
>>
>>
>> This is a snippet of my subdes in i2c node:-
>>
>> i2c0: i2c@1c22000 {
>> status = "okay";
>> clock-frequency =<10>;
>> pinctrl-names = "default";
>> pinctrl-0 =<&i2c0_pins>;
>>
>> tvp514x@5c {
>> compatible = "ti,tvp5146";
>> reg =<0x5c>;
>>
>> port {
>> tvp514x_1: endpoint {
>> remote-endpoint
>> =<&vpif_capture0_1>;
>> hsync-active =<1>;
>> vsync-active =<1>;
>> pclk-sample =<0>;
>> };
>> };
>> };
>>
>> tvp514x@5d {
>> compatible = "ti,tvp5146";
>> reg =<0x5d>;
>>
>> port {
>> tvp514x_2: endpoint {
>> remote-endpoint
>> =<&vpif_capture0_0>;
>> hsync-active =<1>;
>> vsync-active =<1>;
>> pclk-sample =<0>;
>> };
>> };
>> };
>>   ..
>> };
>>
>> Here tvp514x are the subdevs the platform has two of them one at 0x5c and
>> 0x5d,
>> so I have added two nodes for them.
>>
>> Following is DT node for the bridge driver:-
>>
>> vpif_capture@0 {
>> status = "okay";
>> port {
>
>
> You should also have:
> #address-cells = <1>;
> #size-cells = <0>;
>
> here or in vpif_capture node.
>
Ok

>
>> vpif_capture0_1: endpoint@1 {
>> remote =<&tvp514x_1>;
>> };
>> vpif_capture0_0: endpoint@0 {
>> remote =<&tvp514x_2>;
>> };
>> };
>> };
>
>
> Are tvp514x@5c and tvp514x@5d decoders really connected to same bus, or are
> they on separate busses ? If the latter then you should have 2 'port' nodes.
> And in such case don't you need to identify to which
>
The tvp514x@5c and tvp514x@5d are connected to the same bus.

>
>> I have added two endpoints for the bridge driver. In the bridge driver
>> to build the pdata from DT node,I do the following,
>>
>> np = v4l2_of_get_next_endpoint(pdev->dev.of_node, NULL);
>>
>> The above will give the first endpoint ie, endpoint@1
>>  From here is it possible to get the tvp514x_1 endpoint node and the
>> parent of it?
>
>
> Isn't v4l2_of_get_remote_port_parent() what you need ?
>
Al rite I'll check on it.

>
>> so that I  build the asynchronous subdev list for the bridge driver.
>>
>>
>> +static struct v4l2_async_subdev tvp1_sd = {
>> +   .hw = {
>
>
> This doesn't match the current struct v4l2_async_subdev data strcucture,
> there is no 'hw' field now.
>
>
Ah my bad pasted a wrong one earlier one :)

>> +   .bus_type = V4L2_ASYNC_BUS_I2C,
>> +   .match.i2c = {
>> +   

Re: Few Doubts on adding DT nodes for bridge driver

2013-07-21 Thread Prabhakar Lad
Hi Guennadi,

On Sun, Jul 21, 2013 at 3:17 PM, Guennadi Liakhovetski
 wrote:
> On Sun, 21 Jul 2013, Sylwester Nawrocki wrote:
>
[snip]
>> > remote =<&tvp514x_2>;
>
> BTW, just occurred to me: shouldn't also these rather be
> "remote-endpoint?" The documentation example should then be fixed too.
>
Ah correct I was referring the same and added in the 'remote' in device node.
Shall I go ahead and post a patch fixing it ?

>> > };
>> > };
>> > };
>>
>> Are tvp514x@5c and tvp514x@5d decoders really connected to same bus, or are
>> they on separate busses ? If the latter then you should have 2 'port' nodes.
>> And in such case don't you need to identify to which
>>
>> > I have added two endpoints for the bridge driver. In the bridge driver
>> > to build the pdata from DT node,I do the following,
>> >
>> > np = v4l2_of_get_next_endpoint(pdev->dev.of_node, NULL);
>> >
>> > The above will give the first endpoint ie, endpoint@1
>> >  From here is it possible to get the tvp514x_1 endpoint node and the
>> > parent of it?
>>
>> Isn't v4l2_of_get_remote_port_parent() what you need ?
>
> Right, forgot we've got a helper for that already.
>
Yes this works for me now thank :)

Regards,
--Prabhakar Lad
--
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 0/5] Davinci VPBE use devres and some cleanup

2013-07-23 Thread Prabhakar Lad
Hi Hans,

On Sat, Jul 13, 2013 at 2:20 PM, Prabhakar Lad
 wrote:
> From: "Lad, Prabhakar" 
>
> This patch series replaces existing resource handling in the
> driver with managed device resource.
>
> Lad, Prabhakar (5):
>   media: davinci: vpbe_venc: convert to devm_* api
>   media: davinci: vpbe_osd: convert to devm_* api
>   media: davinci: vpbe_display: convert to devm* api
>   media: davinci: vpss: convert to devm* api

can you pick up patches 1-4 for 3.12 ? I'll handle the 5/5 patch later.

Regards,
--Prabhakar Lad
--
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 0/5] Davinci VPBE use devres and some cleanup

2013-07-23 Thread Prabhakar Lad
Abraham,

On Tue, Jul 23, 2013 at 5:14 PM, Abraham, Tobin  wrote:
> All,
>
> I do not know why I keep receiving these e-mails from multiple people. Could 
> you please remove me from your e-mail lists?
>
Please follow this link [1] to un subscribe yourself from the mailing list.

[1] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Regards,
--Prabhakar Lad
--
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 RFC 0/5] v4l2-async DT support improvement and cleanups

2013-07-23 Thread Prabhakar Lad
Hi Sylwester,

On Mon, Jul 22, 2013 at 11:34 PM, Sylwester Nawrocki
 wrote:
> Hello,
>
> This is a few patches for the v4l2-async API I wrote while adding
> the asynchronous subdev registration support to the exynos4-is
> driver.
>
> The most significant change is addition of V4L2_ASYNC_MATCH_OF
> subdev matching method, where host driver can pass a list of
> of_node pointers identifying its subdevs.
>
> I thought it's a reasonable and simple enough way to support device
> tree based systems. Comments/other ideas are of course welcome.
>
> Thanks,
> Sylwester
>
> Sylwester Nawrocki (5):
>   V4L2: Drop bus_type check in v4l2-async match functions
>   V4L2: Rename v4l2_async_bus_* to v4l2_async_match_*
>   V4L2: Add V4L2_ASYNC_MATCH_OF subdev matching type
>   V4L2: Rename subdev field of struct v4l2_async_notifier
>   V4L2: Fold struct v4l2_async_subdev_list with struct v4l2_subdev
>
Thanks for the patche's tested on DA850 EVM for VPIF driver.

for patches 1,2,4,5:

Acked-and-tested-by: Lad, Prabhakar 

and for patch 3:

Acked-by: Lad, Prabhakar 

Regards,
--Prabhakar Lad
--
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 RFC 4/5] V4L2: Rename subdev field of struct v4l2_async_notifier

2013-07-23 Thread Prabhakar Lad
Hi Sylwester,

On Mon, Jul 22, 2013 at 11:34 PM, Sylwester Nawrocki
 wrote:
> This is a purely cosmetic change. Since the 'subdev' member
> points to an array of subdevs it seems more intuitive to name
> it in plural form.
>
> Signed-off-by: Sylwester Nawrocki 
> Signed-off-by: Kyungmin Park 
> ---
>  drivers/media/platform/soc_camera/soc_camera.c |2 +-
>  drivers/media/v4l2-core/v4l2-async.c   |2 +-
>  include/media/v4l2-async.h |4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
>

can you include the following changes in the same patch ?
so that git bisect doesn’t break.

(maybe you need to rebase the patches on
http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/for-v3.12)

Regards,
--Prabhakar Lad

diff --git a/drivers/media/platform/davinci/vpif_capture.c
b/drivers/media/platform/davinci/vpif_capture.c
index b11d7a7..7fbde6d 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -2168,7 +2168,7 @@ static __init int vpif_probe(struct platform_device *pdev)
}
vpif_probe_complete();
} else {
-   vpif_obj.notifier.subdev = vpif_obj.config->asd;
+   vpif_obj.notifier.subdevs = vpif_obj.config->asd;
vpif_obj.notifier.num_subdevs = vpif_obj.config->asd_sizes[0];
vpif_obj.notifier.bound = vpif_async_bound;
vpif_obj.notifier.complete = vpif_async_complete;
diff --git a/drivers/media/platform/davinci/vpif_display.c
b/drivers/media/platform/davinci/vpif_display.c
index c2ff067..6336dfc 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1832,7 +1832,7 @@ static __init int vpif_probe(struct platform_device *pdev)
}
vpif_probe_complete();
} else {
-   vpif_obj.notifier.subdev = vpif_obj.config->asd;
+   vpif_obj.notifier.subdevs = vpif_obj.config->asd;
vpif_obj.notifier.num_subdevs = vpif_obj.config->asd_sizes[0];
vpif_obj.notifier.bound = vpif_async_bound;
vpif_obj.notifier.complete = vpif_async_complete;
--
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] davinci: vpbe: fix build error when CONFIG_VIDEO_ADV_DEBUG is enabled

2012-07-20 Thread Prabhakar Lad
From: Lad, Prabhakar 

Fix build error when CONFIG_VIDEO_ADV_DEBUG is enabled,
declare the vpbe_dev variable.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
---
 drivers/media/video/davinci/vpbe_display.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/davinci/vpbe_display.c 
b/drivers/media/video/davinci/vpbe_display.c
index f78ccc0..6fe7034 100644
--- a/drivers/media/video/davinci/vpbe_display.c
+++ b/drivers/media/video/davinci/vpbe_display.c
@@ -1517,6 +1517,8 @@ static int vpbe_display_g_register(struct file *file, 
void *priv,
struct v4l2_dbg_register *reg)
 {
struct v4l2_dbg_match *match = ®->match;
+   struct vpbe_fh *fh = file->private_data;
+   struct vpbe_device *vpbe_dev = fh->disp_dev->vpbe_dev;
 
if (match->type >= 2) {
v4l2_subdev_call(vpbe_dev->venc,
-- 
1.7.0.4

--
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 RESEND] davinci: vpbe: fix build error when CONFIG_VIDEO_ADV_DEBUG is enabled

2012-07-20 Thread Prabhakar Lad
From: Lad, Prabhakar 

Fix build error when CONFIG_VIDEO_ADV_DEBUG is enabled,
declare the vpbe_dev variable.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
---
  Resending the patch since it didn't reach to the
  linux-media list.

 drivers/media/video/davinci/vpbe_display.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/davinci/vpbe_display.c 
b/drivers/media/video/davinci/vpbe_display.c
index f78ccc0..6fe7034 100644
--- a/drivers/media/video/davinci/vpbe_display.c
+++ b/drivers/media/video/davinci/vpbe_display.c
@@ -1517,6 +1517,8 @@ static int vpbe_display_g_register(struct file *file, 
void *priv,
struct v4l2_dbg_register *reg)
 {
struct v4l2_dbg_match *match = ®->match;
+   struct vpbe_fh *fh = file->private_data;
+   struct vpbe_device *vpbe_dev = fh->disp_dev->vpbe_dev;
 
if (match->type >= 2) {
v4l2_subdev_call(vpbe_dev->venc,
-- 
1.7.4.1

--
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] davinci: vpbe: fix check for s_dv_preset function pointer

2012-07-20 Thread Prabhakar Lad
From: Lad, Prabhakar 

fix check for s_dv_preset function pointer to be NULL.
return -EINVAL if function pointer is NULL.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
---
 drivers/media/video/davinci/vpbe_display.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/davinci/vpbe_display.c 
b/drivers/media/video/davinci/vpbe_display.c
index e106b72..f78ccc0 100644
--- a/drivers/media/video/davinci/vpbe_display.c
+++ b/drivers/media/video/davinci/vpbe_display.c
@@ -1083,7 +1083,7 @@ vpbe_display_s_dv_preset(struct file *file, void *priv,
}
 
/* Set the given standard in the encoder */
-   if (NULL != vpbe_dev->ops.s_dv_preset)
+   if (!vpbe_dev->ops.s_dv_preset)
return -EINVAL;
 
ret = vpbe_dev->ops.s_dv_preset(vpbe_dev, preset);
-- 
1.7.4.1

--
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] davinci: vpbe: add build infrastructure for VPBE on dm365 and dm355

2012-07-20 Thread Prabhakar Lad
From: Manjunath Hadli 

add Kconfig and Makefile changes to build VPBE display
driver on dm365 and dm355 along with dm644x.

Signed-off-by: Manjunath Hadli 
Signed-off-by: Lad, Prabhakar 
---
 drivers/media/video/davinci/Kconfig  |   12 ++--
 drivers/media/video/davinci/Makefile |2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/media/video/davinci/Kconfig 
b/drivers/media/video/davinci/Kconfig
index 9337b56..7fd125d 100644
--- a/drivers/media/video/davinci/Kconfig
+++ b/drivers/media/video/davinci/Kconfig
@@ -93,13 +93,13 @@ config VIDEO_ISIF
   To compile this driver as a module, choose M here: the
   module will be called vpfe.
 
-config VIDEO_DM644X_VPBE
-   tristate "DM644X VPBE HW module"
-   depends on ARCH_DAVINCI_DM644x
+config VIDEO_DAVINCI_VPBE
+   tristate "DAVINCI VPBE HW module"
+   depends on ARCH_DAVINCI_DM644x || ARCH_DAVINCI_DM365 || 
ARCH_DAVINCI_DM355
select VIDEO_VPSS_SYSTEM
select VIDEOBUF_DMA_CONTIG
help
-   Enables VPBE modules used for display on a DM644x
+   Enables VPBE modules used for display on a DM644x, DM365, DM355
SoC.
 
To compile this driver as a module, choose M here: the
@@ -108,10 +108,10 @@ config VIDEO_DM644X_VPBE
 
 config VIDEO_VPBE_DISPLAY
tristate "VPBE V4L2 Display driver"
-   depends on ARCH_DAVINCI_DM644x
+   depends on ARCH_DAVINCI_DM644x || ARCH_DAVINCI_DM365 || 
ARCH_DAVINCI_DM355
select VIDEO_DM644X_VPBE
help
-   Enables VPBE V4L2 Display driver on a DM644x device
+   Enables VPBE V4L2 Display driver on a DM644x, DM365, DM355 device
 
To compile this driver as a module, choose M here: the
module will be called vpbe_display.
diff --git a/drivers/media/video/davinci/Makefile 
b/drivers/media/video/davinci/Makefile
index ae7dafb..3057822 100644
--- a/drivers/media/video/davinci/Makefile
+++ b/drivers/media/video/davinci/Makefile
@@ -16,5 +16,5 @@ obj-$(CONFIG_VIDEO_VPFE_CAPTURE) += vpfe_capture.o
 obj-$(CONFIG_VIDEO_DM6446_CCDC) += dm644x_ccdc.o
 obj-$(CONFIG_VIDEO_DM355_CCDC) += dm355_ccdc.o
 obj-$(CONFIG_VIDEO_ISIF) += isif.o
-obj-$(CONFIG_VIDEO_DM644X_VPBE) += vpbe.o vpbe_osd.o vpbe_venc.o
+obj-$(CONFIG_VIDEO_DAVINCI_VPBE) += vpbe.o vpbe_osd.o vpbe_venc.o
 obj-$(CONFIG_VIDEO_VPBE_DISPLAY) += vpbe_display.o
-- 
1.7.4.1

--
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] davinci: vpss: enable vpss clocks

2012-07-20 Thread Prabhakar Lad
From: Lad, Prabhakar 

By default the VPSS clocks are only enabled in capture driver.
and display wont work if the capture is not enabled. This
patch adds support to enable the VPSS clocks in VPSS driver.
This way we can enable/disable capture and display and use it
independently.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
---
 drivers/media/video/davinci/vpss.c |   38 
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/davinci/vpss.c 
b/drivers/media/video/davinci/vpss.c
index 3e5cf27..30283bb 100644
--- a/drivers/media/video/davinci/vpss.c
+++ b/drivers/media/video/davinci/vpss.c
@@ -25,6 +25,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+
 #include 
 #include 
 
@@ -104,6 +107,10 @@ struct vpss_oper_config {
enum vpss_platform_type platform;
spinlock_t vpss_lock;
struct vpss_hw_ops hw_ops;
+   /* Master clock */
+   struct clk *mclk;
+   /* slave clock */
+   struct clk *sclk;
 };
 
 static struct vpss_oper_config oper_cfg;
@@ -381,6 +388,29 @@ static int __init vpss_probe(struct platform_device *pdev)
return -ENODEV;
}
 
+   /* Get and enable Master clock */
+   oper_cfg.mclk = clk_get(&pdev->dev, "master");
+   if (IS_ERR(oper_cfg.mclk)) {
+   status = PTR_ERR(oper_cfg.mclk);
+   goto fail_getclk;
+   }
+   if (clk_enable(oper_cfg.mclk)) {
+   status = -ENODEV;
+   goto fail_mclk;
+   }
+   if (oper_cfg.platform == DM355 || oper_cfg.platform == DM644X) {
+   /* Get and enable Slave clock */
+   oper_cfg.sclk = clk_get(&pdev->dev, "slave");
+   if (IS_ERR(oper_cfg.sclk)) {
+   status = PTR_ERR(oper_cfg.sclk);
+   goto fail_mclk;
+   }
+   if (clk_enable(oper_cfg.sclk)) {
+   status = -ENODEV;
+   goto fail_sclk;
+   }
+   }
+
dev_info(&pdev->dev, "%s vpss probed\n", platform_name);
r1 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r1)
@@ -442,6 +472,11 @@ fail2:
iounmap(oper_cfg.vpss_regs_base0);
 fail1:
release_mem_region(r1->start, resource_size(r1));
+fail_sclk:
+   clk_put(oper_cfg.sclk);
+fail_mclk:
+   clk_put(oper_cfg.mclk);
+fail_getclk:
return status;
 }
 
@@ -452,6 +487,9 @@ static int __devexit vpss_remove(struct platform_device 
*pdev)
iounmap(oper_cfg.vpss_regs_base0);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(res->start, resource_size(res));
+   clk_put(oper_cfg.mclk);
+   if (oper_cfg.platform == DM355 || oper_cfg.platform == DM644X)
+   clk_put(oper_cfg.sclk);
if (oper_cfg.platform == DM355 || oper_cfg.platform == DM365) {
iounmap(oper_cfg.vpss_regs_base1);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-- 
1.7.0.4

--
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 v6 0/2] add dm365 specific media formats

2012-07-20 Thread Prabhakar Lad
add mediabus formats and pixel formats supported
as part of dm365 vpfe device.
The device supports media formats(transfer and storage)
which include-
1: ALAW compressed bayer.
2: UV interleaved without Y (for resizer).
3: YDYU

Changes for v6:
1: Fixed a comment from Hans, replaced "YUYDYDYV and YVYDYDYU"
   to "YUYDYVYD and YVYDYUYD".

Changes for v5:
1: Fixed comment from Laurent, moved ALAW format above DPCM
   format to keep the alphabetically sorted, grouped textual
   description for ALAW and DPCM compression, as they're mutally
   exclusive, Changed V4L2_MBUS_FMT_YDYC8_1X16 to
   V4L2_MBUS_FMT_YDYUYDYV8_1X16.

Changes for v4:
1: Rebased the patch set on Sakari's branch
(http://git.linuxtv.org/sailus/media_tree.git/shortlog/refs/heads/media-for-3.4)
   mainly because of this patch
   http://www.spinics.net/lists/linux-media/msg44871.html>
2: Fixed comments from Sakari, changed description for
   UV8, and re-arranged &sub-uv8; in
   Documentation/DocBook/media/v4l/pixfmt.xml file.

Changes for v3:
1: Added 4cc code for A-law compressed format as per
  specified in documentation,
  http://www.spinics.net/lists/linux-media/msg43890.html

Changes for v2:
1: Added entries in subdev-formats.xml for
 V4L2_MBUS_FMT_YDYC8_1X16, V4L2_MBUS_FMT_UV8_1X8,
 V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8,
 V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8,
 V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8,
 V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8.
2: Added documentation of ALAW and UV8 pix format.

Manjunath Hadli (2):
  media: add new mediabus format enums for dm365
  v4l2: add new pixel formats supported on dm365

 .../DocBook/media/v4l/pixfmt-srggb10alaw8.xml  |   34 +++
 Documentation/DocBook/media/v4l/pixfmt-uv8.xml |   62 +
 Documentation/DocBook/media/v4l/pixfmt.xml |2 +
 Documentation/DocBook/media/v4l/subdev-formats.xml |  250 +++-
 include/linux/v4l2-mediabus.h  |   10 +-
 include/linux/videodev2.h  |8 +
 6 files changed, 358 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-uv8.xml

--
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 v6 1/2] media: add new mediabus format enums for dm365

2012-07-20 Thread Prabhakar Lad
From: Manjunath Hadli 

add new enum entries for supporting the media-bus formats on dm365.
These include some bayer and some non-bayer formats.
V4L2_MBUS_FMT_YDYUYDYV8_1X16 and V4L2_MBUS_FMT_UV8_1X8 are used
internal to the hardware by the resizer.
V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8 represents the bayer ALAW format
that is supported by dm365 hardware.

Acked-by: Hans Verkuil 
Signed-off-by: Manjunath Hadli 
Signed-off-by: Lad, Prabhakar 
Cc: Laurent Pinchart 
Cc: Sakari Ailus 
Cc: Guennadi Liakhovetski 
---
 Documentation/DocBook/media/v4l/subdev-formats.xml |  250 +++-
 include/linux/v4l2-mediabus.h  |   10 +-
 2 files changed, 252 insertions(+), 8 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml 
b/Documentation/DocBook/media/v4l/subdev-formats.xml
index 49c532e..01b2811 100644
--- a/Documentation/DocBook/media/v4l/subdev-formats.xml
+++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
@@ -353,9 +353,9 @@
The number of bits per pixel component. All components 
are
transferred on the same number of bits. Common values are 8, 10 and 
12.

-   If the pixel components are DPCM-compressed, a mention 
of the
-   DPCM compression and the number of bits per compressed pixel 
component.
-   
+   The compression (optional). If the pixel components are
+   ALAW- or DPCM-compressed, a mention of the compression scheme and the
+   number of bits per compressed pixel component.
The number of bus samples per pixel. Pixels that are 
wider than
the bus width must be transferred in multiple samples. Common values are
1 and 2.
@@ -504,6 +504,74 @@
  r1
  r0

+   
+ V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8
+ 0x3015
+ 
+ -
+ -
+ -
+ -
+ b7
+ b6
+ b5
+ b4
+ b3
+ b2
+ b1
+ b0
+   
+   
+ V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8
+ 0x3016
+ 
+ -
+ -
+ -
+ -
+ g7
+ g6
+ g5
+ g4
+ g3
+ g2
+ g1
+ g0
+   
+   
+ V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8
+ 0x3017
+ 
+ -
+ -
+ -
+ -
+ g7
+ g6
+ g5
+ g4
+ g3
+ g2
+ g1
+ g0
+   
+   
+ V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8
+ 0x3018
+ 
+ -
+ -
+ -
+ -
+ r7
+ r6
+ r5
+ r4
+ r3
+ r2
+ r1
+ r0
+   

  V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8
  0x300b
@@ -853,10 +921,16 @@
   Packed YUV Formats
 
   Those data formats transfer pixel data as (possibly downsampled) 
Y, U
-  and V components. The format code is made of the following information.
+  and V components. Some formats include dummy bits in some of their 
samples
+  and are collectively referred to as "YDYC" (Y-Dummy-Y-Chroma) formats.
+  One cannot rely on the values of these dummy bits as those are undefined.
+  
+  The format code is made of the following information.
   
The Y, U and V components order code, as transferred on 
the
-   bus. Possible values are YUYV, UYVY, YVYU and VYUY.
+   bus. Possible values are YUYV, UYVY, YVYU and VYUY for formats with no
+   dummy bit, and YDYUYDYV, YDYVYDYU, YUYDYVYD and YVYDYUYD for YDYC 
formats.
+   
The number of bits per pixel component. All components 
are
transferred on the same number of bits. Common values are 8, 10 and 
12.

@@ -877,7 +951,21 @@
   U, Y, V, Y order will be named 
V4L2_MBUS_FMT_UYVY8_2X8.
   
 
-  The following table lisst existing packet YUV formats.
+list existing packet 
YUV
+   formats and describes the organization of each pixel data in each 
sample.
+   When a format pattern is split across multiple samples each of the 
samples
+   in the pattern is described.
+
+   The role of each bit transferred over the bus is identified by one
+   of the following codes.
+
+   
+  yx for luma component bit 
number x
+  ux for blue chroma component 
bit number x
+  vx for red chroma component 
bit number x
+  - for non-available bits (for positions higher than 
the bus width)
+  d for dummy bits
+   
 
   
YUV Formats
@@ -965,6 +1053,56 @@
  y1
  y0

+   
+ V4L2_MBUS_FMT_UV8_1X8
+ 0x2015
+   

[PATCH v6 2/2] v4l2: add new pixel formats supported on dm365

2012-07-20 Thread Prabhakar Lad
From: Manjunath Hadli 

add new macro V4L2_PIX_FMT_SGRBG10ALAW8 and associated formats
to represent Bayer format frames compressed by A-LAW algorithm,
add V4L2_PIX_FMT_UV8 to represent storage of CbCr data (UV interleaved)
only.

Signed-off-by: Manjunath Hadli 
Signed-off-by: Lad, Prabhakar 
Cc: Laurent Pinchart 
Cc: Sakari Ailus 
Cc: Hans Verkuil 
Cc: Guennadi Liakhovetski 
---
 .../DocBook/media/v4l/pixfmt-srggb10alaw8.xml  |   34 +++
 Documentation/DocBook/media/v4l/pixfmt-uv8.xml |   62 
 Documentation/DocBook/media/v4l/pixfmt.xml |2 +
 include/linux/videodev2.h  |8 +++
 4 files changed, 106 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-uv8.xml

diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml 
b/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
new file mode 100644
index 000..61cced5
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
@@ -0,0 +1,34 @@
+   
+ 
+   
+ V4L2_PIX_FMT_SRGGB10ALAW8 ('aRA8'),
+ V4L2_PIX_FMT_SGRBG10ALAW8 ('agA8'),
+ V4L2_PIX_FMT_SGBRG10ALAW8 ('aGA8'),
+ V4L2_PIX_FMT_SBGGR10ALAW8 ('aBA8'),
+   
+   &manvol;
+ 
+ 
+   
+ V4L2_PIX_FMT_SRGGB10ALAW8
+   
+   
+ V4L2_PIX_FMT_SGRBG10ALAW8
+   
+   
+ V4L2_PIX_FMT_SGBRG10ALAW8
+   
+   
+ V4L2_PIX_FMT_SBGGR10ALAW8
+   
+   10-bit Bayer formats compressed to 8 bits
+ 
+ 
+   Description
+   The following four pixel formats are raw sRGB / Bayer
+   formats with 10 bits per color compressed to 8 bits each,
+   using the A-LAW algorithm. Each color component consumes 8
+   bits of memory. In other respects this format is similar to
+   .
+ 
+   
diff --git a/Documentation/DocBook/media/v4l/pixfmt-uv8.xml 
b/Documentation/DocBook/media/v4l/pixfmt-uv8.xml
new file mode 100644
index 000..c507c1f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-uv8.xml
@@ -0,0 +1,62 @@
+   
+ 
+   V4L2_PIX_FMT_UV8  ('UV8')
+   &manvol;
+ 
+ 
+   V4L2_PIX_FMT_UV8
+   UV plane interleaved
+ 
+ 
+   Description
+   In this format there is no Y plane, Only CbCr plane. ie
+   (UV interleaved)
+   
+   
+ V4L2_PIX_FMT_UV8
+  pixel image
+   
+
+   
+ Byte Order.
+ Each cell is one byte.
+   
+   
+ 
+ 
+   
+ start + 0:
+ Cb00
+ Cr00
+ Cb01
+ Cr01
+   
+   
+ start + 4:
+ Cb10
+ Cr10
+ Cb11
+ Cr11
+   
+   
+ start + 8:
+ Cb20
+ Cr20
+ Cb21
+ Cr21
+   
+   
+ start + 12:
+ Cb30
+ Cr30
+ Cb31
+ Cr31
+   
+ 
+   
+   
+ 
+ 
+   
+ 
+   
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml 
b/Documentation/DocBook/media/v4l/pixfmt.xml
index e58934c..930f55d 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -673,6 +673,7 @@ access the palette, this must be done with ioctls of the 
Linux framebuffer API.<
 &sub-srggb8;
 &sub-sbggr16;
 &sub-srggb10;
+&sub-srggb10alaw8;
 &sub-srggb10dpcm8;
 &sub-srggb12;
   
@@ -701,6 +702,7 @@ information.
 &sub-y12;
 &sub-y10b;
 &sub-y16;
+&sub-uv8;
 &sub-yuyv;
 &sub-uyvy;
 &sub-yvyu;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 5d78910..2cdf2c1 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -329,6 +329,9 @@ struct v4l2_pix_format {
 /* Palette formats */
 #define V4L2_PIX_FMT_PAL8v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit 
palette */
 
+/* Chrominance formats */
+#define V4L2_PIX_FMT_UV8  v4l2_fourcc('U', 'V', '8', ' ') /*  8  UV 4:4 */
+
 /* Luminance+Chrominance formats */
 #define V4L2_PIX_FMT_YVU410  v4l2_fourcc('Y', 'V', 'U', '9') /*  9  YVU 4:1:0  
   */
 #define V4L2_PIX_FMT_YVU420  v4l2_fourcc('Y', 'V', '1', '2') /* 12  YVU 4:2:0  
   */
@@ -378,6 +381,11 @@ struct v4l2_pix

[PATCH v7 0/2] add dm365 specific media formats

2012-07-27 Thread Prabhakar Lad
add mediabus formats and pixel formats supported
as part of dm365 vpfe device.
The device supports media formats(transfer and storage)
which include-
1: ALAW compressed bayer.
2: UV interleaved without Y (for resizer).
3: YDYU

Changes for v7:
1: Fixed a comment from Laurent, removed subscript for 
   dummy tags.
2: Fixed a comment from Sakari, used the same order for
   ALAW pix fmt according to Documentation/video4linux/4CCs.txt.

Changes for v6:
1: Fixed a comment from Hans, replaced "YUYDYDYV and YVYDYDYU"
   to "YUYDYVYD and YVYDYUYD".

Changes for v5:
1: Fixed comment from Laurent, moved ALAW format above DPCM
   format to keep the alphabetically sorted, grouped textual
   description for ALAW and DPCM compression, as they're mutally
   exclusive, Changed V4L2_MBUS_FMT_YDYC8_1X16 to
   V4L2_MBUS_FMT_YDYUYDYV8_1X16.

Changes for v4:
1: Rebased the patch set on Sakari's branch
(http://git.linuxtv.org/sailus/media_tree.git/shortlog/refs/heads/media-for-3.4)
   mainly because of this patch
   http://www.spinics.net/lists/linux-media/msg44871.html>
2: Fixed comments from Sakari, changed description for
   UV8, and re-arranged &sub-uv8; in
   Documentation/DocBook/media/v4l/pixfmt.xml file.

Changes for v3:
1: Added 4cc code for A-law compressed format as per
  specified in documentation,
  http://www.spinics.net/lists/linux-media/msg43890.html

Changes for v2:
1: Added entries in subdev-formats.xml for
 V4L2_MBUS_FMT_YDYC8_1X16, V4L2_MBUS_FMT_UV8_1X8,
 V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8,
 V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8,
 V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8,
 V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8.
2: Added documentation of ALAW and UV8 pix format.

Manjunath Hadli (2):
  media: add new mediabus format enums for dm365
  v4l2: add new pixel formats supported on dm365

 .../DocBook/media/v4l/pixfmt-srggb10alaw8.xml  |   34 +++
 Documentation/DocBook/media/v4l/pixfmt-uv8.xml |   62 +
 Documentation/DocBook/media/v4l/pixfmt.xml |2 +
 Documentation/DocBook/media/v4l/subdev-formats.xml |  250 +++-
 include/linux/v4l2-mediabus.h  |   10 +-
 include/linux/videodev2.h  |8 +
 6 files changed, 358 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-uv8.xml

--
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 v7 1/2] media: add new mediabus format enums for dm365

2012-07-27 Thread Prabhakar Lad
From: Manjunath Hadli 

add new enum entries for supporting the media-bus formats on dm365.
These include some bayer and some non-bayer formats.
V4L2_MBUS_FMT_YDYUYDYV8_1X16 and V4L2_MBUS_FMT_UV8_1X8 are used
internal to the hardware by the resizer.
V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8 represents the bayer ALAW format
that is supported by dm365 hardware.

Acked-by: Laurent Pinchart 
Acked-by: Hans Verkuil 
Signed-off-by: Manjunath Hadli 
Signed-off-by: Lad, Prabhakar 
Cc: Sakari Ailus 
Cc: Guennadi Liakhovetski 
---
 Documentation/DocBook/media/v4l/subdev-formats.xml |  250 +++-
 include/linux/v4l2-mediabus.h  |   10 +-
 2 files changed, 252 insertions(+), 8 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml 
b/Documentation/DocBook/media/v4l/subdev-formats.xml
index 49c532e..75dc275 100644
--- a/Documentation/DocBook/media/v4l/subdev-formats.xml
+++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
@@ -353,9 +353,9 @@
The number of bits per pixel component. All components 
are
transferred on the same number of bits. Common values are 8, 10 and 
12.

-   If the pixel components are DPCM-compressed, a mention 
of the
-   DPCM compression and the number of bits per compressed pixel 
component.
-   
+   The compression (optional). If the pixel components are
+   ALAW- or DPCM-compressed, a mention of the compression scheme and the
+   number of bits per compressed pixel component.
The number of bus samples per pixel. Pixels that are 
wider than
the bus width must be transferred in multiple samples. Common values are
1 and 2.
@@ -504,6 +504,74 @@
  r1
  r0

+   
+ V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8
+ 0x3015
+ 
+ -
+ -
+ -
+ -
+ b7
+ b6
+ b5
+ b4
+ b3
+ b2
+ b1
+ b0
+   
+   
+ V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8
+ 0x3016
+ 
+ -
+ -
+ -
+ -
+ g7
+ g6
+ g5
+ g4
+ g3
+ g2
+ g1
+ g0
+   
+   
+ V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8
+ 0x3017
+ 
+ -
+ -
+ -
+ -
+ g7
+ g6
+ g5
+ g4
+ g3
+ g2
+ g1
+ g0
+   
+   
+ V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8
+ 0x3018
+ 
+ -
+ -
+ -
+ -
+ r7
+ r6
+ r5
+ r4
+ r3
+ r2
+ r1
+ r0
+   

  V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8
  0x300b
@@ -853,10 +921,16 @@
   Packed YUV Formats
 
   Those data formats transfer pixel data as (possibly downsampled) 
Y, U
-  and V components. The format code is made of the following information.
+  and V components. Some formats include dummy bits in some of their 
samples
+  and are collectively referred to as "YDYC" (Y-Dummy-Y-Chroma) formats.
+  One cannot rely on the values of these dummy bits as those are undefined.
+  
+  The format code is made of the following information.
   
The Y, U and V components order code, as transferred on 
the
-   bus. Possible values are YUYV, UYVY, YVYU and VYUY.
+   bus. Possible values are YUYV, UYVY, YVYU and VYUY for formats with no
+   dummy bit, and YDYUYDYV, YDYVYDYU, YUYDYVYD and YVYDYUYD for YDYC 
formats.
+   
The number of bits per pixel component. All components 
are
transferred on the same number of bits. Common values are 8, 10 and 
12.

@@ -877,7 +951,21 @@
   U, Y, V, Y order will be named 
V4L2_MBUS_FMT_UYVY8_2X8.
   
 
-  The following table lisst existing packet YUV formats.
+list existing packet 
YUV
+   formats and describes the organization of each pixel data in each 
sample.
+   When a format pattern is split across multiple samples each of the 
samples
+   in the pattern is described.
+
+   The role of each bit transferred over the bus is identified by one
+   of the following codes.
+
+   
+  yx for luma component bit 
number x
+  ux for blue chroma component 
bit number x
+  vx for red chroma component 
bit number x
+  - for non-available bits (for positions higher than 
the bus width)
+  d for dummy bits
+   
 
   
YUV Formats
@@ -965,6 +1053,56 @@
  y1
  y0

+   
+ V4L2_MBUS_FMT_UV8_1X8
+ 0x201

[PATCH v7 2/2] v4l2: add new pixel formats supported on dm365

2012-07-27 Thread Prabhakar Lad
From: Manjunath Hadli 

add new macro V4L2_PIX_FMT_SGRBG10ALAW8 and associated formats
to represent Bayer format frames compressed by A-LAW algorithm,
add V4L2_PIX_FMT_UV8 to represent storage of CbCr data (UV interleaved)
only.

Signed-off-by: Manjunath Hadli 
Signed-off-by: Lad, Prabhakar 
Cc: Laurent Pinchart 
Cc: Sakari Ailus 
Cc: Hans Verkuil 
Cc: Guennadi Liakhovetski 
---
 .../DocBook/media/v4l/pixfmt-srggb10alaw8.xml  |   34 +++
 Documentation/DocBook/media/v4l/pixfmt-uv8.xml |   62 
 Documentation/DocBook/media/v4l/pixfmt.xml |2 +
 include/linux/videodev2.h  |8 +++
 4 files changed, 106 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-uv8.xml

diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml 
b/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
new file mode 100644
index 000..c934192
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
@@ -0,0 +1,34 @@
+   
+ 
+   
+ V4L2_PIX_FMT_SBGGR10ALAW8 ('aBA8'),
+ V4L2_PIX_FMT_SGBRG10ALAW8 ('aGA8'),
+ V4L2_PIX_FMT_SGRBG10ALAW8 ('agA8'),
+ V4L2_PIX_FMT_SRGGB10ALAW8 ('aRA8'),
+   
+   &manvol;
+ 
+ 
+   
+ V4L2_PIX_FMT_SBGGR10ALAW8
+   
+   
+ V4L2_PIX_FMT_SGBRG10ALAW8
+   
+   
+ V4L2_PIX_FMT_SGRBG10ALAW8
+   
+   
+ V4L2_PIX_FMT_SRGGB10ALAW8
+   
+   10-bit Bayer formats compressed to 8 bits
+ 
+ 
+   Description
+   The following four pixel formats are raw sRGB / Bayer
+   formats with 10 bits per color compressed to 8 bits each,
+   using the A-LAW algorithm. Each color component consumes 8
+   bits of memory. In other respects this format is similar to
+   .
+ 
+   
diff --git a/Documentation/DocBook/media/v4l/pixfmt-uv8.xml 
b/Documentation/DocBook/media/v4l/pixfmt-uv8.xml
new file mode 100644
index 000..c507c1f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-uv8.xml
@@ -0,0 +1,62 @@
+   
+ 
+   V4L2_PIX_FMT_UV8  ('UV8')
+   &manvol;
+ 
+ 
+   V4L2_PIX_FMT_UV8
+   UV plane interleaved
+ 
+ 
+   Description
+   In this format there is no Y plane, Only CbCr plane. ie
+   (UV interleaved)
+   
+   
+ V4L2_PIX_FMT_UV8
+  pixel image
+   
+
+   
+ Byte Order.
+ Each cell is one byte.
+   
+   
+ 
+ 
+   
+ start + 0:
+ Cb00
+ Cr00
+ Cb01
+ Cr01
+   
+   
+ start + 4:
+ Cb10
+ Cr10
+ Cb11
+ Cr11
+   
+   
+ start + 8:
+ Cb20
+ Cr20
+ Cb21
+ Cr21
+   
+   
+ start + 12:
+ Cb30
+ Cr30
+ Cb31
+ Cr31
+   
+ 
+   
+   
+ 
+ 
+   
+ 
+   
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml 
b/Documentation/DocBook/media/v4l/pixfmt.xml
index e58934c..930f55d 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -673,6 +673,7 @@ access the palette, this must be done with ioctls of the 
Linux framebuffer API.<
 &sub-srggb8;
 &sub-sbggr16;
 &sub-srggb10;
+&sub-srggb10alaw8;
 &sub-srggb10dpcm8;
 &sub-srggb12;
   
@@ -701,6 +702,7 @@ information.
 &sub-y12;
 &sub-y10b;
 &sub-y16;
+&sub-uv8;
 &sub-yuyv;
 &sub-uyvy;
 &sub-yvyu;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 5d78910..2cdf2c1 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -329,6 +329,9 @@ struct v4l2_pix_format {
 /* Palette formats */
 #define V4L2_PIX_FMT_PAL8v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit 
palette */
 
+/* Chrominance formats */
+#define V4L2_PIX_FMT_UV8  v4l2_fourcc('U', 'V', '8', ' ') /*  8  UV 4:4 */
+
 /* Luminance+Chrominance formats */
 #define V4L2_PIX_FMT_YVU410  v4l2_fourcc('Y', 'V', 'U', '9') /*  9  YVU 4:1:0  
   */
 #define V4L2_PIX_FMT_YVU420  v4l2_fourcc('Y', 'V', '1', '2') /* 12  YVU 4:2:0  
   */
@@ -378,6 +381,11 @@ struct v4l2_pix

Re: [PATCH v7 2/2] v4l2: add new pixel formats supported on dm365

2012-08-01 Thread Prabhakar Lad
Hi Sakari,

Thanks for the review.

On Thursday 02 August 2012 05:59 AM, Sakari Ailus wrote:
> Hi Prabhakar,
> 
> Thanks for the patch.
> 
> On Fri, Jul 27, 2012 at 04:25:05PM +0530, Prabhakar Lad wrote:
>> From: Manjunath Hadli 
>>
>> add new macro V4L2_PIX_FMT_SGRBG10ALAW8 and associated formats
>> to represent Bayer format frames compressed by A-LAW algorithm,
>> add V4L2_PIX_FMT_UV8 to represent storage of CbCr data (UV interleaved)
>> only.
>>
>> Signed-off-by: Manjunath Hadli 
>> Signed-off-by: Lad, Prabhakar 
>> Cc: Laurent Pinchart 
>> Cc: Sakari Ailus 
>> Cc: Hans Verkuil 
>> Cc: Guennadi Liakhovetski 
>> ---
>>  .../DocBook/media/v4l/pixfmt-srggb10alaw8.xml  |   34 +++
>>  Documentation/DocBook/media/v4l/pixfmt-uv8.xml |   62 
>> 
>>  Documentation/DocBook/media/v4l/pixfmt.xml |2 +
>>  include/linux/videodev2.h  |8 +++
>>  4 files changed, 106 insertions(+), 0 deletions(-)
>>  create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
>>  create mode 100644 Documentation/DocBook/media/v4l/pixfmt-uv8.xml
>>
>> diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml 
>> b/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
>> new file mode 100644
>> index 000..c934192
>> --- /dev/null
>> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
>> @@ -0,0 +1,34 @@
>> +
>> +  
>> +
>> +  V4L2_PIX_FMT_SBGGR10ALAW8 ('aBA8'),
>> +  V4L2_PIX_FMT_SGBRG10ALAW8 ('aGA8'),
>> +  V4L2_PIX_FMT_SGRBG10ALAW8 ('agA8'),
>> +  V4L2_PIX_FMT_SRGGB10ALAW8 ('aRA8'),
>> +
>> +&manvol;
>> +  
>> +  
>> +
>> +  V4L2_PIX_FMT_SBGGR10ALAW8
>> +
>> +
>> +  V4L2_PIX_FMT_SGBRG10ALAW8
>> +
>> +
>> +  V4L2_PIX_FMT_SGRBG10ALAW8
>> +
>> +
>> +  V4L2_PIX_FMT_SRGGB10ALAW8
>> +
>> +10-bit Bayer formats compressed to 8 bits
>> +  
>> +  
>> +Description
>> +The following four pixel formats are raw sRGB / Bayer
>> +formats with 10 bits per color compressed to 8 bits each,
>> +using the A-LAW algorithm. Each color component consumes 8
>> +bits of memory. In other respects this format is similar to
>> +.
>> +  
>> +
>> diff --git a/Documentation/DocBook/media/v4l/pixfmt-uv8.xml 
>> b/Documentation/DocBook/media/v4l/pixfmt-uv8.xml
>> new file mode 100644
>> index 000..c507c1f
>> --- /dev/null
>> +++ b/Documentation/DocBook/media/v4l/pixfmt-uv8.xml
>> @@ -0,0 +1,62 @@
>> +
>> +  
>> +V4L2_PIX_FMT_UV8  ('UV8')
>> +&manvol;
>> +  
>> +  
>> +V4L2_PIX_FMT_UV8
>> +UV plane interleaved
>> +  
>> +  
>> +Description
>> +In this format there is no Y plane, Only CbCr plane. ie
>> +(UV interleaved)
>> +
>> +
>> +  V4L2_PIX_FMT_UV8
>> +   pixel image
>> +
>> +
>> +
>> +  Byte Order.
>> +  Each cell is one byte.
>> +
>> +
>> +  
>> +  
>> +
>> +  start + 0:
>> +  Cb00
>> +  Cr00
>> +  Cb01
>> +  Cr01
>> +
>> +
>> +  start + 4:
>> +  Cb10
>> +  Cr10
>> +  Cb11
>> +  Cr11
>> +
>> +
>> +  start + 8:
>> +  Cb20
>> +  Cr20
>> +  Cb21
>> +  Cr21
>> +
>> +
>> +  start + 12:
>> +  Cb30
>> +  Cr30
>> +  Cb31
>> +  Cr31
>> +
>> +  
>> +
>> +
>> +  
>> +  
>> +
>> +  
>> +
>> diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml 
>> b/Documentat

[PATCH v8 0/2] add dm365 specific media formats

2012-08-02 Thread Prabhakar Lad
add mediabus formats and pixel formats supported
as part of dm365 vpfe device.
The device supports media formats(transfer and storage)
which include-
1: ALAW compressed bayer.
2: UV interleaved without Y (for resizer).
3: YDYU

Changes for v8:
1: Fixed a comment from Sakari, removed extra space.

Changes for v7:
1: Fixed a comment from Laurent, removed subscript for
   dummy tags.
2: Fixed a comment from Sakari, used the same order for
   ALAW pix fmt according to Documentation/video4linux/4CCs.txt.

Changes for v6:
1: Fixed a comment from Hans, replaced "YUYDYDYV and YVYDYDYU"
   to "YUYDYVYD and YVYDYUYD".

Changes for v5:
1: Fixed comment from Laurent, moved ALAW format above DPCM
   format to keep the alphabetically sorted, grouped textual
   description for ALAW and DPCM compression, as they're mutally
   exclusive, Changed V4L2_MBUS_FMT_YDYC8_1X16 to
   V4L2_MBUS_FMT_YDYUYDYV8_1X16.

Changes for v4:
1: Rebased the patch set on Sakari's branch
(http://git.linuxtv.org/sailus/media_tree.git/shortlog/refs/heads/media-for-3.4)
   mainly because of this patch
   http://www.spinics.net/lists/linux-media/msg44871.html>
2: Fixed comments from Sakari, changed description for
   UV8, and re-arranged &sub-uv8; in
   Documentation/DocBook/media/v4l/pixfmt.xml file.

Changes for v3:
1: Added 4cc code for A-law compressed format as per
  specified in documentation,
  http://www.spinics.net/lists/linux-media/msg43890.html

Changes for v2:
1: Added entries in subdev-formats.xml for
 V4L2_MBUS_FMT_YDYC8_1X16, V4L2_MBUS_FMT_UV8_1X8,
 V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8,
 V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8,
 V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8,
 V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8.
2: Added documentation of ALAW and UV8 pix format.

Manjunath Hadli (2):
  media: add new mediabus format enums for dm365
  v4l2: add new pixel formats supported on dm365

 .../DocBook/media/v4l/pixfmt-srggb10alaw8.xml  |   34 +++
 Documentation/DocBook/media/v4l/pixfmt-uv8.xml |   62 +
 Documentation/DocBook/media/v4l/pixfmt.xml |2 +
 Documentation/DocBook/media/v4l/subdev-formats.xml |  250 +++-
 include/linux/v4l2-mediabus.h  |   10 +-
 include/linux/videodev2.h  |8 +
 6 files changed, 358 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-uv8.xml

--
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] media: add new mediabus format enums for dm365

2012-08-02 Thread Prabhakar Lad
From: Manjunath Hadli 

add new enum entries for supporting the media-bus formats on dm365.
These include some bayer and some non-bayer formats.
V4L2_MBUS_FMT_YDYUYDYV8_1X16 and V4L2_MBUS_FMT_UV8_1X8 are used
internal to the hardware by the resizer.
V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8 represents the bayer ALAW format
that is supported by dm365 hardware.

Acked-by: Sakari Ailus 
Acked-by: Laurent Pinchart 
Acked-by: Hans Verkuil 
Signed-off-by: Manjunath Hadli 
Signed-off-by: Lad, Prabhakar 
Cc: Guennadi Liakhovetski 
---
 Documentation/DocBook/media/v4l/subdev-formats.xml |  250 +++-
 include/linux/v4l2-mediabus.h  |   10 +-
 2 files changed, 252 insertions(+), 8 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml 
b/Documentation/DocBook/media/v4l/subdev-formats.xml
index 49c532e..75dc275 100644
--- a/Documentation/DocBook/media/v4l/subdev-formats.xml
+++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
@@ -353,9 +353,9 @@
The number of bits per pixel component. All components 
are
transferred on the same number of bits. Common values are 8, 10 and 
12.

-   If the pixel components are DPCM-compressed, a mention 
of the
-   DPCM compression and the number of bits per compressed pixel 
component.
-   
+   The compression (optional). If the pixel components are
+   ALAW- or DPCM-compressed, a mention of the compression scheme and the
+   number of bits per compressed pixel component.
The number of bus samples per pixel. Pixels that are 
wider than
the bus width must be transferred in multiple samples. Common values are
1 and 2.
@@ -504,6 +504,74 @@
  r1
  r0

+   
+ V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8
+ 0x3015
+ 
+ -
+ -
+ -
+ -
+ b7
+ b6
+ b5
+ b4
+ b3
+ b2
+ b1
+ b0
+   
+   
+ V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8
+ 0x3016
+ 
+ -
+ -
+ -
+ -
+ g7
+ g6
+ g5
+ g4
+ g3
+ g2
+ g1
+ g0
+   
+   
+ V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8
+ 0x3017
+ 
+ -
+ -
+ -
+ -
+ g7
+ g6
+ g5
+ g4
+ g3
+ g2
+ g1
+ g0
+   
+   
+ V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8
+ 0x3018
+ 
+ -
+ -
+ -
+ -
+ r7
+ r6
+ r5
+ r4
+ r3
+ r2
+ r1
+ r0
+   

  V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8
  0x300b
@@ -853,10 +921,16 @@
   Packed YUV Formats
 
   Those data formats transfer pixel data as (possibly downsampled) 
Y, U
-  and V components. The format code is made of the following information.
+  and V components. Some formats include dummy bits in some of their 
samples
+  and are collectively referred to as "YDYC" (Y-Dummy-Y-Chroma) formats.
+  One cannot rely on the values of these dummy bits as those are undefined.
+  
+  The format code is made of the following information.
   
The Y, U and V components order code, as transferred on 
the
-   bus. Possible values are YUYV, UYVY, YVYU and VYUY.
+   bus. Possible values are YUYV, UYVY, YVYU and VYUY for formats with no
+   dummy bit, and YDYUYDYV, YDYVYDYU, YUYDYVYD and YVYDYUYD for YDYC 
formats.
+   
The number of bits per pixel component. All components 
are
transferred on the same number of bits. Common values are 8, 10 and 
12.

@@ -877,7 +951,21 @@
   U, Y, V, Y order will be named 
V4L2_MBUS_FMT_UYVY8_2X8.
   
 
-  The following table lisst existing packet YUV formats.
+list existing packet 
YUV
+   formats and describes the organization of each pixel data in each 
sample.
+   When a format pattern is split across multiple samples each of the 
samples
+   in the pattern is described.
+
+   The role of each bit transferred over the bus is identified by one
+   of the following codes.
+
+   
+  yx for luma component bit 
number x
+  ux for blue chroma component 
bit number x
+  vx for red chroma component 
bit number x
+  - for non-available bits (for positions higher than 
the bus width)
+  d for dummy bits
+   
 
   
YUV Formats
@@ -965,6 +1053,56 @@
  y1
  y0

+   
+ V4L2_MBUS_FMT_UV8_1X8
+

[PATCH v8 2/2] v4l2: add new pixel formats supported on dm365

2012-08-02 Thread Prabhakar Lad
From: Manjunath Hadli 

add new macro V4L2_PIX_FMT_SGRBG10ALAW8 and associated formats
to represent Bayer format frames compressed by A-LAW algorithm,
add V4L2_PIX_FMT_UV8 to represent storage of CbCr data (UV interleaved)
only.

Acked-by: Laurent Pinchart 
Signed-off-by: Manjunath Hadli 
Signed-off-by: Lad, Prabhakar 
Cc: Sakari Ailus 
Cc: Hans Verkuil 
Cc: Guennadi Liakhovetski 
---
 .../DocBook/media/v4l/pixfmt-srggb10alaw8.xml  |   34 +++
 Documentation/DocBook/media/v4l/pixfmt-uv8.xml |   62 
 Documentation/DocBook/media/v4l/pixfmt.xml |2 +
 include/linux/videodev2.h  |8 +++
 4 files changed, 106 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-uv8.xml

diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml 
b/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
new file mode 100644
index 000..c934192
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
@@ -0,0 +1,34 @@
+   
+ 
+   
+ V4L2_PIX_FMT_SBGGR10ALAW8 ('aBA8'),
+ V4L2_PIX_FMT_SGBRG10ALAW8 ('aGA8'),
+ V4L2_PIX_FMT_SGRBG10ALAW8 ('agA8'),
+ V4L2_PIX_FMT_SRGGB10ALAW8 ('aRA8'),
+   
+   &manvol;
+ 
+ 
+   
+ V4L2_PIX_FMT_SBGGR10ALAW8
+   
+   
+ V4L2_PIX_FMT_SGBRG10ALAW8
+   
+   
+ V4L2_PIX_FMT_SGRBG10ALAW8
+   
+   
+ V4L2_PIX_FMT_SRGGB10ALAW8
+   
+   10-bit Bayer formats compressed to 8 bits
+ 
+ 
+   Description
+   The following four pixel formats are raw sRGB / Bayer
+   formats with 10 bits per color compressed to 8 bits each,
+   using the A-LAW algorithm. Each color component consumes 8
+   bits of memory. In other respects this format is similar to
+   .
+ 
+   
diff --git a/Documentation/DocBook/media/v4l/pixfmt-uv8.xml 
b/Documentation/DocBook/media/v4l/pixfmt-uv8.xml
new file mode 100644
index 000..c507c1f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-uv8.xml
@@ -0,0 +1,62 @@
+   
+ 
+   V4L2_PIX_FMT_UV8  ('UV8')
+   &manvol;
+ 
+ 
+   V4L2_PIX_FMT_UV8
+   UV plane interleaved
+ 
+ 
+   Description
+   In this format there is no Y plane, Only CbCr plane. ie
+   (UV interleaved)
+   
+   
+ V4L2_PIX_FMT_UV8
+  pixel image
+   
+
+   
+ Byte Order.
+ Each cell is one byte.
+   
+   
+ 
+ 
+   
+ start + 0:
+ Cb00
+ Cr00
+ Cb01
+ Cr01
+   
+   
+ start + 4:
+ Cb10
+ Cr10
+ Cb11
+ Cr11
+   
+   
+ start + 8:
+ Cb20
+ Cr20
+ Cb21
+ Cr21
+   
+   
+ start + 12:
+ Cb30
+ Cr30
+ Cb31
+ Cr31
+   
+ 
+   
+   
+ 
+ 
+   
+ 
+   
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml 
b/Documentation/DocBook/media/v4l/pixfmt.xml
index e58934c..930f55d 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -673,6 +673,7 @@ access the palette, this must be done with ioctls of the 
Linux framebuffer API.<
 &sub-srggb8;
 &sub-sbggr16;
 &sub-srggb10;
+&sub-srggb10alaw8;
 &sub-srggb10dpcm8;
 &sub-srggb12;
   
@@ -701,6 +702,7 @@ information.
 &sub-y12;
 &sub-y10b;
 &sub-y16;
+&sub-uv8;
 &sub-yuyv;
 &sub-uyvy;
 &sub-yvyu;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 5d78910..ccee71e 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -329,6 +329,9 @@ struct v4l2_pix_format {
 /* Palette formats */
 #define V4L2_PIX_FMT_PAL8v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit 
palette */
 
+/* Chrominance formats */
+#define V4L2_PIX_FMT_UV8 v4l2_fourcc('U', 'V', '8', ' ') /*  8  UV 4:4 */
+
 /* Luminance+Chrominance formats */
 #define V4L2_PIX_FMT_YVU410  v4l2_fourcc('Y', 'V', 'U', '9') /*  9  YVU 4:1:0  
   */
 #define V4L2_PIX_FMT_YVU420  v4l2_fourcc('Y', 'V', '1', '2') /* 12  YVU 4:2:0  
   */
@@ -378,6 +381,11 @@ struct v4l

[GIT PULL FOR v3.6-rc1] Mediabus And Pixel format supported by DM365

2012-08-06 Thread Prabhakar Lad
Hi Mauro,

Can you please pull the following patches, which add medibus and pixel
format supported by DM365.

Thanks and Regards,
--Prabhakar Lad


The following changes since commit 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee:

  Linux 3.6-rc1 (2012-08-02 16:38:10 -0700)

are available in the git repository at:
  git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git mc_dm365_mbus_fmt

Manjunath Hadli (2):
  media: add new mediabus format enums for dm365
  v4l2: add new pixel formats supported on dm365

 .../DocBook/media/v4l/pixfmt-srggb10alaw8.xml  |   34 +++
 Documentation/DocBook/media/v4l/pixfmt-uv8.xml |   62 +
 Documentation/DocBook/media/v4l/pixfmt.xml |2 +
 Documentation/DocBook/media/v4l/subdev-formats.xml |  250
+++-
 include/linux/v4l2-mediabus.h  |   10 +-
 include/linux/videodev2.h  |8 +
 6 files changed, 358 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-uv8.xml
--
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: [GIT PULL FOR v3.6-rc1] Mediabus And Pixel format supported by DM365

2012-08-06 Thread Prabhakar Lad
Hi Mauro,

Sorry, the subject of course should have been "GIT PULL FOR v3.7"

Thx,
--Prabhakar

On Monday 06 August 2012 12:45 PM, Prabhakar Lad wrote:
> Hi Mauro,
> 
> Can you please pull the following patches, which add medibus and pixel
> format supported by DM365.
> 
> Thanks and Regards,
> --Prabhakar Lad
> 
> 
> The following changes since commit 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee:
> 
>   Linux 3.6-rc1 (2012-08-02 16:38:10 -0700)
> 
> are available in the git repository at:
>   git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git mc_dm365_mbus_fmt
> 
> Manjunath Hadli (2):
>   media: add new mediabus format enums for dm365
>   v4l2: add new pixel formats supported on dm365
> 
>  .../DocBook/media/v4l/pixfmt-srggb10alaw8.xml  |   34 +++
>  Documentation/DocBook/media/v4l/pixfmt-uv8.xml |   62 +
>  Documentation/DocBook/media/v4l/pixfmt.xml |2 +
>  Documentation/DocBook/media/v4l/subdev-formats.xml |  250
> +++-
>  include/linux/v4l2-mediabus.h  |   10 +-
>  include/linux/videodev2.h  |8 +
>  6 files changed, 358 insertions(+), 8 deletions(-)
>  create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb10alaw8.xml
>  create mode 100644 Documentation/DocBook/media/v4l/pixfmt-uv8.xml
> ___
> Davinci-linux-open-source mailing list
> davinci-linux-open-sou...@linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
> 

--
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] vpif: replace preset with the timings API.

2012-08-08 Thread Prabhakar Lad
From: Hans Verkuil 

Signed-off-by: Hans Verkuil 
Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
---
 drivers/media/video/davinci/vpif.c |   16 ++--
 drivers/media/video/davinci/vpif.h |4 +-
 drivers/media/video/davinci/vpif_capture.c |  114 +---
 drivers/media/video/davinci/vpif_capture.h |3 +-
 drivers/media/video/davinci/vpif_display.c |  102 +++--
 drivers/media/video/davinci/vpif_display.h |3 +-
 6 files changed, 43 insertions(+), 199 deletions(-)

diff --git a/drivers/media/video/davinci/vpif.c 
b/drivers/media/video/davinci/vpif.c
index b3637af..b95bff7 100644
--- a/drivers/media/video/davinci/vpif.c
+++ b/drivers/media/video/davinci/vpif.c
@@ -25,6 +25,8 @@
 #include 
 #include 
 #include 
+#include 
+
 #include 
 
 #include "vpif.h"
@@ -65,7 +67,7 @@ const struct vpif_channel_config_params ch_params[] = {
.capture_format = 0,
.vbi_supported = 0,
.hd_sd = 1,
-   .dv_preset = V4L2_DV_480P59_94,
+   .dv_timings = V4L2_DV_BT_CEA_720X480P59_94,
},
{
.name = "576p50",
@@ -82,7 +84,7 @@ const struct vpif_channel_config_params ch_params[] = {
.capture_format = 0,
.vbi_supported = 0,
.hd_sd = 1,
-   .dv_preset = V4L2_DV_576P50,
+   .dv_timings = V4L2_DV_BT_CEA_720X576P50,
},
{
.name = "720p50",
@@ -99,7 +101,7 @@ const struct vpif_channel_config_params ch_params[] = {
.capture_format = 0,
.vbi_supported = 0,
.hd_sd = 1,
-   .dv_preset = V4L2_DV_720P50,
+   .dv_timings = V4L2_DV_BT_CEA_1280X720P50,
},
{
.name = "720p60",
@@ -116,7 +118,7 @@ const struct vpif_channel_config_params ch_params[] = {
.capture_format = 0,
.vbi_supported = 0,
.hd_sd = 1,
-   .dv_preset = V4L2_DV_720P60,
+   .dv_timings = V4L2_DV_BT_CEA_1280X720P60,
},
{
.name = "1080I50",
@@ -136,7 +138,7 @@ const struct vpif_channel_config_params ch_params[] = {
.capture_format = 0,
.vbi_supported = 0,
.hd_sd = 1,
-   .dv_preset = V4L2_DV_1080I50,
+   .dv_timings = V4L2_DV_BT_CEA_1920X1080I50,
},
{
.name = "1080I60",
@@ -156,7 +158,7 @@ const struct vpif_channel_config_params ch_params[] = {
.capture_format = 0,
.vbi_supported = 0,
.hd_sd = 1,
-   .dv_preset = V4L2_DV_1080I60,
+   .dv_timings = V4L2_DV_BT_CEA_1920X1080I60,
},
{
.name = "1080p60",
@@ -173,7 +175,7 @@ const struct vpif_channel_config_params ch_params[] = {
.capture_format = 0,
.vbi_supported = 0,
.hd_sd = 1,
-   .dv_preset = V4L2_DV_1080P60,
+   .dv_timings = V4L2_DV_BT_CEA_1920X1080P60,
},
 
/* SDTV formats */
diff --git a/drivers/media/video/davinci/vpif.h 
b/drivers/media/video/davinci/vpif.h
index c2ce4d9..a1ab6a0 100644
--- a/drivers/media/video/davinci/vpif.h
+++ b/drivers/media/video/davinci/vpif.h
@@ -533,7 +533,7 @@ static inline void channel2_clipping_enable(int enable)
}
 }
 
-/* function to enable clipping (for both active and blanking regions) on ch 2 
*/
+/* function to enable clipping (for both active and blanking regions) on ch 3 
*/
 static inline void channel3_clipping_enable(int enable)
 {
if (enable) {
@@ -634,7 +634,7 @@ struct vpif_channel_config_params {
 * supports capturing vbi or not */
u8 hd_sd;   /* HDTV (1) or SDTV (0) format */
v4l2_std_id stdid;  /* SDTV format */
-   u32 dv_preset;  /* HDTV format */
+   struct v4l2_dv_timings dv_timings;  /* HDTV format */
 };
 
 extern const unsigned int vpif_ch_params_count;
diff --git a/drivers/media/video/davinci/vpif_capture.c 
b/drivers/media/video/davinci/vpif_capture.c
index 266025e..e684c48 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -551,7 +551,8 @@ static int vpif_update_std_info(struct channel_obj *ch)
}
} else {
vpif_dbg(2, debug, "HD format\n");
-   if (config->dv_preset == vid_ch->dv_preset) {
+   if (!memcmp(&config->dv_timings, &vid_ch->dv_timings,
+   sizeof(vid_ch->dv_timings))) {
memcpy(std_info, config, sizeof(*config));
break;
}
@@ -1368,8 +1369,7 @@ static int vpif_s_std(struct file *f

[PATCH 0/2] Replace the obsolete preset API by timings API

2012-08-08 Thread Prabhakar Lad
This first patch replaces the obsolete preset API by timings
API for davinci VPBE, appropriate chnages in machine file for
dm644x in which VPBE is enabled. And the second patch adds support for 
timings API for ths7303 driver. Sending them as s series 
since VPBE uses the ths7303 driver.

Hans Verkuil (1):
  dm644x: replace the obsolete preset API by the timings API.

Manjunath Hadli (1):
  ths7303: enable THS7303 for HD modes

 arch/arm/mach-davinci/board-dm644x-evm.c   |   15 ++--
 arch/arm/mach-davinci/dm644x.c |   17 +---
 drivers/media/video/davinci/vpbe.c |  110 
 drivers/media/video/davinci/vpbe_display.c |   60 +++
 drivers/media/video/davinci/vpbe_venc.c|   25 +++---
 drivers/media/video/ths7303.c  |  107 +++
 include/media/davinci/vpbe.h   |   14 ++--
 include/media/davinci/vpbe_types.h |8 +--
 include/media/davinci/vpbe_venc.h  |2 +-
 9 files changed, 202 insertions(+), 156 deletions(-)

--
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 1/2] dm644x: replace the obsolete preset API by the timings API.

2012-08-08 Thread Prabhakar Lad
From: Hans Verkuil 

Signed-off-by: Hans Verkuil 
Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
---
 arch/arm/mach-davinci/board-dm644x-evm.c   |   15 ++--
 arch/arm/mach-davinci/dm644x.c |   17 +---
 drivers/media/video/davinci/vpbe.c |  110 
 drivers/media/video/davinci/vpbe_display.c |   60 +++
 drivers/media/video/davinci/vpbe_venc.c|   25 +++---
 include/media/davinci/vpbe.h   |   14 ++--
 include/media/davinci/vpbe_types.h |8 +--
 include/media/davinci/vpbe_venc.h  |2 +-
 8 files changed, 111 insertions(+), 140 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c 
b/arch/arm/mach-davinci/board-dm644x-evm.c
index d34ed55..3baf56d 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -620,7 +621,7 @@ static struct vpbe_enc_mode_info dm644xevm_enc_std_timing[] 
= {
{
.name   = "ntsc",
.timings_type   = VPBE_ENC_STD,
-   .timings= {V4L2_STD_525_60},
+   .std_id = V4L2_STD_525_60,
.interlaced = 1,
.xres   = 720,
.yres   = 480,
@@ -632,7 +633,7 @@ static struct vpbe_enc_mode_info dm644xevm_enc_std_timing[] 
= {
{
.name   = "pal",
.timings_type   = VPBE_ENC_STD,
-   .timings= {V4L2_STD_625_50},
+   .std_id = V4L2_STD_625_50,
.interlaced = 1,
.xres   = 720,
.yres   = 576,
@@ -647,8 +648,8 @@ static struct vpbe_enc_mode_info dm644xevm_enc_std_timing[] 
= {
 static struct vpbe_enc_mode_info dm644xevm_enc_preset_timing[] = {
{
.name   = "480p59_94",
-   .timings_type   = VPBE_ENC_DV_PRESET,
-   .timings= {V4L2_DV_480P59_94},
+   .timings_type   = VPBE_ENC_CUSTOM_TIMINGS,
+   .dv_timings = V4L2_DV_BT_CEA_720X480P59_94,
.interlaced = 0,
.xres   = 720,
.yres   = 480,
@@ -659,8 +660,8 @@ static struct vpbe_enc_mode_info 
dm644xevm_enc_preset_timing[] = {
},
{
.name   = "576p50",
-   .timings_type   = VPBE_ENC_DV_PRESET,
-   .timings= {V4L2_DV_576P50},
+   .timings_type   = VPBE_ENC_CUSTOM_TIMINGS,
+   .dv_timings = V4L2_DV_BT_CEA_720X576P50,
.interlaced = 0,
.xres   = 720,
.yres   = 576,
@@ -698,7 +699,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = {
.index  = 1,
.name   = "Component",
.type   = V4L2_OUTPUT_TYPE_ANALOG,
-   .capabilities   = V4L2_OUT_CAP_PRESETS,
+   .capabilities   = V4L2_OUT_CAP_CUSTOM_TIMINGS,
},
.subdev_name= VPBE_VENC_SUBDEV_NAME,
.default_mode   = "480p59_94",
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index c8b8666..79d2880 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -701,7 +701,7 @@ static struct resource dm644x_venc_resources[] = {
 #define DM644X_VPSS_DACCLKEN  BIT(4)
 
 static int dm644x_venc_setup_clock(enum vpbe_enc_timings_type type,
-  unsigned int mode)
+  unsigned int pclock)
 {
int ret = 0;
u32 v = DM644X_VPSS_VENCLKEN;
@@ -711,27 +711,18 @@ static int dm644x_venc_setup_clock(enum 
vpbe_enc_timings_type type,
v |= DM644X_VPSS_DACCLKEN;
writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
break;
-   case VPBE_ENC_DV_PRESET:
-   switch (mode) {
-   case V4L2_DV_480P59_94:
-   case V4L2_DV_576P50:
+   case VPBE_ENC_CUSTOM_TIMINGS:
+   if (pclock <= 2700) {
v |= DM644X_VPSS_MUXSEL_PLL2_MODE |
 DM644X_VPSS_DACCLKEN;
writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
-   break;
-   case V4L2_DV_720P60:
-   case V4L2_DV_1080I60:
-   case V4L2_DV_1080P30:
+   } else {
/*
 * For HD, use external clock source since
 * HD requires higher clock rate
 */
v |= DM644X_VPSS_MUXSEL_VPBECLK_MODE;
writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
- 

[PATCH 2/2] ths7303: enable THS7303 for HD modes

2012-08-08 Thread Prabhakar Lad
From: Manjunath Hadli 

add filter settings for high def modes like 1080i,
1080p,720p and others and implementing dv_timings.

Signed-off-by: Manjunath Hadli 
Signed-off-by: Lad, Prabhakar 
---
 drivers/media/video/ths7303.c |  107 ++--
 1 files changed, 91 insertions(+), 16 deletions(-)

diff --git a/drivers/media/video/ths7303.c b/drivers/media/video/ths7303.c
index e5c0eed..d997583 100644
--- a/drivers/media/video/ths7303.c
+++ b/drivers/media/video/ths7303.c
@@ -28,6 +28,18 @@
 #include 
 #include 
 
+#define THS7303_CHANNEL_1  1
+#define THS7303_CHANNEL_2  2
+#define THS7303_CHANNEL_3  3
+
+enum ths7303_filter_mode {
+   THS7303_FILTER_MODE_480I_576I,
+   THS7303_FILTER_MODE_480P_576P,
+   THS7303_FILTER_MODE_720P_1080I,
+   THS7303_FILTER_MODE_1080P,
+   THS7303_FILTER_MODE_DISABLE
+};
+
 MODULE_DESCRIPTION("TI THS7303 video amplifier driver");
 MODULE_AUTHOR("Chaithrika U S");
 MODULE_LICENSE("GPL");
@@ -37,35 +49,97 @@ module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "Debug level 0-1");
 
 /* following function is used to set ths7303 */
-static int ths7303_setvalue(struct v4l2_subdev *sd, v4l2_std_id std)
+int ths7303_setval(struct v4l2_subdev *sd, enum ths7303_filter_mode mode)
 {
+   u8 input_bias_chroma = 3;
+   u8 input_bias_luma = 3;
+   int disable = 0;
int err = 0;
-   u8 val;
-   struct i2c_client *client;
+   u8 val = 0;
+   u8 temp;
 
-   client = v4l2_get_subdevdata(sd);
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-   if (std & (V4L2_STD_ALL & ~V4L2_STD_SECAM)) {
-   val = 0x02;
-   v4l2_dbg(1, debug, sd, "setting value for SDTV format\n");
-   } else {
-   val = 0x00;
-   v4l2_dbg(1, debug, sd, "disabling all channels\n");
+   if (!client)
+   return -EINVAL;
+
+
+   switch (mode) {
+   case THS7303_FILTER_MODE_1080P:
+   val = (3 << 6);
+   val |= (3 << 3);
+   break;
+   case THS7303_FILTER_MODE_720P_1080I:
+   val = (2 << 6);
+   val |= (2 << 3);
+   break;
+   case THS7303_FILTER_MODE_480P_576P:
+   val = (1 << 6);
+   val |= (1 << 3);
+   break;
+   case THS7303_FILTER_MODE_480I_576I:
+   break;
+   case THS7303_FILTER_MODE_DISABLE:
+   pr_info("mode disabled\n");
+   /* disable all channels */
+   disable = 1;
+   default:
+   /* disable all channels */
+   disable = 1;
}
+   /* Setup channel 2 - Luma - Green */
+   temp = val;
+   if (!disable)
+   val |= input_bias_luma;
+   err = i2c_smbus_write_byte_data(client, THS7303_CHANNEL_2, val);
+   if (err)
+   goto out;
 
-   err |= i2c_smbus_write_byte_data(client, 0x01, val);
-   err |= i2c_smbus_write_byte_data(client, 0x02, val);
-   err |= i2c_smbus_write_byte_data(client, 0x03, val);
+   /* setup two chroma channels */
+   if (!disable)
+   temp |= input_bias_chroma;
 
+   err = i2c_smbus_write_byte_data(client, THS7303_CHANNEL_1, temp);
if (err)
-   v4l2_err(sd, "write failed\n");
+   goto out;
 
+   err = i2c_smbus_write_byte_data(client, THS7303_CHANNEL_3, temp);
+   if (err)
+   goto out;
+   return err;
+out:
+   pr_info("write byte data failed\n");
return err;
 }
 
 static int ths7303_s_std_output(struct v4l2_subdev *sd, v4l2_std_id norm)
 {
-   return ths7303_setvalue(sd, norm);
+   if (norm & (V4L2_STD_ALL & ~V4L2_STD_SECAM))
+   return ths7303_setval(sd, THS7303_FILTER_MODE_480I_576I);
+   else
+   return ths7303_setval(sd, THS7303_FILTER_MODE_DISABLE);
+}
+
+/* for setting filter for HD output */
+static int ths7303_s_dv_timings(struct v4l2_subdev *sd,
+  struct v4l2_dv_timings *dv_timings)
+{
+   u32 height = dv_timings->bt.height;
+   int interlaced = dv_timings->bt.interlaced;
+   int res = 0;
+
+   if (height == 1080 && !interlaced)
+   res = ths7303_setval(sd, THS7303_FILTER_MODE_1080P);
+   else if ((height == 720 && !interlaced) ||
+   (height == 1080 && interlaced))
+   res = ths7303_setval(sd, THS7303_FILTER_MODE_720P_1080I);
+   else if ((height == 480 || height == 576) && !interlaced)
+   res = ths7303_setval(sd, THS7303_FILTER_MODE_480P_576P);
+   else
+   /* disable all channels */
+   res = ths7303_setval(sd, THS7303_FILTER_MODE_DISABLE);
+
+   return res;
 }
 
 static int ths7303_g_chip_ident(struct v4l2_subdev *sd,
@@ -78,6 +152,7 @@ static int ths7303_g_chip_ident(struct v4l2_subdev *sd,
 
 static const struct v4l2_subdev_video_ops ths7303_video_ops = {
.s_std_

[PATCH] davinci: fix build warning when CONFIG_DEBUG_SECTION_MISMATCH is enabled

2012-08-13 Thread Prabhakar Lad
From: Lad, Prabhakar 

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
---
 drivers/media/video/davinci/dm355_ccdc.c   |2 +-
 drivers/media/video/davinci/dm644x_ccdc.c  |2 +-
 drivers/media/video/davinci/isif.c |2 +-
 drivers/media/video/davinci/vpfe_capture.c |2 +-
 drivers/media/video/davinci/vpif.c |2 +-
 drivers/media/video/davinci/vpss.c |2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/video/davinci/dm355_ccdc.c 
b/drivers/media/video/davinci/dm355_ccdc.c
index 5b68847..2eb7dbd 100644
--- a/drivers/media/video/davinci/dm355_ccdc.c
+++ b/drivers/media/video/davinci/dm355_ccdc.c
@@ -1060,7 +1060,7 @@ static int dm355_ccdc_remove(struct platform_device *pdev)
return 0;
 }
 
-static struct platform_driver dm355_ccdc_driver = {
+static __refdata struct platform_driver dm355_ccdc_driver = {
.driver = {
.name   = "dm355_ccdc",
.owner = THIS_MODULE,
diff --git a/drivers/media/video/davinci/dm644x_ccdc.c 
b/drivers/media/video/davinci/dm644x_ccdc.c
index 9303fe5..3ffb7f2 100644
--- a/drivers/media/video/davinci/dm644x_ccdc.c
+++ b/drivers/media/video/davinci/dm644x_ccdc.c
@@ -1068,7 +1068,7 @@ static const struct dev_pm_ops dm644x_ccdc_pm_ops = {
.resume = dm644x_ccdc_resume,
 };
 
-static struct platform_driver dm644x_ccdc_driver = {
+static __refdata struct platform_driver dm644x_ccdc_driver = {
.driver = {
.name   = "dm644x_ccdc",
.owner = THIS_MODULE,
diff --git a/drivers/media/video/davinci/isif.c 
b/drivers/media/video/davinci/isif.c
index 5278fe7..6ce4249 100644
--- a/drivers/media/video/davinci/isif.c
+++ b/drivers/media/video/davinci/isif.c
@@ -1148,7 +1148,7 @@ static int isif_remove(struct platform_device *pdev)
return 0;
 }
 
-static struct platform_driver isif_driver = {
+static __refdata struct platform_driver isif_driver = {
.driver = {
.name   = "isif",
.owner = THIS_MODULE,
diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index 49a845f..572d8f0 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -2066,7 +2066,7 @@ static const struct dev_pm_ops vpfe_dev_pm_ops = {
.resume = vpfe_resume,
 };
 
-static struct platform_driver vpfe_driver = {
+static __refdata struct platform_driver vpfe_driver = {
.driver = {
.name = CAPTURE_DRV_NAME,
.owner = THIS_MODULE,
diff --git a/drivers/media/video/davinci/vpif.c 
b/drivers/media/video/davinci/vpif.c
index b3637af..a058fed 100644
--- a/drivers/media/video/davinci/vpif.c
+++ b/drivers/media/video/davinci/vpif.c
@@ -490,7 +490,7 @@ static const struct dev_pm_ops vpif_pm = {
 #define vpif_pm_ops NULL
 #endif
 
-static struct platform_driver vpif_driver = {
+static __refdata struct platform_driver vpif_driver = {
.driver = {
.name   = "vpif",
.owner = THIS_MODULE,
diff --git a/drivers/media/video/davinci/vpss.c 
b/drivers/media/video/davinci/vpss.c
index 3e5cf27..8f682d8 100644
--- a/drivers/media/video/davinci/vpss.c
+++ b/drivers/media/video/davinci/vpss.c
@@ -460,7 +460,7 @@ static int __devexit vpss_remove(struct platform_device 
*pdev)
return 0;
 }
 
-static struct platform_driver vpss_driver = {
+static __refdata struct platform_driver vpss_driver = {
.driver = {
.name   = "vpss",
.owner = THIS_MODULE,
-- 
1.7.0.4

--
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] davinci: fix build warning when CONFIG_DEBUG_SECTION_MISMATCH is enabled

2012-08-13 Thread Prabhakar Lad
Hi Mauro,

Please drop this patch which is queued for 3.7, the actual fix should be
to annotate probe with __devinit. I'll be sending V2 with the correct fix.

Thx,
--Prabhakar

On Monday 13 August 2012 03:02 PM, Prabhakar Lad wrote:
> From: Lad, Prabhakar 
> 
> Signed-off-by: Lad, Prabhakar 
> Signed-off-by: Manjunath Hadli 
> ---
>  drivers/media/video/davinci/dm355_ccdc.c   |2 +-
>  drivers/media/video/davinci/dm644x_ccdc.c  |2 +-
>  drivers/media/video/davinci/isif.c |2 +-
>  drivers/media/video/davinci/vpfe_capture.c |2 +-
>  drivers/media/video/davinci/vpif.c |2 +-
>  drivers/media/video/davinci/vpss.c |2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/video/davinci/dm355_ccdc.c 
> b/drivers/media/video/davinci/dm355_ccdc.c
> index 5b68847..2eb7dbd 100644
> --- a/drivers/media/video/davinci/dm355_ccdc.c
> +++ b/drivers/media/video/davinci/dm355_ccdc.c
> @@ -1060,7 +1060,7 @@ static int dm355_ccdc_remove(struct platform_device 
> *pdev)
>   return 0;
>  }
>  
> -static struct platform_driver dm355_ccdc_driver = {
> +static __refdata struct platform_driver dm355_ccdc_driver = {
>   .driver = {
>   .name   = "dm355_ccdc",
>   .owner = THIS_MODULE,
> diff --git a/drivers/media/video/davinci/dm644x_ccdc.c 
> b/drivers/media/video/davinci/dm644x_ccdc.c
> index 9303fe5..3ffb7f2 100644
> --- a/drivers/media/video/davinci/dm644x_ccdc.c
> +++ b/drivers/media/video/davinci/dm644x_ccdc.c
> @@ -1068,7 +1068,7 @@ static const struct dev_pm_ops dm644x_ccdc_pm_ops = {
>   .resume = dm644x_ccdc_resume,
>  };
>  
> -static struct platform_driver dm644x_ccdc_driver = {
> +static __refdata struct platform_driver dm644x_ccdc_driver = {
>   .driver = {
>   .name   = "dm644x_ccdc",
>   .owner = THIS_MODULE,
> diff --git a/drivers/media/video/davinci/isif.c 
> b/drivers/media/video/davinci/isif.c
> index 5278fe7..6ce4249 100644
> --- a/drivers/media/video/davinci/isif.c
> +++ b/drivers/media/video/davinci/isif.c
> @@ -1148,7 +1148,7 @@ static int isif_remove(struct platform_device *pdev)
>   return 0;
>  }
>  
> -static struct platform_driver isif_driver = {
> +static __refdata struct platform_driver isif_driver = {
>   .driver = {
>   .name   = "isif",
>   .owner = THIS_MODULE,
> diff --git a/drivers/media/video/davinci/vpfe_capture.c 
> b/drivers/media/video/davinci/vpfe_capture.c
> index 49a845f..572d8f0 100644
> --- a/drivers/media/video/davinci/vpfe_capture.c
> +++ b/drivers/media/video/davinci/vpfe_capture.c
> @@ -2066,7 +2066,7 @@ static const struct dev_pm_ops vpfe_dev_pm_ops = {
>   .resume = vpfe_resume,
>  };
>  
> -static struct platform_driver vpfe_driver = {
> +static __refdata struct platform_driver vpfe_driver = {
>   .driver = {
>   .name = CAPTURE_DRV_NAME,
>   .owner = THIS_MODULE,
> diff --git a/drivers/media/video/davinci/vpif.c 
> b/drivers/media/video/davinci/vpif.c
> index b3637af..a058fed 100644
> --- a/drivers/media/video/davinci/vpif.c
> +++ b/drivers/media/video/davinci/vpif.c
> @@ -490,7 +490,7 @@ static const struct dev_pm_ops vpif_pm = {
>  #define vpif_pm_ops NULL
>  #endif
>  
> -static struct platform_driver vpif_driver = {
> +static __refdata struct platform_driver vpif_driver = {
>   .driver = {
>   .name   = "vpif",
>   .owner = THIS_MODULE,
> diff --git a/drivers/media/video/davinci/vpss.c 
> b/drivers/media/video/davinci/vpss.c
> index 3e5cf27..8f682d8 100644
> --- a/drivers/media/video/davinci/vpss.c
> +++ b/drivers/media/video/davinci/vpss.c
> @@ -460,7 +460,7 @@ static int __devexit vpss_remove(struct platform_device 
> *pdev)
>   return 0;
>  }
>  
> -static struct platform_driver vpss_driver = {
> +static __refdata struct platform_driver vpss_driver = {
>   .driver = {
>   .name   = "vpss",
>   .owner = THIS_MODULE,
> 

--
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 v2] media: davinci: fix section mismatch warnings

2012-08-13 Thread Prabhakar Lad
From: Lad, Prabhakar 

This patch fixes section mismatch warnings for
davinci video drivers.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
---
 Changes for v2:
 1: Annotate probe with __devinit.
 2: Fixed the commit message.

 drivers/media/video/davinci/dm355_ccdc.c   |2 +-
 drivers/media/video/davinci/dm644x_ccdc.c  |2 +-
 drivers/media/video/davinci/isif.c |2 +-
 drivers/media/video/davinci/vpfe_capture.c |2 +-
 drivers/media/video/davinci/vpif.c |2 +-
 drivers/media/video/davinci/vpss.c |2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/video/davinci/dm355_ccdc.c 
b/drivers/media/video/davinci/dm355_ccdc.c
index 5b68847..ce0e413 100644
--- a/drivers/media/video/davinci/dm355_ccdc.c
+++ b/drivers/media/video/davinci/dm355_ccdc.c
@@ -965,7 +965,7 @@ static struct ccdc_hw_device ccdc_hw_dev = {
},
 };
 
-static int __init dm355_ccdc_probe(struct platform_device *pdev)
+static int __devinit dm355_ccdc_probe(struct platform_device *pdev)
 {
void (*setup_pinmux)(void);
struct resource *res;
diff --git a/drivers/media/video/davinci/dm644x_ccdc.c 
b/drivers/media/video/davinci/dm644x_ccdc.c
index 9303fe5..ee7942b 100644
--- a/drivers/media/video/davinci/dm644x_ccdc.c
+++ b/drivers/media/video/davinci/dm644x_ccdc.c
@@ -957,7 +957,7 @@ static struct ccdc_hw_device ccdc_hw_dev = {
},
 };
 
-static int __init dm644x_ccdc_probe(struct platform_device *pdev)
+static int __devinit dm644x_ccdc_probe(struct platform_device *pdev)
 {
struct resource *res;
int status = 0;
diff --git a/drivers/media/video/davinci/isif.c 
b/drivers/media/video/davinci/isif.c
index 5278fe7..b99d542 100644
--- a/drivers/media/video/davinci/isif.c
+++ b/drivers/media/video/davinci/isif.c
@@ -1032,7 +1032,7 @@ static struct ccdc_hw_device isif_hw_dev = {
},
 };
 
-static int __init isif_probe(struct platform_device *pdev)
+static int __devinit isif_probe(struct platform_device *pdev)
 {
void (*setup_pinmux)(void);
struct resource *res;
diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index 49a845f..843b138 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -1829,7 +1829,7 @@ static struct vpfe_device *vpfe_initialize(void)
  * itself to the V4L2 driver and initializes fields of each
  * device objects
  */
-static __init int vpfe_probe(struct platform_device *pdev)
+static __devinit int vpfe_probe(struct platform_device *pdev)
 {
struct vpfe_subdev_info *sdinfo;
struct vpfe_config *vpfe_cfg;
diff --git a/drivers/media/video/davinci/vpif.c 
b/drivers/media/video/davinci/vpif.c
index b3637af..9bd3caa 100644
--- a/drivers/media/video/davinci/vpif.c
+++ b/drivers/media/video/davinci/vpif.c
@@ -417,7 +417,7 @@ int vpif_channel_getfid(u8 channel_id)
 }
 EXPORT_SYMBOL(vpif_channel_getfid);
 
-static int __init vpif_probe(struct platform_device *pdev)
+static int __devinit vpif_probe(struct platform_device *pdev)
 {
int status = 0;
 
diff --git a/drivers/media/video/davinci/vpss.c 
b/drivers/media/video/davinci/vpss.c
index 3e5cf27..146e4b0 100644
--- a/drivers/media/video/davinci/vpss.c
+++ b/drivers/media/video/davinci/vpss.c
@@ -357,7 +357,7 @@ void dm365_vpss_set_pg_frame_size(struct vpss_pg_frame_size 
frame_size)
 }
 EXPORT_SYMBOL(dm365_vpss_set_pg_frame_size);
 
-static int __init vpss_probe(struct platform_device *pdev)
+static int __devinit vpss_probe(struct platform_device *pdev)
 {
struct resource *r1, *r2;
char *platform_name;
-- 
1.7.0.4

--
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: Patches submitted via linux-media ML that are at patchwork.linuxtv.org

2012-08-14 Thread Prabhakar Lad
Hi Mauro,

On Tuesday 14 August 2012 06:34 PM, Mauro Carvalho Chehab wrote:
> In order to help people to know about the status of the pending patches,
> I'm summing-up the patches pending for merge on this email.
> 
> If is there any patch missing, please check if it is at patchwork
> before asking what happened:
>   http://patchwork.linuxtv.org/project/linux-media/list/?state=*
> 
> If patchwork didn't pick, then the emailer likely line-wrapped or
> corrupted the patch.
> 

[Snip]

>   == Laurent Pinchart  == 
> 
> Sep,27 2011: [v2,1/5] omap3evm: Enable regulators for camera interface
>   http://patchwork.linuxtv.org/patch/7969   Vaibhav Hiremath 
> 
> Jul,26 2012: [1/2,media] omap3isp: implement ENUM_FMT 
>   http://patchwork.linuxtv.org/patch/13492  Michael Jones 
> 
> Jul,26 2012: [2/2,media] omap3isp: support G_FMT  
>   http://patchwork.linuxtv.org/patch/13493  Michael Jones 
> 
> 
>   == Prabhakar Lad  == 
> 
> Aug, 2 2012: [1/1] media/video: vpif: fixing function name start to 
> vpif_config_par http://patchwork.linuxtv.org/patch/13576  Dror Cohen 
> 
> 
 This patch can be marked as 'Rejected'. Dror has sent a v2 version
fixing few comments (http://patchwork.linuxtv.org/patch/13689/) which
I'll issue a pull to this v2 patch through Manju's tree soon for 3.7.

Thx,
--Prabhakar

>   == Silvester Nawrocki  == 
> 
> Aug, 2 2012: [PATH,v3,1/2] v4l: Add factory register values form S5K4ECGX 
> sensorhttp://patchwork.linuxtv.org/patch/13580  Sangwook Lee 
> 
> Aug, 2 2012: [PATH,v3,2/2] v4l: Add v4l2 subdev driver for S5K4ECGX sensor
>   http://patchwork.linuxtv.org/patch/13581  Sangwook Lee 
> 
> Aug,10 2012: [1/2,media] s5p-tv: Use devm_regulator_get() in sdo_drv.c file   
>   http://patchwork.linuxtv.org/patch/13719  Sachin Kamat 
> 
> Aug,10 2012: [2/2,media] s5p-tv: Use devm_* functions in sii9234_drv.c file   
>   http://patchwork.linuxtv.org/patch/13720  Sachin Kamat 
> 
> Aug,10 2012: [RESEND] v4l/s5p-mfc: added support for end of stream handling 
> in MFC  http://patchwork.linuxtv.org/patch/13721  Andrzej Hajda 
> 
> Aug,10 2012: [v4,1/2] v4l: Add factory register values form S5K4ECGX sensor   
>   http://patchwork.linuxtv.org/patch/13727  Sangwook Lee 
> 
> Aug,10 2012: [v4,2/2] v4l: Add v4l2 subdev driver for S5K4ECGX sensor 
>   http://patchwork.linuxtv.org/patch/13728  Sangwook Lee 
> 
> Jun,11 2012: [1/3,media] s5p-tv: Replace printk with pr_* functions   
>   http://patchwork.linuxtv.org/patch/11666  Sachin Kamat 
> 
> Jun,11 2012: [2/3,media] s5p-mfc: Replace printk with pr_* functions  
>   http://patchwork.linuxtv.org/patch/11667  Sachin Kamat 
> 
> Jun,11 2012: [3/3,media] s5p-fimc: Replace printk with pr_* functions 
>   http://patchwork.linuxtv.org/patch/11668  Sachin Kamat 
> 
> Jun,12 2012: [1/1, media] s5p-fimc: Replace custom err() macro with 
> v4l2_err() macr http://patchwork.linuxtv.org/patch/11675  Sachin Kamat 
> 
> 
>   == Jonathan Corbet  == 
> 
> Apr,26 2012: [2/2] marvell-cam: Build fix: missing "select VIDEOBUF2_VMALLOC" 
>   http://patchwork.linuxtv.org/patch/10848  Chris Ball 
> 
> This one is an alternative RFC proposal for the above, if Jon/Chris
> decide to take another approach:
> 
> Aug,13 2012: [2/2] marvell-cam: Build fix: missing "select VIDEOBUF2_VMALLOC" 
>   http://patchwork.linuxtv.org/patch/13784  Mauro Carvalho Chehab 
> 
> 
>   == Manu Abraham  == 
> 
> Jun, 8 2011: Add remote control support for mantis
>   http://patchwork.linuxtv.org/patch/7217   Christoph Pinkl 
> 
> Nov,29 2011: stv090x: implement function for reading uncorrected blocks count 
>   http://patchwork.linuxtv.org/patch/8656   Mariusz Bia?o?czyk 
> 
> Mar,11 2012: [2/3] stv090x: use error counter 1 for BER estimation
>   http://patchwork.linuxtv.org/patch/10301  Andreas Regel 
> 
> Mar,11 2012: [3/3] stv090x: On STV0903 do not set registers of the second 
> path. http://patchwork.linuxtv.org/patch/10302  Andreas Regel 
> 
> Apr, 1 2012: [05/11] Slightly more friendly debugging output. 
>   http://patchwork.linuxtv.org/patch/10520  "Steinar H. Gunderson" 
> 
> Apr, 1 2012: [06/11] Replace ca_lock by a slightly more general 
> int_stat_lock.  http://patchwork.linuxtv.org/patch/10521  "Steinar H. 
> Gunderson" 
> Apr, 1 2012: [07/11] Fix a ton of SMP-unsafe accesses.
>   http://patchwork.linuxtv.org/patch/10523  

Re: Patches submitted via linux-media ML that are at patchwork.linuxtv.org

2012-08-16 Thread Prabhakar Lad
Hi Mauro,

On Thursday 16 August 2012 05:16 AM, Mauro Carvalho Chehab wrote:
> Em 14-08-2012 10:04, Mauro Carvalho Chehab escreveu:
>> In order to help people to know about the status of the pending patches,
>> I'm summing-up the patches pending for merge on this email.
> 
> Thank you all maintainers that helped me updating it!
> 
> If I didn't miss anything, the patches below are what's under review.
> 
> I applied today the reorg patches part 2. Please test. There are still some
> mess at drivers/media/platform. I may try to address it next week, if I have
> some time. Of course, people are welcome to do that, instead ;) Basically,
> vivi, platform and mem2mem drivers are there, maybe together with some other
> stuff. I think soc_camera deserves its own directory, just like other
> platform drivers.
> 
> The Kconfig stuff on V4L can likely be simplified: there are too many hidden
> options there that probably can be removed, in order to make it simpler.
> 
> Anyway, at least in my humble opinion, things are now better organized.
> 
> With regards to media-build.git tree, I updated it to properly apply the
> fixup patches against the new tree. I didn't updated the driver removal
> logic there, used during "make install".
> 
> For the driver removal logic to work at media-build, the file "obsolete.txt" 
> needs to have the name and patches for all drivers before the reorganization.
> As the maximum backport is 2.6.31, I suspect that all other stuff at 
> "obsolete.txt" just got outdated and can be removed.
> 
> Thanks,
> Mauro
> 
>   == Needing more discussions/review by the LinuxTV community == 
> 
> Jun,21 2012: [media] dvb frontend core: tuning in ISDB-T using DVB API v3 
>   http://patchwork.linuxtv.org/patch/12988  Olivier Grenie 
> 
> Jun,21 2012: dvb: push down ioctl lock in dvb_usercopy
>   http://patchwork.linuxtv.org/patch/12989  Nikolaus Schulz 
> 
> Jul,26 2012: media: rc: Add support to decode Remotes using NECx IR protocol  
>   http://patchwork.linuxtv.org/patch/13480  Ravi Kumar V 
> 
> Jul,31 2012: [RFC] Fix DVB ioctls failing if frontend open/closed too fast
>   http://patchwork.linuxtv.org/patch/13563  Juergen Lock 
> 
> Jan,20 2012: [RFC] dvb: Add DVBv5 properties for quality parameters   
>   http://patchwork.linuxtv.org/patch/9578   Mauro Carvalho Chehab 
> 
> Aug,13 2012: [media] dvb: frontend API: Add a flag to indicate that 
> get_frontend()  http://patchwork.linuxtv.org/patch/13783  Mauro Carvalho 
> Chehab 
> 
>   == Guennadi Liakhovetski  == 
> 
> Jul,12 2012: media: mx2_camera: Remove MX2_CAMERA_SWAP16 and 
> MX2_CAMERA_PACK_DIR_MS http://patchwork.linuxtv.org/patch/13331  Javier 
> Martin 
> May,25 2012: [08/15] video: mx2_emmaprp: Use 
> clk_prepare_enable/clk_disable_unprepa 
> http://patchwork.linuxtv.org/patch/11507  Fabio Estevam 
> 
> 
>   == Prabhakar Lad  == 
> 
> Aug, 9 2012: [1/1, v2] media/video: vpif: fixing function name start to 
> vpif_config http://patchwork.linuxtv.org/patch/13689  Dror Cohen 
> 
> 
 This patch can be marked as 'Accepted'.

Thanks and Regards,
--Prabhakar

>   == Jonathan Corbet  == 
> 
> Apr,26 2012: [2/2] marvell-cam: Build fix: missing "select VIDEOBUF2_VMALLOC" 
>   http://patchwork.linuxtv.org/patch/10848  Chris Ball 
> Aug,13 2012: [2/2] marvell-cam: Build fix: missing "select VIDEOBUF2_VMALLOC" 
>   http://patchwork.linuxtv.org/patch/13784  Mauro Carvalho Chehab 
> 
> 
>   == Manu Abraham  == 
> 
> May,25 2011: Add remote control support for mantis
> Christoph Pinkl 
> 
> Jun, 8 2011: Add remote control support for mantis
>   http://patchwork.linuxtv.org/patch/7217   Christoph Pinkl 
> 
> Nov,29 2011: stv090x: implement function for reading uncorrected blocks count 
>   http://patchwork.linuxtv.org/patch/8656   Mariusz Bia?o?czyk 
> 
> Mar,11 2012: [2/3] stv090x: use error counter 1 for BER estimation
>   http://patchwork.linuxtv.org/patch/10301  Andreas Regel 
> 
> Mar,11 2012: [3/3] stv090x: On STV0903 do not set registers of the second 
> path. http://patchwork.linuxtv.org/patch/10302  Andreas Regel 
> 
> Apr, 1 2012: [05/11] Slightly more friendly debugging output. 
>   http://patchwork.linuxtv.org/patch/10520  "Steinar H. Gunderson" 
> 
> Apr, 1 2012: [06/11] Replace ca_lock by a slightly more general 
> int_stat_lock.  http://patchwork.linuxtv.org/patch/10521  &

Re: [PATCH] [media] davinci: vpfe: Add documentation

2012-08-16 Thread Prabhakar Lad
Hi Rob,

On Thursday 16 August 2012 06:40 PM, Rob Landley wrote:
> On 07/11/2012 10:39 AM, Manjunath Hadli wrote:
>> Add documentation on the Davinci VPFE driver. Document the subdevs,
>> and private IOTCLs the driver implements
>>
>> Signed-off-by: Manjunath Hadli 
>> Signed-off-by: Lad, Prabhakar 
> 
> I saw the comment on the 8th, is there another version of this
> documentation coming...?
> 
 I was waiting for comments from Sakari/Laurent, If they are happy
 from what Manju has proposed, depending on the outcome of the
discussion I'll soon post another version soon.

Thanks and Regards,
--Prabhakar

> Rob
> 

--
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] media: davinci: vpif: add check for NULL handler

2012-08-16 Thread Prabhakar Lad
From: Lad, Prabhakar 

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
Cc: Hans Verkuil 
---
 drivers/media/video/davinci/vpif_capture.c |   12 +++-
 drivers/media/video/davinci/vpif_display.c |   14 --
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/media/video/davinci/vpif_capture.c 
b/drivers/media/video/davinci/vpif_capture.c
index 266025e..a87b7a5 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue *vq, 
unsigned int count)
}
 
/* configure 1 or 2 channel mode */
-   ret = vpif_config_data->setup_input_channel_mode
-   (vpif->std_info.ycmux_mode);
+   if (vpif_config_data->setup_input_channel_mode) {
+   ret = vpif_config_data->setup_input_channel_mode
+   (vpif->std_info.ycmux_mode);
 
-   if (ret < 0) {
-   vpif_dbg(1, debug, "can't set vpif channel mode\n");
-   return ret;
+   if (ret < 0) {
+   vpif_dbg(1, debug, "can't set vpif channel mode\n");
+   return ret;
+   }
}
 
/* Call vpif_set_params function to set the parameters and addresses */
diff --git a/drivers/media/video/davinci/vpif_display.c 
b/drivers/media/video/davinci/vpif_display.c
index e129c98..1e35f92 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue *vq, 
unsigned int count)
}
 
/* clock settings */
-   ret =
-   vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
-   ch->vpifparams.std_info.hd_sd);
-   if (ret < 0) {
-   vpif_err("can't set clock\n");
-   return ret;
+   if (vpif_config_data->set_clock) {
+   ret =
+   vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
+   ch->vpifparams.std_info.hd_sd);
+   if (ret < 0) {
+   vpif_err("can't set clock\n");
+   return ret;
+   }
}
 
/* set the parameters and addresses */
-- 
1.7.0.4

--
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] media: davinci: vpif: add check for NULL handler

2012-08-16 Thread Prabhakar Lad
Hi Laurent,

Thanks for the review.

On Thursday 16 August 2012 08:43 PM, Laurent Pinchart wrote:
> Hi Prabhakar,
> 
> Thanks for the patch.
> 
> On Thursday 16 August 2012 19:32:00 Prabhakar Lad wrote:
>> From: Lad, Prabhakar 
>>
>> Signed-off-by: Lad, Prabhakar 
>> Signed-off-by: Manjunath Hadli 
>> Cc: Hans Verkuil 
>> ---
>>  drivers/media/video/davinci/vpif_capture.c |   12 +++-
>>  drivers/media/video/davinci/vpif_display.c |   14 --
>>  2 files changed, 15 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/media/video/davinci/vpif_capture.c
>> b/drivers/media/video/davinci/vpif_capture.c index 266025e..a87b7a5 100644
>> --- a/drivers/media/video/davinci/vpif_capture.c
>> +++ b/drivers/media/video/davinci/vpif_capture.c
>> @@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
>> unsigned int count) }
>>
>>  /* configure 1 or 2 channel mode */
>> -ret = vpif_config_data->setup_input_channel_mode
>> -(vpif->std_info.ycmux_mode);
>> +if (vpif_config_data->setup_input_channel_mode) {
>> +ret = vpif_config_data->setup_input_channel_mode
>> +(vpif->std_info.ycmux_mode);
>>
>> -if (ret < 0) {
>> -vpif_dbg(1, debug, "can't set vpif channel mode\n");
>> -return ret;
>> +if (ret < 0) {
>> +vpif_dbg(1, debug, "can't set vpif channel mode\n");
>> +return ret;
>> +}
> 
> This change looks good to me. However, note that you will need to get rid of 
> board code callbacks at some point to implement device tree support. It would 
> be worth thinking about how to do so now.
> 
Currently VPIF driver is only used by dm646x, and the handlers for this
in the the board code are not null. This patch is intended for da850
where this handlers will be null.

>>  }
>>
>>  /* Call vpif_set_params function to set the parameters and addresses */
>> diff --git a/drivers/media/video/davinci/vpif_display.c
>> b/drivers/media/video/davinci/vpif_display.c index e129c98..1e35f92 100644
>> --- a/drivers/media/video/davinci/vpif_display.c
>> +++ b/drivers/media/video/davinci/vpif_display.c
>> @@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
>> unsigned int count) }
>>
>>  /* clock settings */
>> -ret =
>> -vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
>> -ch->vpifparams.std_info.hd_sd);
>> -if (ret < 0) {
>> -vpif_err("can't set clock\n");
>> -return ret;
>> +if (vpif_config_data->set_clock) {
> 
> Does the DaVinci platform use the common clock framework ? If so, a better 
> fix 
> for this would be to pass a clock name through platform data instead of using 
> a callback function.
> 
Currently DaVinci is not using the common clock framework.

Can you ACK this patch?

Thanks and Regards,
--Prabhakar

>> +ret =
>> +vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
>> +ch->vpifparams.std_info.hd_sd);
>> +if (ret < 0) {
>> +vpif_err("can't set clock\n");
>> +return ret;
>> +}
>>  }
>>
>>  /* set the parameters and addresses */

--
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] media: davinci: vpif: add check for NULL handler

2012-08-17 Thread Prabhakar Lad
Hi Sekhar,

On Friday 17 August 2012 11:07 AM, Sekhar Nori wrote:
> On 8/17/2012 10:51 AM, Prabhakar Lad wrote:
>> Hi Laurent,
>>
>> Thanks for the review.
>>
>> On Thursday 16 August 2012 08:43 PM, Laurent Pinchart wrote:
>>> Hi Prabhakar,
>>>
>>> Thanks for the patch.
>>>
>>> On Thursday 16 August 2012 19:32:00 Prabhakar Lad wrote:
>>>> From: Lad, Prabhakar 
>>>>
>>>> Signed-off-by: Lad, Prabhakar 
>>>> Signed-off-by: Manjunath Hadli 
>>>> Cc: Hans Verkuil 
>>>> ---
>>>>  drivers/media/video/davinci/vpif_capture.c |   12 +++-
>>>>  drivers/media/video/davinci/vpif_display.c |   14 --
>>>>  2 files changed, 15 insertions(+), 11 deletions(-)
>>>>
>>>> diff --git a/drivers/media/video/davinci/vpif_capture.c
>>>> b/drivers/media/video/davinci/vpif_capture.c index 266025e..a87b7a5 100644
>>>> --- a/drivers/media/video/davinci/vpif_capture.c
>>>> +++ b/drivers/media/video/davinci/vpif_capture.c
>>>> @@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
>>>> unsigned int count) }
>>>>
>>>>/* configure 1 or 2 channel mode */
>>>> -  ret = vpif_config_data->setup_input_channel_mode
>>>> -  (vpif->std_info.ycmux_mode);
>>>> +  if (vpif_config_data->setup_input_channel_mode) {
>>>> +  ret = vpif_config_data->setup_input_channel_mode
>>>> +  (vpif->std_info.ycmux_mode);
>>>>
>>>> -  if (ret < 0) {
>>>> -  vpif_dbg(1, debug, "can't set vpif channel mode\n");
>>>> -  return ret;
>>>> +  if (ret < 0) {
>>>> +  vpif_dbg(1, debug, "can't set vpif channel mode\n");
>>>> +  return ret;
>>>> +  }
>>>
>>> This change looks good to me. However, note that you will need to get rid 
>>> of 
>>> board code callbacks at some point to implement device tree support. It 
>>> would 
>>> be worth thinking about how to do so now.
>>>
>> Currently VPIF driver is only used by dm646x, and the handlers for this
>> in the the board code are not null. This patch is intended for da850
>> where this handlers will be null.
>>
>>>>}
>>>>
>>>>/* Call vpif_set_params function to set the parameters and addresses */
>>>> diff --git a/drivers/media/video/davinci/vpif_display.c
>>>> b/drivers/media/video/davinci/vpif_display.c index e129c98..1e35f92 100644
>>>> --- a/drivers/media/video/davinci/vpif_display.c
>>>> +++ b/drivers/media/video/davinci/vpif_display.c
>>>> @@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
>>>> unsigned int count) }
>>>>
>>>>/* clock settings */
>>>> -  ret =
>>>> -  vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
>>>> -  ch->vpifparams.std_info.hd_sd);
>>>> -  if (ret < 0) {
>>>> -  vpif_err("can't set clock\n");
>>>> -  return ret;
>>>> +  if (vpif_config_data->set_clock) {
>>>
>>> Does the DaVinci platform use the common clock framework ? If so, a better 
>>> fix 
>>> for this would be to pass a clock name through platform data instead of 
>>> using 
>>> a callback function.
>>>
>> Currently DaVinci is not using the common clock framework.
>>
>> Can you ACK this patch?
> 
> Yes, DaVinci has not migrated to common clock framework (yet). However,
> even without that it should be possible to use clock API in driver code.
> Using a callback to enable clocks or even passing the clock name from
> platform data would be bypassing an existing framework. Clock name
> should be IP specific, so it should be possible to use that in driver.
> 
The callback is not actually dealing with PSC clock's but with system
module registers.

Thx,
--Prabhakar

> Thanks,
> Sekhar
> 

--
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] libdvbv5: Fix byte swapping for embedded toolchains

2012-08-21 Thread Prabhakar Lad
Hi Gregor,

Thanks for the patch.

On Wednesday 22 August 2012 12:28 AM, Gregor Jasny wrote:
> Reported-by: "Lad, Prabhakar" 
> Signed-off-by: Gregor Jasny 

  Acked-by: Prabhakar Lad 

Thx,
--Prabhakar

> ---
>  lib/include/descriptors.h |6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/include/descriptors.h b/lib/include/descriptors.h
> index 9039014..a64370c 100644
> --- a/lib/include/descriptors.h
> +++ b/lib/include/descriptors.h
> @@ -25,7 +25,7 @@
>  #ifndef _DESCRIPTORS_H
>  #define _DESCRIPTORS_H
>  
> -#include 
> +#include 
>  #include 
>  #include 
>  
> @@ -46,11 +46,11 @@ extern char *default_charset;
>  extern char *output_charset;
>  
>  #define bswap16(b) do {\
> - b = be16toh(b); \
> + b = ntohs(b); \
>  } while (0)
>  
>  #define bswap32(b) do {\
> - b = be32toh(b); \
> + b = ntohl(b); \
>  } while (0)
>  
>  struct dvb_desc {
> 

--
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] media: v4l2-ctrls: add control for dpcm predictor

2012-08-29 Thread Prabhakar Lad
From: Lad, Prabhakar 

add V4L2_CID_DPCM_PREDICTOR control of type menu, which
determines the dpcm predictor. The predictor can be either
simple or advanced.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
Cc: Sakari Ailus 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Mauro Carvalho Chehab 
Cc: Sylwester Nawrocki 
Cc: Hans de Goede 
Cc: Kyungmin Park 
---
 This patches has one checkpatch warning for line over
 80 characters altough it can be avoided I have kept it
 for consistency.

 drivers/media/v4l2-core/v4l2-ctrls.c |9 +
 include/linux/videodev2.h|5 +
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index b6a2ee7..2d7bc15 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -425,6 +425,11 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
"Gray",
NULL,
};
+   static const char * const dpcm_predictor[] = {
+   "Simple Predictor",
+   "Advanced Predictor",
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -502,6 +507,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
return mpeg4_profile;
case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
return jpeg_chroma_subsampling;
+   case V4L2_CID_DPCM_PREDICTOR:
+   return dpcm_predictor;
 
default:
return NULL;
@@ -732,6 +739,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_IMAGE_PROC_CLASS: return "Image Processing 
Controls";
case V4L2_CID_LINK_FREQ:return "Link Frequency";
case V4L2_CID_PIXEL_RATE:   return "Pixel Rate";
+   case V4L2_CID_DPCM_PREDICTOR:   return "DPCM Predictor";
 
default:
return NULL;
@@ -832,6 +840,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
case V4L2_CID_ISO_SENSITIVITY_AUTO:
case V4L2_CID_EXPOSURE_METERING:
case V4L2_CID_SCENE_MODE:
+   case V4L2_CID_DPCM_PREDICTOR:
*type = V4L2_CTRL_TYPE_MENU;
break;
case V4L2_CID_LINK_FREQ:
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 6d6dfa7..4edb941 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -2000,6 +2000,11 @@ enum v4l2_jpeg_chroma_subsampling {
 
 #define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE 
+ 1)
 #define V4L2_CID_PIXEL_RATE(V4L2_CID_IMAGE_PROC_CLASS_BASE 
+ 2)
+#define V4L2_CID_DPCM_PREDICTOR
(V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
+enum v4l2_dpcm_predictor {
+   V4L2_DPCM_PREDICTOR_SIMPLE  = 0,
+   V4L2_DPCM_PREDICTOR_ADVANCE = 1,
+};
 
 /*
  * T U N I N G
-- 
1.7.0.4

--
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] media: v4l2-ctrls: add control for dpcm predictor

2012-08-29 Thread Prabhakar Lad
Hi Sylwester,

On Wednesday 29 August 2012 06:13 PM, Sylwester Nawrocki wrote:
> Hi Prabhakar,
> 
> On 08/29/2012 02:31 PM, Prabhakar Lad wrote:
>> From: Lad, Prabhakar 
>>
>> add V4L2_CID_DPCM_PREDICTOR control of type menu, which
>> determines the dpcm predictor. The predictor can be either
>> simple or advanced.
> 
> Thanks for the patch. I was expecting to find some information about
> this new control in its DocBook documentation, but this part seems
> to be missing here. :) Could you please add relevant entries in
> Documentation/DocBook/media/v4l/controls.xml as well ?
> 
Thanks for the catch :) I'll add it for v2.

Thanks and Regards,
--Prabhakar

> --
> 
> Regards,
> Sylwester
> 

--
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] [media] davinci: vpfe: Add documentation

2012-08-29 Thread Prabhakar Lad
Hi Sakari,

On Thu, Aug 16, 2012 at 9:53 PM, Sakari Ailus  wrote:
> Hi Manju,
>
> On Thu, Aug 09, 2012 at 09:13:52AM +0530, Manjunath Hadli wrote:
>> Hi Sakari,
>>
>>  Thank you for the comments.
>
> Thanks for the graphs!
>
>> On Thursday 02 August 2012 05:37 AM, Sakari Ailus wrote:
>> > Hi Manju,
>> >
>> > Thanks for the patch.
>> >
>> > Please make sure these patches reach linux-media next time. If they do
>> > not,
>> > it severely limits the number of potential reviewers. I don't know
>> > why, but
>> > the original patch isn't on linux-media even if the list was cc'd.
>> >
>> > Dropping linux-kernel from cc.
>> >
>> > Manjunath Hadli wrote:
>> >> Add documentation on the Davinci VPFE driver. Document the subdevs,
>> >> and private IOTCLs the driver implements
>> >>
>> >> Signed-off-by: Manjunath Hadli 
>> >> Signed-off-by: Lad, Prabhakar 
>> >> ---
>> >>   Documentation/video4linux/davinci-vpfe-mc.txt |  263
>> >> +
>> >>   1 files changed, 263 insertions(+), 0 deletions(-)
>> >>   create mode 100644 Documentation/video4linux/davinci-vpfe-mc.txt
>> >>
>> >> diff --git a/Documentation/video4linux/davinci-vpfe-mc.txt
>> >> b/Documentation/video4linux/davinci-vpfe-mc.txt
>> >> new file mode 100644
>> >> index 000..968194f
>> >> --- /dev/null
>> >> +++ b/Documentation/video4linux/davinci-vpfe-mc.txt
>> >> @@ -0,0 +1,263 @@
>> >> +Davinci Video processing Front End (VPFE) driver
>> >> +
>> >> +Copyright (C) 2012 Texas Instruments Inc
>> >> +
>> >> +Contacts: Manjunath Hadli 
>> >> +
>> >> +Introduction
>> >> +
>> >> +
>> >> +This file documents the Texas Instruments Davinci Video processing
>> >> Front End
>> >> +(VPFE) driver located under drivers/media/video/davinci. The
>> >> original driver
>> >> +exists for Davinci VPFE, which is now being changed to Media Controller
>> >> +Framework.
>> >> +
>> >> +Currently the driver has been successfully used on the following
>> >> version of Davinci:
>> >> +
>> >> +DM365/DM368
>> >> +
>> >> +The driver implements V4L2, Media controller and v4l2_subdev
>> >> interfaces.
>> >> +Sensor, lens and flash drivers using the v4l2_subdev interface in
>> >> the kernel
>> >> +are supported.
>> >> +
>> >> +
>> >> +Split to subdevs
>> >> +
>> >> +
>> >> +The Davinic VPFE is split into V4L2 subdevs, each of the blocks
>> >> inside the VPFE
>> >> +having one subdev to represent it. Each of the subdevs provide a
>> >> V4L2 subdev
>> >> +interface to userspace.
>> >> +
>> >> +DAVINCI CCDC
>> >> +DAVINCI PREVIEWER
>> >> +DAVINCI RESIZER
>> >> +DAVINCI AEW
>> >> +DAVINCI AF
>> >> +
>> >> +Each possible link in the VPFE is modeled by a link in the Media
>> >> controller
>> >> +interface. For an example program see [1].
>> >> +
>> >> +
>> >> +Private IOCTLs
>> >> +==
>> >> +
>> >> +The Davinci Video processing Front End (VPFE) driver supports
>> >> standard V4L2
>> >> +IOCTLs and controls where possible and practical. Much of the
>> >> functions provided
>> >> +by the VPFE, however, does not fall under the standard IOCTLs.
>> >> +
>> >> +In general, there is a private ioctl for configuring each of the blocks
>> >> +containing hardware-dependent functions.
>> >> +
>> >> +The following private IOCTLs are supported:
>> >> +
>> >> +1: IOCTL: PREV_S_PARAM/PREV_G_PARAM
>> >> +Description:
>> >> +Sets/Gets the parameters required by the previewer module
>> >> +Parameter:
>> >> +/**
>> >> + * struct prev_module_param- structure to configure preview modules
>> >> + * @version: Version of the preview module
>> >> + * @len: Length of the module config structure
>> >> + * @module_id: Module id
>> >> + * @param: pointer to module config parameter.
>> >> + */
>> >> +struct prev_module_param {
>> >> +char version[IMP_MAX_NAME_SIZE];
>> >> +unsigned short len;
>> >> +unsigned short module_id;
>> >> +void *param;
>> >> +};
>> >
>> > In addition to what Laurent commented on this, could the version
>> > information be passed in struct media_entity_desc instead?
>> I plan to leave out the version.
>> >
>> > As a general comment, it's a bad idea to design an API that allows
>> > passing
>> > blobs, especially when the expected size of the blobs isn't known. That
>> > really equals to asking for trouble.
>> >
>> > That said, I know this is an area where complete documentation is acarce,
>> > but I think that at least the memory layout of the current blob pointers
>> > should be visible in the struct definitions whenever possible. See
>> > e.g. the
>> > OMAP 3 ISP driver.
>> I have proposed using a union of structures instead of the void  blob.
>> I also saw the OMAP implementation, and they are pointers (but not void).
>> To me the union approach looks better as it keeps the architecture
>> intact and does not necessitate an
>> explicit copy_from_user. Which of these ways do you suggest?
>
> I would suggest to use the approach taken in the OMAP

Re: [PATCH] media: v4l2-ctrls: add control for dpcm predictor

2012-08-29 Thread Prabhakar Lad
Hi Sakari,

Thanks for the review.

On Wed, Aug 29, 2012 at 7:51 PM, Sakari Ailus  wrote:
> Hi Prabhakar,
>
> Thanks for the patch.
>
> On Wed, Aug 29, 2012 at 06:01:07PM +0530, Prabhakar Lad wrote:
>> From: Lad, Prabhakar 
>>
>> add V4L2_CID_DPCM_PREDICTOR control of type menu, which
>> determines the dpcm predictor. The predictor can be either
>> simple or advanced.
>>
>> Signed-off-by: Lad, Prabhakar 
>> Signed-off-by: Manjunath Hadli 
>> Cc: Sakari Ailus 
>> Cc: Hans Verkuil 
>> Cc: Laurent Pinchart 
>> Cc: Mauro Carvalho Chehab 
>> Cc: Sylwester Nawrocki 
>> Cc: Hans de Goede 
>> Cc: Kyungmin Park 
>> ---
>>  This patches has one checkpatch warning for line over
>>  80 characters altough it can be avoided I have kept it
>>  for consistency.
>>
>>  drivers/media/v4l2-core/v4l2-ctrls.c |9 +
>>  include/linux/videodev2.h|5 +
>>  2 files changed, 14 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
>> b/drivers/media/v4l2-core/v4l2-ctrls.c
>> index b6a2ee7..2d7bc15 100644
>> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
>> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
>> @@ -425,6 +425,11 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
>>   "Gray",
>>   NULL,
>>   };
>> + static const char * const dpcm_predictor[] = {
>> + "Simple Predictor",
>> + "Advanced Predictor",
>> + NULL,
>> + };
>>
>>   switch (id) {
>>   case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
>> @@ -502,6 +507,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
>>   return mpeg4_profile;
>>   case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
>>   return jpeg_chroma_subsampling;
>> + case V4L2_CID_DPCM_PREDICTOR:
>> + return dpcm_predictor;
>>
>>   default:
>>   return NULL;
>> @@ -732,6 +739,7 @@ const char *v4l2_ctrl_get_name(u32 id)
>>   case V4L2_CID_IMAGE_PROC_CLASS: return "Image Processing 
>> Controls";
>>   case V4L2_CID_LINK_FREQ:return "Link Frequency";
>>   case V4L2_CID_PIXEL_RATE:   return "Pixel Rate";
>> + case V4L2_CID_DPCM_PREDICTOR:   return "DPCM Predictor";
>>
>>   default:
>>   return NULL;
>> @@ -832,6 +840,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
>> v4l2_ctrl_type *type,
>>   case V4L2_CID_ISO_SENSITIVITY_AUTO:
>>   case V4L2_CID_EXPOSURE_METERING:
>>   case V4L2_CID_SCENE_MODE:
>> + case V4L2_CID_DPCM_PREDICTOR:
>>   *type = V4L2_CTRL_TYPE_MENU;
>>   break;
>>   case V4L2_CID_LINK_FREQ:
>> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
>> index 6d6dfa7..4edb941 100644
>> --- a/include/linux/videodev2.h
>> +++ b/include/linux/videodev2.h
>> @@ -2000,6 +2000,11 @@ enum v4l2_jpeg_chroma_subsampling {
>>
>>  #define V4L2_CID_LINK_FREQ   
>> (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
>>  #define V4L2_CID_PIXEL_RATE  
>> (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
>> +#define V4L2_CID_DPCM_PREDICTOR  
>> (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
>> +enum v4l2_dpcm_predictor {
>> + V4L2_DPCM_PREDICTOR_SIMPLE  = 0,
>> + V4L2_DPCM_PREDICTOR_ADVANCE = 1,
>> +};
>
> s/ADVANCE/ADVANCED/ perhaps?
>
Ok I'll make it ADVANCED.

> To add to Sylwester's comment on the documentation, I think this control
> belongs to the image processing controls class.
>
I have added it as part of image processing control class itself
(#define V4L2_CID_DPCM_PREDICTOR  (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)),
 I'll include the same in documentation as well.

Thanks and Regards,
--Prabhakar Lad

> Kind regards,
>
> --
> Sakari Ailus
> e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
> ___
> Davinci-linux-open-source mailing list
> davinci-linux-open-sou...@linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
--
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 v2] media: v4l2-ctrls: add control for dpcm predictor

2012-08-30 Thread Prabhakar Lad
From: Lad, Prabhakar 

add V4L2_CID_DPCM_PREDICTOR control of type menu, which
determines the dpcm predictor. The predictor can be either
simple or advanced.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
Cc: Sakari Ailus 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Mauro Carvalho Chehab 
Cc: Sylwester Nawrocki 
Cc: Hans de Goede 
Cc: Kyungmin Park 
---
This patches has one checkpatch warning for line over
80 characters altough it can be avoided I have kept it
for consistency.

Changes for v2: 
1: Added documentaion in controls.xml pointed by Sylwester.
2: Chnaged V4L2_DPCM_PREDICTOR_ADVANCE to V4L2_DPCM_PREDICTOR_ADVANCED
   pointed by Sakari.

 Documentation/DocBook/media/v4l/controls.xml |   25 -
 drivers/media/v4l2-core/v4l2-ctrls.c |9 +
 include/linux/videodev2.h|5 +
 3 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/controls.xml 
b/Documentation/DocBook/media/v4l/controls.xml
index 93b9c68..84746d0 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -4267,7 +4267,30 @@ interface and may change in the future.
pixels / second.

  
- 
+ 
+   V4L2_CID_DPCM_PREDICTOR
+   menu
+ 
+ 
+DPCM Predictor: depicts what type of 
prediction
+   is used simple or advanced.
+   
+ 
+ 
+   
+ 
+   
+V4L2_DPCM_PREDICTOR_SIMPLE
+ Predictor type is simple
+   
+   
+ 
V4L2_DPCM_PREDICTOR_ADVANCED
+ Predictor type is advanced
+   
+ 
+   
+ 
+   

   
   
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index b6a2ee7..2d7bc15 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -425,6 +425,11 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
"Gray",
NULL,
};
+   static const char * const dpcm_predictor[] = {
+   "Simple Predictor",
+   "Advanced Predictor",
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -502,6 +507,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
return mpeg4_profile;
case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
return jpeg_chroma_subsampling;
+   case V4L2_CID_DPCM_PREDICTOR:
+   return dpcm_predictor;
 
default:
return NULL;
@@ -732,6 +739,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_IMAGE_PROC_CLASS: return "Image Processing 
Controls";
case V4L2_CID_LINK_FREQ:return "Link Frequency";
case V4L2_CID_PIXEL_RATE:   return "Pixel Rate";
+   case V4L2_CID_DPCM_PREDICTOR:   return "DPCM Predictor";
 
default:
return NULL;
@@ -832,6 +840,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
case V4L2_CID_ISO_SENSITIVITY_AUTO:
case V4L2_CID_EXPOSURE_METERING:
case V4L2_CID_SCENE_MODE:
+   case V4L2_CID_DPCM_PREDICTOR:
*type = V4L2_CTRL_TYPE_MENU;
break;
case V4L2_CID_LINK_FREQ:
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 6d6dfa7..ca9fb78 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -2000,6 +2000,11 @@ enum v4l2_jpeg_chroma_subsampling {
 
 #define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE 
+ 1)
 #define V4L2_CID_PIXEL_RATE(V4L2_CID_IMAGE_PROC_CLASS_BASE 
+ 2)
+#define V4L2_CID_DPCM_PREDICTOR
(V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
+enum v4l2_dpcm_predictor {
+   V4L2_DPCM_PREDICTOR_SIMPLE  = 0,
+   V4L2_DPCM_PREDICTOR_ADVANCED= 1,
+};
 
 /*
  * T U N I N G
-- 
1.7.0.4

--
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] [media] davinci: vpfe: Add documentation

2012-09-01 Thread Prabhakar Lad
Hi Laurent,

On Sat, Sep 1, 2012 at 7:52 PM, Laurent Pinchart
 wrote:
> Hi Sakari,
>
> On Saturday 01 September 2012 12:57:07 Sakari Ailus wrote:
>> On Wed, Aug 29, 2012 at 08:11:50PM +0530, Prabhakar Lad wrote:
>
> [snip]
>
>> > For test pattern you meant control to enable/disable it ?
>>
>> There are two approaches I can think of.
>>
>> One is a menu control which can be used to choose the test pattern (or
>> disable it). The control could be standardised but the menu items would have
>> to be hardware-specific since the test patterns themselves are not
>> standardised.
>
> Agreed. The test patterns themselves are highly hardware-specific.
>
> From personal experience with sensors, most devices implement a small, fixed
> set of test patterns that can be exposed through a menu control. However, some
> devices also implement more "configurable" test patterns. For instance the
> MT9V032 can generate horizontal, vertical or diagonal test patterns, or a
> uniform grey test pattern with a user-configurable value. This would then
> require two controls.
>
two controls I didn't get it ? When we have menu itself with a list of standard
patterns why would two controls be required ?

Thx,
--Prabhakar Lad

>> The alternative is to have a boolean control to enable (and disable) the
>> test pattern and then a menu control to choose which one to use. Using or
>> implemeting the control to select the test pattern isn't even strictly
>> necessary to get a test pattern out of the device: one can enable it without
>> knowing which one it is.
>>
>> So which one would be better? Similar cases include V4L2_CID_SCENE_MODE
>> which is used to choose the scene mode from a list of alternatives. The main
>> difference to this case is that the menu items of the scene mode control
>> are standardised, too.
>>
>> I'd be inclined to have a single menu control, even if the other menu items
>> will be device-specific. The first value (0) still has to be documented to
>> mean the test pattern is disabled.
>>
>> Laurent, Hans: what do you think?
>
> A menu control with value 0 meaning test pattern disabled has my preference as
> well.
>
> --
> 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


[PATCH v3] media: v4l2-ctrls: add control for dpcm predictor

2012-09-03 Thread Prabhakar Lad
From: Lad, Prabhakar 

add V4L2_CID_DPCM_PREDICTOR control of type menu, which
determines the dpcm predictor. The predictor can be either
simple or advanced.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
Cc: Sakari Ailus 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Mauro Carvalho Chehab 
Cc: Sylwester Nawrocki 
Cc: Hans de Goede 
Cc: Kyungmin Park 
Cc: Rob Landley 
Cc: HeungJun Kim 
---
This patches has one checkpatch warning for line over
80 characters altough it can be avoided I have kept it
for consistency.

Changes for v3:
1: Added better explanation for DPCM, pointed by Hans.

Changes for v2:
1: Added documentaion in controls.xml pointed by Sylwester.
2: Chnaged V4L2_DPCM_PREDICTOR_ADVANCE to V4L2_DPCM_PREDICTOR_ADVANCED
   pointed by Sakari.

 Documentation/DocBook/media/v4l/controls.xml |   48 +-
 drivers/media/v4l2-core/v4l2-ctrls.c |9 +
 include/linux/videodev2.h|5 +++
 3 files changed, 61 insertions(+), 1 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/controls.xml 
b/Documentation/DocBook/media/v4l/controls.xml
index 93b9c68..f704218 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -4267,7 +4267,53 @@ interface and may change in the future.
pixels / second.

  
- 
+ 
+   V4L2_CID_DPCM_PREDICTOR
+   menu
+ 
+ 
+Differential pulse-code modulation (DPCM) 
is a signal
+   encoder that uses the baseline of pulse-code modulation (PCM) but 
adds some
+   functionalities based on the prediction of the samples of the 
signal. The input
+   can be an analog signal or a digital signal.
+
+   If the input is a continuous-time
+   analog signal, it needs to be sampled first so that a discrete-time 
signal is
+   the input to the DPCM encoder.
+
+   Simple: take the values of two
+   consecutive samples; if they are analog samples, quantize them; 
calculate the
+   difference between the first one and the next; the output is the 
difference, and
+   it can be further entropy coded.
+
+   Advanced: instead of taking a difference relative to a 
previous input sample,
+   take the difference relative to the output of a local model of the 
decoder process;
+   in this option, the difference can be quantized, which allows a 
good way to
+   incorporate a controlled loss in the encoding.
+
+   Applying one of these two processes, short-term redundancy 
(positive correlation of
+   nearby values) of the signal is eliminated; compression ratios on 
the order of 2 to 4
+   can be achieved if differences are subsequently entropy coded, 
because the entropy of
+   the difference signal is much smaller than that of the original 
discrete signal treated
+   as independent samples.For more information about DPCM see http://en.wikipedia.org/wiki/Differential_pulse-code_modulation";>Wikipedia.
+   
+ 
+ 
+   
+ 
+   
+V4L2_DPCM_PREDICTOR_SIMPLE
+ Predictor type is simple
+   
+   
+ 
V4L2_DPCM_PREDICTOR_ADVANCED
+ Predictor type is advanced
+   
+ 
+   
+ 
+   

   
   
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index b6a2ee7..2d7bc15 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -425,6 +425,11 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
"Gray",
NULL,
};
+   static const char * const dpcm_predictor[] = {
+   "Simple Predictor",
+   "Advanced Predictor",
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -502,6 +507,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
return mpeg4_profile;
case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
return jpeg_chroma_subsampling;
+   case V4L2_CID_DPCM_PREDICTOR:
+   return dpcm_predictor;
 
default:
return NULL;
@@ -732,6 +739,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_IMAGE_PROC_CLASS: return "Image Processing 
Controls";
case V4L2_CID_LINK_FREQ:return "Link Frequency";
case V4L2_CID_PIXEL_RATE:   return "Pixel Rate";
+   case V4L2_CID_DPCM_PREDICTOR:   return "DPCM Predictor";
 
default:
return NULL;
@@ -832,6 +840,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
case V4L2_CID_ISO_SENSITIVITY_AUTO:
case V4L2_CID_EXPOSURE_METERING:
case V

[PATCH] media: v4l2-ctrls: add control for test pattern

2012-09-03 Thread Prabhakar Lad
From: Lad, Prabhakar 

add V4L2_CID_TEST_PATTERN of type menu, which determines
the internal test pattern selected by the device.

Signed-off-by: Lad, Prabhakar 
Signed-off-by: Manjunath Hadli 
Cc: Sakari Ailus 
Cc: Hans Verkuil 
Cc: Laurent Pinchart 
Cc: Mauro Carvalho Chehab 
Cc: Sylwester Nawrocki 
Cc: Hans de Goede 
Cc: Kyungmin Park 
Cc: Rob Landley 
Cc: HeungJun Kim 
Cc: Rob Landley 
---
 This patches has one checkpatch warning for line over
 80 characters altough it can be avoided I have kept it
 for consistency.

 Documentation/DocBook/media/v4l/controls.xml |   52 ++
 drivers/media/v4l2-core/v4l2-ctrls.c |   16 
 include/linux/videodev2.h|   12 ++
 3 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/controls.xml 
b/Documentation/DocBook/media/v4l/controls.xml
index f704218..06f16e7 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -4313,6 +4313,58 @@ interface and may change in the future.
  

  
+ 
+   V4L2_CID_TEST_PATTERN
+   menu
+ 
+ 
+The capture devices/sensors have the 
capability to
+   generate internal test patterns. This test patterns are used to 
test a device
+   is properly working and can generate the desired waveforms that it 
supports.
+   
+ 
+ 
+   
+ 
+   
+V4L2_TEST_PATTERN_DISABLED
+ Test pattern generation is disabled
+   
+   
+ 
V4L2_TEST_PATTERN_VERTICAL_LINES
+ Generate vertical lines as test pattern
+   
+   
+ 
V4L2_TEST_PATTERN_HORIZONTAL_LINES
+ Generate horizontal lines as test pattern
+   
+   
+ 
V4L2_TEST_PATTERN_DIAGONAL_LINES
+ Generate diagonal lines as test pattern
+   
+   
+ 
V4L2_TEST_PATTERN_SOLID_BLACK
+ Generate solid black color as test pattern
+   
+   
+ 
V4L2_TEST_PATTERN_SOLID_WHITE
+ Generate solid white color as test pattern
+   
+   
+ 
V4L2_TEST_PATTERN_SOLID_BLUE
+ Generate solid blue color as test pattern
+   
+   
+ 
V4L2_TEST_PATTERN_SOLID_RED
+ Generate solid red color as test pattern
+   
+   
+ 
V4L2_TEST_PATTERN_CHECKER_BOARD
+ Generate a checker board as test pattern
+   
+ 
+   
+ 


   
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index 2d7bc15..ae709d1 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -430,6 +430,18 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
"Advanced Predictor",
NULL,
};
+   static const char * const test_pattern[] = {
+   "Test Pattern Disabled",
+   "Vertical Lines",
+   "Horizontal Lines",
+   "Diagonal Lines",
+   "Solid Black",
+   "Solid White",
+   "Solid Blue",
+   "Solid Red",
+   "Checker Board",
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -509,6 +521,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
return jpeg_chroma_subsampling;
case V4L2_CID_DPCM_PREDICTOR:
return dpcm_predictor;
+   case V4L2_CID_TEST_PATTERN:
+   return test_pattern;
 
default:
return NULL;
@@ -740,6 +754,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_LINK_FREQ:return "Link Frequency";
case V4L2_CID_PIXEL_RATE:   return "Pixel Rate";
case V4L2_CID_DPCM_PREDICTOR:   return "DPCM Predictor";
+   case V4L2_CID_TEST_PATTERN: return "Test Pattern";
 
default:
return NULL;
@@ -841,6 +856,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
case V4L2_CID_EXPOSURE_METERING:
case V4L2_CID_SCENE_MODE:
case V4L2_CID_DPCM_PREDICTOR:
+   case V4L2_CID_TEST_PATTERN:
*type = V4L2_CTRL_TYPE_MENU;
break;
case V4L2_CID_LINK_FREQ:
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index ca9fb78..1796079 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -2005,6 +2005,18 @@ enum v4l2_dpcm_predictor {
V4L2_DPCM_PREDICTOR_SIMPLE  = 0,
V4L2_DPCM_PREDICTOR_A

Re: [PATCH v3] media: v4l2-ctrls: add control for dpcm predictor

2012-09-03 Thread Prabhakar Lad
Hi Sylwester,

Thanks for the review.

On Monday 03 September 2012 02:51 PM, Sylwester Nawrocki wrote:
> On 09/03/2012 09:20 AM, Prabhakar Lad wrote:
>> From: Lad, Prabhakar 
>>
>> add V4L2_CID_DPCM_PREDICTOR control of type menu, which
>> determines the dpcm predictor. The predictor can be either
>> simple or advanced.
>>
>> Signed-off-by: Lad, Prabhakar 
>> Signed-off-by: Manjunath Hadli 
>> Cc: Sakari Ailus 
>> Cc: Hans Verkuil 
>> Cc: Laurent Pinchart 
>> Cc: Mauro Carvalho Chehab 
>> Cc: Sylwester Nawrocki 
>> Cc: Hans de Goede 
>> Cc: Kyungmin Park 
>> Cc: Rob Landley 
>> Cc: HeungJun Kim 
> 
> Looks good.
> 
> Reviewed-by: Sylwester Nawrocki 
> 
>> ---
>> This patches has one checkpatch warning for line over
>> 80 characters altough it can be avoided I have kept it
>> for consistency.
>>
>> Changes for v3:
>> 1: Added better explanation for DPCM, pointed by Hans.
>>
>> Changes for v2:
>> 1: Added documentaion in controls.xml pointed by Sylwester.
>> 2: Chnaged V4L2_DPCM_PREDICTOR_ADVANCE to V4L2_DPCM_PREDICTOR_ADVANCED
>>pointed by Sakari.
>>
>>  Documentation/DocBook/media/v4l/controls.xml |   48 
>> +-
>>  drivers/media/v4l2-core/v4l2-ctrls.c |9 +
>>  include/linux/videodev2.h|5 +++
>>  3 files changed, 61 insertions(+), 1 deletions(-)
>>
>> diff --git a/Documentation/DocBook/media/v4l/controls.xml 
>> b/Documentation/DocBook/media/v4l/controls.xml
>> index 93b9c68..f704218 100644
>> --- a/Documentation/DocBook/media/v4l/controls.xml
>> +++ b/Documentation/DocBook/media/v4l/controls.xml
>> @@ -4267,7 +4267,53 @@ interface and may change in the future.
>>  pixels / second.
>>  
>>
>> -  
>> +  
>> +> spanname="id">V4L2_CID_DPCM_PREDICTOR
>> +menu
>> +  
>> +  
>> + Differential pulse-code modulation (DPCM) 
>> is a signal
>> +encoder that uses the baseline of pulse-code modulation (PCM) but 
>> adds some
>> +functionalities based on the prediction of the samples of the 
>> signal. The input
>> +    can be an analog signal or a digital signal.
>> +
>> +If the input is a continuous-time
>> +analog signal, it needs to be sampled first so that a discrete-time 
>> signal is
>> +the input to the DPCM encoder.
> 
> nit: this whole paragraph could fit in 2 lines.
> 
thanks for the catch ,I'll post a v4 fixing this.

Thanks and Regards,
--Prabhakar Lad

>> +
>> +Simple: take the values of two
>> +consecutive samples; if they are analog samples, quantize them; 
>> calculate the
>> +difference between the first one and the next; the output is the 
>> difference, and
>> +it can be further entropy coded.
>> +
>> +Advanced: instead of taking a difference relative to a 
>> previous input sample,
>> +take the difference relative to the output of a local model of the 
>> decoder process;
>> +in this option, the difference can be quantized, which allows a 
>> good way to
>> +incorporate a controlled loss in the encoding.
>> +
>> +Applying one of these two processes, short-term redundancy 
>> (positive correlation of
>> +nearby values) of the signal is eliminated; compression ratios on 
>> the order of 2 to 4
>> +can be achieved if differences are subsequently entropy coded, 
>> because the entropy of
>> +the difference signal is much smaller than that of the original 
>> discrete signal treated
>> +as independent samples.For more information about DPCM see > +
>> url="http://en.wikipedia.org/wiki/Differential_pulse-code_modulation";>Wikipedia.
>> +
>> +  
>> +  
>> +
>> +  
>> +
>> + V4L2_DPCM_PREDICTOR_SIMPLE
>> +  Predictor type is simple
>> +
>> +
>> +  
>> V4L2_DPCM_PREDICTOR_ADVANCED
>> +  Predictor type is advanced
>> +
>> +  
>> +
>> +  
>> +
>>  
>>
>>
>> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
>> b/drivers/media/v4l2-core/v4l2-ctrls.c
>> index b6a2ee7..2d7bc15 100644
>> --- a/drivers/media/v4l2-core/v4l2-

Re: [PATCH] media: v4l2-ctrls: add control for test pattern

2012-09-03 Thread Prabhakar Lad
Hi Hans,

Thanks for the review.

On Monday 03 September 2012 02:52 PM, Hans Verkuil wrote:
> On Mon September 3 2012 11:16:17 Prabhakar Lad wrote:
>> From: Lad, Prabhakar 
>>
>> add V4L2_CID_TEST_PATTERN of type menu, which determines
>> the internal test pattern selected by the device.
>>
>> Signed-off-by: Lad, Prabhakar 
>> Signed-off-by: Manjunath Hadli 
>> Cc: Sakari Ailus 
>> Cc: Hans Verkuil 
>> Cc: Laurent Pinchart 
>> Cc: Mauro Carvalho Chehab 
>> Cc: Sylwester Nawrocki 
>> Cc: Hans de Goede 
>> Cc: Kyungmin Park 
>> Cc: Rob Landley 
>> Cc: HeungJun Kim 
>> Cc: Rob Landley 
>> ---
>>  This patches has one checkpatch warning for line over
>>  80 characters altough it can be avoided I have kept it
>>  for consistency.
>>
>>  Documentation/DocBook/media/v4l/controls.xml |   52 
>> ++
>>  drivers/media/v4l2-core/v4l2-ctrls.c |   16 
>>  include/linux/videodev2.h|   12 ++
>>  3 files changed, 80 insertions(+), 0 deletions(-)
>>
>> diff --git a/Documentation/DocBook/media/v4l/controls.xml 
>> b/Documentation/DocBook/media/v4l/controls.xml
>> index f704218..06f16e7 100644
>> --- a/Documentation/DocBook/media/v4l/controls.xml
>> +++ b/Documentation/DocBook/media/v4l/controls.xml
>> @@ -4313,6 +4313,58 @@ interface and may change in the future.
>>
>>  
>>
>> +  
>> +> spanname="id">V4L2_CID_TEST_PATTERN
>> +menu
>> +  
>> +  
>> + The capture devices/sensors have the 
>> capability to
> 
> Test patterns are also applicable to output devices, not just capture and 
> sensor devices.
> 
Agreed. I'll make it 'capture/display/sensors'.

>> +generate internal test patterns. This test patterns are used to 
>> test a device
>> +is properly working and can generate the desired waveforms that it 
>> supports.
>> +
>> +  
>> +  
>> +
>> +  
>> +
>> + V4L2_TEST_PATTERN_DISABLED
>> +  Test pattern generation is disabled
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_VERTICAL_LINES
>> +  Generate vertical lines as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_HORIZONTAL_LINES
>> +  Generate horizontal lines as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_DIAGONAL_LINES
>> +  Generate diagonal lines as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_SOLID_BLACK
>> +  Generate solid black color as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_SOLID_WHITE
>> +  Generate solid white color as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_SOLID_BLUE
>> +  Generate solid blue color as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_SOLID_RED
>> +  Generate solid red color as test pattern
>> +
> 
> Just wondering: is there no SOLID_GREEN available with this sensor?
> 
Not sure I guess it should be.

Thanks and Regards,
--Prabhakar Lad

> Regards,
> 
>   Hans
> 
>> +
>> +  
>> V4L2_TEST_PATTERN_CHECKER_BOARD
>> +  Generate a checker board as test pattern
>> +
>> +  
>> +
>> +  
>>  
>>  
>>
>> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
>> b/drivers/media/v4l2-core/v4l2-ctrls.c
>> index 2d7bc15..ae709d1 100644
>> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
>> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
>> @@ -430,6 +430,18 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
>>  "Advanced Predictor",
>>  NULL,
>>  };
>> +static const char * const test_pattern[] = {
>> +"Test Pattern Disabled",
>> +"Vertical Lines",
>> +"Horizontal Lines",
>> +"Diagonal Lines",
>> +"Solid Black",
>> +"Solid White",
>> +"Solid Bl

Re: [PATCH] media: v4l2-ctrls: add control for test pattern

2012-09-03 Thread Prabhakar Lad
Hi Sylwester,

Thanks for the review.

On Monday 03 September 2012 02:55 PM, Sylwester Nawrocki wrote:
> On 09/03/2012 11:16 AM, Prabhakar Lad wrote:
>> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
>> b/drivers/media/v4l2-core/v4l2-ctrls.c
>> index 2d7bc15..ae709d1 100644
>> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
>> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
>> @@ -430,6 +430,18 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
>>  "Advanced Predictor",
>>  NULL,
>>  };
>> +static const char * const test_pattern[] = {
>> +"Test Pattern Disabled",
> 
> How about just "Disabled" ?
> 
Ok.

Thanks and Regards,
--Prabhakar Lad

>> +"Vertical Lines",
>> +"Horizontal Lines",
>> +"Diagonal Lines",
>> +"Solid Black",
>> +"Solid White",
>> +"Solid Blue",
>> +"Solid Red",
>> +"Checker Board",
>> +NULL,
>> +};
> 
> --
> 
> Regards,
> Sylwester
> 

--
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] media: v4l2-ctrls: add control for test pattern

2012-09-03 Thread Prabhakar Lad
Hi Sakari,

Thanks for the review.

On Tuesday 04 September 2012 01:09 AM, Sakari Ailus wrote:
> Hi Prabhakar,
> 
> Thanks for the patch.
> 
> On Mon, Sep 03, 2012 at 02:46:17PM +0530, Prabhakar Lad wrote:
>> From: Lad, Prabhakar 
>>
>> add V4L2_CID_TEST_PATTERN of type menu, which determines
>> the internal test pattern selected by the device.
>>
>> Signed-off-by: Lad, Prabhakar 
>> Signed-off-by: Manjunath Hadli 
>> Cc: Sakari Ailus 
>> Cc: Hans Verkuil 
>> Cc: Laurent Pinchart 
>> Cc: Mauro Carvalho Chehab 
>> Cc: Sylwester Nawrocki 
>> Cc: Hans de Goede 
>> Cc: Kyungmin Park 
>> Cc: Rob Landley 
>> Cc: HeungJun Kim 
>> Cc: Rob Landley 
>> ---
>>  This patches has one checkpatch warning for line over
>>  80 characters altough it can be avoided I have kept it
>>  for consistency.
>>
>>  Documentation/DocBook/media/v4l/controls.xml |   52 
>> ++
>>  drivers/media/v4l2-core/v4l2-ctrls.c |   16 
>>  include/linux/videodev2.h|   12 ++
>>  3 files changed, 80 insertions(+), 0 deletions(-)
>>
>> diff --git a/Documentation/DocBook/media/v4l/controls.xml 
>> b/Documentation/DocBook/media/v4l/controls.xml
>> index f704218..06f16e7 100644
>> --- a/Documentation/DocBook/media/v4l/controls.xml
>> +++ b/Documentation/DocBook/media/v4l/controls.xml
>> @@ -4313,6 +4313,58 @@ interface and may change in the future.
>>
>>  
>>
>> +  
>> +> spanname="id">V4L2_CID_TEST_PATTERN
>> +menu
>> +  
>> +  
>> + The capture devices/sensors have the 
>> capability to
>> +generate internal test patterns. This test patterns are used to 
>> test a device
>> +is properly working and can generate the desired waveforms that it 
>> supports.
>> +
>> +  
>> +  
>> +
>> +  
>> +
>> + V4L2_TEST_PATTERN_DISABLED
>> +  Test pattern generation is disabled
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_VERTICAL_LINES
>> +  Generate vertical lines as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_HORIZONTAL_LINES
>> +  Generate horizontal lines as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_DIAGONAL_LINES
>> +  Generate diagonal lines as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_SOLID_BLACK
>> +  Generate solid black color as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_SOLID_WHITE
>> +  Generate solid white color as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_SOLID_BLUE
>> +  Generate solid blue color as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_SOLID_RED
>> +  Generate solid red color as test pattern
>> +
>> +
>> +  
>> V4L2_TEST_PATTERN_CHECKER_BOARD
>> +  Generate a checker board as test pattern
>> +
> 
> You're defining 8 different test patterns based on a single device, I guess? 
> 
No.

> As the test patterns are not standardised, I'd suppose that if another
> driver implements the same control, it would require another n menu items
> added to the same standard menu. That way we'd run quickly out of menu items
> as the maximum is 32.
> 
Agreed the test patterns are not standardized and are hardware
dependent, but this entries which have been added are generally common
across capture/display/sensors.

> For this reason I'd leave the items in the menu up to the driver that
> implements the control, until we have more information on the test patterns
> different devices implement --- as discussed earlier.
> 
Assuming that I only added disable test pattern and if a driver wants to
implement this control and wants add  an item to this menu, on what
basis an entry to this menu will be qualified then ?

Thanks and Regards,
--Prabhakar Lad

> Kind regards,
> 

--
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


<    1   2   3   4   5   6   7   >