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.
Configuration Changes
This table summarizes Linux configuration changes from kernel version 4.9 to version.
| Environment variable | Kernel 5.10 | Kernel 4.9 |
|---|---|---|
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 |
CONFIG_VIDEO_IMX185=m |
CONFIG_THERMAL_GOV |
N/A | CONFIG_THERMAL_GOV_CONTINUOUS=y |
Sensor Driver File Name Changes
This table describes files whose names have changed from kernel version 4.9 to version 5.10.
| Kernel 5.10 | Kernel 4.9 |
|---|---|
nv_imx185.c |
imx185.c |
nv_imx268.c |
imx268.c |
nv_imx318.c |
imx318.c |
nv_ov9281.c |
ov9281.c |
nv_ov10823.c |
ov10823.c |
nv_ov23850.c |
ov23850.c |
nv_imx390.c |
imx390.c |
nv_imx219.c |
imx219.c |
nv_imx274.c |
imx274.c |
nv_lc898212 |
lc898212 |
nv_ov5693.c |
ov5693.c |
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:
Adapting the new Power Domain framework in drivers and corresponding header inclusions. The use of
powergate_idis dropped, astegra_powergateis deprecated in kernel version 5.10.The following table shows paths for the functions used in the current and previous kernel versions.
Kernel 5.10 Kernel 4.9 kernel/kernel-5.10/include/linux/pm_domain.h
kernel/kernel-4.9/include/linux/tegra_pm_domains.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.10 Kernel 4.9 ktime_get_ts64getrawmonotonic()struct timespec64struct timespecns_to_timespec64ns_to_timespecVB2_BUF_STATE_ERRORVB2_BUF_STATE_REQUEUEINGVFL_TYPE_VIDEOkernel/kernel-4.9/include/media/v4l2-dev.hVFL_TYPE_GRABBERkernel/kernel-5.10/include/media/v4l2-dev.hV4l2 ctl API changes:
kernel/kernel-5.10/drivers/media/v4l2-core/v4l2-ctrls.cV4l2 ctl API changes:
kernel/kernel-4.9/drivers/media/v4l2-core/v4l2-ctrls.cV4L2 structure changes:
kernel/kernel-5.10/include/media/v4l2-async.hV4L2 structure changes:
kernel/kernel-4.9/include/media/v4l2-async.hModified enum type for C-PHY and D-PHY in
v4l2_mbus_config:/dev-main_l4t/kernel/kernel-5.10/include/media/v4l2-mediabus.hv4l2_mbus_typefor kernel version 4.9:kernel/kernel-4.9/include/media/v4l2-mediabus.hAdapting to changes in debugfs APIs. For function definitions, see the files listed in the table below.
Kernel 5.10 Kernel 4.9 kernel/kernel-5.10/fs/debugfs/file.ckernel/kernel-4.9/fs/debugfs/file.cAdapting to replacement of kmap APIs with
vmap dma_bufAPIs. For API definitions, see the files listed in the table below.Kernel 5.10 Kernel 4.9 kernel/kernel-5.10/drivers/dma-buf/dma-buf.ckernel/kernel-4.9/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.10 | Kernel 4.9 |
|---|---|
| |
|
I2C API
I2C API changes are listed below.
| Kernel 5.10 | Kernel 4.9 |
|---|---|
|
|
|
|
|
|
NVIDIA Capture Driver Code Path
Some of the capture mode driver file paths for channel configuration (VI, ISP) have changed.
| Kernel 5.10 | Kernel 4.9 |
|---|---|
|
|
|