lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260119-imx412-v3-1-8b46929af773@oss.qualcomm.com>
Date: Mon, 19 Jan 2026 18:15:01 +0800
From: Wenmeng Liu <wenmeng.liu@....qualcomm.com>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        Wenmeng Liu <wenmeng.liu@....qualcomm.com>
Subject: [PATCH v3 1/2] media: i2c: imx412: fix sensor power-on timing

Assert the reset GPIO at the start of power-on, enable regulators and the
clock, then deassert reset. 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@....qualcomm.com>
---
 drivers/media/i2c/imx412.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
index b3826f80354703b17b416dc233854da3f5736e38..ebc2fb706442365f541540bf4ce9d307d42e0061 100644
--- a/drivers/media/i2c/imx412.c
+++ b/drivers/media/i2c/imx412.c
@@ -1022,6 +1022,8 @@ static int imx412_power_on(struct device *dev)
 	struct imx412 *imx412 = to_imx412(sd);
 	int ret;
 
+	gpiod_set_value_cansleep(imx412->reset_gpio, 1);
+
 	ret = regulator_bulk_enable(ARRAY_SIZE(imx412_supply_names),
 				    imx412->supplies);
 	if (ret < 0) {
@@ -1029,20 +1031,19 @@ static int imx412_power_on(struct device *dev)
 		return ret;
 	}
 
-	gpiod_set_value_cansleep(imx412->reset_gpio, 0);
-
 	ret = clk_prepare_enable(imx412->inclk);
 	if (ret) {
 		dev_err(imx412->dev, "fail to enable inclk\n");
 		goto error_reset;
 	}
 
+	gpiod_set_value_cansleep(imx412->reset_gpio, 0);
+
 	usleep_range(1000, 1200);
 
 	return 0;
 
 error_reset:
-	gpiod_set_value_cansleep(imx412->reset_gpio, 1);
 	regulator_bulk_disable(ARRAY_SIZE(imx412_supply_names),
 			       imx412->supplies);
 

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ