From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: niklas.soderlund+renesas@ragnatech.se,
kieran.bingham@ideasonboard.com, linux-media@vger.kernel.org,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 3/5] media: adv748x: Store the source subdevice in TX
Date: Thu, 13 Dec 2018 11:29:24 +0200 [thread overview]
Message-ID: <3458994.7daZaNYgSu@avalon> (raw)
In-Reply-To: <1544541373-30044-4-git-send-email-jacopo+renesas@jmondi.org>
Hi Jacopo,
Thank you for the patch.
On Tuesday, 11 December 2018 17:16:11 EET Jacopo Mondi wrote:
> The power_up_tx() procedure needs to set a few registers conditionally to
> the selected video source, but it currently checks for the provided tx to
> be either TXA or TXB.
>
> With the introduction of dynamic routing between HDMI and AFE entities to
> TXA, checking which TX the function is operating on is not meaningful
> anymore.
>
> To fix this, store the subdevice of the source providing video data to the
> CSI-2 TX in the 'struct adv748x_csi2' representing the TX and check on it.
>
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> ---
> drivers/media/i2c/adv748x/adv748x-core.c | 2 +-
> drivers/media/i2c/adv748x/adv748x-csi2.c | 3 +++
> drivers/media/i2c/adv748x/adv748x.h | 1 +
> 3 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/adv748x/adv748x-core.c
> b/drivers/media/i2c/adv748x/adv748x-core.c index 5495dc7891e8..f3aabbccdfb5
> 100644
> --- a/drivers/media/i2c/adv748x/adv748x-core.c
> +++ b/drivers/media/i2c/adv748x/adv748x-core.c
> @@ -254,7 +254,7 @@ static int adv748x_power_up_tx(struct adv748x_csi2 *tx)
> adv748x_write_check(state, page, 0x00, 0xa0 | tx->num_lanes, &ret);
>
> /* ADI Required Write */
> - if (is_txa(tx)) {
> + if (tx->rsd == &state->hdmi.sd) {
> adv748x_write_check(state, page, 0xdb, 0x10, &ret);
> adv748x_write_check(state, page, 0xd6, 0x07, &ret);
> } else {
> diff --git a/drivers/media/i2c/adv748x/adv748x-csi2.c
> b/drivers/media/i2c/adv748x/adv748x-csi2.c index 4d1aefc2c8d0..307966f4c736
> 100644
> --- a/drivers/media/i2c/adv748x/adv748x-csi2.c
> +++ b/drivers/media/i2c/adv748x/adv748x-csi2.c
> @@ -46,6 +46,9 @@ static int adv748x_csi2_register_link(struct adv748x_csi2
> *tx, return ret;
> }
>
> + if (flags & MEDIA_LNK_FL_ENABLED)
> + tx->rsd = src;
> +
> return media_create_pad_link(&src->entity, src_pad,
> &tx->sd.entity, ADV748X_CSI2_SINK,
> flags);
> diff --git a/drivers/media/i2c/adv748x/adv748x.h
> b/drivers/media/i2c/adv748x/adv748x.h index b482c7fe6957..387002d6da65
> 100644
> --- a/drivers/media/i2c/adv748x/adv748x.h
> +++ b/drivers/media/i2c/adv748x/adv748x.h
> @@ -85,6 +85,7 @@ struct adv748x_csi2 {
> struct v4l2_ctrl_handler ctrl_hdl;
> struct v4l2_ctrl *pixel_rate;
> struct v4l2_subdev sd;
> + struct v4l2_subdev *rsd;
How about naming this source instead of rsd ? rsd is a bit cryptic.
With that change,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> };
>
> #define notifier_to_csi2(n) container_of(n, struct adv748x_csi2, notifier)
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2018-12-13 9:28 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 15:16 [PATCH 0/5] media: adv748x: Implement dynamic routing support Jacopo Mondi
2018-12-11 15:16 ` [PATCH 1/5] media: adv748x: Rework reset procedure Jacopo Mondi
2018-12-11 23:52 ` Kieran Bingham
2018-12-12 8:16 ` jacopo mondi
2018-12-12 10:13 ` Kieran Bingham
2018-12-13 9:15 ` Laurent Pinchart
2018-12-11 15:16 ` [PATCH 2/5] media: adv748x: csi2: Link AFE with TXA and TXB Jacopo Mondi
2018-12-11 23:07 ` Kieran Bingham
2018-12-12 8:21 ` jacopo mondi
2018-12-12 10:19 ` Kieran Bingham
2018-12-13 9:25 ` Laurent Pinchart
2018-12-11 15:16 ` [PATCH 3/5] media: adv748x: Store the source subdevice in TX Jacopo Mondi
2018-12-11 23:19 ` Kieran Bingham
2018-12-13 9:29 ` Laurent Pinchart [this message]
2018-12-11 15:16 ` [PATCH 4/5] media: adv748x: Store the TX sink in HDMI/AFE Jacopo Mondi
2018-12-11 23:24 ` Kieran Bingham
2018-12-13 9:34 ` Laurent Pinchart
2018-12-11 15:16 ` [PATCH 5/5] media: adv748x: Implement link_setup callback Jacopo Mondi
2018-12-11 23:43 ` Kieran Bingham
2018-12-12 8:27 ` jacopo mondi
2018-12-12 10:30 ` Kieran Bingham
2018-12-13 9:40 ` Laurent Pinchart
2018-12-27 20:38 ` Jacopo Mondi
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=3458994.7daZaNYgSu@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=jacopo+renesas@jmondi.org \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
/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 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.