mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v7 0/2] media: i2c: imx412: power on timing adjust
@ 2026-01-23  9:19 Wenmeng Liu
  2026-01-23  9:19 ` [PATCH v7 1/2] media: i2c: imx412: Assert reset GPIO during probe Wenmeng Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Wenmeng Liu @ 2026-01-23  9:19 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Wenmeng Liu

This series of patches mainly addresses two issues:
1. Fix potential timing issues that may occur during the first and second power on.
If the reset GPIO happens to default to the deasserted state at the very
first power-up, the previous sequence could let the sensor run before
supplies/clock are fully stable, while subsequent power cycles would
differ because the driver explicitly toggles reset. This results in
inconsistent power on sequences between the first and later power on.

2. The Arducam IMX577 sensor requires a longer reset time.

Changes in v7:
- Add vendor details to the comments. -- Sakari
- Link to v6: https://lore.kernel.org/r/20260122-imx412-v6-0-2c0b54594c2a@oss.qualcomm.com

Changes in v6:
- Added comments for the modifications. -- Sakari
- Link to v5: https://lore.kernel.org/r/20260121-imx412-v5-0-be67654a4afe@oss.qualcomm.com

Changes in v5:
- Assert reset GPIO in imx412_parse_hw_config. -- Tarang
- Link to v4: https://lore.kernel.org/r/20260121-imx412-v4-0-f6bdf83f116b@oss.qualcomm.com

Changes in v4:
- Add assert reset in probe. -- Sakari
- Link to v3: https://lore.kernel.org/r/20260119-imx412-v3-0-8b46929af773@oss.qualcomm.com

Changes in v3:
- Fix power on timing. -- Bryan.
- Add reset delay time for Arducam Imx577.
- Link to v2: https://lore.kernel.org/all/20260109044913.3310-1-wenmeng.liu@oss.qualcomm.com/

Changes in v2:
- Move the 7.4–8 ms delay before mode-register programming to satisfy T7 (NVM read).
- Link to v1: https://lore.kernel.org/all/20251222-imx412-v1-1-51c7e724b376@oss.qualcomm.com/

---
Wenmeng Liu (2):
      media: i2c: imx412: Assert reset GPIO during probe
      media: i2c: imx412: Extend the power-on waiting time

 drivers/media/i2c/imx412.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
base-commit: e3b32dcb9f23e3c3927ef3eec6a5842a988fb574
change-id: 20260119-imx412-d6710b9fd3c6

Best regards,
-- 
Wenmeng Liu <wenmeng.liu@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v7 1/2] media: i2c: imx412: Assert reset GPIO during probe
  2026-01-23  9:19 [PATCH v7 0/2] media: i2c: imx412: power on timing adjust Wenmeng Liu
@ 2026-01-23  9:19 ` Wenmeng Liu
  2026-03-03 13:33   ` Sakari Ailus
  2026-01-23  9:19 ` [PATCH v7 2/2] media: i2c: imx412: Extend the power-on waiting time Wenmeng Liu
  2026-02-27  5:34 ` [PATCH v7 0/2] media: i2c: imx412: power on timing adjust Wenmeng Liu
  2 siblings, 1 reply; 6+ messages in thread
From: Wenmeng Liu @ 2026-01-23  9:19 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Wenmeng Liu

Assert the reset GPIO before first power up. This avoids a mismatch where
the first power up (when the reset GPIO defaults deasserted) differs from
subsequent cycles.

Signed-off-by: Wenmeng Liu <wenmeng.liu@oss.qualcomm.com>
---
 drivers/media/i2c/imx412.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
index b3826f80354703b17b416dc233854da3f5736e38..aa63dfc349181bf9c180ffd566b0317d05b410c1 100644
--- a/drivers/media/i2c/imx412.c
+++ b/drivers/media/i2c/imx412.c
@@ -925,7 +925,7 @@ static int imx412_parse_hw_config(struct imx412 *imx412)
 
 	/* Request optional reset pin */
 	imx412->reset_gpio = devm_gpiod_get_optional(imx412->dev, "reset",
-						     GPIOD_OUT_LOW);
+						     GPIOD_OUT_HIGH);
 	if (IS_ERR(imx412->reset_gpio)) {
 		dev_err(imx412->dev, "failed to get reset gpio %pe\n",
 			imx412->reset_gpio);

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v7 2/2] media: i2c: imx412: Extend the power-on waiting time
  2026-01-23  9:19 [PATCH v7 0/2] media: i2c: imx412: power on timing adjust Wenmeng Liu
  2026-01-23  9:19 ` [PATCH v7 1/2] media: i2c: imx412: Assert reset GPIO during probe Wenmeng Liu
@ 2026-01-23  9:19 ` Wenmeng Liu
  2026-02-27  5:34 ` [PATCH v7 0/2] media: i2c: imx412: power on timing adjust Wenmeng Liu
  2 siblings, 0 replies; 6+ messages in thread
From: Wenmeng Liu @ 2026-01-23  9:19 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Wenmeng Liu

The Arducam IMX577 module requires a longer reset time than the 1000µs
configured in the current driver. Increase the wait time after power-on
to ensure proper initialization.

Signed-off-by: Wenmeng Liu <wenmeng.liu@oss.qualcomm.com>
---
 drivers/media/i2c/imx412.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
index aa63dfc349181bf9c180ffd566b0317d05b410c1..e25e0a9ff65c3554d1d1c8297d945378c2c1f27b 100644
--- a/drivers/media/i2c/imx412.c
+++ b/drivers/media/i2c/imx412.c
@@ -1037,7 +1037,11 @@ static int imx412_power_on(struct device *dev)
 		goto error_reset;
 	}
 
-	usleep_range(1000, 1200);
+	/*
+	 * Certain Arducam IMX577 module variants require a longer reset settle
+	 * time. Increasing the delay from 1ms to 10ms ensures reliable startup.
+	 */
+	usleep_range(10000, 12000);
 
 	return 0;
 

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v7 0/2] media: i2c: imx412: power on timing adjust
  2026-01-23  9:19 [PATCH v7 0/2] media: i2c: imx412: power on timing adjust Wenmeng Liu
  2026-01-23  9:19 ` [PATCH v7 1/2] media: i2c: imx412: Assert reset GPIO during probe Wenmeng Liu
  2026-01-23  9:19 ` [PATCH v7 2/2] media: i2c: imx412: Extend the power-on waiting time Wenmeng Liu
@ 2026-02-27  5:34 ` Wenmeng Liu
  2026-02-27 22:01   ` Sakari Ailus
  2 siblings, 1 reply; 6+ messages in thread
From: Wenmeng Liu @ 2026-02-27  5:34 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab; +Cc: linux-media, linux-kernel



On 1/23/2026 5:19 PM, Wenmeng Liu wrote:
> This series of patches mainly addresses two issues:
> 1. Fix potential timing issues that may occur during the first and second power on.
> If the reset GPIO happens to default to the deasserted state at the very
> first power-up, the previous sequence could let the sensor run before
> supplies/clock are fully stable, while subsequent power cycles would
> differ because the driver explicitly toggles reset. This results in
> inconsistent power on sequences between the first and later power on.
> 
> 2. The Arducam IMX577 sensor requires a longer reset time.
> 
> Changes in v7:
> - Add vendor details to the comments. -- Sakari
> - Link to v6: https://lore.kernel.org/r/20260122-imx412-v6-0-2c0b54594c2a@oss.qualcomm.com
> 
> Changes in v6:
> - Added comments for the modifications. -- Sakari
> - Link to v5: https://lore.kernel.org/r/20260121-imx412-v5-0-be67654a4afe@oss.qualcomm.com
> 
> Changes in v5:
> - Assert reset GPIO in imx412_parse_hw_config. -- Tarang
> - Link to v4: https://lore.kernel.org/r/20260121-imx412-v4-0-f6bdf83f116b@oss.qualcomm.com
> 
> Changes in v4:
> - Add assert reset in probe. -- Sakari
> - Link to v3: https://lore.kernel.org/r/20260119-imx412-v3-0-8b46929af773@oss.qualcomm.com
> 
> Changes in v3:
> - Fix power on timing. -- Bryan.
> - Add reset delay time for Arducam Imx577.
> - Link to v2: https://lore.kernel.org/all/20260109044913.3310-1-wenmeng.liu@oss.qualcomm.com/
> 
> Changes in v2:
> - Move the 7.4–8 ms delay before mode-register programming to satisfy T7 (NVM read).
> - Link to v1: https://lore.kernel.org/all/20251222-imx412-v1-1-51c7e724b376@oss.qualcomm.com/
> 
> ---
> Wenmeng Liu (2):
>        media: i2c: imx412: Assert reset GPIO during probe
>        media: i2c: imx412: Extend the power-on waiting time
> 
>   drivers/media/i2c/imx412.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> ---
> base-commit: e3b32dcb9f23e3c3927ef3eec6a5842a988fb574
> change-id: 20260119-imx412-d6710b9fd3c6
> 
> Best regards,

Gentle reminder.

Thanks,
Wenmeng

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v7 0/2] media: i2c: imx412: power on timing adjust
  2026-02-27  5:34 ` [PATCH v7 0/2] media: i2c: imx412: power on timing adjust Wenmeng Liu
@ 2026-02-27 22:01   ` Sakari Ailus
  0 siblings, 0 replies; 6+ messages in thread
From: Sakari Ailus @ 2026-02-27 22:01 UTC (permalink / raw)
  To: Wenmeng Liu; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel

Hi Wenmeng,

On Fri, Feb 27, 2026 at 01:34:25PM +0800, Wenmeng Liu wrote:
> Gentle reminder.

I'll try to review these early next week.

-- 
Sakari Ailus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v7 1/2] media: i2c: imx412: Assert reset GPIO during probe
  2026-01-23  9:19 ` [PATCH v7 1/2] media: i2c: imx412: Assert reset GPIO during probe Wenmeng Liu
@ 2026-03-03 13:33   ` Sakari Ailus
  0 siblings, 0 replies; 6+ messages in thread
From: Sakari Ailus @ 2026-03-03 13:33 UTC (permalink / raw)
  To: Wenmeng Liu; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel

Hi Wenmeng,

On Fri, Jan 23, 2026 at 05:19:55PM +0800, Wenmeng Liu wrote:
> Assert the reset GPIO before first power up. This avoids a mismatch where
> the first power up (when the reset GPIO defaults deasserted) differs from
> subsequent cycles.
> 
> Signed-off-by: Wenmeng Liu <wenmeng.liu@oss.qualcomm.com>

I'll add:

Fixes: 9214e86c0cc1 ("media: i2c: Add imx412 camera sensor driver")
Cc: stable@vger.kernel.org

> ---
>  drivers/media/i2c/imx412.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
> index b3826f80354703b17b416dc233854da3f5736e38..aa63dfc349181bf9c180ffd566b0317d05b410c1 100644
> --- a/drivers/media/i2c/imx412.c
> +++ b/drivers/media/i2c/imx412.c
> @@ -925,7 +925,7 @@ static int imx412_parse_hw_config(struct imx412 *imx412)
>  
>  	/* Request optional reset pin */
>  	imx412->reset_gpio = devm_gpiod_get_optional(imx412->dev, "reset",
> -						     GPIOD_OUT_LOW);
> +						     GPIOD_OUT_HIGH);
>  	if (IS_ERR(imx412->reset_gpio)) {
>  		dev_err(imx412->dev, "failed to get reset gpio %pe\n",
>  			imx412->reset_gpio);
> 

-- 
Kind regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-03 13:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-23  9:19 [PATCH v7 0/2] media: i2c: imx412: power on timing adjust Wenmeng Liu
2026-01-23  9:19 ` [PATCH v7 1/2] media: i2c: imx412: Assert reset GPIO during probe Wenmeng Liu
2026-03-03 13:33   ` Sakari Ailus
2026-01-23  9:19 ` [PATCH v7 2/2] media: i2c: imx412: Extend the power-on waiting time Wenmeng Liu
2026-02-27  5:34 ` [PATCH v7 0/2] media: i2c: imx412: power on timing adjust Wenmeng Liu
2026-02-27 22:01   ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®