Jetson Xavier CAM0 reset(GPIO3_PH.03) can not pull HIGH in my lt6911uxc driver probe?

Could you provide your reference test code to me on AGX Xavier?

hello SammyChenTw,

it’s simply check the gpio_set function,
dump the behavior and check the kernel timestamps for the performance,
for example,

diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c
index 45d0251..6796b62 100644
--- a/drivers/media/i2c/ov5693.c
+++ b/drivers/media/i2c/ov5693.c
@@ -170,6 +170,7 @@ static void ov5693_gpio_set(struct camera_common_data *s_data,
 {
        struct camera_common_pdata *pdata = s_data->pdata;

+       pr_err("JC: %s: GPIO-%d++\n", __func__, gpio);
        if (pdata && pdata->use_cam_gpio)
                cam_gpio_ctrl(s_data->dev, gpio, val, 1);
        else {
@@ -178,6 +179,7 @@ static void ov5693_gpio_set(struct camera_common_data *s_data,
                else
                        gpio_set_value(gpio, val);
        }
+       pr_err("JC: %s: GPIO-%d--\n", __func__, gpio);
 }

Hi, @JerryChang :

I do two test in ov5693_probe(), and see the difference test result as below:
[GPIO test1 - control GPIO cam0_reset before ov5693_board_setup() in ov5693_probe() ]
GPIO347(CAM0_REST)=1.30ms
GPIO417=2.9ms

Test1 test code:

+#define YUAN_GPIO417	417
ov5693_probe() {
	mutex_init(&priv->streaming_lock);

+	pr_info("SAMMY: GPIO test in %s(), start\n", __func__);
+		ov5693_gpio_set(priv->s_data,priv->s_data->power->reset_gpio, 0);
+	usleep_range(1000, 1010);
+	if (gpio_is_valid(priv->s_data->power->reset_gpio))
+		ov5693_gpio_set(priv->s_data,priv->s_data->power->reset_gpio, 1);
+	if (gpio_is_valid(YUAN_GPIO417))
+		ov5693_gpio_set(priv->s_data,YUAN_GPIO417, 1);
+	usleep_range(1000, 1010);	
+	if (gpio_is_valid(YUAN_GPIO417))
+		ov5693_gpio_set(priv->s_data,YUAN_GPIO417, 0);
+	pr_info("SAMMY: GPIO test in %s(), end\n", __func__);	

	err = ov5693_board_setup(priv);
		if (err) {
			dev_err(dev, "board setup failed\n");
			return err;
	}
	
}

Test1 dmesg log:

root@nvidia-xavier:/ # insmod ov5693.ko
root@nvidia-xavie:/ # dmesg
[15700.505918] ov5693_probe()
[15700.505930] ov5693 2-0036: probing v4l2 sensor.
[15700.506047] ov5693_parse_dt()
[15700.506245] ov5693_power_get()
[15700.507317] ov5693 2-0036: tegracam sensor driver:ov5693_v2.0.6
[15700.507341] SAMMY: GPIO test in ov5693_probe(), start
[15700.507345] JC: ov5693_gpio_set: GPIO-347++, val=0
[15700.507470] JC: ov5693_gpio_set: GPIO-347–, val=0
[15700.508662] JC: ov5693_gpio_set: GPIO-347++, val=1
[15700.508778] JC: ov5693_gpio_set: GPIO-347–, val=1
[15700.508864] JC: ov5693_gpio_set: GPIO-417++, val=1
[15700.508953] JC: ov5693_gpio_set: GPIO-417–, val=1
[15700.510059] JC: ov5693_gpio_set: GPIO-417++, val=0
[15700.510168] JC: ov5693_gpio_set: GPIO-417–, val=0
[15700.510250] SAMMY: GPIO test in ov5693_probe(), end
[15700.510254] ov5693_board_setup()
[15700.510734] ov5693_power_on()
[15700.510755] JC: ov5693_gpio_set: GPIO-350++, val=1
[15700.510865] JC: ov5693_gpio_set: GPIO-350–, val=1
[15700.513003] JC: ov5693_gpio_set: GPIO-347++, val=1
[15700.513142] JC: ov5693_gpio_set: GPIO-347–, val=1
[15701.280420] ov5693_power_off()
[15701.280436] pw->reset_gpio=347
[15701.280496] JC: ov5693_gpio_set: GPIO-350++, val=0
[15701.280677] JC: ov5693_gpio_set: GPIO-350–, val=0
[15701.280824] JC: ov5693_gpio_set: GPIO-347++, val=0
[15701.280921] JC: ov5693_gpio_set: GPIO-347–, val=0
[15701.283887] tegra194-vi5 15c10000.vi: subdev ov5693 2-0036 bound
[15701.294794] ov5693_power_on()
[15701.294828] JC: ov5693_gpio_set: GPIO-350++, val=1
[15701.294972] JC: ov5693_gpio_set: GPIO-350–, val=1
[15701.297256] JC: ov5693_gpio_set: GPIO-347++, val=1
[15701.297381] JC: ov5693_gpio_set: GPIO-347–, val=1
[15701.305281] ov5693_power_off()
[15701.305290] pw->reset_gpio=347
[15701.305343] JC: ov5693_gpio_set: GPIO-350++, val=0
[15701.305477] JC: ov5693_gpio_set: GPIO-350–, val=0
[15701.305587] JC: ov5693_gpio_set: GPIO-347++, val=0
[15701.305681] JC: ov5693_gpio_set: GPIO-347–, val=0

Test1 result in scope:

[GPIO test2 - control GPIO cam0_reset after ov5693_board_setup() in ov5693_probe() ]
GPIO347(CAM0_REST)=3.8ms
GPIO417=774.85ms

Test2 test code:

+#define YUAN_GPIO417	417
ov5693_probe() {
	mutex_init(&priv->streaming_lock);

	err = ov5693_board_setup(priv);
		if (err) {
			dev_err(dev, "board setup failed\n");
			return err;
	}

+	pr_info("SAMMY: GPIO test in %s(), start\n", __func__);
+		ov5693_gpio_set(priv->s_data,priv->s_data->power->reset_gpio, 0);
+	usleep_range(1000, 1010);
+	if (gpio_is_valid(priv->s_data->power->reset_gpio))
+		ov5693_gpio_set(priv->s_data,priv->s_data->power->reset_gpio, 1);
+	if (gpio_is_valid(YUAN_GPIO417))
+		ov5693_gpio_set(priv->s_data,YUAN_GPIO417, 1);
+	usleep_range(1000, 1010);	
+	if (gpio_is_valid(YUAN_GPIO417))
+		ov5693_gpio_set(priv->s_data,YUAN_GPIO417, 0);
+	pr_info("SAMMY: GPIO test in %s(), end\n", __func__);	
	
}

Test2 dmesg log:

root@nvidia-xavier:/ # insmod ov5693.ko
root@nvidia-xavie:/ # dmesg
[15026.997351] ov5693_probe()
[15026.997372] ov5693 2-0036: probing v4l2 sensor.
[15026.997442] ov5693_parse_dt()
[15026.997786] ov5693_power_get()
[15026.998466] ov5693 2-0036: tegracam sensor driver:ov5693_v2.0.6
[15026.998512] ov5693_board_setup()
[15026.999434] ov5693_power_on()
[15026.999486] JC: ov5693_gpio_set: GPIO-350++, val=1
[15026.999654] JC: ov5693_gpio_set: GPIO-350–, val=1
[15027.001842] JC: ov5693_gpio_set: GPIO-347++, val=1
[15027.001978] JC: ov5693_gpio_set: GPIO-347–, val=1
[15027.767118] ov5693_power_off()
[15027.767132] pw->reset_gpio=347
[15027.767182] JC: ov5693_gpio_set: GPIO-350++, val=0
[15027.767339] JC: ov5693_gpio_set: GPIO-350–, val=0
[15027.767487] JC: ov5693_gpio_set: GPIO-347++, val=0
[15027.767586] JC: ov5693_gpio_set: GPIO-347–, val=0
[15027.769961] SAMMY: GPIO test in ov5693_probe(), start
[15027.769971] JC: ov5693_gpio_set: GPIO-347++, val=0
[15027.770088] JC: ov5693_gpio_set: GPIO-347–, val=0
[15027.771258] JC: ov5693_gpio_set: GPIO-347++, val=1
[15027.771386] JC: ov5693_gpio_set: GPIO-347–, val=1
[15027.771483] JC: ov5693_gpio_set: GPIO-417++, val=1
[15027.771626] JC: ov5693_gpio_set: GPIO-417–, val=1
[15027.772772] JC: ov5693_gpio_set: GPIO-417++, val=0
[15027.772878] JC: ov5693_gpio_set: GPIO-417–, val=0
[15027.773000] SAMMY: GPIO test in ov5693_probe(), end
[15027.773458] tegra194-vi5 15c10000.vi: subdev ov5693 2-0036 bound
[15027.784689] ov5693_power_on()
[15027.784743] JC: ov5693_gpio_set: GPIO-350++, val=1
[15027.785518] JC: ov5693_gpio_set: GPIO-350–, val=1
[15027.787677] JC: ov5693_gpio_set: GPIO-347++, val=1
[15027.788037] JC: ov5693_gpio_set: GPIO-347–, val=1
[15027.799309] ov5693_power_off()
[15027.799318] pw->reset_gpio=347
[15027.799371] JC: ov5693_gpio_set: GPIO-350++, val=0
[15027.799483] JC: ov5693_gpio_set: GPIO-350–, val=0
[15027.800053] JC: ov5693_gpio_set: GPIO-347++, val=0
[15027.800172] JC: ov5693_gpio_set: GPIO-347–, val=0

Test2 result in scope:

test-1

test-2

hello SammyChenTw,

it looks kernel functions actives normally, all those gpio controls (recap as above) returns ~1ms for both tests.

But my question is why GPIO417 test 2 is 774.85ms in scpoe?
The GPIO control code are same, and it only put to difference position, and result are difference in scpoe.

hello SammyChenTw,

I don’t sure the root cause.
since all those gpio controls returns ~1ms for both tests from software side, did you see any unexpected errors?

Here are the dmesg log, and I don’t see unexpected error:
20211215_ov5693_gpio_test2_kernel_log.txt (379.3 KB)

There’s no failures and kernel function works normally.
Is there any abnormal situation on your system?

I use reference design PCBA(OV5693 camera sensor board + Jetson Xavier Developer Kit Carrier Board B03) for this testing.
I don’t see any abnormal situation.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.