Kernel

IMX6 ADV7180:沒有 /dev/media0

  • July 10, 2019

我在 KARO-TX6Q 上使用 kernel.org 的核心 4.14.24,在定制板上使用 ADV7182。

使用 KARO git 的核心 4.1.15,我使用了修改為與 adv7182 一起使用的 adv7180_tvin 驅動程序。此驅動程序不使用 media_controller 系統,而是直接創建 /dev/videoX 條目。

由於新的軟體更新,4.1.15 核心太舊了。我需要使用 kernel.org 的 4.14.24 核心。

在 kernel.org adv7180_tvin 中不存在,我必須使用 media_controller 綁定係統。

核心選擇:

CONFIG_MEDIA_CONTROLLER=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_VIDEO_MUX=y
CONFIG_VIDEO_CODA=y
CONFIG_VIDEO_MEM2MEM_DEINTERLACE=y
CONFIG_VIDEO_SH_VEU=y
CONFIG_VIDEO_ADV7180=m
CONFIG_IMX_IPUV3_CORE=y
CONFIG_IMX_HAVE_PLATFORM_IPU_CORE=y

引導日誌:

[    3.468290] imx-media capture-subsystem: Media device initialized
[    3.474664] imx-media capture-subsystem: imx_media_add_async_subdev: added port, match type FWNODE
[    3.483815] imx-media capture-subsystem: imx_media_add_async_subdev: added ipu1_csi0_mux, match type FWNODE
[    3.493779] imx-media capture-subsystem: imx_media_add_async_subdev: added camera, match type FWNODE
[    3.503180] imx-media capture-subsystem: imx_media_add_async_subdev: added port, match type FWNODE
[    3.512311] imx-media capture-subsystem: imx_media_add_async_subdev: added port, match type FWNODE
[    3.521454] imx-media capture-subsystem: imx_media_add_async_subdev: added port, match type FWNODE
[    3.530520] imx-media capture-subsystem: imx_media_add_async_subdev: added ipu2_csi1_mux, match type FWNODE
[    3.541128] imx-media capture-subsystem: imx_media_add_async_subdev: added imx-ipuv3-vdic.2, match type DEVNAME
[    3.551657] imx-media capture-subsystem: imx_media_add_async_subdev: added imx-ipuv3-ic.3, match type DEVNAME
[    3.561998] imx-media capture-subsystem: imx_media_add_async_subdev: added imx-ipuv3-ic.4, match type DEVNAME
[    3.572307] imx-media capture-subsystem: imx_media_add_async_subdev: added imx-ipuv3-ic.5, match type DEVNAME
[    3.582649] imx-media capture-subsystem: imx_media_add_async_subdev: added imx-ipuv3-vdic.8, match type DEVNAME
[    3.593245] imx-media capture-subsystem: imx_media_add_async_subdev: added imx-ipuv3-ic.9, match type DEVNAME
[    3.603684] imx-media capture-subsystem: imx_media_add_async_subdev: added imx-ipuv3-ic.10, match type DEVNAME
[    3.603994] imx-media capture-subsystem: imx_media_add_async_subdev: added imx-ipuv3-ic.11, match type DEVNAME
[    3.604921] imx-media: Registered subdev ipu1_vdic
[    3.605717] imx-media: Registered subdev ipu2_vdic
[    3.606199] imx-media: Registered subdev ipu1_ic_prp
[    3.606447] imx-media: Registered subdev ipu1_ic_prpenc
[    3.608277] imx-media: Registered subdev ipu1_ic_prpvf
[    3.609036] imx-media: Registered subdev ipu2_ic_prp
[    3.609254] imx-media: Registered subdev ipu2_ic_prpenc
[    3.610069] imx-media: Registered subdev ipu2_ic_prpvf
[    3.611536] imx-media: Registered subdev ipu1_csi0
[    3.612867] imx-media: Registered subdev ipu1_csi1
[    3.821930] imx-media: Registered subdev ipu1_csi0_mux
[    3.822390] imx-media: Registered subdev ipu2_csi1_mux
[   14.911115] imx-media: Registered subdev adv7180 1-0020
[   14.931374] imx-media capture-subsystem: Entity type for entity adv7180 1-0020 was not initialized!

BTD 文件:

&i2c2 {
   pinctrl-names = "default", "gpio";
   pinctrl-0 = <&pinctrl_i2c2>;
   pinctrl-1 = <&pinctrl_i2c2_gpio>;
   scl-gpios = <&gpio2 30 GPIO_ACTIVE_HIGH>;
   sda-gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
   clock-frequency = <100000>;
   status = "okay";

   adv7182: camera@20 {
       compatible = "adi,adv7182";
       pinctrl-names = "default";
       /* pinctrl-0 = <&pinctrl_adv7182>; */
       reg = <0x20>;
       powerdown-gpios = <&gpio3 17 GPIO_ACTIVE_LOW>;
       interrupt-parent = <&gpio1>;
       interrupts = <27 IRQ_TYPE_LEVEL_LOW>;

       port {
           adv7182_to_ipu1_csi0_mux: endpoint {
               remote-endpoint = <&ipu1_csi0_mux_from_parallel_sensor>;
               bus-width = <8>;
           };
       };
   };
};

&ipu1_csi0_from_ipu1_csi0_mux {
   bus-width = <8>;
};

&ipu1_csi0_mux_from_parallel_sensor {
   remote-endpoint = <&adv7182_to_ipu1_csi0_mux>;
   bus-width = <8>;
};

&ipu1_csi0 {
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_ipu1_csi0>;
};


pinctrl_ipu1_csi0: ipu1_csi0grp {
   fsl,pins = <
   MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK    0x10
   MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC      0x10
   MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC       0x10
   MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12   0x10
   MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13   0x10
   MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14   0x10
   MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15   0x10
   MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16   0x10
   MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17   0x10
   MX6QDL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18   0x10
   MX6QDL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19   0x10
   >;
};

沒有 /dev/media0 文件。我該如何調試?

謝謝

編輯 :

這條線永遠不會被呼叫,因為 list_empty(¬ifier->waiting) 總是假的。驅動程序/媒體/v4l2-core/v4l2-async.c @126

if (list_empty(&notifier->waiting) && notifier->complete)
   return notifier->complete(notifier); // <-- this line

媒體控制器需要同時啟動兩個 IPU。通過添加 dts 解決:

&ipu2 {
       status = "okay";
};

引用自:https://unix.stackexchange.com/questions/528507