.. _SD.CameraDevelopment.CameraDevelopment.CameraDriverPorting: .. include:: /content/swdocs.rsts .. spelling:: ctl debugfs dev kmap Camera Driver Porting !!!!!!!!!!!!!!!!!!!!! This topic gives a high-level overview of changes in Jetson Linux release 34 that may impact camera driver development when kernel version 4.9 is replaced by kernel version 5.10. It is intended to assist camera driver developers who must migrate to the new kernel version. For more details, see the source code released with the BSP and the documentation in the BSP distribution’s directory ``kernel/kernel-5.10/Documentation/``. For additional information about kernel 5.10, see the `description of changes in Linux 5.1 `__ on the `Kernelnewbies web site `__. .. todo:: Something bad happened to the second link; it has exactly the same URL (the web site's home page) as the former one. I've noted the same error in the r34.1 DP Release Notes, so the error may get corrected there first. Configuration Changes @@@@@@@@@@@@@@@@@@@@@ This table summarizes Linux configuration changes from kernel version 4.9 to version. .. raw:: html :file: CameraDriverPorting/ConfigurationChanges.htm Sensor Driver File Name Changes @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ This table describes files whose names have changed from kernel version 4.9 to version 5.10. .. raw:: html :file: CameraDriverPorting/SensorDriverFileNameChanges.htm Guarding Kernel Version-Specific Code @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ NVIDIA-specific kernel code in ``kernel/nvidia/`` is guarded by checks that compare the ``LINUX_VERSION_CODE`` macro against ``KERNEL_VERSION(x, x, x)``. These are the important changes in the new driver that is protected by this comparison of macros: .. todo:: "...that is protected..." refers back to the driver. "...that are protected..." would refer back to the changes. Which is intended? 1. Adapting the new Power Domain framework in drivers and corresponding header inclusions. The use of ``powergate_id`` is dropped, as ``tegra_powergate`` is deprecated in kernel version 5.10. The following table shows paths for the functions used in the current and previous kernel versions. .. raw:: html :file: CameraDriverPorting/GuardingKernelVersionSpecificCode-1.htm 2. Adapting VI drivers to V4L2 framework changes to replace video buffer state, and changes to time related v4l2-ctl APIs and structures. Some examples are listed in the table below. .. raw:: html :file: CameraDriverPorting/GuardingKernelVersionSpecificCode-2.htm 3. Adapting to changes in debugfs APIs. For function definitions, see the files listed in the table below. .. raw:: html :file: CameraDriverPorting/GuardingKernelVersionSpecificCode-3.htm 4. Adapting to replacement of kmap APIs with ``vmap dma_buf`` APIs. For API definitions, see the files listed in the table below. .. raw:: html :file: CameraDriverPorting/GuardingKernelVersionSpecificCode-4.htm dev_err() Function @@@@@@@@@@@@@@@@@@ The definition of ``dev_err()`` has changed. For more information, see the files listed below. .. raw:: html :file: CameraDriverPorting/DeverrFunction.htm I2C API @@@@@@@ I2C API changes are listed below. .. raw:: html :file: CameraDriverPorting/I2cApi.htm NVIDIA Capture Driver Code Path @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Some of the capture mode driver file paths for channel configuration (VI, ISP) have changed. .. raw:: html :file: CameraDriverPorting/NvidiaCaptureDriverCodePath.htm