DTS示例

Sensor的DTS配置大同小异,根据硬件的设计,主要是pinctl (iomux)clkgpio以及remote port

以下示例是在昉·惊鸿-7110 DevKit上的IMX219 DTS节点。
imx219: imx219@10 {
		compatible = "sony,imx219";
		reg = <0x10>;
		clocks = <&clk_ext_camera>;
		clock-names = "xclk";
		reset-gpio = <&ext_gpio 11 GPIO_ACTIVE_HIGH>;
		rotation = <0>;
		orientation = <1>; //CAMERA_ORIENTATION_BACK

		port {
			/* CSI2 bus endpoint */
			imx219_to_csi2rx0: endpoint {
				remote-endpoint = <&csi2rx0_from_imx219>;
				bus-type = <4>;      /* MIPI CSI-2 D-PHY */
				clock-lanes = <4>;
				data-lanes = <0 1>;
				lane-polarities = <0 0 0>;
				link-frequencies = /bits/ 64 <456000000>;
			};
		};
	};
以下为上述代码块的参数说明:
  • compatible:兼容性信息,用于连接驱动程序和目标设备。
  • reg:寄存器基本地址。
  • clocks:所需要的clocks。
  • clock-names:上述时钟的名称,需要和驱动中定义的相同。
  • reset-gpio:GPIO复位信号。
  • rotation:Camera旋转。