All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/8] Lager/Koelsch board HDMI input support
@ 2016-05-11 14:02 Ulrich Hecht
  2016-05-11 14:02 ` [PATCH v4 1/8] v4l: subdev: Add pad config allocator and init Ulrich Hecht
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Ulrich Hecht @ 2016-05-11 14:02 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle, Ulrich Hecht

Hi!

This series implements Lager/Koelsch HDMI input support on top of version 6
of Niklas's rcar-vin rewrite ("[PATCHv6] [media] rcar-vin: add Renesas R-Car
VIN driver").

This revision addresses the issues found in Hans Verkuil's review of the series
(except for the EDID intialization, which I have left in), and adds his Koelsch
support patch.

CU
Uli


Changes since v3:
- rvin_enum_dv_timings(): use vin->src_pad_idx
- rvin_dv_timings_cap(): likewise
- rvin_s_dv_timings(): update vin->format
- add Koelsch support

Changes since v2:
- rebased on top of rcar-vin driver v4
- removed "adv7604: fix SPA register location for ADV7612" (picked up)
- changed prefix of dts patch to "ARM: dts: lager: "


Hans Verkuil (1):
  r8a7791-koelsch.dts: add HDMI input

Laurent Pinchart (1):
  v4l: subdev: Add pad config allocator and init

Ulrich Hecht (4):
  media: rcar_vin: Use correct pad number in try_fmt
  media: rcar-vin: pad-aware driver initialisation
  media: rcar-vin: add DV timings support
  media: rcar-vin: initialize EDID data

William Towle (2):
  media: adv7604: automatic "default-input" selection
  ARM: dts: lager: Add entries for VIN HDMI input support

 arch/arm/boot/dts/r8a7790-lager.dts         |  39 +++++++
 arch/arm/boot/dts/r8a7791-koelsch.dts       |  41 ++++++++
 drivers/media/i2c/adv7604.c                 |  18 +++-
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 158 +++++++++++++++++++++++++++-
 drivers/media/platform/rcar-vin/rcar-vin.h  |   2 +
 drivers/media/v4l2-core/v4l2-subdev.c       |  19 +++-
 include/media/v4l2-subdev.h                 |  10 ++
 7 files changed, 282 insertions(+), 5 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v4 1/8] v4l: subdev: Add pad config allocator and init
  2016-05-11 14:02 [PATCH v4 0/8] Lager/Koelsch board HDMI input support Ulrich Hecht
@ 2016-05-11 14:02 ` Ulrich Hecht
  2016-05-13  8:28   ` Hans Verkuil
  2016-05-11 14:02 ` [PATCH v4 2/8] media: adv7604: automatic "default-input" selection Ulrich Hecht
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Ulrich Hecht @ 2016-05-11 14:02 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle, Laurent Pinchart

From: Laurent Pinchart <laurent.pinchart@linaro.org>

Add a new subdev operation to initialize a subdev pad config array, and
a helper function to allocate and initialize the array. This can be used
by bridge drivers to implement try format based on subdev pad
operations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@linaro.org>
Acked-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/v4l2-core/v4l2-subdev.c | 19 ++++++++++++++++++-
 include/media/v4l2-subdev.h           | 10 ++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index d630838..f32ac0d 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -35,7 +35,7 @@
 static int subdev_fh_init(struct v4l2_subdev_fh *fh, struct v4l2_subdev *sd)
 {
 #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
-	fh->pad = kzalloc(sizeof(*fh->pad) * sd->entity.num_pads, GFP_KERNEL);
+	fh->pad = v4l2_subdev_alloc_pad_config(sd);
 	if (fh->pad == NULL)
 		return -ENOMEM;
 #endif
@@ -569,6 +569,23 @@ int v4l2_subdev_link_validate(struct media_link *link)
 		sink, link, &source_fmt, &sink_fmt);
 }
 EXPORT_SYMBOL_GPL(v4l2_subdev_link_validate);
+
+struct v4l2_subdev_pad_config *v4l2_subdev_alloc_pad_config(struct v4l2_subdev *sd)
+{
+	struct v4l2_subdev_pad_config *cfg;
+
+	if (!sd->entity.num_pads)
+		return NULL;
+
+	cfg = kcalloc(sd->entity.num_pads, sizeof(*cfg), GFP_KERNEL);
+	if (!cfg)
+		return NULL;
+
+	v4l2_subdev_call(sd, pad, init_cfg, cfg);
+
+	return cfg;
+}
+EXPORT_SYMBOL_GPL(v4l2_subdev_alloc_pad_config);
 #endif /* CONFIG_MEDIA_CONTROLLER */
 
 void v4l2_subdev_init(struct v4l2_subdev *sd, const struct v4l2_subdev_ops *ops)
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 11e2dfe..6c47cdd 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -607,6 +607,8 @@ struct v4l2_subdev_pad_config {
  *                  may be adjusted by the subdev driver to device capabilities.
  */
 struct v4l2_subdev_pad_ops {
+	void (*init_cfg)(struct v4l2_subdev *sd,
+			 struct v4l2_subdev_pad_config *cfg);
 	int (*enum_mbus_code)(struct v4l2_subdev *sd,
 			      struct v4l2_subdev_pad_config *cfg,
 			      struct v4l2_subdev_mbus_code_enum *code);
@@ -801,7 +803,15 @@ int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd,
 				      struct v4l2_subdev_format *source_fmt,
 				      struct v4l2_subdev_format *sink_fmt);
 int v4l2_subdev_link_validate(struct media_link *link);
+
+struct v4l2_subdev_pad_config *v4l2_subdev_alloc_pad_config(struct v4l2_subdev *sd);
+
+static inline void v4l2_subdev_free_pad_config(struct v4l2_subdev_pad_config *cfg)
+{
+	kfree(cfg);
+}
 #endif /* CONFIG_MEDIA_CONTROLLER */
+
 void v4l2_subdev_init(struct v4l2_subdev *sd,
 		      const struct v4l2_subdev_ops *ops);
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 2/8] media: adv7604: automatic "default-input" selection
  2016-05-11 14:02 [PATCH v4 0/8] Lager/Koelsch board HDMI input support Ulrich Hecht
  2016-05-11 14:02 ` [PATCH v4 1/8] v4l: subdev: Add pad config allocator and init Ulrich Hecht
@ 2016-05-11 14:02 ` Ulrich Hecht
  2016-06-27  9:26   ` Hans Verkuil
  2016-05-11 14:02 ` [PATCH v4 3/8] media: rcar_vin: Use correct pad number in try_fmt Ulrich Hecht
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Ulrich Hecht @ 2016-05-11 14:02 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle, Ulrich Hecht

From: William Towle <william.towle@codethink.co.uk>

Add logic such that the "default-input" property becomes unnecessary
for chips that only have one suitable input (ADV7611 by design, and
ADV7612 due to commit 7111cddd518f ("[media] media: adv7604: reduce
support to first (digital) input").

Additionally, Ian's documentation in commit bf9c82278c34 ("[media]
media: adv7604: ability to read default input port from DT") states
that the "default-input" property should reside directly in the node
for adv7612. Hence, also adjust the parsing to make the implementation
consistent with this.

Signed-off-by: William Towle <william.towle@codethink.co.uk>
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 drivers/media/i2c/adv7604.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 41a1bfc..d722c16 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -2788,7 +2788,7 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
 	struct device_node *np;
 	unsigned int flags;
 	int ret;
-	u32 v;
+	u32 v = -1;
 
 	np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node;
 
@@ -2810,6 +2810,22 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
 
 	of_node_put(endpoint);
 
+	if (of_property_read_u32(np, "default-input", &v)) {
+		/* not specified ... can we choose automatically? */
+		switch (state->info->type) {
+		case ADV7611:
+			v = 0;
+			break;
+		case ADV7612:
+			if (state->info->max_port == ADV76XX_PAD_HDMI_PORT_A)
+				v = 0;
+			/* else is unhobbled, leave unspecified */
+		default:
+			break;
+		}
+	}
+	state->pdata.default_input = v;
+
 	flags = bus_cfg.bus.parallel.flags;
 
 	if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 3/8] media: rcar_vin: Use correct pad number in try_fmt
  2016-05-11 14:02 [PATCH v4 0/8] Lager/Koelsch board HDMI input support Ulrich Hecht
  2016-05-11 14:02 ` [PATCH v4 1/8] v4l: subdev: Add pad config allocator and init Ulrich Hecht
  2016-05-11 14:02 ` [PATCH v4 2/8] media: adv7604: automatic "default-input" selection Ulrich Hecht
@ 2016-05-11 14:02 ` Ulrich Hecht
  2016-06-28 11:32   ` Mauro Carvalho Chehab
  2016-05-11 14:02 ` [PATCH v4 4/8] media: rcar-vin: pad-aware driver initialisation Ulrich Hecht
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Ulrich Hecht @ 2016-05-11 14:02 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle, Ulrich Hecht

Fix rcar_vin_try_fmt's use of an inappropriate pad number when calling
the subdev set_fmt function - for the ADV7612, IDs should be non-zero.

Signed-off-by: William Towle <william.towle@codethink.co.uk>
Reviewed-by: Rob Taylor <rob.taylor@codethink.co.uk>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
[uli: adapted to rcar-vin rewrite]
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 0bc4487..42dbd35 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -98,7 +98,7 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
 					struct rvin_source_fmt *source)
 {
 	struct v4l2_subdev *sd;
-	struct v4l2_subdev_pad_config pad_cfg;
+	struct v4l2_subdev_pad_config *pad_cfg;
 	struct v4l2_subdev_format format = {
 		.which = which,
 	};
@@ -108,10 +108,16 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
 
 	v4l2_fill_mbus_format(&format.format, pix, vin->source.code);
 
+	pad_cfg = v4l2_subdev_alloc_pad_config(sd);
+	if (pad_cfg == NULL)
+		return -ENOMEM;
+
+	format.pad = vin->src_pad_idx;
+
 	ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, pad, set_fmt,
-					 &pad_cfg, &format);
+					 pad_cfg, &format);
 	if (ret < 0)
-		return ret;
+		goto cleanup;
 
 	v4l2_fill_pix_format(pix, &format.format);
 
@@ -121,6 +127,8 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
 	vin_dbg(vin, "Source resolution: %ux%u\n", source->width,
 		source->height);
 
+cleanup:
+	v4l2_subdev_free_pad_config(pad_cfg);
 	return 0;
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 4/8] media: rcar-vin: pad-aware driver initialisation
  2016-05-11 14:02 [PATCH v4 0/8] Lager/Koelsch board HDMI input support Ulrich Hecht
                   ` (2 preceding siblings ...)
  2016-05-11 14:02 ` [PATCH v4 3/8] media: rcar_vin: Use correct pad number in try_fmt Ulrich Hecht
@ 2016-05-11 14:02 ` Ulrich Hecht
  2016-05-11 14:02 ` [PATCH v4 5/8] media: rcar-vin: add DV timings support Ulrich Hecht
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Ulrich Hecht @ 2016-05-11 14:02 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle, Ulrich Hecht, Rob Taylor

Add detection of source pad number for drivers aware of the media controller
API, so that rcar-vin can create device nodes to support modern drivers such
as adv7604.c (for HDMI on Lager) and the converted adv7180.c (for composite)
underneath.

Building rcar_vin gains a dependency on CONFIG_MEDIA_CONTROLLER, in
line with requirements for building the drivers associated with it.

Signed-off-by: William Towle <william.towle@codethink.co.uk>
Signed-off-by: Rob Taylor <rob.taylor@codethink.co.uk>
[uli: adapted to rcar-vin rewrite]
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 16 ++++++++++++++++
 drivers/media/platform/rcar-vin/rcar-vin.h  |  2 ++
 2 files changed, 18 insertions(+)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 42dbd35..3788f8a 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -691,6 +691,9 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
 	struct v4l2_mbus_framefmt *mf = &fmt.format;
 	struct video_device *vdev = &vin->vdev;
 	struct v4l2_subdev *sd = vin_to_source(vin);
+#if defined(CONFIG_MEDIA_CONTROLLER)
+	int pad_idx;
+#endif
 	int ret;
 
 	v4l2_set_subdev_hostdata(sd, vin);
@@ -737,6 +740,19 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
 	vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
 		V4L2_CAP_READWRITE;
 
+	vin->src_pad_idx = 0;
+#if defined(CONFIG_MEDIA_CONTROLLER)
+	for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
+		if (sd->entity.pads[pad_idx].flags
+				== MEDIA_PAD_FL_SOURCE)
+			break;
+	if (pad_idx >= sd->entity.num_pads)
+		return -EINVAL;
+
+	vin->src_pad_idx = pad_idx;
+#endif
+	fmt.pad = vin->src_pad_idx;
+
 	/* Try to improve our guess of a reasonable window format */
 	ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt);
 	if (ret) {
diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h b/drivers/media/platform/rcar-vin/rcar-vin.h
index 544a3b3..a6dd6db 100644
--- a/drivers/media/platform/rcar-vin/rcar-vin.h
+++ b/drivers/media/platform/rcar-vin/rcar-vin.h
@@ -87,6 +87,7 @@ struct rvin_graph_entity {
  *
  * @vdev:		V4L2 video device associated with VIN
  * @v4l2_dev:		V4L2 device
+ * @src_pad_idx:	source pad index for media controller drivers
  * @ctrl_handler:	V4L2 control handler
  * @notifier:		V4L2 asynchronous subdevs notifier
  * @entity:		entity in the DT for subdevice
@@ -117,6 +118,7 @@ struct rvin_dev {
 
 	struct video_device vdev;
 	struct v4l2_device v4l2_dev;
+	int src_pad_idx;
 	struct v4l2_ctrl_handler ctrl_handler;
 	struct v4l2_async_notifier notifier;
 	struct rvin_graph_entity entity;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 5/8] media: rcar-vin: add DV timings support
  2016-05-11 14:02 [PATCH v4 0/8] Lager/Koelsch board HDMI input support Ulrich Hecht
                   ` (3 preceding siblings ...)
  2016-05-11 14:02 ` [PATCH v4 4/8] media: rcar-vin: pad-aware driver initialisation Ulrich Hecht
@ 2016-05-11 14:02 ` Ulrich Hecht
  2016-06-27  9:28   ` Hans Verkuil
  2016-05-11 14:02 ` [PATCH v4 6/8] media: rcar-vin: initialize EDID data Ulrich Hecht
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Ulrich Hecht @ 2016-05-11 14:02 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle, Ulrich Hecht

Adds ioctls DV_TIMINGS_CAP, ENUM_DV_TIMINGS, G_DV_TIMINGS, S_DV_TIMINGS,
and QUERY_DV_TIMINGS.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 82 +++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 3788f8a..10a5c10 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -400,6 +400,10 @@ static int rvin_enum_input(struct file *file, void *priv,
 
 	i->type = V4L2_INPUT_TYPE_CAMERA;
 	i->std = vin->vdev.tvnorms;
+
+	if (v4l2_subdev_has_op(sd, pad, dv_timings_cap))
+		i->capabilities = V4L2_IN_CAP_DV_TIMINGS;
+
 	strlcpy(i->name, "Camera", sizeof(i->name));
 
 	return 0;
@@ -478,6 +482,78 @@ static int rvin_subscribe_event(struct v4l2_fh *fh,
 	return v4l2_ctrl_subscribe_event(fh, sub);
 }
 
+static int rvin_enum_dv_timings(struct file *file, void *priv_fh,
+				    struct v4l2_enum_dv_timings *timings)
+{
+	struct rvin_dev *vin = video_drvdata(file);
+	struct v4l2_subdev *sd = vin_to_source(vin);
+	int pad, ret;
+
+	pad = timings->pad;
+	timings->pad = vin->src_pad_idx;
+
+	ret = v4l2_subdev_call(sd, pad, enum_dv_timings, timings);
+
+	timings->pad = pad;
+
+	return ret;
+}
+
+static int rvin_s_dv_timings(struct file *file, void *priv_fh,
+				    struct v4l2_dv_timings *timings)
+{
+	struct rvin_dev *vin = video_drvdata(file);
+	struct v4l2_subdev *sd = vin_to_source(vin);
+	int err;
+
+	err = v4l2_subdev_call(sd,
+			video, s_dv_timings, timings);
+	if (!err) {
+		vin->source.width = timings->bt.width;
+		vin->source.height = timings->bt.height;
+		vin->format.width = timings->bt.width;
+		vin->format.height = timings->bt.height;
+	}
+	return err;
+}
+
+static int rvin_g_dv_timings(struct file *file, void *priv_fh,
+				    struct v4l2_dv_timings *timings)
+{
+	struct rvin_dev *vin = video_drvdata(file);
+	struct v4l2_subdev *sd = vin_to_source(vin);
+
+	return v4l2_subdev_call(sd,
+			video, g_dv_timings, timings);
+}
+
+static int rvin_query_dv_timings(struct file *file, void *priv_fh,
+				    struct v4l2_dv_timings *timings)
+{
+	struct rvin_dev *vin = video_drvdata(file);
+	struct v4l2_subdev *sd = vin_to_source(vin);
+
+	return v4l2_subdev_call(sd,
+			video, query_dv_timings, timings);
+}
+
+static int rvin_dv_timings_cap(struct file *file, void *priv_fh,
+				    struct v4l2_dv_timings_cap *cap)
+{
+	struct rvin_dev *vin = video_drvdata(file);
+	struct v4l2_subdev *sd = vin_to_source(vin);
+	int pad, ret;
+
+	pad = cap->pad;
+	cap->pad = vin->src_pad_idx;
+
+	ret = v4l2_subdev_call(sd, pad, dv_timings_cap, cap);
+
+	cap->pad = pad;
+
+	return ret;
+}
+
 static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
 	.vidioc_querycap		= rvin_querycap,
 	.vidioc_try_fmt_vid_cap		= rvin_try_fmt_vid_cap,
@@ -494,6 +570,12 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
 	.vidioc_g_input			= rvin_g_input,
 	.vidioc_s_input			= rvin_s_input,
 
+	.vidioc_dv_timings_cap		= rvin_dv_timings_cap,
+	.vidioc_enum_dv_timings		= rvin_enum_dv_timings,
+	.vidioc_g_dv_timings		= rvin_g_dv_timings,
+	.vidioc_s_dv_timings		= rvin_s_dv_timings,
+	.vidioc_query_dv_timings	= rvin_query_dv_timings,
+
 	.vidioc_querystd		= rvin_querystd,
 	.vidioc_g_std			= rvin_g_std,
 	.vidioc_s_std			= rvin_s_std,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 6/8] media: rcar-vin: initialize EDID data
  2016-05-11 14:02 [PATCH v4 0/8] Lager/Koelsch board HDMI input support Ulrich Hecht
                   ` (4 preceding siblings ...)
  2016-05-11 14:02 ` [PATCH v4 5/8] media: rcar-vin: add DV timings support Ulrich Hecht
@ 2016-05-11 14:02 ` Ulrich Hecht
  2016-05-13  8:36   ` Hans Verkuil
  2016-05-11 14:02 ` [PATCH v4 7/8] ARM: dts: lager: Add entries for VIN HDMI input support Ulrich Hecht
  2016-05-11 14:02 ` [PATCH v4 8/8] r8a7791-koelsch.dts: add HDMI input Ulrich Hecht
  7 siblings, 1 reply; 17+ messages in thread
From: Ulrich Hecht @ 2016-05-11 14:02 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle, Ulrich Hecht

Initializes the decoder subdevice with a fixed EDID blob.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 46 +++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 10a5c10..5bb3c3b 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -765,6 +765,41 @@ static void rvin_notify(struct v4l2_subdev *sd,
 	}
 }
 
+static u8 edid[256] = {
+	0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
+	0x48, 0xAE, 0x9C, 0x27, 0x00, 0x00, 0x00, 0x00,
+	0x19, 0x12, 0x01, 0x03, 0x80, 0x00, 0x00, 0x78,
+	0x0E, 0x00, 0xB2, 0xA0, 0x57, 0x49, 0x9B, 0x26,
+	0x10, 0x48, 0x4F, 0x2F, 0xCF, 0x00, 0x31, 0x59,
+	0x45, 0x59, 0x61, 0x59, 0x81, 0x99, 0x01, 0x01,
+	0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3A,
+	0x80, 0x18, 0x71, 0x38, 0x2D, 0x40, 0x58, 0x2C,
+	0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E,
+	0x00, 0x00, 0x00, 0xFD, 0x00, 0x31, 0x55, 0x18,
+	0x5E, 0x11, 0x00, 0x0A, 0x20, 0x20, 0x20, 0x20,
+	0x20, 0x20, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x43,
+	0x20, 0x39, 0x30, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
+	0x0A, 0x0A, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x10,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x68,
+	0x02, 0x03, 0x1a, 0xc0, 0x48, 0xa2, 0x10, 0x04,
+	0x02, 0x01, 0x21, 0x14, 0x13, 0x23, 0x09, 0x07,
+	0x07, 0x65, 0x03, 0x0c, 0x00, 0x10, 0x00, 0xe2,
+	0x00, 0x2a, 0x01, 0x1d, 0x00, 0x80, 0x51, 0xd0,
+	0x1c, 0x20, 0x40, 0x80, 0x35, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x1e, 0x8c, 0x0a, 0xd0, 0x8a,
+	0x20, 0xe0, 0x2d, 0x10, 0x10, 0x3e, 0x96, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd7
+};
+
 int rvin_v4l2_probe(struct rvin_dev *vin)
 {
 	struct v4l2_subdev_format fmt = {
@@ -870,5 +905,16 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
 	v4l2_info(&vin->v4l2_dev, "Device registered as %s\n",
 		  video_device_node_name(&vin->vdev));
 
+	{
+		struct v4l2_subdev_edid rvin_edid = {
+			.pad = 0,
+			.start_block = 0,
+			.blocks = 2,
+			.edid = edid,
+		};
+		v4l2_subdev_call(sd, pad, set_edid,
+				&rvin_edid);
+	}
+
 	return ret;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 7/8] ARM: dts: lager: Add entries for VIN HDMI input support
  2016-05-11 14:02 [PATCH v4 0/8] Lager/Koelsch board HDMI input support Ulrich Hecht
                   ` (5 preceding siblings ...)
  2016-05-11 14:02 ` [PATCH v4 6/8] media: rcar-vin: initialize EDID data Ulrich Hecht
@ 2016-05-11 14:02 ` Ulrich Hecht
  2016-05-11 14:02 ` [PATCH v4 8/8] r8a7791-koelsch.dts: add HDMI input Ulrich Hecht
  7 siblings, 0 replies; 17+ messages in thread
From: Ulrich Hecht @ 2016-05-11 14:02 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle, Rob Taylor, Ulrich Hecht

From: William Towle <william.towle@codethink.co.uk>

Add DT entries for vin0, vin0_pins, and adv7612.

Sets the 'default-input' property for ADV7612, enabling image and video
capture without the need to have userspace specifying routing.

Signed-off-by: William Towle <william.towle@codethink.co.uk>
Signed-off-by: Rob Taylor <rob.taylor@codethink.co.uk>
[uli: added interrupt, renamed endpoint, merged default-input]
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 arch/arm/boot/dts/r8a7790-lager.dts | 39 +++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index 749ba02..7e53f5c 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -427,6 +427,11 @@
 		function = "usb2";
 	};
 
+	vin0_pins: vin0 {
+		groups = "vin0_data24", "vin0_sync", "vin0_clkenb", "vin0_clk";
+		function = "vin0";
+	};
+
 	vin1_pins: vin {
 		groups = "vin1_data8", "vin1_clk";
 		function = "vin1";
@@ -607,6 +612,21 @@
 		reg = <0x12>;
 	};
 
+	hdmi-in@4c {
+		compatible = "adi,adv7612";
+		reg = <0x4c>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
+		remote = <&vin0>;
+		default-input = <0>;
+
+		port {
+			adv7612: endpoint {
+				remote-endpoint = <&vin0ep0>;
+			};
+		};
+	};
+
 	composite-in@20 {
 		compatible = "adi,adv7180";
 		reg = <0x20>;
@@ -722,6 +742,25 @@
 	status = "okay";
 };
 
+/* HDMI video input */
+&vin0 {
+	pinctrl-0 = <&vin0_pins>;
+	pinctrl-names = "default";
+
+	status = "ok";
+
+	port {
+		vin0ep0: endpoint {
+			remote-endpoint = <&adv7612>;
+			bus-width = <24>;
+			hsync-active = <0>;
+			vsync-active = <0>;
+			pclk-sample = <1>;
+			data-active = <1>;
+		};
+	};
+};
+
 /* composite video input */
 &vin1 {
 	pinctrl-0 = <&vin1_pins>;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v4 8/8] r8a7791-koelsch.dts: add HDMI input
  2016-05-11 14:02 [PATCH v4 0/8] Lager/Koelsch board HDMI input support Ulrich Hecht
                   ` (6 preceding siblings ...)
  2016-05-11 14:02 ` [PATCH v4 7/8] ARM: dts: lager: Add entries for VIN HDMI input support Ulrich Hecht
@ 2016-05-11 14:02 ` Ulrich Hecht
  2016-05-12  4:55   ` Simon Horman
  7 siblings, 1 reply; 17+ messages in thread
From: Ulrich Hecht @ 2016-05-11 14:02 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle, Hans Verkuil, Ulrich Hecht

From: Hans Verkuil <hverkuil@xs4all.nl>

Add support in the dts for the HDMI input. Based on the Lager dts
patch from Ultich Hecht.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[uli: removed "renesas," prefixes from pfc nodes]
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 arch/arm/boot/dts/r8a7791-koelsch.dts | 41 +++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
index da59c28..a96e3fa 100644
--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
+++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
@@ -393,6 +393,11 @@
 		function = "usb1";
 	};
 
+	vin0_pins: vin0 {
+		groups = "vin0_data24", "vin0_sync", "vin0_clkenb", "vin0_clk";
+		function = "vin0";
+	};
+
 	vin1_pins: vin1 {
 		groups = "vin1_data8", "vin1_clk";
 		function = "vin1";
@@ -551,6 +556,21 @@
 		reg = <0x12>;
 	};
 
+	hdmi-in@4c {
+		compatible = "adi,adv7612";
+		reg = <0x4c>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
+		remote = <&vin0>;
+		default-input = <0>;
+
+		port {
+			adv7612: endpoint {
+				remote-endpoint = <&vin0ep>;
+			};
+		};
+	};
+
 	composite-in@20 {
 		compatible = "adi,adv7180";
 		reg = <0x20>;
@@ -672,6 +692,27 @@
 	cpu0-supply = <&vdd_dvfs>;
 };
 
+/* HDMI video input */
+&vin0 {
+	status = "okay";
+	pinctrl-0 = <&vin0_pins>;
+	pinctrl-names = "default";
+
+	port {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		vin0ep: endpoint {
+			remote-endpoint = <&adv7612>;
+			bus-width = <24>;
+			hsync-active = <0>;
+			vsync-active = <0>;
+			pclk-sample = <1>;
+			data-active = <1>;
+		};
+	};
+};
+
 /* composite video input */
 &vin1 {
 	status = "okay";
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 8/8] r8a7791-koelsch.dts: add HDMI input
  2016-05-11 14:02 ` [PATCH v4 8/8] r8a7791-koelsch.dts: add HDMI input Ulrich Hecht
@ 2016-05-12  4:55   ` Simon Horman
  0 siblings, 0 replies; 17+ messages in thread
From: Simon Horman @ 2016-05-12  4:55 UTC (permalink / raw)
  To: Ulrich Hecht
  Cc: hans.verkuil, niklas.soderlund, linux-media, linux-renesas-soc,
	magnus.damm, laurent.pinchart, ian.molton, lars, william.towle,
	Hans Verkuil

On Wed, May 11, 2016 at 04:02:56PM +0200, Ulrich Hecht wrote:
> From: Hans Verkuil <hverkuil@xs4all.nl>
> 
> Add support in the dts for the HDMI input. Based on the Lager dts
> patch from Ultich Hecht.

Please use "ARM: dts: koelsch:" as the prefix for this patch title.

Thanks

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 1/8] v4l: subdev: Add pad config allocator and init
  2016-05-11 14:02 ` [PATCH v4 1/8] v4l: subdev: Add pad config allocator and init Ulrich Hecht
@ 2016-05-13  8:28   ` Hans Verkuil
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Verkuil @ 2016-05-13  8:28 UTC (permalink / raw)
  To: Ulrich Hecht, hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle, Laurent Pinchart

On 05/11/2016 04:02 PM, Ulrich Hecht wrote:
> From: Laurent Pinchart <laurent.pinchart@linaro.org>
> 
> Add a new subdev operation to initialize a subdev pad config array, and
> a helper function to allocate and initialize the array. This can be used
> by bridge drivers to implement try format based on subdev pad
> operations.

This patch has already been merged and can be dropped.

	Hans

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 6/8] media: rcar-vin: initialize EDID data
  2016-05-11 14:02 ` [PATCH v4 6/8] media: rcar-vin: initialize EDID data Ulrich Hecht
@ 2016-05-13  8:36   ` Hans Verkuil
  2016-06-27  9:30     ` Hans Verkuil
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Verkuil @ 2016-05-13  8:36 UTC (permalink / raw)
  To: Ulrich Hecht, hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle

On 05/11/2016 04:02 PM, Ulrich Hecht wrote:
> Initializes the decoder subdevice with a fixed EDID blob.
> 
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>

Nacked-by: Hans Verkuil <hans.verkuil@cisco.com>

Instead implement the g/s_edid ioctls.

You truly cannot default to an EDID. When an EDID is set the HPD will go high.
But you don't know the EDID here, the contents of the EDID is something that
only userspace will know depending on the type of device you're building.

In practice userspace will overwrite the EDID with the real one and so the HPD
will go down and up again. And while transmitters are supposed to handle that
cleanly, in reality this is a different story.

Just add the g/s_edid ioctls and you can use 'v4l2-ctl --set-edid=edid=hdmi' to
fill in a default EDID.

I won't accept this patch since I know from my own experience that this doesn't
work.

Regards,

	Hans

> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 46 +++++++++++++++++++++++++++++
>  1 file changed, 46 insertions(+)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> index 10a5c10..5bb3c3b 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -765,6 +765,41 @@ static void rvin_notify(struct v4l2_subdev *sd,
>  	}
>  }
>  
> +static u8 edid[256] = {
> +	0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
> +	0x48, 0xAE, 0x9C, 0x27, 0x00, 0x00, 0x00, 0x00,
> +	0x19, 0x12, 0x01, 0x03, 0x80, 0x00, 0x00, 0x78,
> +	0x0E, 0x00, 0xB2, 0xA0, 0x57, 0x49, 0x9B, 0x26,
> +	0x10, 0x48, 0x4F, 0x2F, 0xCF, 0x00, 0x31, 0x59,
> +	0x45, 0x59, 0x61, 0x59, 0x81, 0x99, 0x01, 0x01,
> +	0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3A,
> +	0x80, 0x18, 0x71, 0x38, 0x2D, 0x40, 0x58, 0x2C,
> +	0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E,
> +	0x00, 0x00, 0x00, 0xFD, 0x00, 0x31, 0x55, 0x18,
> +	0x5E, 0x11, 0x00, 0x0A, 0x20, 0x20, 0x20, 0x20,
> +	0x20, 0x20, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x43,
> +	0x20, 0x39, 0x30, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
> +	0x0A, 0x0A, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x10,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x68,
> +	0x02, 0x03, 0x1a, 0xc0, 0x48, 0xa2, 0x10, 0x04,
> +	0x02, 0x01, 0x21, 0x14, 0x13, 0x23, 0x09, 0x07,
> +	0x07, 0x65, 0x03, 0x0c, 0x00, 0x10, 0x00, 0xe2,
> +	0x00, 0x2a, 0x01, 0x1d, 0x00, 0x80, 0x51, 0xd0,
> +	0x1c, 0x20, 0x40, 0x80, 0x35, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x1e, 0x8c, 0x0a, 0xd0, 0x8a,
> +	0x20, 0xe0, 0x2d, 0x10, 0x10, 0x3e, 0x96, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd7
> +};
> +
>  int rvin_v4l2_probe(struct rvin_dev *vin)
>  {
>  	struct v4l2_subdev_format fmt = {
> @@ -870,5 +905,16 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
>  	v4l2_info(&vin->v4l2_dev, "Device registered as %s\n",
>  		  video_device_node_name(&vin->vdev));
>  
> +	{
> +		struct v4l2_subdev_edid rvin_edid = {
> +			.pad = 0,
> +			.start_block = 0,
> +			.blocks = 2,
> +			.edid = edid,
> +		};
> +		v4l2_subdev_call(sd, pad, set_edid,
> +				&rvin_edid);
> +	}
> +
>  	return ret;
>  }
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 2/8] media: adv7604: automatic "default-input" selection
  2016-05-11 14:02 ` [PATCH v4 2/8] media: adv7604: automatic "default-input" selection Ulrich Hecht
@ 2016-06-27  9:26   ` Hans Verkuil
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Verkuil @ 2016-06-27  9:26 UTC (permalink / raw)
  To: Ulrich Hecht, hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle

On 05/11/2016 04:02 PM, Ulrich Hecht wrote:
> From: William Towle <william.towle@codethink.co.uk>
> 
> Add logic such that the "default-input" property becomes unnecessary
> for chips that only have one suitable input (ADV7611 by design, and
> ADV7612 due to commit 7111cddd518f ("[media] media: adv7604: reduce
> support to first (digital) input").
> 
> Additionally, Ian's documentation in commit bf9c82278c34 ("[media]
> media: adv7604: ability to read default input port from DT") states
> that the "default-input" property should reside directly in the node
> for adv7612. Hence, also adjust the parsing to make the implementation
> consistent with this.
> 
> Signed-off-by: William Towle <william.towle@codethink.co.uk>
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> ---
>  drivers/media/i2c/adv7604.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
> index 41a1bfc..d722c16 100644
> --- a/drivers/media/i2c/adv7604.c
> +++ b/drivers/media/i2c/adv7604.c
> @@ -2788,7 +2788,7 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
>  	struct device_node *np;
>  	unsigned int flags;
>  	int ret;
> -	u32 v;
> +	u32 v = -1;
>  
>  	np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node;
>  
> @@ -2810,6 +2810,22 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
>  
>  	of_node_put(endpoint);
>  
> +	if (of_property_read_u32(np, "default-input", &v)) {
> +		/* not specified ... can we choose automatically? */
> +		switch (state->info->type) {
> +		case ADV7611:
> +			v = 0;
> +			break;
> +		case ADV7612:
> +			if (state->info->max_port == ADV76XX_PAD_HDMI_PORT_A)
> +				v = 0;
> +			/* else is unhobbled, leave unspecified */

Please add a break here, don't fall through.

What happens when the default_input is unspecified? I don't really like this,
I think that if nothing is specified, then it should just fall back to
input 0.

Note that neither include/media/i2c/adv7604.h nor Documentation/devicetree/bindings/media/i2c/adv7604.txt
say anything about this either.

Regards,

	Hans

> +		default:
> +			break;
> +		}
> +	}
> +	state->pdata.default_input = v;
> +
>  	flags = bus_cfg.bus.parallel.flags;
>  
>  	if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 5/8] media: rcar-vin: add DV timings support
  2016-05-11 14:02 ` [PATCH v4 5/8] media: rcar-vin: add DV timings support Ulrich Hecht
@ 2016-06-27  9:28   ` Hans Verkuil
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Verkuil @ 2016-06-27  9:28 UTC (permalink / raw)
  To: Ulrich Hecht, hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle

On 05/11/2016 04:02 PM, Ulrich Hecht wrote:
> Adds ioctls DV_TIMINGS_CAP, ENUM_DV_TIMINGS, G_DV_TIMINGS, S_DV_TIMINGS,
> and QUERY_DV_TIMINGS.
> 
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 82 +++++++++++++++++++++++++++++
>  1 file changed, 82 insertions(+)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> index 3788f8a..10a5c10 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -400,6 +400,10 @@ static int rvin_enum_input(struct file *file, void *priv,
>  
>  	i->type = V4L2_INPUT_TYPE_CAMERA;
>  	i->std = vin->vdev.tvnorms;
> +
> +	if (v4l2_subdev_has_op(sd, pad, dv_timings_cap))
> +		i->capabilities = V4L2_IN_CAP_DV_TIMINGS;
> +
>  	strlcpy(i->name, "Camera", sizeof(i->name));
>  
>  	return 0;
> @@ -478,6 +482,78 @@ static int rvin_subscribe_event(struct v4l2_fh *fh,
>  	return v4l2_ctrl_subscribe_event(fh, sub);
>  }
>  
> +static int rvin_enum_dv_timings(struct file *file, void *priv_fh,
> +				    struct v4l2_enum_dv_timings *timings)
> +{
> +	struct rvin_dev *vin = video_drvdata(file);
> +	struct v4l2_subdev *sd = vin_to_source(vin);
> +	int pad, ret;
> +
> +	pad = timings->pad;
> +	timings->pad = vin->src_pad_idx;
> +
> +	ret = v4l2_subdev_call(sd, pad, enum_dv_timings, timings);
> +
> +	timings->pad = pad;
> +
> +	return ret;
> +}
> +
> +static int rvin_s_dv_timings(struct file *file, void *priv_fh,
> +				    struct v4l2_dv_timings *timings)
> +{
> +	struct rvin_dev *vin = video_drvdata(file);
> +	struct v4l2_subdev *sd = vin_to_source(vin);
> +	int err;
> +
> +	err = v4l2_subdev_call(sd,
> +			video, s_dv_timings, timings);
> +	if (!err) {
> +		vin->source.width = timings->bt.width;
> +		vin->source.height = timings->bt.height;
> +		vin->format.width = timings->bt.width;
> +		vin->format.height = timings->bt.height;
> +	}
> +	return err;
> +}
> +
> +static int rvin_g_dv_timings(struct file *file, void *priv_fh,
> +				    struct v4l2_dv_timings *timings)
> +{
> +	struct rvin_dev *vin = video_drvdata(file);
> +	struct v4l2_subdev *sd = vin_to_source(vin);
> +
> +	return v4l2_subdev_call(sd,
> +			video, g_dv_timings, timings);
> +}
> +
> +static int rvin_query_dv_timings(struct file *file, void *priv_fh,
> +				    struct v4l2_dv_timings *timings)
> +{
> +	struct rvin_dev *vin = video_drvdata(file);
> +	struct v4l2_subdev *sd = vin_to_source(vin);
> +
> +	return v4l2_subdev_call(sd,
> +			video, query_dv_timings, timings);
> +}
> +
> +static int rvin_dv_timings_cap(struct file *file, void *priv_fh,
> +				    struct v4l2_dv_timings_cap *cap)
> +{
> +	struct rvin_dev *vin = video_drvdata(file);
> +	struct v4l2_subdev *sd = vin_to_source(vin);
> +	int pad, ret;
> +
> +	pad = cap->pad;
> +	cap->pad = vin->src_pad_idx;
> +
> +	ret = v4l2_subdev_call(sd, pad, dv_timings_cap, cap);
> +
> +	cap->pad = pad;
> +
> +	return ret;
> +}
> +
>  static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>  	.vidioc_querycap		= rvin_querycap,
>  	.vidioc_try_fmt_vid_cap		= rvin_try_fmt_vid_cap,
> @@ -494,6 +570,12 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>  	.vidioc_g_input			= rvin_g_input,
>  	.vidioc_s_input			= rvin_s_input,
>  
> +	.vidioc_dv_timings_cap		= rvin_dv_timings_cap,
> +	.vidioc_enum_dv_timings		= rvin_enum_dv_timings,
> +	.vidioc_g_dv_timings		= rvin_g_dv_timings,
> +	.vidioc_s_dv_timings		= rvin_s_dv_timings,
> +	.vidioc_query_dv_timings	= rvin_query_dv_timings,
> +
>  	.vidioc_querystd		= rvin_querystd,
>  	.vidioc_g_std			= rvin_g_std,
>  	.vidioc_s_std			= rvin_s_std,
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 6/8] media: rcar-vin: initialize EDID data
  2016-05-13  8:36   ` Hans Verkuil
@ 2016-06-27  9:30     ` Hans Verkuil
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Verkuil @ 2016-06-27  9:30 UTC (permalink / raw)
  To: Ulrich Hecht, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm, laurent.pinchart,
	ian.molton, lars, william.towle

Hi Ulrich,

On 05/13/2016 10:36 AM, Hans Verkuil wrote:
> On 05/11/2016 04:02 PM, Ulrich Hecht wrote:
>> Initializes the decoder subdevice with a fixed EDID blob.
>>
>> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> 
> Nacked-by: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Instead implement the g/s_edid ioctls.
> 
> You truly cannot default to an EDID. When an EDID is set the HPD will go high.
> But you don't know the EDID here, the contents of the EDID is something that
> only userspace will know depending on the type of device you're building.
> 
> In practice userspace will overwrite the EDID with the real one and so the HPD
> will go down and up again. And while transmitters are supposed to handle that
> cleanly, in reality this is a different story.
> 
> Just add the g/s_edid ioctls and you can use 'v4l2-ctl --set-edid=edid=hdmi' to
> fill in a default EDID.
> 
> I won't accept this patch since I know from my own experience that this doesn't
> work.

I haven't seen a follow-up on this. Can you do a v5? It's likely that will be the
last version and I can commit this.

Thanks!

	Hans

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 3/8] media: rcar_vin: Use correct pad number in try_fmt
  2016-05-11 14:02 ` [PATCH v4 3/8] media: rcar_vin: Use correct pad number in try_fmt Ulrich Hecht
@ 2016-06-28 11:32   ` Mauro Carvalho Chehab
  2016-06-28 11:59     ` Geert Uytterhoeven
  0 siblings, 1 reply; 17+ messages in thread
From: Mauro Carvalho Chehab @ 2016-06-28 11:32 UTC (permalink / raw)
  To: Ulrich Hecht
  Cc: hans.verkuil, niklas.soderlund, linux-media, linux-renesas-soc,
	magnus.damm, laurent.pinchart, ian.molton, lars, william.towle

Em Wed, 11 May 2016 16:02:51 +0200
Ulrich Hecht <ulrich.hecht+renesas@gmail.com> escreveu:

> Fix rcar_vin_try_fmt's use of an inappropriate pad number when calling
> the subdev set_fmt function - for the ADV7612, IDs should be non-zero.
> 
> Signed-off-by: William Towle <william.towle@codethink.co.uk>
> Reviewed-by: Rob Taylor <rob.taylor@codethink.co.uk>
> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
> [uli: adapted to rcar-vin rewrite]

Please use [email@domain: some revierwer note], as stated at Documentation/SubmittingPatches.

> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>

This patch breaks compilation:

drivers/media/platform/rcar-vin/rcar-v4l2.c: In function '__rvin_try_format_source':
drivers/media/platform/rcar-vin/rcar-v4l2.c:115:18: error: 'struct rvin_dev' has no member named 'src_pad_idx'
  format.pad = vin->src_pad_idx;
                  ^~



> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> index 0bc4487..42dbd35 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -98,7 +98,7 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
>  					struct rvin_source_fmt *source)
>  {
>  	struct v4l2_subdev *sd;
> -	struct v4l2_subdev_pad_config pad_cfg;
> +	struct v4l2_subdev_pad_config *pad_cfg;
>  	struct v4l2_subdev_format format = {
>  		.which = which,
>  	};
> @@ -108,10 +108,16 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
>  
>  	v4l2_fill_mbus_format(&format.format, pix, vin->source.code);
>  
> +	pad_cfg = v4l2_subdev_alloc_pad_config(sd);
> +	if (pad_cfg == NULL)
> +		return -ENOMEM;
> +
> +	format.pad = vin->src_pad_idx;
> +
>  	ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, pad, set_fmt,
> -					 &pad_cfg, &format);
> +					 pad_cfg, &format);
>  	if (ret < 0)
> -		return ret;
> +		goto cleanup;
>  
>  	v4l2_fill_pix_format(pix, &format.format);
>  
> @@ -121,6 +127,8 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
>  	vin_dbg(vin, "Source resolution: %ux%u\n", source->width,
>  		source->height);
>  
> +cleanup:
> +	v4l2_subdev_free_pad_config(pad_cfg);
>  	return 0;
>  }
>  



Thanks,
Mauro

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4 3/8] media: rcar_vin: Use correct pad number in try_fmt
  2016-06-28 11:32   ` Mauro Carvalho Chehab
@ 2016-06-28 11:59     ` Geert Uytterhoeven
  0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2016-06-28 11:59 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Ulrich Hecht, Hans Verkuil, Niklas Söderlund,
	Linux Media Mailing List, Linux-Renesas, Magnus Damm,
	Laurent Pinchart, Ian Molton, Lars-Peter Clausen, William Towle

Hi Mauro,

On Tue, Jun 28, 2016 at 1:32 PM, Mauro Carvalho Chehab
<mchehab@s-opensource.com> wrote:
> Em Wed, 11 May 2016 16:02:51 +0200
> Ulrich Hecht <ulrich.hecht+renesas@gmail.com> escreveu:
>
>> Fix rcar_vin_try_fmt's use of an inappropriate pad number when calling
>> the subdev set_fmt function - for the ADV7612, IDs should be non-zero.
>>
>> Signed-off-by: William Towle <william.towle@codethink.co.uk>
>> Reviewed-by: Rob Taylor <rob.taylor@codethink.co.uk>
>> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
>> [uli: adapted to rcar-vin rewrite]
>
> Please use [email@domain: some revierwer note], as stated at Documentation/SubmittingPatches.

"While there is nothing mandatory about this, it
 seems like prepending the description with your mail and/or name, all
 enclosed in square brackets, is noticeable enough to make it obvious that
 you are responsible for last-minute changes."

Hence a name should be sufficient.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-06-28 11:59 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-11 14:02 [PATCH v4 0/8] Lager/Koelsch board HDMI input support Ulrich Hecht
2016-05-11 14:02 ` [PATCH v4 1/8] v4l: subdev: Add pad config allocator and init Ulrich Hecht
2016-05-13  8:28   ` Hans Verkuil
2016-05-11 14:02 ` [PATCH v4 2/8] media: adv7604: automatic "default-input" selection Ulrich Hecht
2016-06-27  9:26   ` Hans Verkuil
2016-05-11 14:02 ` [PATCH v4 3/8] media: rcar_vin: Use correct pad number in try_fmt Ulrich Hecht
2016-06-28 11:32   ` Mauro Carvalho Chehab
2016-06-28 11:59     ` Geert Uytterhoeven
2016-05-11 14:02 ` [PATCH v4 4/8] media: rcar-vin: pad-aware driver initialisation Ulrich Hecht
2016-05-11 14:02 ` [PATCH v4 5/8] media: rcar-vin: add DV timings support Ulrich Hecht
2016-06-27  9:28   ` Hans Verkuil
2016-05-11 14:02 ` [PATCH v4 6/8] media: rcar-vin: initialize EDID data Ulrich Hecht
2016-05-13  8:36   ` Hans Verkuil
2016-06-27  9:30     ` Hans Verkuil
2016-05-11 14:02 ` [PATCH v4 7/8] ARM: dts: lager: Add entries for VIN HDMI input support Ulrich Hecht
2016-05-11 14:02 ` [PATCH v4 8/8] r8a7791-koelsch.dts: add HDMI input Ulrich Hecht
2016-05-12  4:55   ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.