Camera Driver Porting
This topic gives a high-level overview of changes in Jetson Linux release 36 that may impact camera driver development when kernel version 5.10 is replaced by kernel version 5.15. 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 <top>/kernel/3rdparty/canonical/linux-jammy/kernel-source/Documentation
.
For additional information about kernel 5.15, see the description of changes in Linux 5.15 on the Kernelnewbies web site.
Configuration Changes
This table summarizes Linux configuration changes from kernel version 5.10 to version 5.15.
Environment variable | Kernel 5.10 | Kernel 5.15 |
---|---|---|
CONFIG_MEDIA |
CONFIG_MEDIA_PLATFORM_SUPPORT=y |
N/A |
CONFIG_TEGRA_GRHOST |
CONFIG_TEGRA_GRHOST_NVCSI=y |
N/A |
CONFIG_VIDEO |
CONFIG_VIDEO_ISC=m |
N/A |
CONFIG_VIDEO (sensor) |
CONFIG_NV_VIDEO_IMX185=m |
N/A |
Kernel Version-Specific Code
NVIDIA-specific kernel code in kernel/nvidia-oot/
is guarded by checks that compare the LINUX_VERSION_CODE
macro against KERNEL_VERSION(x, x, x)
.
These are the changes in the new driver:
Adapting the Power Domain framework in drivers and corresponding header inclusions.
The following table shows paths for the functions used in the current kernel versions.
Kernel 5.15 Kernel 5.10 /kernel/3rdparty/canonical/linux-jammy/kernel-source/include/linux/pm_domain.h /kernel/kernel-5.10/include/linux/pm_domain.h 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.
Kernel 5.15 ktime_get_ts64
struct timespec64
ns_to_timespec64
VB2_BUF_STATE_ERROR
VFL_TYPE_VIDEO
/kernel/3rdparty/canonical/linux-jammy/kernel-source/include/media/v4l2-dev.h V4L2 structure changes:
/kernel/3rdparty/canonical/linux-jammy/kernel-source/include/media/v4l2-async.h Modified enum type for C-PHY and D-PHY in
v4l2_mbus_config
:/kernel/3rdparty/canonical/linux-jammy/kernel-source/include/uapi/linux//v4l2-mediabus.h Adapting to changes in debugfs APIs. For function definitions, see the files listed in the table below.
Kernel 5.15 Kernel 5.10 /kernel/3rdparty/canonical/linux-jammy/kernel-source/fs/debugfs/file.c /kernel/kernel-5.10/fs/debugfs/file.c Adapting to replacement of kmap APIs with
vmap dma_buf
APIs. For API definitions, see the files listed in the table below.Kernel 5.15 Kernel 5.10 /kernel/3rdparty/canonical/linux-jammy/kernel-source/drivers/dma-buf/dma-buf.c /kernel/kernel-5.10/drivers/dma-buf/dma-buf.c
dev_err() Function
The definition of dev_err()
has changed. For more information, see the files listed below.
Kernel 5.15 | Kernel 5.10 |
---|---|
|
|
I2C API
I2C API changes are listed below.
Kernel 5.15 |
---|
|
|
NVIDIA Capture Driver Code Path
Some of the capture mode driver file paths for channel configuration (VI, ISP) have changed.
Kernel 5.15 | Kernel 5.10 |
---|---|
|
|