Re: [PATCH v2 1/2] media: mt8m111: add device-tree suppport

2014-07-05 Thread Robert Jarzmik
Hi Guennadi,

I just noticed the subject contains a typo, mt8m111 instead of mt9m111. Is there
any other pending comment I'm overlooking before I post the final serie for
m9m111 dt conversion ?

Cheers.

--
Robert
--
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 1/2] media: soc_camera: pxa_camera device-tree support

2014-07-05 Thread Robert Jarzmik
Robert Jarzmik robert.jarz...@free.fr writes:

Hi Guennadi, Mark,

Can I consider my work done for this serie, or am I forgetting pending comments
? If done, an ack from Mark would be good.

Cheers.

--
Robert
--
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/3] DocBook media: fix wrong spacing

2014-07-05 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

There shouldn't be any spaces after constant or before /constant.
This leads to ugly results like: 'image size set by VIDIOC_S_FMT .'

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 Documentation/DocBook/media/v4l/selection-api.xml  | 95 +++---
 .../DocBook/media/v4l/vidioc-g-selection.xml   | 40 +
 2 files changed, 66 insertions(+), 69 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/selection-api.xml 
b/Documentation/DocBook/media/v4l/selection-api.xml
index 4c238ce..28cbded 100644
--- a/Documentation/DocBook/media/v4l/selection-api.xml
+++ b/Documentation/DocBook/media/v4l/selection-api.xml
@@ -86,47 +86,47 @@ selection targets available for a video capture device.  It 
is recommended to
 configure the cropping targets before to the composing targets./para
 
 paraThe range of coordinates of the top left corner, width and height of
-areas that can be sampled is given by the constant V4L2_SEL_TGT_CROP_BOUNDS
-/constant target. It is recommended for the driver developers to put the
-top/left corner at position constant (0,0) /constant.  The rectangle's
+areas that can be sampled is given by the 
constantV4L2_SEL_TGT_CROP_BOUNDS/constant
+target. It is recommended for the driver developers to put the
+top/left corner at position constant(0,0)/constant.  The rectangle's
 coordinates are expressed in pixels./para
 
 paraThe top left corner, width and height of the source rectangle, that is
-the area actually sampled, is given by the constant V4L2_SEL_TGT_CROP
-/constant target. It uses the same coordinate system as constant
-V4L2_SEL_TGT_CROP_BOUNDS /constant. The active cropping area must lie
-completely inside the capture boundaries. The driver may further adjust the
-requested size and/or position according to hardware limitations./para
+the area actually sampled, is given by the 
constantV4L2_SEL_TGT_CROP/constant
+target. It uses the same coordinate system as 
constantV4L2_SEL_TGT_CROP_BOUNDS/constant.
+The active cropping area must lie completely inside the capture boundaries. The
+driver may further adjust the requested size and/or position according to 
hardware
+limitations./para
 
 paraEach capture device has a default source rectangle, given by the
-constant V4L2_SEL_TGT_CROP_DEFAULT /constant target. This rectangle shall
+constantV4L2_SEL_TGT_CROP_DEFAULT/constant target. This rectangle shall
 over what the driver writer considers the complete picture.  Drivers shall set
 the active crop rectangle to the default when the driver is first loaded, but
 not later./para
 
 paraThe composing targets refer to a memory buffer. The limits of composing
-coordinates are obtained using constant V4L2_SEL_TGT_COMPOSE_BOUNDS
-/constant.  All coordinates are expressed in pixels. The rectangle's top/left
-corner must be located at position constant (0,0) /constant. The width and
-height are equal to the image size set by constant VIDIOC_S_FMT /constant.
+coordinates are obtained using 
constantV4L2_SEL_TGT_COMPOSE_BOUNDS/constant.
+All coordinates are expressed in pixels. The rectangle's top/left
+corner must be located at position constant(0,0)/constant. The width and
+height are equal to the image size set by constantVIDIOC_S_FMT/constant.
 /para
 
 paraThe part of a buffer into which the image is inserted by the hardware is
-controlled by the constant V4L2_SEL_TGT_COMPOSE /constant target.
+controlled by the constantV4L2_SEL_TGT_COMPOSE/constant target.
 The rectangle's coordinates are also expressed in the same coordinate system as
 the bounds rectangle. The composing rectangle must lie completely inside bounds
 rectangle. The driver must adjust the composing rectangle to fit to the
 bounding limits. Moreover, the driver can perform other adjustments according
 to hardware limitations. The application can control rounding behaviour using
-link linkend=v4l2-selection-flags constraint flags /link./para
+link linkend=v4l2-selection-flags constraint flags/link./para
 
 paraFor capture devices the default composing rectangle is queried using
-constant V4L2_SEL_TGT_COMPOSE_DEFAULT /constant. It is usually equal to the
+constantV4L2_SEL_TGT_COMPOSE_DEFAULT/constant. It is usually equal to the
 bounding rectangle./para
 
 paraThe part of a buffer that is modified by the hardware is given by
-constant V4L2_SEL_TGT_COMPOSE_PADDED /constant. It contains all pixels
-defined using constant V4L2_SEL_TGT_COMPOSE /constant plus all
+constantV4L2_SEL_TGT_COMPOSE_PADDED/constant. It contains all pixels
+defined using constantV4L2_SEL_TGT_COMPOSE/constant plus all
 padding data modified by hardware during insertion process. All pixels outside
 this rectangle emphasismust not/emphasis be changed by the hardware. The
 content of pixels that lie inside the padded area but outside active area is
@@ -140,52 +140,51 @@ where the rubbish pixels are located and remove them if 
needed./para
titleConfiguration of video output/title
 
 paraFor 

[PATCH 2/3] DocBook media: add missing dqevent src_change field.

2014-07-05 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

The v4l2_event union has a new src_change field, but that was never
added to the VIDIOC_DQEVENT documentation of that union. Fixed.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 Documentation/DocBook/media/v4l/vidioc-dqevent.xml | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml 
b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml
index 820f86e..9ca2d08 100644
--- a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml
@@ -94,6 +94,12 @@
  /row
  row
entry/entry
+   entryv4l2-event-src-change;/entry
+entrystructfieldsrc_change/structfield/entry
+   entryEvent data for event V4L2_EVENT_SOURCE_CHANGE./entry
+ /row
+ row
+   entry/entry
entry__u8/entry
 entrystructfielddata/structfield[64]/entry
entryEvent data. Defined by the event type. The union
-- 
2.0.0

--
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: No audio support in struct v4l2_subdev_format

2014-07-05 Thread Hans Verkuil
On 07/04/2014 01:38 PM, Divneil Wadhawan wrote:
 Hi Hans,
 
 
 
 It should generate an initial SOURCE_CHANGE event with 'changes' set to
 V4L2_EVENT_SRC_CH_RESOLUTION. That way the application that just subscribed 
 to this
 event with V4L2_EVENT_SUB_FL_SEND_INITIAL will get an initial event.
 
 Just checked in 3.10 which I am using, this is for the control events.
 
 So, I will check in detail and in case fits our case, will reuse the part in 
 my code.
 
 
 I hate to say this, but I have no idea what you mean. Can you show some code?
 
 
 static int hdmirx_evt_add(struct v4l2_subscribed_event *sev, unsigned elems)
 {
 struct v4l2_fh *fh = sev-fh;
 struct v4l2_subdev *sd = vdev_to_v4l2_subdev(fh-vdev);
 struct hdmirx_ctx_s *hdmirx_ctx = v4l2_get_subdevdata(sd);
 
 
 ...
 
 
 list_add_tail(sev-node, hdmirx_ctx-subs_list);
 
 
 
 
 
 return 0;
 }
 
 
 static void hdmirx_evt_del(struct v4l2_subscribed_event *sev)
 {
 struct v4l2_fh *fh = sev-fh;
 struct v4l2_subdev *sd = vdev_to_v4l2_subdev(fh-vdev);
 struct hdmirx_ctx_s *hdmirx_ctx = v4l2_get_subdevdata(sd);
 
 
 
 .
 
 
 list_del(sev-node);
 
 
 ..
 
 }
 
 
 
 struct v4l2_subscribed_event_ops hdmirx_event_ops = {
 .add = hdmirx_status_evt_add,
 .del = hdmirx_status_evt_del,
 .replace = v4l2_ctrl_replace,
 .merge = v4l2_ctrl_merge,
 };
 
 
 
 hdmi_core_subscribe_event()
 
 {
 
 
 
  ret = v4l2_event_subscribe(fh, sub,
  HDMIRX_EVENT_QUEUE_DEPTH, hdmirx_event_ops);
 
 
 }
 
 
 static const struct v4l2_subdev_core_ops hdmirx_subdev_core_ops = {
 .ioctl =  xxx
 .subscribe_event = hdmirx_core_subscribe_event,
 
 ...
 
 }

Very weird code. If you want to support events all you have to do is this:

int my_subdev_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
 struct v4l2_event_subscription *sub)
{
switch (sub-type) {
case V4L2_EVENT_CTRL:
return v4l2_ctrl_subdev_subscribe_event(sd, fh, sub);
case V4L2_EVENT_SOURCE_CHANGE:
return v4l2_src_change_event_subdev_subscribe(sd, fh, sub);
...
default:
return -EINVAL;
}
}

Since your QUEUE_DEPTH event is custom and I have no idea what it does, I also
can't say if you really need event_ops, but it seems very peculiar. It is almost
certainly wrong what you are doing.

Regards,

Hans

 
 
 v4l2_event_subscribe() takes the 4th arg as the event_ops. ctrl and 
 source_change events are not allowing 
 
 to override ops. It can be like:
 
 int v4l2_ctrl_subdev_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh 
 *fh,
  struct v4l2_event_subscription *sub, xxx 
 )
 
 {
 
 if (!xxx)
 
  default ops as open source
 
 
 }
 
 
 
 But shouldn't that be handled by an alsa driver? That's what someone has to
 figure out: what goes in alsa and what still has to be provided by V4L2. For 
 HDMI
 output in e.g. an nvidia card the audio is fully handled by alsa AFAIK.
 
 Okay, I will come back on this later.
 
 Let's see if I can do something better with the event handling.
 
 
 Regards,
 
 Divneil --
 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
 

--
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/3] DocBook media: fix incorrect header reference

2014-07-05 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

The text referred to videodev.h when videodev2.h was meant. Fixed.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 Documentation/DocBook/media/v4l/pixfmt.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml 
b/Documentation/DocBook/media/v4l/pixfmt.xml
index 91dcbc8..a01f8b5 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -248,7 +248,7 @@ has just as many pad bytes after it as the other 
rows./para
 
 paraIn V4L2 each format has an identifier which looks like
 constantPIX_FMT_XXX/constant, defined in the link
-linkend=videodevvideodev.h/link header file. These identifiers
+linkend=videodevvideodev2.h/link header file. These identifiers
 represent link linkend=v4l2-fourccfour character (FourCC) codes/link
 which are also listed below, however they are not the same as those
 used in the Windows world./para
-- 
2.0.0

--
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] hdpvr: fix reported HDTV colorspace

2014-07-05 Thread Hans Verkuil
The colorspace for HDTV is REC709, not SMPTE240M.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com

diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c 
b/drivers/media/usb/hdpvr/hdpvr-video.c
index 0500c417..f379e50 100644
--- a/drivers/media/usb/hdpvr/hdpvr-video.c
+++ b/drivers/media/usb/hdpvr/hdpvr-video.c
@@ -1029,7 +1029,7 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void 
*_fh,
f-fmt.pix.field = V4L2_FIELD_INTERLACED;
} else {
/* HDTV formats */
-   f-fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE240M;
+   f-fmt.pix.colorspace = V4L2_COLORSPACE_REC709;
f-fmt.pix.field = V4L2_FIELD_NONE;
}
return 0;
--
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


Looking for Asus My Cinema U3000 (not Mini and not Hybrid) owners

2014-07-05 Thread Raimonds Cicans

Hello.

I am looking for Asus My Cinema U3000 (not Mini and not Hybrid) owners.
I am looking for device with USB VendorId:DeviceId = 0b05:1713

I am trying to write device driver for this device,
but unfortunately I bricked mine.

How can you help:

1) donate your device

or

2) send me dump of device's memory chip (ATMEL 24C128N) contents
Dump can be created at electronic repair shop or I can try to write dump 
tool


or

3) sell your device



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


rcar-vin soc-camera device tree updates

2014-07-05 Thread Ben Dooks
This is a new patch, with most of the issues from the previous
reviews now fixed. If there is anything that I have missed then
please let me know.

The only issues remaining is what to do about multiple subdevices
and/or multiple ports on drivers. I have yet to do either of erroring
out or supporting them. Feedback on this issue is welcome.

--
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/6] adv7180: Remove duplicate unregister call

2014-07-05 Thread Ben Dooks
From: Ian Molton ian.mol...@codethink.co.uk

This driver moved over to v4l2_async_unregister_subdev()
but still retained a call to v4l2_unregister_subdev(). Remove.

Signed-off-by: Ian Molton ian.mol...@codethink.co.uk
Signed-off-by: Ben Dooks ben.do...@codethink.co.uk
---
 drivers/media/i2c/adv7180.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index ac1cdbe..821178d 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -663,7 +663,6 @@ static int adv7180_remove(struct i2c_client *client)
if (state-irq  0)
free_irq(client-irq, state);
 
-   v4l2_device_unregister_subdev(sd);
adv7180_exit_controls(state);
mutex_destroy(state-mutex);
return 0;
-- 
2.0.0

--
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/6] rcar_vin: copy flags from pdata

2014-07-05 Thread Ben Dooks
The platform data is a single word, so simply copy
it into the device's private data structure than
keeping a copy of the pointer.

This will make changing to device-tree binding
easier as it is one allocation instead of two.

Signed-off-by: Ben Dooks ben.do...@codethink.co.uk
---
 drivers/media/platform/soc_camera/rcar_vin.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/soc_camera/rcar_vin.c 
b/drivers/media/platform/soc_camera/rcar_vin.c
index e594230..7c4299d 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -126,13 +126,13 @@ struct rcar_vin_priv {
int sequence;
/* State of the VIN module in capturing mode */
enum rcar_vin_state state;
-   struct rcar_vin_platform_data   *pdata;
struct soc_camera_host  ici;
struct list_headcapture;
 #define MAX_BUFFER_NUM 3
struct vb2_buffer   *queue_buf[MAX_BUFFER_NUM];
struct vb2_alloc_ctx*alloc_ctx;
enum v4l2_field field;
+   unsigned intpdata_flags;
unsigned intvb_count;
unsigned intnr_hw_slots;
boolrequest_to_stop;
@@ -275,12 +275,12 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
break;
case V4L2_MBUS_FMT_YUYV8_2X8:
/* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */
-   vnmc |= priv-pdata-flags  RCAR_VIN_BT656 ?
+   vnmc |= priv-pdata_flags  RCAR_VIN_BT656 ?
VNMC_INF_YUV8_BT656 : VNMC_INF_YUV8_BT601;
break;
case V4L2_MBUS_FMT_YUYV10_2X10:
/* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */
-   vnmc |= priv-pdata-flags  RCAR_VIN_BT656 ?
+   vnmc |= priv-pdata_flags  RCAR_VIN_BT656 ?
VNMC_INF_YUV10_BT656 : VNMC_INF_YUV10_BT601;
break;
default:
@@ -797,7 +797,7 @@ static int rcar_vin_set_bus_param(struct soc_camera_device 
*icd)
/* Make choises, based on platform preferences */
if ((common_flags  V4L2_MBUS_HSYNC_ACTIVE_HIGH) 
(common_flags  V4L2_MBUS_HSYNC_ACTIVE_LOW)) {
-   if (priv-pdata-flags  RCAR_VIN_HSYNC_ACTIVE_LOW)
+   if (priv-pdata_flags  RCAR_VIN_HSYNC_ACTIVE_LOW)
common_flags = ~V4L2_MBUS_HSYNC_ACTIVE_HIGH;
else
common_flags = ~V4L2_MBUS_HSYNC_ACTIVE_LOW;
@@ -805,7 +805,7 @@ static int rcar_vin_set_bus_param(struct soc_camera_device 
*icd)
 
if ((common_flags  V4L2_MBUS_VSYNC_ACTIVE_HIGH) 
(common_flags  V4L2_MBUS_VSYNC_ACTIVE_LOW)) {
-   if (priv-pdata-flags  RCAR_VIN_VSYNC_ACTIVE_LOW)
+   if (priv-pdata_flags  RCAR_VIN_VSYNC_ACTIVE_LOW)
common_flags = ~V4L2_MBUS_VSYNC_ACTIVE_HIGH;
else
common_flags = ~V4L2_MBUS_VSYNC_ACTIVE_LOW;
@@ -1445,7 +1445,7 @@ static int rcar_vin_probe(struct platform_device *pdev)
priv-ici.drv_name = dev_name(pdev-dev);
priv-ici.ops = rcar_vin_host_ops;
 
-   priv-pdata = pdata;
+   priv-pdata_flags = pdata-flags;
priv-chip = pdev-id_entry-driver_data;
spin_lock_init(priv-lock);
INIT_LIST_HEAD(priv-capture);
-- 
2.0.0

--
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/6] [V3] soc_camera: add support for dt binding soc_camera drivers

2014-07-05 Thread Ben Dooks
Add initial support for OF based soc-camera devices that may be used
by any of the soc-camera drivers. The driver itself will need converting
to use OF.

These changes allow the soc-camera driver to do the connecting of any
async capable v4l2 device to the soc-camera driver. This has currently
been tested on the Renesas Lager board.

It currently only supports one input device per driver as this seems
to be the standard connection for these devices.

Signed-off-by: Ben Dooks ben.do...@codethink.co.uk
---

Fixes since v1:
- Fix i2c mclk name compatible with other drivers
- Ensure of_node is put after use
Fixes since v2:
- Updated freeing of dyn-pdev as requested
- Coding style fixes
- Allocate initial resources in one go
---
 drivers/media/platform/soc_camera/soc_camera.c | 123 -
 1 file changed, 122 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/soc_camera/soc_camera.c 
b/drivers/media/platform/soc_camera/soc_camera.c
index 7fec8cd..e25fc8e 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -36,6 +36,7 @@
 #include media/v4l2-common.h
 #include media/v4l2-ioctl.h
 #include media/v4l2-dev.h
+#include media/v4l2-of.h
 #include media/videobuf-core.h
 #include media/videobuf2-core.h
 
@@ -1581,6 +1582,124 @@ static void scan_async_host(struct soc_camera_host *ici)
 #define scan_async_host(ici)   do {} while (0)
 #endif
 
+#ifdef CONFIG_OF
+
+struct soc_of_info {
+   struct soc_camera_async_subdev  sasd;
+   struct v4l2_async_subdev*subdevs[2];
+};
+
+static int soc_of_bind(struct soc_camera_host *ici,
+  struct device_node *ep,
+  struct device_node *remote)
+{
+   struct soc_camera_device *icd;
+   struct soc_camera_desc sdesc = {.host_desc.bus_id = ici-nr,};
+   struct soc_camera_async_client *sasc;
+   struct soc_of_info *info;
+   struct i2c_client *client;
+   char clk_name[V4L2_SUBDEV_NAME_SIZE];
+   int ret;
+
+   /* allocate a new subdev and add match info to it */
+   info = devm_kzalloc(ici-v4l2_dev.dev, sizeof(struct soc_of_info),
+   GFP_KERNEL);
+   if (!info)
+   return -ENOMEM;
+
+   info-sasd.asd.match.of.node = remote;
+   info-sasd.asd.match_type = V4L2_ASYNC_MATCH_OF;
+   info-subdevs[0] = info-sasd.asd;
+
+   /* Or shall this be managed by the soc-camera device? */
+   sasc = devm_kzalloc(ici-v4l2_dev.dev, sizeof(*sasc), GFP_KERNEL);
+   if (!sasc)
+   return -ENOMEM;
+
+   /* HACK: just need a != NULL */
+   sdesc.host_desc.board_info = ERR_PTR(-ENODATA);
+
+   ret = soc_camera_dyn_pdev(sdesc, sasc);
+   if (ret  0)
+   goto eallocpdev;
+
+   sasc-sensor = info-sasd.asd;
+
+   icd = soc_camera_add_pdev(sasc);
+   if (!icd) {
+   ret = -ENOMEM;
+   goto eaddpdev;
+   }
+
+   sasc-notifier.subdevs = info-subdevs;
+   sasc-notifier.num_subdevs = 1;
+   sasc-notifier.bound = soc_camera_async_bound;
+   sasc-notifier.unbind = soc_camera_async_unbind;
+   sasc-notifier.complete = soc_camera_async_complete;
+
+   icd-sasc = sasc;
+   icd-parent = ici-v4l2_dev.dev;
+
+   client = of_find_i2c_device_by_node(remote);
+
+   if (client)
+   snprintf(clk_name, sizeof(clk_name), %d-%04x,
+client-adapter-nr, client-addr);
+   else
+   snprintf(clk_name, sizeof(clk_name), of-%s,
+of_node_full_name(remote));
+
+   icd-clk = v4l2_clk_register(soc_camera_clk_ops, clk_name, mclk, 
icd);
+   if (IS_ERR(icd-clk)) {
+   ret = PTR_ERR(icd-clk);
+   goto eclkreg;
+   }
+
+   ret = v4l2_async_notifier_register(ici-v4l2_dev, sasc-notifier);
+   if (!ret)
+   return 0;
+eclkreg:
+   icd-clk = NULL;
+   platform_device_del(sasc-pdev);
+eaddpdev:
+   platform_device_put(sasc-pdev);
+eallocpdev:
+   devm_kfree(ici-v4l2_dev.dev, sasc);
+   dev_err(ici-v4l2_dev.dev, group probe failed: %d\n, ret);
+
+   return ret;
+}
+
+static void scan_of_host(struct soc_camera_host *ici)
+{
+   struct device_node *np = ici-v4l2_dev.dev-of_node;
+   struct device_node *epn = NULL;
+   struct device_node *ren;
+
+   while (true) {
+   epn = of_graph_get_next_endpoint(np, epn);
+   if (!epn)
+   break;
+
+   ren = of_graph_get_remote_port(epn);
+   if (!ren) {
+   pr_info(%s: no remote for %s\n,
+   __func__,  of_node_full_name(epn));
+   continue;
+   }
+
+   /* so we now have a remote node to connect */
+   soc_of_bind(ici, epn, ren-parent);
+
+   of_node_put(epn);
+ 

[PATCH 6/6] [PATCH v2] ARM: lager: add vin1 node

2014-07-05 Thread Ben Dooks
Add device-tree for vin1 (composite video in) on the
lager board.

Signed-off-by: Ben Dooks ben.do...@codethink.co.uk
---

Fixes since v1:
- Whitespace fixes as suggested by Sergei
---
 arch/arm/boot/dts/r8a7790-lager.dts | 36 
 1 file changed, 36 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7790-lager.dts 
b/arch/arm/boot/dts/r8a7790-lager.dts
index 4805c9f..e00543b 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -214,6 +214,11 @@
renesas,groups = i2c2;
renesas,function = i2c2;
};
+
+   vin1_pins: vin {
+   renesas,groups = vin1_data8, vin1_clk;
+   renesas,function = vin1;
+   };
 };
 
 ether {
@@ -342,8 +347,39 @@
status = ok;
pinctrl-0 = i2c2_pins;
pinctrl-names = default;
+
+   composite-in@20 {
+   compatible = adi,adv7180;
+   reg = 0x20;
+   remote = vin1;
+
+   port {
+   adv7180: endpoint {
+   bus-width = 8;
+   remote-endpoint = vin1ep0;
+   };
+   };
+   };
 };
 
 i2c3  {
status = ok;
 };
+
+/* composite video input */
+vin1 {
+   pinctrl-0 = vin1_pins;
+   pinctrl-names = default;
+
+   status = ok;
+
+   port {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   vin1ep0: endpoint {
+   remote-endpoint = adv7180;
+   bus-width = 8;
+   };
+   };
+};
-- 
2.0.0

--
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/6] r8a7790.dtsi: add vin[0-3] nodes

2014-07-05 Thread Ben Dooks
Add nodes for the four video input channels on the R8A7790.

Signed-off-by: Ben Dooks ben.do...@codethink.co.uk
---
 arch/arm/boot/dts/r8a7790.dtsi | 36 
 1 file changed, 36 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 7ff2960..a6f083d 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -33,6 +33,10 @@
spi2 = msiof1;
spi3 = msiof2;
spi4 = msiof3;
+   vin0 = vin0;
+   vin1 = vin1;
+   vin2 = vin2;
+   vin3 = vin3;
};
 
cpus {
@@ -462,6 +466,38 @@
status = disabled;
};
 
+   vin0: vin@e6ef {
+   compatible = renesas,vin-r8a7790;
+   clocks = mstp8_clks R8A7790_CLK_VIN0;
+   reg = 0 0xe6ef 0 0x1000;
+   interrupts = 0 188 IRQ_TYPE_LEVEL_HIGH;
+   status = disabled;
+   };
+
+   vin1: vin@e6ef1000 {
+   compatible = renesas,vin-r8a7790;
+   clocks = mstp8_clks R8A7790_CLK_VIN1;
+   reg = 0 0xe6ef1000 0 0x1000;
+   interrupts = 0 189 IRQ_TYPE_LEVEL_HIGH;
+   status = disabled;
+   };
+
+   vin2: vin@e6ef2000 {
+   compatible = renesas,vin-r8a7790;
+   clocks = mstp8_clks R8A7790_CLK_VIN2;
+   reg = 0 0xe6ef2000 0 0x1000;
+   interrupts = 0 190 IRQ_TYPE_LEVEL_HIGH;
+   status = disabled;
+   };
+
+   vin3: vin@e6ef3000 {
+   compatible = renesas,vin-r8a7790;
+   clocks = mstp8_clks R8A7790_CLK_VIN3;
+   reg = 0 0xe6ef3000 0 0x1000;
+   interrupts = 0 191 IRQ_TYPE_LEVEL_HIGH;
+   status = disabled;
+   };
+
clocks {
#address-cells = 2;
#size-cells = 2;
-- 
2.0.0

--
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/6] rcar_vin: add devicetree support

2014-07-05 Thread Ben Dooks
Add support for devicetree probe for the rcar-vin
driver.

Signed-off-by: Ben Dooks ben.do...@codethink.co.uk
---
 .../devicetree/bindings/media/rcar_vin.txt | 86 ++
 drivers/media/platform/soc_camera/rcar_vin.c   | 72 --
 2 files changed, 151 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/rcar_vin.txt

diff --git a/Documentation/devicetree/bindings/media/rcar_vin.txt 
b/Documentation/devicetree/bindings/media/rcar_vin.txt
new file mode 100644
index 000..10fefa9
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/rcar_vin.txt
@@ -0,0 +1,86 @@
+Renesas RCar Video Input driver (rcar_vin)
+--
+
+The rcar_vin device provides video input capabilities for the Renesas R-Car
+family of devices. The current blocks are always slaves and suppot one input
+channel which can be either RGB, YUYV or BT656.
+
+ - compatible: Must be one of the following
+   - renesas,vin-r8a7791 for the R8A7791 device
+   - renesas,vin-r8a7790 for the R8A7790 device
+   - renesas,vin-r8a7779 for the R8A7779 device
+   - renesas,vin-r8a7778 for the R8A7778 device
+ - reg: the register base and size for the device registers
+ - interrupts: the interrupt for the device
+ - clocks: Reference to the parent clock
+
+Additionally, an alias named vinX will need to be created to specify
+which video input device this is.
+
+The per-board settings:
+ - port sub-node describing a single endpoint connected to the vin
+   as described in video-interfaces.txt[1]. Only the first one will
+   be considered as each vin interface has one input port.
+
+   These settings are used to work out video input format and widths
+   into the system.
+
+
+Device node example
+---
+
+   aliases {
+  vin0 = vin0;
+   };
+
+vin0: vin@0xe6ef {
+compatible = renesas,vin-r8a7790;
+clocks = mstp8_clks R8A7790_CLK_VIN0;
+reg = 0 0xe6ef 0 0x1000;
+interrupts = 0 188 IRQ_TYPE_LEVEL_HIGH;
+status = disabled;
+};
+
+Board setup example (vin1 composite video input)
+
+
+i2c2   {
+status = ok;
+pinctrl-0 = i2c2_pins;
+pinctrl-names = default;
+
+adv7180@020 {
+compatible = adi,adv7180;
+reg = 0x20;
+remote = vin1;
+
+port {
+adv7180: endpoint {
+bus-width = 8;
+remote-endpoint = vin1ep0;
+};
+};
+};
+};
+
+/* composite video input */
+vin1 {
+pinctrl-0 = vin1_pins;
+pinctrl-names = default;
+
+status = ok;
+
+port {
+#address-cells = 1;
+#size-cells = 0;
+
+vin1ep0: endpoint {
+remote-endpoint = adv7180;
+bus-width = 8;
+};
+};
+};
+
+
+
+[1] video-interfaces.txt common video media interface
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c 
b/drivers/media/platform/soc_camera/rcar_vin.c
index 7c4299d..eb196ef 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -24,6 +24,8 @@
 #include linux/pm_runtime.h
 #include linux/slab.h
 #include linux/videodev2.h
+#include linux/of.h
+#include linux/of_device.h
 
 #include media/soc_camera.h
 #include media/soc_mediabus.h
@@ -32,6 +34,7 @@
 #include media/v4l2-device.h
 #include media/v4l2-mediabus.h
 #include media/v4l2-subdev.h
+#include media/v4l2-of.h
 #include media/videobuf2-dma-contig.h
 
 #include soc_scale_crop.h
@@ -1390,6 +1393,17 @@ static struct soc_camera_host_ops rcar_vin_host_ops = {
.init_videobuf2 = rcar_vin_init_videobuf2,
 };
 
+#ifdef CONFIG_OF
+static struct of_device_id rcar_vin_of_table[] = {
+   { .compatible = renesas,vin-r8a7791, .data = (void *)RCAR_GEN2 },
+   { .compatible = renesas,vin-r8a7790, .data = (void *)RCAR_GEN2 },
+   { .compatible = renesas,vin-r8a7779, .data = (void *)RCAR_H1 },
+   { .compatible = renesas,vin-r8a7778, .data = (void *)RCAR_M1 },
+   { },
+};
+MODULE_DEVICE_TABLE(of, rcar_vin_of_table);
+#endif
+
 static struct platform_device_id rcar_vin_id_table[] = {
{ r8a7791-vin,  RCAR_GEN2 },
{ r8a7790-vin,  RCAR_GEN2 },
@@ -1402,15 +1416,52 @@ MODULE_DEVICE_TABLE(platform, rcar_vin_id_table);
 
 static int rcar_vin_probe(struct platform_device *pdev)
 {
+   const struct of_device_id *match = NULL;
struct rcar_vin_priv *priv;
struct resource *mem;
struct rcar_vin_platform_data *pdata;
+   unsigned int pdata_flags;
int irq, ret;
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata || !pdata-flags) {
-   dev_err(pdev-dev, 

cron job: media_tree daily build: OK

2014-07-05 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Sun Jul  6 04:00:29 CEST 2014
git branch: test
git hash:   ff792c85e60727e66774eb3da8129298690eab0c
gcc version:i686-linux-gcc (GCC) 4.8.2
sparse version: v0.5.0-14-gf11dd94
host hardware:  x86_64
host os:3.14-5.slh.5-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.31.14-i686: OK
linux-2.6.32.27-i686: OK
linux-2.6.33.7-i686: OK
linux-2.6.34.7-i686: OK
linux-2.6.35.9-i686: OK
linux-2.6.36.4-i686: OK
linux-2.6.37.6-i686: OK
linux-2.6.38.8-i686: OK
linux-2.6.39.4-i686: OK
linux-3.0.60-i686: OK
linux-3.1.10-i686: OK
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: OK
linux-3.7.4-i686: OK
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12.23-i686: OK
linux-3.13.11-i686: OK
linux-3.14.9-i686: OK
linux-3.15.2-i686: OK
linux-3.16-rc1-i686: OK
linux-2.6.31.14-x86_64: OK
linux-2.6.32.27-x86_64: OK
linux-2.6.33.7-x86_64: OK
linux-2.6.34.7-x86_64: OK
linux-2.6.35.9-x86_64: OK
linux-2.6.36.4-x86_64: OK
linux-2.6.37.6-x86_64: OK
linux-2.6.38.8-x86_64: OK
linux-2.6.39.4-x86_64: OK
linux-3.0.60-x86_64: OK
linux-3.1.10-x86_64: OK
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: OK
linux-3.7.4-x86_64: OK
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: OK
linux-3.12.23-x86_64: OK
linux-3.13.11-x86_64: OK
linux-3.14.9-x86_64: OK
linux-3.15.2-x86_64: OK
linux-3.16-rc1-x86_64: OK
apps: OK
spec-git: OK
sparse: WARNINGS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
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