The V4L2 sub-device interface offers a robust solution to executing the configuration. Through software, the V4L2 sub-device interface can support all CSI-2 cameras in the market, with minimal or zero changes to the CSI-2 host driver. The main driver will call the sub-device driver, ask it to power on, start streaming, change video mode, and so on, without needing to know anything about the camera it is talking to.
Designers should use the V4L2 sub-device interface when writing the CSI-2 device driver, and also use the V4L2 API to write the CSI-2 host driver. The Linux kernel includes several examples on how to do this along with documentation and generic example drivers.
The DesignWare IP Prototyping Kit for MIPI CSI-2 Host includes a V4L2 driver for Synopsys DesignWare CSI-2 Host IP and a V4L2 sub-device driver for the Omnivision OV5647. Replacing the camera on the system does not require changes to the host-side device driver. From the software perspective for the device side, designers need to either install the appropriate V4L2 sub-device driver for the camera from the Linux kernel, or write a new V4L2 sub-device driver for the camera, themselves.
Designers using the kit can also take advantage of the existing DesignWare CSI-2 Host IP and modify the source code to control other sub-devices to might add to the design (ex: RAW converter, image resizers, etc).