All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [PATCH 3/5] rcar-vin: Cache the CSI-2 channel selection value
Date: Fri, 16 Oct 2020 01:14:06 +0200	[thread overview]
Message-ID: <20201015231408.2399933-4-niklas.soderlund+renesas@ragnatech.se> (raw)
In-Reply-To: <20201015231408.2399933-1-niklas.soderlund+renesas@ragnatech.se>

In preparation of suspend/resume support cache the chsel value when
written to the register so it can be restored on resume if needed.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 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 680160f9f851d8a3..f65deac4c2dbed54 100644
--- a/drivers/media/platform/rcar-vin/rcar-dma.c
+++ b/drivers/media/platform/rcar-vin/rcar-dma.c
@@ -1456,6 +1456,8 @@ int rvin_set_channel_routing(struct rvin_dev *vin, u8 chsel)
 
 	vin_dbg(vin, "Set IFMD 0x%x\n", ifmd);
 
+	vin->chsel = chsel;
+
 	/* 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 8396e0e45478fe4f..2fef23470e3ddfe3 100644
--- a/drivers/media/platform/rcar-vin/rcar-vin.h
+++ b/drivers/media/platform/rcar-vin/rcar-vin.h
@@ -189,6 +189,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
  *
  * @mbus_code:		media bus format code
  * @format:		active V4L2 pixel format
@@ -232,6 +233,7 @@ struct rvin_dev {
 	enum rvin_dma_state state;
 
 	bool is_csi;
+	unsigned int chsel;
 
 	u32 mbus_code;
 	struct v4l2_pix_format format;
-- 
2.28.0


  parent reply	other threads:[~2020-10-15 23:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 23:14 [PATCH 0/5] rcar-vin: Support suspend and resume Niklas Söderlund
2020-10-15 23:14 ` [PATCH 1/5] rcar-vin: Use scratch buffer when not in running state Niklas Söderlund
2020-10-16 15:52   ` Jacopo Mondi
2020-10-15 23:14 ` [PATCH 2/5] rcar-vin: Remove handling of user-space buffers when stopping Niklas Söderlund
2020-10-16 15:55   ` Jacopo Mondi
2020-10-15 23:14 ` Niklas Söderlund [this message]
2020-10-16 15:57   ` [PATCH 3/5] rcar-vin: Cache the CSI-2 channel selection value Jacopo Mondi
2020-10-15 23:14 ` [PATCH 4/5] rcar-vin: Break out hardware start and stop to new methods Niklas Söderlund
2020-10-16 16:00   ` Jacopo Mondi
2020-10-15 23:14 ` [PATCH 5/5] rcar-vin: Add support for suspend and resume Niklas Söderlund
2020-10-16  7:05   ` Geert Uytterhoeven
2020-10-16 16:07   ` Jacopo Mondi
2020-10-16 14:15     ` Niklas Söderlund
2020-10-16 17:26       ` Jacopo Mondi
2020-10-16  7:06 ` [PATCH 0/5] rcar-vin: Support " Geert Uytterhoeven
2020-10-16 10:46   ` Niklas Söderlund
2020-10-16 11:26     ` Geert Uytterhoeven
2020-10-16 12:23       ` Niklas Söderlund
2020-10-16 12:39         ` Geert Uytterhoeven

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=20201015231408.2399933-4-niklas.soderlund+renesas@ragnatech.se \
    --to=niklas.soderlund+renesas@ragnatech.se \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /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.