iMX8MM and PCA6416 IO-Expander's output 8,9 ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

iMX8MM and PCA6416 IO-Expander's output 8,9 ?

2,439件の閲覧回数
khang_letruong
Senior Contributor III

Dear Community,

I expect to use EXP_IO8 and EXP_IO9 of PCA6416 on iMX8MM EVK as POWER-DOWN and RESET control for a camera sensor :

iMX8MMEVK-TCA6416.png

I imitated the use of PCA6416's outputs #1, #3, #4, #5 in arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi as below :

 

 

        reg_audio_board: regulator-audio-board {
                ...
                gpio = <&pca6416 1 GPIO_ACTIVE_HIGH>;
                regulator-always-on;
        };

        sound-ak4458 {
                ...
                reset-gpios = <&pca6416 4 GPIO_ACTIVE_LOW>;
        };

        ak5558: ak5558@13 {
                compatible = "asahi-kasei,ak5558";
                reg = <0x13>;
                reset-gpios = <&pca6416 3 GPIO_ACTIVE_LOW>;
                ...
        };

        ak4497: ak4497@11 {
                compatible = "asahi-kasei,ak4497";
                reg = <0x11>;
                reset-gpios = <&pca6416 5 GPIO_ACTIVE_LOW>;
                ...
        };

 

 

And used the output #8, #9 for my sensor's node in the custom dts :

 

 

+&i2c3 {
+       /delete-node/ov5640_mipi@3c;
+
+       adv728x_mipi1: adv728x_mipi1@21 {
+               compatible = "adi,adv7280-m";
+               reg = <0x21>;
+               csi_id = <0x00>;
+               status = "okay";
+
+               pwn-gpios = <&pca6416 8 GPIO_ACTIVE_LOW>;
+               rst-gpios = <&pca6416 9 GPIO_ACTIVE_LOW>;
+
+               port {
+                       adv728x_mipi1_ep: endpoint {
+                               remote-endpoint = <&mipi1_sensor_ep>;
+
+                               data-lanes = <1>;
+                               clock-lanes = <0>;
+                       };
+               };
+       };
+};

 

 

 

I always got the following error :

 

 

[    6.706860] adv7180 2-0021: request for power pin failed: -517
[    7.539305] adv7180 2-0021: request for power pin failed: -517

 

 

for the below code snippet :

 

 

        state->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "pwn",
                                                   GPIOD_OUT_HIGH);
        if (IS_ERR(state->pwdn_gpio)) {
                ret = PTR_ERR(state->pwdn_gpio);
                v4l_err(client, "request for power pin failed: %d\n", ret);
                return ret;
        }

 

 

Could someone tell me how I would be able to use the mentioned outputs, please ?

Thanks in advance and best regards,
Khang

0 件の賞賛
返信
7 返答(返信)

2,416件の閲覧回数
BiyongSUN
NXP Employee
NXP Employee

Please try the camera senor module later than  subsys_initcall.

0 件の賞賛
返信

2,411件の閲覧回数
khang_letruong
Senior Contributor III

Hi @BiyongSUN ,

Please try the camera senor module later than subsys_initcall.

Could you explain a little bit more how to do, please ?

Best regards,

K.

0 件の賞賛
返信

2,392件の閲覧回数
BiyongSUN
NXP Employee
NXP Employee

You try you camera as module. you build the camera driver as module not build in than manually insmod.

The you try the camera senor module later than subsys_initcall. Because the gpio expander driver using subsys_initcall.

0 件の賞賛
返信

2,387件の閲覧回数
khang_letruong
Senior Contributor III

Dear @BiyongSUN ,

You try you camera as module. you build the camera driver as module not build in than manually insmod.

The you try the camera senor module later than subsys_initcall. Because the gpio expander driver using subsys_initcall.

From the beginning, the module has already been built as loadable module an it is loaded as the associated node is defined in the dts:

 

diff --git a/arch/arm64/configs/imx_v8_defconfig b/arch/arm64/configs/imx_v8_defconfig
index ab8c97e3dcb0..12b55c27cf34 100644
--- a/arch/arm64/configs/imx_v8_defconfig
+++ b/arch/arm64/configs/imx_v8_defconfig
@@ -528,6 +528,7 @@ CONFIG_SDR_PLATFORM_DRIVERS=y
 CONFIG_VIDEO_IMX219=m
 CONFIG_VIDEO_OV5640=y
 CONFIG_VIDEO_OV5645=m
+CONFIG_VIDEO_ADV7180=m
 CONFIG_IMX_DPU_CORE=y
 CONFIG_IMX_LCDIF_CORE=y
 CONFIG_IMX_LCDIFV3_CORE=y

 

 

But error still happened.

Best Regards,

Khang

0 件の賞賛
返信

2,382件の閲覧回数
BiyongSUN
NXP Employee
NXP Employee

here is my suggestion. 

Use the original dts. 

and use the the gpio in /sys/class/gpio from use space, first to narrow down the issue.

 

Accessing GPIO From UserSpace - NXP Community

0 件の賞賛
返信

2,420件の閲覧回数
khang_letruong
Senior Contributor III

Hi,

Is there any idea, please ?

Best regards,
K.

0 件の賞賛
返信

2,391件の閲覧回数
BiyongSUN
NXP Employee
NXP Employee

I gave you idea, have you tried? 

try the camera senor module later than subsys_initcall.

It may because the gpio expander driver init later than the camera driver init. 

0 件の賞賛
返信