我在 KARO-TX6Q 上使用 kernel.org 上的内核 4.14.24,在定制板上使用 ADV7182。
对于来自 KARO git 的内核 4.1.15,我使用了经过修改的 adv7180_tvin 驱动程序以与 adv7182 配合使用。该驱动程序不使用 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!
数据TB文件:
&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) 始终为 false。驱动程序/media/v4l2-core/v4l2-async.c @126
if (list_empty(¬ifier->waiting) && notifier->complete)
return notifier->complete(notifier); // <-- this line
答案1
媒体控制器需要同时激活两个 IPU。通过添加 dts 解决:
&ipu2 {
status = "okay";
};