Hello everyone,
I have a custom board that has an IMX6ull processor and it is connected to a video decoder ADV7182. The version of linux kernel is 4.1.15. I want to configure it to capture video from an analogue camera.
Can you help me how to configure the kernel or how to patch the linux kernel?
Hi riguang peng,
Our i.MX6QDL Sabreauto EVK supports ADV7180, you can refer to it for your design.
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
... ...
i2c@1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
adv7180: adv7180@21 {
compatible = "adv,adv7180";
reg = <0x21>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ipu1_1>;
clocks = <&clks IMX6QDL_CLK_CKO>;
clock-names = "csi_mclk";
DOVDD-supply = <®_3p3v>; /* 3.3v, enabled via 2.8 VGEN6 */
AVDD-supply = <®_3p3v>; /* 1.8v */
DVDD-supply = <®_3p3v>; /* 1.8v */
PVDD-supply = <®_3p3v>; /* 1.8v */
pwn-gpios = <&max7310_b 2 0>;
csi_id = <0>;
mclk = <24000000>;
mclk_source = <0>;
cvbs = <1>;
};
... ...
adv7180 driver:
linux_top/drivers/media/platform/mxc/capture/adv7180.c
Have a nice day!
BR,
Weidong
Hi Wigros Sun, Thank you!
Now, I config my dts as flowing:
&i2c2 {
clock_frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c2>;
status = "okay";
adv7182: adv7182@20 {
compatible = "adv,adv7180";
reg = <0x20>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_csi1>;
clocks = <&clks IMX6UL_CLK_CSI>;
clock-names = "csi_mclk";
//pwn-gpios = <&gpio_spi 6 1>;
//rst-gpios = <&gpio_spi 5 0>;
csi_id = <0>;
//mclk = <24000000>;
//mclk_source = <0>;
mclk = <28636300>;
mclk_source = <0>;
status = "okay";
port {
adv7182_ep: endpoint {
remote-endpoint = <&csi1_ep>;
};
};
};
};
&csi {
status = "okay";
//pinctrl-names = "default";
//pinctrl-0 = <&pinctrl_csi1>;
port {
csi1_ep: endpoint {
remote-endpoint = <&adv7182_ep>;
};
};
};
then I patch the mx6s_capture.c according to 0001-Enable-CSI-support-BT656-interlace-and-add-adv7180.patch.zip, I do not change the drivers/media/platform/mxc/capture/adv7180.c.
Do you have any other advice?
Hi,
你的硬件连接方式,要和dts里的节点对应上。
pwn-gpios
rst-gpios
这2个是电源控制和reset控制,你的电路上没有吗?
ADV7180的驱动里会读取和处理dts节点里的配置,然后再处理。你要根据你的硬件配置节点,而且要微调一下adv7180.c
weidong
现在我的视频流能够出来了,但是颜色不对,感觉是ADV7182A寄存器配置的问题,请指导怎样配置
Hi,
关于ADV7182A寄存器配置的问题,你最好能够请求ADI的FAE或者他们代理的FAE来帮你配置,因为不是我们的芯片,我们也没有原厂熟悉。
另外使用模拟摄像机,你需要注意
(1)制式一致性
摄像头制式(PAL,NTSC), ADV7182A制式配置,mxc_v4l2_capture.c(这是CPU端捕获驱动)中制式跟踪一下,三者是否是一致的;
(2)YUV输出协议
一般我们都会用BT.656格式输出,那么VSYN/ HSYNC都会编码在data的8bit数据线上,你不需要外部连接HSYNC/VSYNC信号。
(3)camera的上电
我们要求camera先上电,对你的系统来说,就是camera和ADV7182A先上电。
你先按照上面的建议检查一下,然后再请去寻求相关支持。
Have a nice day!
BR,
Weidong
技术支持:你好!
已经初步这个问题,是由于RGB三个颜色都缺色的问题,data0-data7上都有数据信号,具体是哪里的问题,还在分析中,另外还有一个问题,就是视频的延迟比较大,在1S秒左右,这个延迟优化有什么建议吗?