diff mbox series

[2/4] media: imx: imx-mipi-csis: Add version register

Message ID 20220615192602.25472-3-laurent.pinchart@ideasonboard.com
State Accepted
Commit a1c046d3228b6a89963f9ef55d38770ad612954d
Headers show
Series media: imx: imx-mipi-csis: Add i.MX8MP support | expand

Commit Message

Laurent Pinchart June 15, 2022, 7:26 p.m. UTC
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(+)

Comments

Rui Miguel Silva June 15, 2022, 11:51 p.m. UTC | #1
Hey Laurent,
On Wed, Jun 15, 2022 at 10:26:00PM +0300, Laurent Pinchart wrote:
> 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>

Nothing against this.

Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>

Cheers,
   Rui

> ---
>  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
>
diff mbox series

Patch

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)