From: Sakari Ailus <sakari.ailus@iki.fi>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
linux-media@vger.kernel.org,
Kieran Bingham <kieran.bingham@ideasonboard.com>,
linux-renesas-soc@vger.kernel.org,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH 1/2] media: entity: Add pad_from_dt_regs entity operation
Date: Fri, 28 Apr 2017 13:32:57 +0300 [thread overview]
Message-ID: <20170428103256.GG7456@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <20170427223323.13861-2-niklas.soderlund+renesas@ragnatech.se>
Hi Niklas,
On Fri, Apr 28, 2017 at 12:33:22AM +0200, Niklas Söderlund wrote:
> The optional operation can be used by entities to report how it maps its
> DT node ports and endpoints to media pad numbers. This is useful for
> devices which require more advanced mappings of pads then DT port
> number is equivalent with media port number.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> include/media/media-entity.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/media/media-entity.h b/include/media/media-entity.h
> index c7c254c5bca1761b..47efaf4d825e671b 100644
> --- a/include/media/media-entity.h
> +++ b/include/media/media-entity.h
> @@ -171,6 +171,9 @@ struct media_pad {
>
> /**
> * struct media_entity_operations - Media entity operations
> + * @pad_from_dt_regs: Return the pad number based on DT port and reg
> + * properties. This operation can be used to map a
> + * DT port and reg to a media pad number. Optional.
Don't you need to provide entity as an argument as well? The driver will be
a little bit loss due to lack of context. :-)
How about using the endpoint's device node (or fwnode; you can get it using
of_fwnode_handle() soon) instead? You can always obtain the port node by
just getting the parent.
> * @link_setup: Notify the entity of link changes. The operation can
> * return an error, in which case link setup will be
> * cancelled. Optional.
> @@ -184,6 +187,7 @@ struct media_pad {
> * mutex held.
> */
> struct media_entity_operations {
> + int (*pad_from_dt_regs)(int port_reg, int reg, unsigned int *pad);
> int (*link_setup)(struct media_entity *entity,
> const struct media_pad *local,
> const struct media_pad *remote, u32 flags);
--
Kind regards,
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
next prev parent reply other threads:[~2017-04-28 10:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-27 22:33 [PATCH 0/2] media: entity: add operation to help map DT node to media pad Niklas Söderlund
2017-04-27 22:33 ` [PATCH 1/2] media: entity: Add pad_from_dt_regs entity operation Niklas Söderlund
2017-04-28 10:32 ` Sakari Ailus [this message]
2017-04-28 11:57 ` Niklas Söderlund
2017-04-28 12:53 ` Sakari Ailus
2017-04-27 22:33 ` [PATCH 2/2] media: entity: Add media_entity_pad_from_dt_regs() function Niklas Söderlund
2017-04-28 10:43 ` Sakari Ailus
2017-04-28 12:04 ` Niklas Söderlund
2017-04-28 13:10 ` Sakari Ailus
2017-04-28 11:26 ` [PATCH 0/2] media: entity: add operation to help map DT node to media pad Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170428103256.GG7456@valkosipuli.retiisi.org.uk \
--to=sakari.ailus@iki.fi \
--cc=kieran.bingham@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox