Linux Media Controller development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: Jacopo Mondi <jacopo@jmondi.org>,
	Paul Elder <paul.elder@ideasonboard.com>,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	kernel@pengutronix.de, linux-imx@nxp.com
Subject: [PATCH 2/4] media: imx: imx-mipi-csis: Add version register
Date: Wed, 15 Jun 2022 22:26:00 +0300	[thread overview]
Message-ID: <20220615192602.25472-3-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20220615192602.25472-1-laurent.pinchart@ideasonboard.com>

Register at offset 0x00 isn't documented, but the NXP BSP
imx8-mipi-csi2-sam driver defines it as a version register. Tests on
i.MX7D and i.MX8MP have confirmed this, with values matching the version
of the IP core specified in the respective reference manuals.

This commit doesn't make use of the version register at runtime as the
compatible strings are enough to identify the IP core version.
Nonetheless, capturing the information in register definitions that
don't affect the code negatively is useful for future development.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/platform/nxp/imx-mipi-csis.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
index 09a220c1bfe8..8674aaad5fa0 100644
--- a/drivers/media/platform/nxp/imx-mipi-csis.c
+++ b/drivers/media/platform/nxp/imx-mipi-csis.c
@@ -46,6 +46,11 @@
 
 /* Register map definition */
 
+/* CSIS version */
+#define MIPI_CSIS_VERSION			0x00
+#define MIPI_CSIS_VERSION_IMX7D			0x03030505
+#define MIPI_CSIS_VERSION_IMX8MP		0x03060301
+
 /* CSIS common control */
 #define MIPI_CSIS_CMN_CTRL			0x04
 #define MIPI_CSIS_CMN_CTRL_UPDATE_SHADOW	BIT(16)
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2022-06-15 19:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 19:25 [PATCH 0/4] media: imx: imx-mipi-csis: Add i.MX8MP support Laurent Pinchart
2022-06-15 19:25 ` [PATCH 1/4] media: imx: imx-mipi-csis: Set the subdev fwnode for endpoint matching Laurent Pinchart
2022-06-15 23:50   ` Rui Miguel Silva
2022-06-15 19:26 ` Laurent Pinchart [this message]
2022-06-15 23:51   ` [PATCH 2/4] media: imx: imx-mipi-csis: Add version register Rui Miguel Silva
2022-06-15 19:26 ` [PATCH 3/4] media: imx: imx-mipi-csis: Implement the .get_frame_desc() operation Laurent Pinchart
2022-06-15 23:53   ` Rui Miguel Silva
2022-06-15 23:59     ` Laurent Pinchart
2022-06-16  0:09       ` Rui Miguel Silva
2022-06-15 19:26 ` [PATCH 4/4] dt-bindings: media: nxp,imx-mipi-csi2: i.MX8MP support Laurent Pinchart
2022-06-15 21:01   ` Krzysztof Kozlowski

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=20220615192602.25472-3-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=jacopo@jmondi.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-media@vger.kernel.org \
    --cc=paul.elder@ideasonboard.com \
    --cc=rmfrfs@gmail.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