All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 2/4] rcar-vin: cache the CSI-2 channel selection value
Date: Fri, 14 Dec 2018 10:23:25 +0200	[thread overview]
Message-ID: <14327612.kiatMVmQX0@avalon> (raw)
In-Reply-To: <20181214061824.10296-3-niklas.soderlund+renesas@ragnatech.se>

Hi Niklas,

Thank you for the patch.

On Friday, 14 December 2018 08:18:22 EET Niklas Söderlund wrote:
> In preparation of suspend/resume support cache the chsel value when we
> write it to the register so it can be restored on resume if needed.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>  drivers/media/platform/rcar-vin/rcar-dma.c | 2 ++
>  drivers/media/platform/rcar-vin/rcar-vin.h | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c
> b/drivers/media/platform/rcar-vin/rcar-dma.c index
> beb9248992a48a74..64f7636f94d6a0a3 100644
> --- a/drivers/media/platform/rcar-vin/rcar-dma.c
> +++ b/drivers/media/platform/rcar-vin/rcar-dma.c
> @@ -1336,6 +1336,8 @@ int rvin_set_channel_routing(struct rvin_dev *vin, u8
> chsel)
> 
>  	vin_dbg(vin, "Set IFMD 0x%x\n", ifmd);
> 
> +	vin->chsel = chsel;
> +

Would it be useful to add a

	if (vin->chsel == chsel)
		return 0;

at the beginning of the function, or is that impossible ?

>  	/* Restore VNMC. */
>  	rvin_write(vin, vnmc, VNMC_REG);
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h
> b/drivers/media/platform/rcar-vin/rcar-vin.h index
> 0b13b34d03e3dce4..d21fc991b7a9da36 100644
> --- a/drivers/media/platform/rcar-vin/rcar-vin.h
> +++ b/drivers/media/platform/rcar-vin/rcar-vin.h
> @@ -170,6 +170,7 @@ struct rvin_info {
>   * @state:		keeps track of operation state
>   *
>   * @is_csi:		flag to mark the VIN as using a CSI-2 subdevice
> + * @chsel		Cached value of the current CSI-2 channel selection

Nitpicking, the documentation for other fields don't start with a capital 
letter.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>   *
>   * @mbus_code:		media bus format code
>   * @format:		active V4L2 pixel format
> @@ -207,6 +208,7 @@ struct rvin_dev {
>  	enum rvin_dma_state state;
> 
>  	bool is_csi;
> +	unsigned int chsel;
> 
>  	u32 mbus_code;
>  	struct v4l2_pix_format format;

-- 
Regards,

Laurent Pinchart




  reply	other threads:[~2018-12-14  8:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14  6:18 [PATCH 0/4] rcar-vin: add support for suspend and resume Niklas Söderlund
2018-12-14  6:18 ` [PATCH 1/4] rcar-vin: fix wrong return value in rvin_set_channel_routing() Niklas Söderlund
2018-12-14  8:19   ` Laurent Pinchart
2018-12-14  6:18 ` [PATCH 2/4] rcar-vin: cache the CSI-2 channel selection value Niklas Söderlund
2018-12-14  8:23   ` Laurent Pinchart [this message]
2018-12-14  6:18 ` [PATCH 3/4] rcar-vin: make rvin_{start,stop}_streaming() available for internal use Niklas Söderlund
2018-12-14  8:27   ` Laurent Pinchart
2018-12-14  6:18 ` [PATCH 4/4] rcar-vin: add support for suspend and resume Niklas Söderlund
2018-12-14  8:37   ` Laurent Pinchart

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=14327612.kiatMVmQX0@avalon \
    --to=laurent.pinchart@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.