TX1 R24.2.1 SOC_CAMERA Driver Support

I have developed TC358748 camera sensor driver based on SOC_CAMERA framework in R23.2 i want to use that on R24.2.1.

As SOC_CAMERA is deprecated in R24.2, How to enable in kernel defconfig.

In menuconfig, below are related to V4L2
Multimedia Support
–Media Controller API
–V4L2 sub-device userspace API
–V4L2 int device (DEPRECATED)
–V4L platform devices —>
–SoC camera support
–platform camera support (NEW)
–SuperH Mobile MIPI CSI-2 Interface driver (NEW)
–SuperH Mobile CEU Interface driver (NEW)
–Tegra soc_camera host driver
–Tegra soc_camera host VI2 driver (NEW)
–Tegra soc_camera host SCF bypass driver (NEW)

So what modules need to be enable for SOC_CAMERA and without using nvidia ISP.?

I have added following in tegra21_defconfig

CONFIG_VIDEO_TEGRA=m
CONFIG_VIDEO_TEGRA_VI=m
CONFIG_SOC_CAMERA=y
CONFIG_VIDEO_TEGRA_VI2=y
CONFIG_SOC_CAMERA_TC358748=m

And zImage build command gives me following errors

..
..
CHK     include/generated/compile.h
UPD     include/generated/compile.h
CC      init/version.o
LD      init/built-in.o
drivers/built-in.o: In function `tegra_vi_v4l2_init':
/home/ritesh/kernel_R24.2.1/kernel/drivers/media/platform/tegra/camera/mc_common.c:192: undefined reference to `tegra_vi_get'
drivers/built-in.o: In function `tegra_channel_update_clknbw':
/home/ritesh/kernel_R24.2.1/kernel/drivers/media/platform/tegra/camera/channel.c:850: undefined reference to `tegra_vi_get'
/home/ritesh/kernel_R24.2.1/kernel/Makefile:794: recipe for target 'vmlinux' failed
make[1]: *** [vmlinux] Error 1
Makefile:130: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

To solve error, i have to enable following modules as build in from menuconfig

Media Controller API 
V4L2 sub-device userspace API
Tegra video input host1x client driver

After that if i flashed this kernel. modprobe tegra_camera gives following error

modprobe : ERROR: could not insert 'tegra_camera' : Device or resource busy

So whats wrong here?

For r24.2 don’t support soc_camera any more. You may need to port you driver to the “Media Controller” driver.

You can read more about it in the documentation available in the package called L4T R24-2 Documentation, you can download it from: Jetson Download Center | NVIDIA Developer (nvl4t_docs/index.html - sections: Video for Linux User Guide and Sensor Driver Programming Guide)

I think in R24.2 soc_camera is deprecated. And i can see soc_camera in menuconfig entries.
I am planning to port driver to Media Controller but in future.
But i thinks it will takes 1-2 weeks for development and testing.
Actually due to my project deadline i need to get my camera works with in 2-3 days. Is there any way i can disable Media Controller and enable Soc_Camera?

There are many code dependence. It’s hard and may take much time to enable the SOC_CAMERA on r24.2

You may try to remove the CONFIG_MEDIA_CONTROLLER, CONFIG_VIDEOV4L2_SUBDEV_API and add soc_camera config, you may need override some file from r24.1 or r23.x to fixed the compile issue.