* [PATCH v2 0/7] media: synopsys: enhancements and i.MX95 support
@ 2026-04-23 8:22 Guoniu Zhou
2026-04-23 8:22 ` [PATCH v2 1/7] media: synopsys: Fix out-of-bounds check in enum_mbus_code Guoniu Zhou
` (6 more replies)
0 siblings, 7 replies; 15+ messages in thread
From: Guoniu Zhou @ 2026-04-23 8:22 UTC (permalink / raw)
To: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Frank Li, Sakari Ailus, Bryan O'Donoghue,
Mehdi Djait, Hans Verkuil
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
linux-rockchip, Guoniu Zhou
This series enhances the Synopsys DesignWare MIPI CSI-2 receiver driver
with multiple stream support and adds i.MX95 platform support.
The i.MX95 variant is similar to i.MX93 but uses IDI instead of IPI. Since
IDI is software transparent, only a different register map is needed.
Tested on i.MX93 and i.MX95 platforms.
Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
---
Changes in v2:
- Add two new patches
- Simplify error handling by keeping goto labels instead of early returns
- Removes redundant register availability check
- Uses read_poll_timeout() with dw_mipi_csi2rx_read() instead of
readl_poll_timeout() with direct register address
- Fixes stopstate condition logic
- Check PHY stopstate after sensor enable instead of before to ensure
correct timing.
- Optimize PHY stopstate polling parameters (1000us->10us, 2s->1ms) to
balance performance and responsiveness.
- Add dedicated constraint block for i.MX95 to reflect different clock
requirements (only per clock needed vs i.MX93 which needs both per and
pixel clocks)
- Update commit message to include more details about interface differences
- Add Reviewed-by tag from Frank Li <Frank.Li@nxp.com>
- Update commit message
- See each patch's changelog for details.
- Link to v1: https://lore.kernel.org/r/20260415-csi2_imx95-v1-0-7d63f3508719@oss.nxp.com
---
Guoniu Zhou (7):
media: synopsys: Fix out-of-bounds check in enum_mbus_code
media: synopsys: Fix IPI using hardcoded datatype
media: synopsys: Add support for RAW16 Bayer formats
media: synopsys: Add support for multiple streams
media: synopsys: Add PHY stopstate wait for i.MX93
media: dt-bindings: add NXP i.MX95 compatible string
media: synopsys: Add support for i.MX95
.../bindings/media/rockchip,rk3568-mipi-csi2.yaml | 16 +++
drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 109 +++++++++++++++++++--
2 files changed, 118 insertions(+), 7 deletions(-)
---
base-commit: 4fbeef21f5387234111b5d52924e77757626faa5
change-id: 20260414-csi2_imx95-65ad0e7f630a
Best regards,
--
Guoniu Zhou <guoniu.zhou@oss.nxp.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 1/7] media: synopsys: Fix out-of-bounds check in enum_mbus_code
2026-04-23 8:22 [PATCH v2 0/7] media: synopsys: enhancements and i.MX95 support Guoniu Zhou
@ 2026-04-23 8:22 ` Guoniu Zhou
2026-04-24 3:57 ` Frank Li
2026-04-23 8:22 ` [PATCH v2 2/7] media: synopsys: Fix IPI using hardcoded datatype Guoniu Zhou
` (5 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Guoniu Zhou @ 2026-04-23 8:22 UTC (permalink / raw)
To: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Frank Li, Sakari Ailus, Bryan O'Donoghue,
Mehdi Djait, Hans Verkuil
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
linux-rockchip, Guoniu Zhou
dw_mipi_csi2rx_enum_mbus_code() contains an off-by-one error in the
bounds check for code->index, allowing an access past the end of the
formats array.
Fixes: 355a11004066 ("media: synopsys: add driver for the designware mipi csi-2 receiver")
Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
---
Changes in v2:
- New added in v2
---
drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
index ce17f986279e..02eb4a6cafad 100644
--- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
+++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
@@ -430,7 +430,7 @@ dw_mipi_csi2rx_enum_mbus_code(struct v4l2_subdev *sd,
return 0;
case DW_MIPI_CSI2RX_PAD_SINK:
- if (code->index > csi2->formats_num)
+ if (code->index >= csi2->formats_num)
return -EINVAL;
code->code = csi2->formats[code->index].code;
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 2/7] media: synopsys: Fix IPI using hardcoded datatype
2026-04-23 8:22 [PATCH v2 0/7] media: synopsys: enhancements and i.MX95 support Guoniu Zhou
2026-04-23 8:22 ` [PATCH v2 1/7] media: synopsys: Fix out-of-bounds check in enum_mbus_code Guoniu Zhou
@ 2026-04-23 8:22 ` Guoniu Zhou
2026-04-24 3:58 ` Frank Li
2026-04-23 8:22 ` [PATCH v2 3/7] media: synopsys: Add support for RAW16 Bayer formats Guoniu Zhou
` (4 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Guoniu Zhou @ 2026-04-23 8:22 UTC (permalink / raw)
To: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Frank Li, Sakari Ailus, Bryan O'Donoghue,
Mehdi Djait, Hans Verkuil
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
linux-rockchip, Guoniu Zhou
The imx93_csi2rx_dphy_ipi_enable() function configures the IPI datatype
using csi2->formats->csi_dt, which is initialized during probe but never
updated in set_fmt(). This causes the IPI to always use the probe-time
default datatype, ignoring the actual media bus format negotiated at
runtime. When userspace requests a different format, the IPI hardware is
configured with the wrong datatype, resulting in incorrect image output.
Fix by updating csi2->formats in the set_fmt callback to reflect the
currently negotiated format, ensuring the IPI configuration matches the
runtime datatype.
Fixes: ec40b431f0ab ("media: synopsys: csi2rx: add i.MX93 support")
Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
---
Changes in v2:
- New added in v2
---
drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
index 02eb4a6cafad..b3f90da8b43c 100644
--- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
+++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
@@ -470,6 +470,11 @@ static int dw_mipi_csi2rx_set_fmt(struct v4l2_subdev *sd,
*src = *sink;
+ /* Store the CSIS format descriptor for active formats. */
+ if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
+ csi2->formats = fmt ? :
+ dw_mipi_csi2rx_find_format(csi2, default_format.code);
+
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 3/7] media: synopsys: Add support for RAW16 Bayer formats
2026-04-23 8:22 [PATCH v2 0/7] media: synopsys: enhancements and i.MX95 support Guoniu Zhou
2026-04-23 8:22 ` [PATCH v2 1/7] media: synopsys: Fix out-of-bounds check in enum_mbus_code Guoniu Zhou
2026-04-23 8:22 ` [PATCH v2 2/7] media: synopsys: Fix IPI using hardcoded datatype Guoniu Zhou
@ 2026-04-23 8:22 ` Guoniu Zhou
2026-04-24 3:59 ` Frank Li
2026-04-23 8:22 ` [PATCH v2 4/7] media: synopsys: Add support for multiple streams Guoniu Zhou
` (3 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Guoniu Zhou @ 2026-04-23 8:22 UTC (permalink / raw)
To: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Frank Li, Sakari Ailus, Bryan O'Donoghue,
Mehdi Djait, Hans Verkuil
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
linux-rockchip, Guoniu Zhou
Add higher bit-depth raw image data support for the sensors, which supports
16-bit output.
Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
---
Changes in v2:
- Update commit message
---
drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
index b3f90da8b43c..d572d2eb3bcb 100644
--- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
+++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
@@ -252,6 +252,26 @@ static const struct dw_mipi_csi2rx_format formats[] = {
.depth = 12,
.csi_dt = MIPI_CSI2_DT_RAW12,
},
+ {
+ .code = MEDIA_BUS_FMT_SBGGR16_1X16,
+ .depth = 16,
+ .csi_dt = MIPI_CSI2_DT_RAW16,
+ },
+ {
+ .code = MEDIA_BUS_FMT_SGBRG16_1X16,
+ .depth = 16,
+ .csi_dt = MIPI_CSI2_DT_RAW16,
+ },
+ {
+ .code = MEDIA_BUS_FMT_SGRBG16_1X16,
+ .depth = 16,
+ .csi_dt = MIPI_CSI2_DT_RAW16,
+ },
+ {
+ .code = MEDIA_BUS_FMT_SRGGB16_1X16,
+ .depth = 16,
+ .csi_dt = MIPI_CSI2_DT_RAW16,
+ },
};
static inline struct dw_mipi_csi2rx_device *to_csi2(struct v4l2_subdev *sd)
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 4/7] media: synopsys: Add support for multiple streams
2026-04-23 8:22 [PATCH v2 0/7] media: synopsys: enhancements and i.MX95 support Guoniu Zhou
` (2 preceding siblings ...)
2026-04-23 8:22 ` [PATCH v2 3/7] media: synopsys: Add support for RAW16 Bayer formats Guoniu Zhou
@ 2026-04-23 8:22 ` Guoniu Zhou
2026-04-24 4:01 ` Frank Li
2026-04-23 8:23 ` [PATCH v2 5/7] media: synopsys: Add PHY stopstate wait for i.MX93 Guoniu Zhou
` (2 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Guoniu Zhou @ 2026-04-23 8:22 UTC (permalink / raw)
To: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Frank Li, Sakari Ailus, Bryan O'Donoghue,
Mehdi Djait, Hans Verkuil
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
linux-rockchip, Guoniu Zhou
The current driver only supports single stream operation. Add support
for multiple concurrent streams by tracking enabled streams with a
bitmask and only initializing the hardware once for the first stream.
This enables use cases such as surround view systems where multiple
camera streams need to be processed simultaneously through the same
CSI-2 receiver interface.
Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
---
Changes in v2:
- Simplify error handling by keeping goto labels instead of early returns
---
drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
index d572d2eb3bcb..5a2e74d055c0 100644
--- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
+++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
@@ -113,6 +113,7 @@ struct dw_mipi_csi2rx_device {
enum v4l2_mbus_type bus_type;
u32 lanes_num;
+ u64 enabled_streams;
const struct dw_mipi_csi2rx_drvdata *drvdata;
};
@@ -537,20 +538,26 @@ static int dw_mipi_csi2rx_enable_streams(struct v4l2_subdev *sd,
if (ret)
goto err;
- ret = dw_mipi_csi2rx_start(csi2);
- if (ret) {
- dev_err(dev, "failed to enable CSI hardware\n");
- goto err_pm_runtime_put;
+ if (!csi2->enabled_streams) {
+ ret = dw_mipi_csi2rx_start(csi2);
+ if (ret) {
+ dev_err(dev, "failed to enable CSI hardware\n");
+ goto err_pm_runtime_put;
+ }
}
ret = v4l2_subdev_enable_streams(remote_sd, remote_pad->index, mask);
if (ret)
goto err_csi_stop;
+ csi2->enabled_streams |= streams_mask;
+
return 0;
err_csi_stop:
- dw_mipi_csi2rx_stop(csi2);
+ /* Stop CSI hardware if no streams are enabled */
+ if (!csi2->enabled_streams)
+ dw_mipi_csi2rx_stop(csi2);
err_pm_runtime_put:
pm_runtime_put(dev);
err:
@@ -577,11 +584,16 @@ static int dw_mipi_csi2rx_disable_streams(struct v4l2_subdev *sd,
&streams_mask);
ret = v4l2_subdev_disable_streams(remote_sd, remote_pad->index, mask);
+ if (ret)
+ dev_err(dev, "failed to disable streams on remote subdev: %d\n", ret);
- dw_mipi_csi2rx_stop(csi2);
+ csi2->enabled_streams &= ~streams_mask;
pm_runtime_put(dev);
+ if (!csi2->enabled_streams)
+ dw_mipi_csi2rx_stop(csi2);
+
return ret;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 5/7] media: synopsys: Add PHY stopstate wait for i.MX93
2026-04-23 8:22 [PATCH v2 0/7] media: synopsys: enhancements and i.MX95 support Guoniu Zhou
` (3 preceding siblings ...)
2026-04-23 8:22 ` [PATCH v2 4/7] media: synopsys: Add support for multiple streams Guoniu Zhou
@ 2026-04-23 8:23 ` Guoniu Zhou
2026-04-24 4:02 ` Frank Li
2026-04-23 8:23 ` [PATCH v2 6/7] media: dt-bindings: add NXP i.MX95 compatible string Guoniu Zhou
2026-04-23 8:23 ` [PATCH v2 7/7] media: synopsys: Add support for i.MX95 Guoniu Zhou
6 siblings, 1 reply; 15+ messages in thread
From: Guoniu Zhou @ 2026-04-23 8:23 UTC (permalink / raw)
To: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Frank Li, Sakari Ailus, Bryan O'Donoghue,
Mehdi Djait, Hans Verkuil
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
linux-rockchip, Guoniu Zhou
Implement waiting for D-PHY lanes to enter stop state on i.MX93. This
ensures proper PHY initialization by verifying that the clock lane and
all active data lanes have entered the stop state before proceeding with
further operations.
Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
---
Changes in v2:
- Removes redundant register availability check
- Uses read_poll_timeout() with dw_mipi_csi2rx_read() instead of
readl_poll_timeout() with direct register address
- Fixes stopstate condition logic
- Check PHY stopstate after sensor enable instead of before to ensure
correct timing.
- Optimize PHY stopstate polling parameters (1000us->10us, 2s->1ms) to
balance performance and responsiveness.
---
drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 36 ++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
index 5a2e74d055c0..8c38fe8a3f06 100644
--- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
+++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
@@ -11,6 +11,7 @@
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
+#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/phy/phy.h>
@@ -35,6 +36,8 @@
#define DW_REG_EXIST BIT(31)
#define DW_REG(x) (DW_REG_EXIST | (x))
+#define DPHY_STOPSTATE_CLK_LANE BIT(16)
+
#define DPHY_TEST_CTRL0_TEST_CLR BIT(0)
#define IPI_VCID_VC(x) FIELD_PREP(GENMASK(1, 0), (x))
@@ -65,6 +68,7 @@ enum dw_mipi_csi2rx_regs_index {
DW_MIPI_CSI2RX_PHY_TST_CTRL0,
DW_MIPI_CSI2RX_PHY_TST_CTRL1,
DW_MIPI_CSI2RX_PHY_SHUTDOWNZ,
+ DW_MIPI_CSI2RX_PHY_STOPSTATE,
DW_MIPI_CSI2RX_IPI_DATATYPE,
DW_MIPI_CSI2RX_IPI_MEM_FLUSH,
DW_MIPI_CSI2RX_IPI_MODE,
@@ -87,6 +91,7 @@ struct dw_mipi_csi2rx_drvdata {
void (*dphy_assert_reset)(struct dw_mipi_csi2rx_device *csi2);
void (*dphy_deassert_reset)(struct dw_mipi_csi2rx_device *csi2);
void (*ipi_enable)(struct dw_mipi_csi2rx_device *csi2);
+ int (*wait_for_phy_stopstate)(struct dw_mipi_csi2rx_device *csi2);
};
struct dw_mipi_csi2rx_format {
@@ -139,6 +144,7 @@ static const u32 imx93_regs[DW_MIPI_CSI2RX_MAX] = {
[DW_MIPI_CSI2RX_PHY_SHUTDOWNZ] = DW_REG(0x40),
[DW_MIPI_CSI2RX_DPHY_RSTZ] = DW_REG(0x44),
[DW_MIPI_CSI2RX_PHY_STATE] = DW_REG(0x48),
+ [DW_MIPI_CSI2RX_PHY_STOPSTATE] = DW_REG(0x4c),
[DW_MIPI_CSI2RX_PHY_TST_CTRL0] = DW_REG(0x50),
[DW_MIPI_CSI2RX_PHY_TST_CTRL1] = DW_REG(0x54),
[DW_MIPI_CSI2RX_IPI_MODE] = DW_REG(0x80),
@@ -550,10 +556,19 @@ static int dw_mipi_csi2rx_enable_streams(struct v4l2_subdev *sd,
if (ret)
goto err_csi_stop;
+ if (!csi2->enabled_streams &&
+ csi2->drvdata->wait_for_phy_stopstate) {
+ ret = csi2->drvdata->wait_for_phy_stopstate(csi2);
+ if (ret)
+ goto err_disable_streams;
+ }
+
csi2->enabled_streams |= streams_mask;
return 0;
+err_disable_streams:
+ v4l2_subdev_disable_streams(remote_sd, remote_pad->index, mask);
err_csi_stop:
/* Stop CSI hardware if no streams are enabled */
if (!csi2->enabled_streams)
@@ -864,11 +879,32 @@ static void imx93_csi2rx_dphy_ipi_enable(struct dw_mipi_csi2rx_device *csi2)
dw_mipi_csi2rx_write(csi2, DW_MIPI_CSI2RX_IPI_MODE, val);
}
+static int imx93_csi2rx_wait_for_phy_stopstate(struct dw_mipi_csi2rx_device *csi2)
+{
+ struct device *dev = csi2->dev;
+ u32 stopstate_mask;
+ u32 val;
+ int ret;
+
+ stopstate_mask = DPHY_STOPSTATE_CLK_LANE | GENMASK(csi2->lanes_num - 1, 0);
+
+ ret = read_poll_timeout(dw_mipi_csi2rx_read, val,
+ (val & stopstate_mask) == stopstate_mask,
+ 10, 1000, true,
+ csi2, DW_MIPI_CSI2RX_PHY_STOPSTATE);
+ if (ret)
+ dev_err(dev, "lanes are not in stop state: %#x, expected %#x\n",
+ val, stopstate_mask);
+
+ return ret;
+}
+
static const struct dw_mipi_csi2rx_drvdata imx93_drvdata = {
.regs = imx93_regs,
.dphy_assert_reset = imx93_csi2rx_dphy_assert_reset,
.dphy_deassert_reset = imx93_csi2rx_dphy_deassert_reset,
.ipi_enable = imx93_csi2rx_dphy_ipi_enable,
+ .wait_for_phy_stopstate = imx93_csi2rx_wait_for_phy_stopstate,
};
static const struct of_device_id dw_mipi_csi2rx_of_match[] = {
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 6/7] media: dt-bindings: add NXP i.MX95 compatible string
2026-04-23 8:22 [PATCH v2 0/7] media: synopsys: enhancements and i.MX95 support Guoniu Zhou
` (4 preceding siblings ...)
2026-04-23 8:23 ` [PATCH v2 5/7] media: synopsys: Add PHY stopstate wait for i.MX93 Guoniu Zhou
@ 2026-04-23 8:23 ` Guoniu Zhou
2026-04-24 4:05 ` Frank Li
2026-04-25 9:50 ` Krzysztof Kozlowski
2026-04-23 8:23 ` [PATCH v2 7/7] media: synopsys: Add support for i.MX95 Guoniu Zhou
6 siblings, 2 replies; 15+ messages in thread
From: Guoniu Zhou @ 2026-04-23 8:23 UTC (permalink / raw)
To: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Frank Li, Sakari Ailus, Bryan O'Donoghue,
Mehdi Djait, Hans Verkuil
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
linux-rockchip, Guoniu Zhou
The i.MX95 CSI-2 controller is nearly identical to i.MX93, with the
main difference being the data output interface:
i.MX93 use IPI (Image Pixel Interface), which requires:
- Pixel clock input
- Software configuration through registers
i.MX95 uses IDI (Image Data Interface), which:
- Does not require pixel clock
- Is software transparent (no register configuration needed)
Due to these differences in register layout and initialization needs,
the two variants cannot share the same compatible string. The driver
needs to distinguish between them to handle the interface correctly.
Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
---
Changes in v2:
- Add dedicated constraint block for i.MX95 to reflect different clock
requirements (only per clock needed vs i.MX93 which needs both per
and pixel clocks)
- Update commit message to include more details about interface differences
---
.../bindings/media/rockchip,rk3568-mipi-csi2.yaml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi2.yaml b/Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi2.yaml
index 4ac4a3b6f406..4e0bc75c2136 100644
--- a/Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi2.yaml
+++ b/Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi2.yaml
@@ -18,6 +18,7 @@ properties:
compatible:
enum:
- fsl,imx93-mipi-csi2
+ - fsl,imx95-mipi-csi2
- rockchip,rk3568-mipi-csi2
reg:
@@ -135,6 +136,21 @@ allOf:
clock-names:
minItems: 2
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: fsl,imx95-mipi-csi2
+ then:
+ properties:
+ interrupts:
+ maxItems: 1
+ interrupt-names: false
+ clocks:
+ maxItems: 1
+ clock-names:
+ maxItems: 1
+
examples:
- |
#include <dt-bindings/clock/rk3568-cru.h>
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 7/7] media: synopsys: Add support for i.MX95
2026-04-23 8:22 [PATCH v2 0/7] media: synopsys: enhancements and i.MX95 support Guoniu Zhou
` (5 preceding siblings ...)
2026-04-23 8:23 ` [PATCH v2 6/7] media: dt-bindings: add NXP i.MX95 compatible string Guoniu Zhou
@ 2026-04-23 8:23 ` Guoniu Zhou
6 siblings, 0 replies; 15+ messages in thread
From: Guoniu Zhou @ 2026-04-23 8:23 UTC (permalink / raw)
To: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Frank Li, Sakari Ailus, Bryan O'Donoghue,
Mehdi Djait, Hans Verkuil
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
linux-rockchip, Guoniu Zhou
Add support for the i.MX95 MIPI CSI-2 receiver. The i.MX95 variant is
nearly identical to i.MX93, with the main difference being the use of
IDI (Image Data Interface) instead of IPI (Image Pixel Interface).
However, the IDI interface is transparent to software, requiring only
a different register map definition while sharing the same PHY control
functions with i.MX93.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
---
Changes in v2:
- Add Reviewed-by tag from Frank Li <Frank.Li@nxp.com>
---
drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
index 8c38fe8a3f06..62910d61eb64 100644
--- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
+++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
@@ -154,6 +154,17 @@ static const u32 imx93_regs[DW_MIPI_CSI2RX_MAX] = {
[DW_MIPI_CSI2RX_IPI_SOFTRSTN] = DW_REG(0xa0),
};
+static const u32 imx95_regs[DW_MIPI_CSI2RX_MAX] = {
+ [DW_MIPI_CSI2RX_N_LANES] = DW_REG(0x4),
+ [DW_MIPI_CSI2RX_RESETN] = DW_REG(0x8),
+ [DW_MIPI_CSI2RX_PHY_SHUTDOWNZ] = DW_REG(0x40),
+ [DW_MIPI_CSI2RX_DPHY_RSTZ] = DW_REG(0x44),
+ [DW_MIPI_CSI2RX_PHY_STATE] = DW_REG(0x48),
+ [DW_MIPI_CSI2RX_PHY_STOPSTATE] = DW_REG(0x4c),
+ [DW_MIPI_CSI2RX_PHY_TST_CTRL0] = DW_REG(0x50),
+ [DW_MIPI_CSI2RX_PHY_TST_CTRL1] = DW_REG(0x54),
+};
+
static const struct v4l2_mbus_framefmt default_format = {
.width = 3840,
.height = 2160,
@@ -907,11 +918,22 @@ static const struct dw_mipi_csi2rx_drvdata imx93_drvdata = {
.wait_for_phy_stopstate = imx93_csi2rx_wait_for_phy_stopstate,
};
+static const struct dw_mipi_csi2rx_drvdata imx95_drvdata = {
+ .regs = imx95_regs,
+ .dphy_assert_reset = imx93_csi2rx_dphy_assert_reset,
+ .dphy_deassert_reset = imx93_csi2rx_dphy_deassert_reset,
+ .wait_for_phy_stopstate = imx93_csi2rx_wait_for_phy_stopstate,
+};
+
static const struct of_device_id dw_mipi_csi2rx_of_match[] = {
{
.compatible = "fsl,imx93-mipi-csi2",
.data = &imx93_drvdata,
},
+ {
+ .compatible = "fsl,imx95-mipi-csi2",
+ .data = &imx95_drvdata,
+ },
{
.compatible = "rockchip,rk3568-mipi-csi2",
.data = &rk3568_drvdata,
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/7] media: synopsys: Fix out-of-bounds check in enum_mbus_code
2026-04-23 8:22 ` [PATCH v2 1/7] media: synopsys: Fix out-of-bounds check in enum_mbus_code Guoniu Zhou
@ 2026-04-24 3:57 ` Frank Li
0 siblings, 0 replies; 15+ messages in thread
From: Frank Li @ 2026-04-24 3:57 UTC (permalink / raw)
To: Guoniu Zhou
Cc: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Sakari Ailus, Bryan O'Donoghue, Mehdi Djait,
Hans Verkuil, linux-media, linux-kernel, devicetree, imx,
linux-arm-kernel, linux-rockchip
On Thu, Apr 23, 2026 at 04:22:56PM +0800, Guoniu Zhou wrote:
> dw_mipi_csi2rx_enum_mbus_code() contains an off-by-one error in the
> bounds check for code->index, allowing an access past the end of the
> formats array.
>
> Fixes: 355a11004066 ("media: synopsys: add driver for the designware mipi csi-2 receiver")
> Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Changes in v2:
> - New added in v2
> ---
> drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> index ce17f986279e..02eb4a6cafad 100644
> --- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> +++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> @@ -430,7 +430,7 @@ dw_mipi_csi2rx_enum_mbus_code(struct v4l2_subdev *sd,
>
> return 0;
> case DW_MIPI_CSI2RX_PAD_SINK:
> - if (code->index > csi2->formats_num)
> + if (code->index >= csi2->formats_num)
> return -EINVAL;
>
> code->code = csi2->formats[code->index].code;
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 2/7] media: synopsys: Fix IPI using hardcoded datatype
2026-04-23 8:22 ` [PATCH v2 2/7] media: synopsys: Fix IPI using hardcoded datatype Guoniu Zhou
@ 2026-04-24 3:58 ` Frank Li
0 siblings, 0 replies; 15+ messages in thread
From: Frank Li @ 2026-04-24 3:58 UTC (permalink / raw)
To: Guoniu Zhou
Cc: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Sakari Ailus, Bryan O'Donoghue, Mehdi Djait,
Hans Verkuil, linux-media, linux-kernel, devicetree, imx,
linux-arm-kernel, linux-rockchip
On Thu, Apr 23, 2026 at 04:22:57PM +0800, Guoniu Zhou wrote:
> The imx93_csi2rx_dphy_ipi_enable() function configures the IPI datatype
> using csi2->formats->csi_dt, which is initialized during probe but never
> updated in set_fmt(). This causes the IPI to always use the probe-time
> default datatype, ignoring the actual media bus format negotiated at
> runtime. When userspace requests a different format, the IPI hardware is
> configured with the wrong datatype, resulting in incorrect image output.
>
> Fix by updating csi2->formats in the set_fmt callback to reflect the
> currently negotiated format, ensuring the IPI configuration matches the
> runtime datatype.
>
> Fixes: ec40b431f0ab ("media: synopsys: csi2rx: add i.MX93 support")
> Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Changes in v2:
> - New added in v2
> ---
> drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> index 02eb4a6cafad..b3f90da8b43c 100644
> --- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> +++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> @@ -470,6 +470,11 @@ static int dw_mipi_csi2rx_set_fmt(struct v4l2_subdev *sd,
>
> *src = *sink;
>
> + /* Store the CSIS format descriptor for active formats. */
> + if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
> + csi2->formats = fmt ? :
> + dw_mipi_csi2rx_find_format(csi2, default_format.code);
> +
> return 0;
> }
>
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/7] media: synopsys: Add support for RAW16 Bayer formats
2026-04-23 8:22 ` [PATCH v2 3/7] media: synopsys: Add support for RAW16 Bayer formats Guoniu Zhou
@ 2026-04-24 3:59 ` Frank Li
0 siblings, 0 replies; 15+ messages in thread
From: Frank Li @ 2026-04-24 3:59 UTC (permalink / raw)
To: Guoniu Zhou
Cc: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Sakari Ailus, Bryan O'Donoghue, Mehdi Djait,
Hans Verkuil, linux-media, linux-kernel, devicetree, imx,
linux-arm-kernel, linux-rockchip
On Thu, Apr 23, 2026 at 04:22:58PM +0800, Guoniu Zhou wrote:
> Add higher bit-depth raw image data support for the sensors, which supports
> 16-bit output.
>
> Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Changes in v2:
> - Update commit message
> ---
> drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> index b3f90da8b43c..d572d2eb3bcb 100644
> --- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> +++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> @@ -252,6 +252,26 @@ static const struct dw_mipi_csi2rx_format formats[] = {
> .depth = 12,
> .csi_dt = MIPI_CSI2_DT_RAW12,
> },
> + {
> + .code = MEDIA_BUS_FMT_SBGGR16_1X16,
> + .depth = 16,
> + .csi_dt = MIPI_CSI2_DT_RAW16,
> + },
> + {
> + .code = MEDIA_BUS_FMT_SGBRG16_1X16,
> + .depth = 16,
> + .csi_dt = MIPI_CSI2_DT_RAW16,
> + },
> + {
> + .code = MEDIA_BUS_FMT_SGRBG16_1X16,
> + .depth = 16,
> + .csi_dt = MIPI_CSI2_DT_RAW16,
> + },
> + {
> + .code = MEDIA_BUS_FMT_SRGGB16_1X16,
> + .depth = 16,
> + .csi_dt = MIPI_CSI2_DT_RAW16,
> + },
> };
>
> static inline struct dw_mipi_csi2rx_device *to_csi2(struct v4l2_subdev *sd)
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 4/7] media: synopsys: Add support for multiple streams
2026-04-23 8:22 ` [PATCH v2 4/7] media: synopsys: Add support for multiple streams Guoniu Zhou
@ 2026-04-24 4:01 ` Frank Li
0 siblings, 0 replies; 15+ messages in thread
From: Frank Li @ 2026-04-24 4:01 UTC (permalink / raw)
To: Guoniu Zhou
Cc: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Sakari Ailus, Bryan O'Donoghue, Mehdi Djait,
Hans Verkuil, linux-media, linux-kernel, devicetree, imx,
linux-arm-kernel, linux-rockchip
On Thu, Apr 23, 2026 at 04:22:59PM +0800, Guoniu Zhou wrote:
> The current driver only supports single stream operation. Add support
> for multiple concurrent streams by tracking enabled streams with a
> bitmask and only initializing the hardware once for the first stream.
>
> This enables use cases such as surround view systems where multiple
> camera streams need to be processed simultaneously through the same
> CSI-2 receiver interface.
>
> Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Changes in v2:
> - Simplify error handling by keeping goto labels instead of early returns
> ---
> drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 24 ++++++++++++++++++------
> 1 file changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> index d572d2eb3bcb..5a2e74d055c0 100644
> --- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> +++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> @@ -113,6 +113,7 @@ struct dw_mipi_csi2rx_device {
>
> enum v4l2_mbus_type bus_type;
> u32 lanes_num;
> + u64 enabled_streams;
>
> const struct dw_mipi_csi2rx_drvdata *drvdata;
> };
> @@ -537,20 +538,26 @@ static int dw_mipi_csi2rx_enable_streams(struct v4l2_subdev *sd,
> if (ret)
> goto err;
>
> - ret = dw_mipi_csi2rx_start(csi2);
> - if (ret) {
> - dev_err(dev, "failed to enable CSI hardware\n");
> - goto err_pm_runtime_put;
> + if (!csi2->enabled_streams) {
> + ret = dw_mipi_csi2rx_start(csi2);
> + if (ret) {
> + dev_err(dev, "failed to enable CSI hardware\n");
> + goto err_pm_runtime_put;
> + }
> }
>
> ret = v4l2_subdev_enable_streams(remote_sd, remote_pad->index, mask);
> if (ret)
> goto err_csi_stop;
>
> + csi2->enabled_streams |= streams_mask;
> +
> return 0;
>
> err_csi_stop:
> - dw_mipi_csi2rx_stop(csi2);
> + /* Stop CSI hardware if no streams are enabled */
> + if (!csi2->enabled_streams)
> + dw_mipi_csi2rx_stop(csi2);
> err_pm_runtime_put:
> pm_runtime_put(dev);
> err:
> @@ -577,11 +584,16 @@ static int dw_mipi_csi2rx_disable_streams(struct v4l2_subdev *sd,
> &streams_mask);
>
> ret = v4l2_subdev_disable_streams(remote_sd, remote_pad->index, mask);
> + if (ret)
> + dev_err(dev, "failed to disable streams on remote subdev: %d\n", ret);
>
> - dw_mipi_csi2rx_stop(csi2);
> + csi2->enabled_streams &= ~streams_mask;
>
> pm_runtime_put(dev);
>
> + if (!csi2->enabled_streams)
> + dw_mipi_csi2rx_stop(csi2);
> +
> return ret;
> }
>
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 5/7] media: synopsys: Add PHY stopstate wait for i.MX93
2026-04-23 8:23 ` [PATCH v2 5/7] media: synopsys: Add PHY stopstate wait for i.MX93 Guoniu Zhou
@ 2026-04-24 4:02 ` Frank Li
0 siblings, 0 replies; 15+ messages in thread
From: Frank Li @ 2026-04-24 4:02 UTC (permalink / raw)
To: Guoniu Zhou
Cc: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Sakari Ailus, Bryan O'Donoghue, Mehdi Djait,
Hans Verkuil, linux-media, linux-kernel, devicetree, imx,
linux-arm-kernel, linux-rockchip
On Thu, Apr 23, 2026 at 04:23:00PM +0800, Guoniu Zhou wrote:
> Implement waiting for D-PHY lanes to enter stop state on i.MX93. This
> ensures proper PHY initialization by verifying that the clock lane and
> all active data lanes have entered the stop state before proceeding with
> further operations.
>
> Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Changes in v2:
> - Removes redundant register availability check
> - Uses read_poll_timeout() with dw_mipi_csi2rx_read() instead of
> readl_poll_timeout() with direct register address
> - Fixes stopstate condition logic
> - Check PHY stopstate after sensor enable instead of before to ensure
> correct timing.
> - Optimize PHY stopstate polling parameters (1000us->10us, 2s->1ms) to
> balance performance and responsiveness.
> ---
> drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 36 ++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> index 5a2e74d055c0..8c38fe8a3f06 100644
> --- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> +++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> @@ -11,6 +11,7 @@
> #include <linux/clk.h>
> #include <linux/delay.h>
> #include <linux/io.h>
> +#include <linux/iopoll.h>
> #include <linux/module.h>
> #include <linux/of.h>
> #include <linux/phy/phy.h>
> @@ -35,6 +36,8 @@
> #define DW_REG_EXIST BIT(31)
> #define DW_REG(x) (DW_REG_EXIST | (x))
>
> +#define DPHY_STOPSTATE_CLK_LANE BIT(16)
> +
> #define DPHY_TEST_CTRL0_TEST_CLR BIT(0)
>
> #define IPI_VCID_VC(x) FIELD_PREP(GENMASK(1, 0), (x))
> @@ -65,6 +68,7 @@ enum dw_mipi_csi2rx_regs_index {
> DW_MIPI_CSI2RX_PHY_TST_CTRL0,
> DW_MIPI_CSI2RX_PHY_TST_CTRL1,
> DW_MIPI_CSI2RX_PHY_SHUTDOWNZ,
> + DW_MIPI_CSI2RX_PHY_STOPSTATE,
> DW_MIPI_CSI2RX_IPI_DATATYPE,
> DW_MIPI_CSI2RX_IPI_MEM_FLUSH,
> DW_MIPI_CSI2RX_IPI_MODE,
> @@ -87,6 +91,7 @@ struct dw_mipi_csi2rx_drvdata {
> void (*dphy_assert_reset)(struct dw_mipi_csi2rx_device *csi2);
> void (*dphy_deassert_reset)(struct dw_mipi_csi2rx_device *csi2);
> void (*ipi_enable)(struct dw_mipi_csi2rx_device *csi2);
> + int (*wait_for_phy_stopstate)(struct dw_mipi_csi2rx_device *csi2);
> };
>
> struct dw_mipi_csi2rx_format {
> @@ -139,6 +144,7 @@ static const u32 imx93_regs[DW_MIPI_CSI2RX_MAX] = {
> [DW_MIPI_CSI2RX_PHY_SHUTDOWNZ] = DW_REG(0x40),
> [DW_MIPI_CSI2RX_DPHY_RSTZ] = DW_REG(0x44),
> [DW_MIPI_CSI2RX_PHY_STATE] = DW_REG(0x48),
> + [DW_MIPI_CSI2RX_PHY_STOPSTATE] = DW_REG(0x4c),
> [DW_MIPI_CSI2RX_PHY_TST_CTRL0] = DW_REG(0x50),
> [DW_MIPI_CSI2RX_PHY_TST_CTRL1] = DW_REG(0x54),
> [DW_MIPI_CSI2RX_IPI_MODE] = DW_REG(0x80),
> @@ -550,10 +556,19 @@ static int dw_mipi_csi2rx_enable_streams(struct v4l2_subdev *sd,
> if (ret)
> goto err_csi_stop;
>
> + if (!csi2->enabled_streams &&
> + csi2->drvdata->wait_for_phy_stopstate) {
> + ret = csi2->drvdata->wait_for_phy_stopstate(csi2);
> + if (ret)
> + goto err_disable_streams;
> + }
> +
> csi2->enabled_streams |= streams_mask;
>
> return 0;
>
> +err_disable_streams:
> + v4l2_subdev_disable_streams(remote_sd, remote_pad->index, mask);
> err_csi_stop:
> /* Stop CSI hardware if no streams are enabled */
> if (!csi2->enabled_streams)
> @@ -864,11 +879,32 @@ static void imx93_csi2rx_dphy_ipi_enable(struct dw_mipi_csi2rx_device *csi2)
> dw_mipi_csi2rx_write(csi2, DW_MIPI_CSI2RX_IPI_MODE, val);
> }
>
> +static int imx93_csi2rx_wait_for_phy_stopstate(struct dw_mipi_csi2rx_device *csi2)
> +{
> + struct device *dev = csi2->dev;
> + u32 stopstate_mask;
> + u32 val;
> + int ret;
> +
> + stopstate_mask = DPHY_STOPSTATE_CLK_LANE | GENMASK(csi2->lanes_num - 1, 0);
> +
> + ret = read_poll_timeout(dw_mipi_csi2rx_read, val,
> + (val & stopstate_mask) == stopstate_mask,
> + 10, 1000, true,
> + csi2, DW_MIPI_CSI2RX_PHY_STOPSTATE);
> + if (ret)
> + dev_err(dev, "lanes are not in stop state: %#x, expected %#x\n",
> + val, stopstate_mask);
> +
> + return ret;
> +}
> +
> static const struct dw_mipi_csi2rx_drvdata imx93_drvdata = {
> .regs = imx93_regs,
> .dphy_assert_reset = imx93_csi2rx_dphy_assert_reset,
> .dphy_deassert_reset = imx93_csi2rx_dphy_deassert_reset,
> .ipi_enable = imx93_csi2rx_dphy_ipi_enable,
> + .wait_for_phy_stopstate = imx93_csi2rx_wait_for_phy_stopstate,
> };
>
> static const struct of_device_id dw_mipi_csi2rx_of_match[] = {
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 6/7] media: dt-bindings: add NXP i.MX95 compatible string
2026-04-23 8:23 ` [PATCH v2 6/7] media: dt-bindings: add NXP i.MX95 compatible string Guoniu Zhou
@ 2026-04-24 4:05 ` Frank Li
2026-04-25 9:50 ` Krzysztof Kozlowski
1 sibling, 0 replies; 15+ messages in thread
From: Frank Li @ 2026-04-24 4:05 UTC (permalink / raw)
To: Guoniu Zhou
Cc: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Sakari Ailus, Bryan O'Donoghue, Mehdi Djait,
Hans Verkuil, linux-media, linux-kernel, devicetree, imx,
linux-arm-kernel, linux-rockchip
On Thu, Apr 23, 2026 at 04:23:01PM +0800, Guoniu Zhou wrote:
> The i.MX95 CSI-2 controller is nearly identical to i.MX93, with the
> main difference being the data output interface:
>
> i.MX93 use IPI (Image Pixel Interface), which requires:
> - Pixel clock input
> - Software configuration through registers
>
> i.MX95 uses IDI (Image Data Interface), which:
> - Does not require pixel clock
> - Is software transparent (no register configuration needed)
Nit: Remove "Is", just "Software ... "
>
> Due to these differences in register layout and initialization needs,
> the two variants cannot share the same compatible string. The driver
> needs to distinguish between them to handle the interface correctly.
>
> Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Changes in v2:
> - Add dedicated constraint block for i.MX95 to reflect different clock
> requirements (only per clock needed vs i.MX93 which needs both per
> and pixel clocks)
> - Update commit message to include more details about interface differences
> ---
> .../bindings/media/rockchip,rk3568-mipi-csi2.yaml | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi2.yaml b/Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi2.yaml
> index 4ac4a3b6f406..4e0bc75c2136 100644
> --- a/Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi2.yaml
> +++ b/Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi2.yaml
> @@ -18,6 +18,7 @@ properties:
> compatible:
> enum:
> - fsl,imx93-mipi-csi2
> + - fsl,imx95-mipi-csi2
> - rockchip,rk3568-mipi-csi2
>
> reg:
> @@ -135,6 +136,21 @@ allOf:
> clock-names:
> minItems: 2
>
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: fsl,imx95-mipi-csi2
> + then:
> + properties:
> + interrupts:
> + maxItems: 1
> + interrupt-names: false
> + clocks:
> + maxItems: 1
> + clock-names:
> + maxItems: 1
> +
> examples:
> - |
> #include <dt-bindings/clock/rk3568-cru.h>
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 6/7] media: dt-bindings: add NXP i.MX95 compatible string
2026-04-23 8:23 ` [PATCH v2 6/7] media: dt-bindings: add NXP i.MX95 compatible string Guoniu Zhou
2026-04-24 4:05 ` Frank Li
@ 2026-04-25 9:50 ` Krzysztof Kozlowski
1 sibling, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2026-04-25 9:50 UTC (permalink / raw)
To: Guoniu Zhou
Cc: Michael Riesch, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Laurent Pinchart, Frank Li, Sakari Ailus, Bryan O'Donoghue,
Mehdi Djait, Hans Verkuil, linux-media, linux-kernel, devicetree,
imx, linux-arm-kernel, linux-rockchip
On Thu, Apr 23, 2026 at 04:23:01PM +0800, Guoniu Zhou wrote:
> The i.MX95 CSI-2 controller is nearly identical to i.MX93, with the
> main difference being the data output interface:
>
> i.MX93 use IPI (Image Pixel Interface), which requires:
> - Pixel clock input
> - Software configuration through registers
>
> i.MX95 uses IDI (Image Data Interface), which:
> - Does not require pixel clock
> - Is software transparent (no register configuration needed)
>
> Due to these differences in register layout and initialization needs,
> the two variants cannot share the same compatible string. The driver
> needs to distinguish between them to handle the interface correctly.
>
> Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> ---
> Changes in v2:
> - Add dedicated constraint block for i.MX95 to reflect different clock
> requirements (only per clock needed vs i.MX93 which needs both per
> and pixel clocks)
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-04-25 9:50 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-23 8:22 [PATCH v2 0/7] media: synopsys: enhancements and i.MX95 support Guoniu Zhou
2026-04-23 8:22 ` [PATCH v2 1/7] media: synopsys: Fix out-of-bounds check in enum_mbus_code Guoniu Zhou
2026-04-24 3:57 ` Frank Li
2026-04-23 8:22 ` [PATCH v2 2/7] media: synopsys: Fix IPI using hardcoded datatype Guoniu Zhou
2026-04-24 3:58 ` Frank Li
2026-04-23 8:22 ` [PATCH v2 3/7] media: synopsys: Add support for RAW16 Bayer formats Guoniu Zhou
2026-04-24 3:59 ` Frank Li
2026-04-23 8:22 ` [PATCH v2 4/7] media: synopsys: Add support for multiple streams Guoniu Zhou
2026-04-24 4:01 ` Frank Li
2026-04-23 8:23 ` [PATCH v2 5/7] media: synopsys: Add PHY stopstate wait for i.MX93 Guoniu Zhou
2026-04-24 4:02 ` Frank Li
2026-04-23 8:23 ` [PATCH v2 6/7] media: dt-bindings: add NXP i.MX95 compatible string Guoniu Zhou
2026-04-24 4:05 ` Frank Li
2026-04-25 9:50 ` Krzysztof Kozlowski
2026-04-23 8:23 ` [PATCH v2 7/7] media: synopsys: Add support for i.MX95 Guoniu Zhou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox