i.MX 8MP capture video by tc358743,using Dual ISI for single CSI solution not work

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX 8MP capture video by tc358743,using Dual ISI for single CSI solution not work

Jump to solution
1,753 Views
feiyu
Contributor III

Hi,

Application Note: AN13430 "i.MX 8MP Dual ISI channels for single CSI" explains how to use two ISI channels connected on single CSI port.

I want to do something similar to the application description, but replace the camera sensor with tc358743 like this:

dual isi.png

In order to realize the above requirements, I verified it in two steps.

First of all, on the development board(base kernel5.4.10) that can connect ar052x camera, according to the description of AN13430, the device tree and driver are modified, and it has achieved success, which can independent capture videos on isi0 and isi1 at the same time(Both ISI channels are 1920*1080@30Hz).

Then, on the development board(base kernel5.10.9) that can connect to tc358743, the same modification is made according to AN13430. Although two nodes, video0 and Video1, are also generated, which can capture video respectively,but there is a problem when capture video at the same time: first turn on video0 to collect video stream, and then turn on video1 to collect video. After video1 is turned on, the capture will be normal, but the video stream of video0 will be closed(Both ISI channels are 1920*1080@60Hz).

 

The SOC on the two development boards is exactly the same, but there is a difference in the kernel version, which leads to some differences in CSI and ISI drivers, but I don't know whether this difference leads to the problem. The reference driver code is given below.

I wonder if anyone has encountered the problem described above and solved it?

Any hints are welcome. Thx

 

 

0 Kudos
1 Solution
1,684 Views
feiyu
Contributor III

Hi,joanxie 

Thank you so much for your reply

I tried the patch you provided, but it didn't work.

However, I have solved the problem by modifying the <mxc_isi_capture_release> function in the/driver/staging/media/imx/

 

Before:
if (isi_cap->is_streaming[isi_cap->id])
    mxc_isi_cap_streamoff(file, NULL, q->type);

After:
isi_cap->refcnt--;
if (isi_cap->refcnt == 0) {
    if (isi_cap->is_streaming[isi_cap->id]) {
        mutex_unlock(&isi_cap->lock);
        mxc_isi_cap_streamoff(file, NULL, q->type);
        mutex_lock(&isi_cap->lock);
    }
}

 

imx8-isi-cap.c file. The modification method is shown below.

View solution in original post

0 Kudos
4 Replies
1,752 Views
feiyu
Contributor III

The reference driver code is given here.

0 Kudos
1,752 Views
feiyu
Contributor III

The reference driver code is given here.

0 Kudos
1,695 Views
joanxie
NXP TechSupport
NXP TechSupport

how about try this patch?

--- a/drivers/staging/media/imx/imx8-isi-core.c
+++ b/drivers/staging/media/imx/imx8-isi-core.c
@@ -443,7 +443,7 @@ static int mxc_isi_imx8mp_parse_resets(struct mxc_isi_dev *mxc_isi)
 	struct device *dev = &mxc_isi->pdev->dev;
 	struct reset_control *reset;
 
-	reset = devm_reset_control_get(dev, "isi_rst_proc");
+	reset = devm_reset_control_get_optional_shared(dev, "isi_rst_proc");
 	if (IS_ERR(reset)) {
 		if (PTR_ERR(reset) != -EPROBE_DEFER)
 			dev_err(dev, "Failed to get isi proc reset control\n");
@@ -451,7 +451,7 @@ static int mxc_isi_imx8mp_parse_resets(struct mxc_isi_dev *mxc_isi)
 	}
 	mxc_isi->isi_rst_proc = reset;
 
-	reset = devm_reset_control_get(dev, "isi_rst_apb");
+	reset = devm_reset_control_get_optional_shared(dev, "isi_rst_apb");
 	if (IS_ERR(reset)) {
 		if (PTR_ERR(reset) != -EPROBE_DEFER)
 			dev_err(dev, "Failed to get isi apb reset control\n");
0 Kudos
1,685 Views
feiyu
Contributor III

Hi,joanxie 

Thank you so much for your reply

I tried the patch you provided, but it didn't work.

However, I have solved the problem by modifying the <mxc_isi_capture_release> function in the/driver/staging/media/imx/

 

Before:
if (isi_cap->is_streaming[isi_cap->id])
    mxc_isi_cap_streamoff(file, NULL, q->type);

After:
isi_cap->refcnt--;
if (isi_cap->refcnt == 0) {
    if (isi_cap->is_streaming[isi_cap->id]) {
        mutex_unlock(&isi_cap->lock);
        mxc_isi_cap_streamoff(file, NULL, q->type);
        mutex_lock(&isi_cap->lock);
    }
}

 

imx8-isi-cap.c file. The modification method is shown below.

0 Kudos