<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: IMX8MP ISP AutoFocus IMX219 in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/IMX8MP-ISP-AutoFocus-IMX219/m-p/1945635#M227937</link>
    <description>I have the same problem as ibocakir_06. What changes should I make to the kernel? Can you elaborate on this a bit?</description>
    <pubDate>Mon, 02 Sep 2024 20:00:21 GMT</pubDate>
    <dc:creator>oguzhanarm</dc:creator>
    <dc:date>2024-09-02T20:00:21Z</dc:date>
    <item>
      <title>IMX8MP ISP AutoFocus IMX219</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX8MP-ISP-AutoFocus-IMX219/m-p/1944825#M227875</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have implemented ISP layer with the following repo given by NXP to IMX8MP processor and we can capture/stream IMX219 camera without problem.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/nxp-imx-support/meta-imx8mp-isp-imx219" target="_self"&gt;meta-imx8mp-isp-imx219&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;We use&amp;nbsp;&lt;A href="https://www.arducam.com/product/arducam-imx219-auto-focus-camera-module-drop-in-replacement-for-raspberry-pi-v2-and-nvidia-jetson-nano-camera/" target="_self"&gt;B0182 Arducam&lt;/A&gt;&amp;nbsp;camera from Arducam, and it has a VCM module to drive lens. Before adding the DW9714 driver to kernel, we can access to VCM via I2C and control it by device address 0x0c. We can see that our vcm module works fine and we can make a manual focus while streaming. So we don't have any problem about the hardware. The device tree overlay of IMX219 and VCM is given below.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; /* Verdin I2C_4_CSI SODIMM 93-95 */
 &amp;amp;i2c3 {
     #address-cells = &amp;lt;1&amp;gt;;
     #size-cells = &amp;lt;0&amp;gt;;
     status = "okay";

    vcm: dw9714@c {
        // #address-cells = &amp;lt;1&amp;gt;;
        // #size-cells = &amp;lt;0&amp;gt;;
        compatible = "dongwoon,dw9714";
        reg = &amp;lt;0x0c&amp;gt;;
        id = &amp;lt;9714&amp;gt;;
        vcc-supply = &amp;lt;&amp;amp;reg_3p3v&amp;gt;;
    };
 
    imx219: imx219@10 {
        compatible = "sony,imx219";
        reg = &amp;lt;0x10&amp;gt;;
        clocks = &amp;lt;&amp;amp;clk IMX8MP_CLK_IPP_DO_CLKO2&amp;gt;;
        clock-names = "xclk";
        assigned-clocks = &amp;lt;&amp;amp;clk IMX8MP_CLK_IPP_DO_CLKO2&amp;gt;;
        assigned-clock-parents = &amp;lt;&amp;amp;clk IMX8MP_CLK_24M&amp;gt;;
        assigned-clock-rates = &amp;lt;24000000&amp;gt;;
        csi_id = &amp;lt;0&amp;gt;;
        
        pwn-gpios = &amp;lt;&amp;amp;gpio1 6 GPIO_ACTIVE_HIGH&amp;gt;;
        rst-gpios = &amp;lt;&amp;amp;gpio1 8 GPIO_ACTIVE_HIGH&amp;gt;;
        mclk = &amp;lt;24000000&amp;gt;;
        mclk_source = &amp;lt;0&amp;gt;;

        lens-focus = &amp;lt;&amp;amp;vcm&amp;gt;;
        
        mipi_csi;
        status = "okay";

        port {
            imx219_mipi_0_ep: endpoint {
                remote-endpoint = &amp;lt;&amp;amp;mipi_csi0_ep&amp;gt;;
                data-lanes = &amp;lt;1 2&amp;gt;;
                clock-lanes = &amp;lt;0&amp;gt;;
                clock-noncontinuous;
                link-frequencies = /bits/ 64 &amp;lt;456000000&amp;gt;;
    
            };
        };
    };
 };
 

&amp;amp;mipi_csi_0 {
    #address-cells = &amp;lt;1&amp;gt;;
    #size-cells = &amp;lt;0&amp;gt;;
    status = "okay";

    port@0 {
        reg = &amp;lt;0&amp;gt;;

        mipi_csi0_ep: endpoint {
            csis-hs-settle = &amp;lt;13&amp;gt;;
            csis-clk-settle = &amp;lt;2&amp;gt;;
            csis-wclk;
            data-lanes = &amp;lt;2&amp;gt;;
            remote-endpoint = &amp;lt;&amp;amp;imx219_mipi_0_ep&amp;gt;;
        };
    };
};
 
&amp;amp;cameradev {
    /delete-node/ mipi_csi_1;
};

&amp;amp;cameradev {
    status = "okay";
};

&amp;amp;isi_0 {
    status = "disabled";
};

&amp;amp;isi_1 {
    status = "disabled";
};

&amp;amp;isp_0 {
    status = "okay";
};

&amp;amp;dewarp {
    status = "okay";
};&lt;/LI-CODE&gt;&lt;P&gt;After that, we have added the vcm module driver to the kernel with the help of &lt;A href="https://community.nxp.com/t5/i-MX-Processors/IMX8MP-ISP-camera-autofocus/m-p/1532111#M195950" target="_self"&gt;this forum thread&lt;/A&gt;. Acc. to this topic, vcm module driver contains&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;dw9714_priv_ioctl&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;. And also we have added the proper "&lt;STRONG&gt;focus-lens&lt;/STRONG&gt;" node inside to the device tree of imx219. We can approve that when I start run.sh, this script loads kernel modules including imx219.ko, dw9714.ko is loaded automatically, and when I prompt lsmod, I can see that this module is used by imx219 module.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now the problem begins. We use &lt;STRONG&gt;./vvext 2&lt;/STRONG&gt; command to control camera features like &lt;STRONG&gt;AutoFocus.&amp;nbsp;&lt;/STRONG&gt;When I enter the proper inputs to vvext API, for example, enabling AF, setting mode to manual and setting AF Length to 100(other values are also tested) &lt;STRONG&gt;nothing hapens&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To analyze the problem, we have placed a debug lines to the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;IMX219_IsiFocusSetIss&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;function, in the imx219.c code in the isp-imx repo. We have approved that when we apply vvext api command, isp-media-server enters focus functions. However these function are all empty and only contains &lt;STRONG&gt;TRACE&lt;/STRONG&gt; log lines.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot from 2024-08-31 22-20-34.png" style="width: 248px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/296388i0FB9C9E9696F2152/image-dimensions/248x457?v=v2" width="248" height="457" role="button" title="Screenshot from 2024-08-31 22-20-34.png" alt="Screenshot from 2024-08-31 22-20-34.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/iMX8M-Plus-ISP-on-Android-how-to-enable-AutoFocus-function/m-p/1761745" target="_self"&gt;This topic&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;also claims that these functions are empty. We have test isp-imx versions from 18 to 24 and all are the same.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4" color="#FF0000"&gt;&lt;SPAN&gt;To sum up, we can not run manual focus or auto focus vv_ext controls via API. Can you guide us to solve this problem?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;&lt;LI-PRODUCT title="IMX8MPLUS" id="IMX8MPLUS"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;LI-PRODUCT title="MIPI-CAMERA" id="MIPI-CAMERA"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;#ISP #IMX219&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2024 19:37:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX8MP-ISP-AutoFocus-IMX219/m-p/1944825#M227875</guid>
      <dc:creator>ibocakir_06</dc:creator>
      <dc:date>2024-08-31T19:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: IMX8MP ISP AutoFocus IMX219</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX8MP-ISP-AutoFocus-IMX219/m-p/1945548#M227929</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You need modify the driver for arducam since the MX219 works with auto focus.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 14:50:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX8MP-ISP-AutoFocus-IMX219/m-p/1945548#M227929</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2024-09-02T14:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: IMX8MP ISP AutoFocus IMX219</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX8MP-ISP-AutoFocus-IMX219/m-p/1945635#M227937</link>
      <description>I have the same problem as ibocakir_06. What changes should I make to the kernel? Can you elaborate on this a bit?</description>
      <pubDate>Mon, 02 Sep 2024 20:00:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX8MP-ISP-AutoFocus-IMX219/m-p/1945635#M227937</guid>
      <dc:creator>oguzhanarm</dc:creator>
      <dc:date>2024-09-02T20:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: IMX8MP ISP AutoFocus IMX219</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX8MP-ISP-AutoFocus-IMX219/m-p/1955141#M228457</link>
      <description>&lt;P&gt;Can you describe this more detail? What do you mean by modifying the driver?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added the code to driver as an example of ar1335_mipi.c driver.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However as I mentioned before the ISS drivers are empty for autofocus functions.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 10:51:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX8MP-ISP-AutoFocus-IMX219/m-p/1955141#M228457</guid>
      <dc:creator>ibocakir_06</dc:creator>
      <dc:date>2024-09-16T10:51:33Z</dc:date>
    </item>
  </channel>
</rss>

