public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] media: i2c: imx412: power on timing adjust
@ 2026-01-21  8:06 Wenmeng Liu
  2026-01-21  8:06 ` [PATCH v4 1/2] media: i2c: imx412: fix sensor power-on timing Wenmeng Liu
  2026-01-21  8:06 ` [PATCH v4 2/2] media: i2c: imx412: Extend the power-on waiting time Wenmeng Liu
  0 siblings, 2 replies; 5+ messages in thread
From: Wenmeng Liu @ 2026-01-21  8:06 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 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: fix sensor power-on timing
      media: i2c: imx412: Extend the power-on waiting time

 drivers/media/i2c/imx412.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
base-commit: 053966c344dbd346e71305f530e91ea77916189f
change-id: 20260119-imx412-d6710b9fd3c6

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


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

* [PATCH v4 1/2] media: i2c: imx412: fix sensor power-on timing
  2026-01-21  8:06 [PATCH v4 0/2] media: i2c: imx412: power on timing adjust Wenmeng Liu
@ 2026-01-21  8:06 ` Wenmeng Liu
  2026-01-21  8:47   ` Tarang Raval
  2026-01-21  8:06 ` [PATCH v4 2/2] media: i2c: imx412: Extend the power-on waiting time Wenmeng Liu
  1 sibling, 1 reply; 5+ messages in thread
From: Wenmeng Liu @ 2026-01-21  8:06 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, 2 insertions(+)

diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
index b3826f80354703b17b416dc233854da3f5736e38..5cb55deb125edb218779b076429f9fff93e11a08 100644
--- a/drivers/media/i2c/imx412.c
+++ b/drivers/media/i2c/imx412.c
@@ -1188,6 +1188,8 @@ static int imx412_probe(struct i2c_client *client)
 
 	mutex_init(&imx412->mutex);
 
+	gpiod_set_value_cansleep(imx412->reset_gpio, 1);
+
 	ret = imx412_power_on(imx412->dev);
 	if (ret) {
 		dev_err(imx412->dev, "failed to power-on the sensor\n");

-- 
2.34.1


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

* [PATCH v4 2/2] media: i2c: imx412: Extend the power-on waiting time
  2026-01-21  8:06 [PATCH v4 0/2] media: i2c: imx412: power on timing adjust Wenmeng Liu
  2026-01-21  8:06 ` [PATCH v4 1/2] media: i2c: imx412: fix sensor power-on timing Wenmeng Liu
@ 2026-01-21  8:06 ` Wenmeng Liu
  1 sibling, 0 replies; 5+ messages in thread
From: Wenmeng Liu @ 2026-01-21  8:06 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
index 5cb55deb125edb218779b076429f9fff93e11a08..38086b18743ae3b5d10c939b7f99c3e27e1f5d71 100644
--- a/drivers/media/i2c/imx412.c
+++ b/drivers/media/i2c/imx412.c
@@ -1037,7 +1037,7 @@ static int imx412_power_on(struct device *dev)
 		goto error_reset;
 	}
 
-	usleep_range(1000, 1200);
+	usleep_range(10000, 12000);
 
 	return 0;
 

-- 
2.34.1


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

* Re: [PATCH v4 1/2] media: i2c: imx412: fix sensor power-on timing
  2026-01-21  8:06 ` [PATCH v4 1/2] media: i2c: imx412: fix sensor power-on timing Wenmeng Liu
@ 2026-01-21  8:47   ` Tarang Raval
  2026-01-21  9:01     ` Wenmeng Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Tarang Raval @ 2026-01-21  8:47 UTC (permalink / raw)
  To: Wenmeng Liu
  Cc: linux-media@vger.kernel.org, Sakari Ailus,
	linux-kernel@vger.kernel.org, Mauro Carvalho Chehab

Hi Wenmeng,

> 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, 2 insertions(+)                                              
>                                                                               
> diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c          
> index b3826f80354703b17b416dc233854da3f5736e38..5cb55deb125edb218779b076429f9fff93e11a08 100644
> --- a/drivers/media/i2c/imx412.c                                              
> +++ b/drivers/media/i2c/imx412.c                                              
> @@ -1188,6 +1188,8 @@ static int imx412_probe(struct i2c_client *client)      
>                                                                               
>         mutex_init(&imx412->mutex);                                           
>                                                                               
> +       gpiod_set_value_cansleep(imx412->reset_gpio, 1);                      
> +                                                                             
                                                                                
Just logic needs to be set to high when requesting this GPIO in                 
imx412_parse_hw_config.                                                         
                                                                                
Best regards,                                                                   
Tarang                                                                          

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

* Re: [PATCH v4 1/2] media: i2c: imx412: fix sensor power-on timing
  2026-01-21  8:47   ` Tarang Raval
@ 2026-01-21  9:01     ` Wenmeng Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Wenmeng Liu @ 2026-01-21  9:01 UTC (permalink / raw)
  To: Tarang Raval
  Cc: linux-media@vger.kernel.org, Sakari Ailus,
	linux-kernel@vger.kernel.org, Mauro Carvalho Chehab

Hi Tarang,

On 1/21/2026 4:47 PM, Tarang Raval wrote:
> Hi Wenmeng,
> 
>> 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, 2 insertions(+)
>>                                                                                
>> diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
>> index b3826f80354703b17b416dc233854da3f5736e38..5cb55deb125edb218779b076429f9fff93e11a08 100644
>> --- a/drivers/media/i2c/imx412.c
>> +++ b/drivers/media/i2c/imx412.c
>> @@ -1188,6 +1188,8 @@ static int imx412_probe(struct i2c_client *client)
>>                                                                                
>>          mutex_init(&imx412->mutex);
>>                                                                                
>> +       gpiod_set_value_cansleep(imx412->reset_gpio, 1);
>> +
>                                                                                  
> Just logic needs to be set to high when requesting this GPIO in
> imx412_parse_hw_config.
Thank you for pointing that out.

Thanks,
Wenmeng

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

end of thread, other threads:[~2026-01-21  9:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-21  8:06 [PATCH v4 0/2] media: i2c: imx412: power on timing adjust Wenmeng Liu
2026-01-21  8:06 ` [PATCH v4 1/2] media: i2c: imx412: fix sensor power-on timing Wenmeng Liu
2026-01-21  8:47   ` Tarang Raval
2026-01-21  9:01     ` Wenmeng Liu
2026-01-21  8:06 ` [PATCH v4 2/2] media: i2c: imx412: Extend the power-on waiting time Wenmeng Liu

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