[PATCH 4/5] media: imx8mq-mipi-csi2: Explicitly release reset

guoniu.zhou@oss.nxp.com posted 5 patches 1 month, 3 weeks ago
There is a newer version of this series
[PATCH 4/5] media: imx8mq-mipi-csi2: Explicitly release reset
Posted by guoniu.zhou@oss.nxp.com 1 month, 3 weeks ago
From: Guoniu Zhou <guoniu.zhou@nxp.com>

Call reset_control_deassert() to explicitly release reset to
make sure reset bits are cleared since platform like i.MX8ULP
can't clear its reset bits automatically.

Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com>
---
 drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
index be07ff27071f..071d939d9048 100644
--- a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
+++ b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
@@ -371,9 +371,7 @@ static int imx8mq_mipi_csi_sw_reset(struct csi_state *state)
 	int ret;
 
 	/*
-	 * these are most likely self-clearing reset bits. to make it
-	 * more clear, the reset-imx7 driver should implement the
-	 * .reset() operation.
+	 * Explicitly release reset to make sure reset bits are cleared.
 	 */
 	ret = reset_control_assert(state->rst);
 	if (ret < 0) {
@@ -381,7 +379,7 @@ static int imx8mq_mipi_csi_sw_reset(struct csi_state *state)
 		return ret;
 	}
 
-	return 0;
+	return reset_control_deassert(state->rst);
 }
 
 static void imx8mq_mipi_csi_set_params(struct csi_state *state)
-- 
2.34.1
Re: [PATCH 4/5] media: imx8mq-mipi-csi2: Explicitly release reset
Posted by Frank Li 1 month, 3 weeks ago
On Tue, Aug 12, 2025 at 04:19:25PM +0800, guoniu.zhou@oss.nxp.com wrote:
> From: Guoniu Zhou <guoniu.zhou@nxp.com>
>
> Call reset_control_deassert() to explicitly release reset to
> make sure reset bits are cleared since platform like i.MX8ULP
> can't clear its reset bits automatically.

nit: wrap at 75 char

>
> Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com>

> ---
>  drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
> index be07ff27071f..071d939d9048 100644
> --- a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
> +++ b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
> @@ -371,9 +371,7 @@ static int imx8mq_mipi_csi_sw_reset(struct csi_state *state)
>  	int ret;
>
>  	/*
> -	 * these are most likely self-clearing reset bits. to make it
> -	 * more clear, the reset-imx7 driver should implement the
> -	 * .reset() operation.
> +	 * Explicitly release reset to make sure reset bits are cleared.

this comments should be above reset_control_deassert()

Frank
>  	 */
>  	ret = reset_control_assert(state->rst);
>  	if (ret < 0) {
> @@ -381,7 +379,7 @@ static int imx8mq_mipi_csi_sw_reset(struct csi_state *state)
>  		return ret;
>  	}
>
> -	return 0;
> +	return reset_control_deassert(state->rst);
>  }
>
>  static void imx8mq_mipi_csi_set_params(struct csi_state *state)
> --
> 2.34.1
>