Return-path: Received: from smtp-4.sys.kth.se ([130.237.48.193]:37423 "EHLO smtp-4.sys.kth.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962AbdCNTGr (ORCPT ); Tue, 14 Mar 2017 15:06:47 -0400 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= To: Laurent Pinchart , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, tomoharu.fukawa.eb@renesas.com, Sakari Ailus , Geert Uytterhoeven , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH v3 20/27] rcar-vin: register a media pad if running in media controller mode Date: Tue, 14 Mar 2017 20:03:01 +0100 Message-Id: <20170314190308.25790-21-niklas.soderlund+renesas@ragnatech.se> In-Reply-To: <20170314190308.25790-1-niklas.soderlund+renesas@ragnatech.se> References: <20170314190308.25790-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-media-owner@vger.kernel.org List-ID: When running in media controller mode a media pad is needed, register one. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-core.c | 9 +++++++++ drivers/media/platform/rcar-vin/rcar-vin.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c index 7aaa01dee014d64b..f560d27449b84882 100644 --- a/drivers/media/platform/rcar-vin/rcar-core.c +++ b/drivers/media/platform/rcar-vin/rcar-core.c @@ -267,7 +267,16 @@ static int rvin_group_init(struct rvin_dev *vin) if (ret) return ret; + vin->pad.flags = MEDIA_PAD_FL_SINK; + ret = media_entity_pads_init(&vin->vdev->entity, 1, &vin->pad); + if (ret) + goto error_v4l2; + return 0; +error_v4l2: + rvin_v4l2_mc_remove(vin); + + return ret; } /* ----------------------------------------------------------------------------- diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h b/drivers/media/platform/rcar-vin/rcar-vin.h index 6f2b1e28381678a9..06934313950253f4 100644 --- a/drivers/media/platform/rcar-vin/rcar-vin.h +++ b/drivers/media/platform/rcar-vin/rcar-vin.h @@ -103,6 +103,8 @@ struct rvin_info { * @notifier: V4L2 asynchronous subdevs notifier * @digital: entity in the DT for local digital subdevice * + * @pad: pad for media controller + * * @lock: protects @queue * @queue: vb2 buffers queue * @@ -132,6 +134,8 @@ struct rvin_dev { struct v4l2_async_notifier notifier; struct rvin_graph_entity digital; + struct media_pad pad; + struct mutex lock; struct vb2_queue queue; -- 2.12.0