debian系统目前支持Usb camera是没有问题,走UVC功能接口。那么mipi 接口camera和并口接口的camera,在Debian系统怎么设置呢,其实原理一样,也走uvc接口封装函数.
下面给他大家简单说明:
首先在dts文件定义Mipi camera接口的定义:
camera0: camera-module@60 {
status = "okay";
compatible = "ovti,ov13850-v4l2-i2c-subdev";
reg = < 0x60 >;
device_type = "v4l2-i2c-subdev";
clocks = <&cru SCLK_CIF_OUT>;
clock-names = "clk_cif_out";
pinctrl-names = "rockchip,camera_default",
"rockchip,camera_sleep";
pinctrl-0 = <&cam0_default_pins>;
pinctrl-1 = <&cam0_sleep_pins>;
rockchip,pwr-gpio = <&gpio2 10 GPIO_ACTIVE_HIGH>;
rockchip,camera-module-mclk-name = "clk_cif_out";
rockchip,camera-module-facing = "back";
rockchip,camera-module-name = "cmk-cb0695-fv1";
rockchip,camera-module-len-name = "lg9569a2";
rockchip,camera-module-fov-h = "133.0";
rockchip,camera-module-fov-v = "100.1";
rockchip,camera-module-orientation = <0>;
rockchip,camera-module-iq-flip = <0>;
rockchip,camera-module-iq-mirror = <0>;
rockchip,camera-module-flip = <0>;
rockchip,camera-module-mirror = <0>;
rockchip,camera-module-defrect0 = <640 480 0 0 640 480>;
rockchip,camera-module-defrect1 = <640 480 0 0 640 480>;
rockchip,camera-module-defrect2 = <640 480 0 0 640 480>;
rockchip,camera-module-defrect3 = <640 480 0 0 640 480>;
rockchip,camera-module-flash-support = <0>;
rockchip,camera-module-mipi-dphy-index = <0>;
};
cif_isp0: cif_isp@ff910000 {
compatible = "rockchip,rk3399-cif-isp";
rockchip,grf = <&grf>;
reg = <0x0 0xff910000 0x0 0x4000>, <0x0 0xff968000 0x0 0x8000>;
reg-names = "register", "dsihost-register";
clocks =
<&cru ACLK_ISP0_NOC>, <&cru ACLK_ISP0_WRAPPER>,
<&cru HCLK_ISP0_NOC>, <&cru HCLK_ISP0_WRAPPER>,
<&cru SCLK_ISP0>, <&cru SCLK_DPHY_RX0_CFG>,
<&cru SCLK_CIF_OUT>, <&cru SCLK_CIF_OUT>,
<&cru SCLK_MIPIDPHY_REF>;
clock-names =
"aclk_isp0_noc", "aclk_isp0_wrapper",
"hclk_isp0_noc", "hclk_isp0_wrapper",
"clk_isp0", "pclk_dphyrx",
"clk_cif_out", "clk_cif_pll",
"pclk_dphy_ref";
interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH 0>;
interrupt-names = "cif_isp10_irq";
power-domains = <&power RK3399_PD_ISP0>;
rockchip,isp,iommu-enable = <1>;
iommus = <&isp0_mmu>;
status = "disabled";
};
通过上面的配置后,打开驱动,驱动加载成功了。通过应用就可以切换摄像头,图像就可以出来了
export DISPLAY=:0.0
su linaro -c " \ gst-launch-1.0 v4l2src device=/dev/video2 io-mode=4 ! videoconvert ! video/x-raw,format=NV12,width=640,height=480 ! rkximagesink \"
在debian 系统的目录下面也有一个文件,路径
/usr/local/bin/test_camera.sh
注意要修改/dev/videoX x表示设备节点号,看系统/dev/videox是多少,对应修改,执行就可以看到图像出来
|