Commit Graph

19 Commits

Author SHA1 Message Date
Shawn Bai
2e202467e3 [MAX96712][MAX96726]support RAW10 and RAW16 to ToT
Bug 5277201

Change-Id: I0d402e7d26b700f78e3a5ce4a461b33f4f2cda1c
Signed-off-by: Shawn Bai <xueyuanb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3458947
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Jukka Kaartinen <jkaartinen@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-12-05 05:09:51 -08:00
Shubham Chandra
5500a4aee6 media: camera: modify error log to info log
v4l2-compliance has a negative test for image size,
resulting in an error log. Modify this error log to
info to avoid reporting kernel error/warning failure.

Bug 5143480

Change-Id: I5ec459f97c5b09e130293b59c19c1eb3ea9a53ee
Signed-off-by: Shubham Chandra <shubhamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3396425
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Nithin Varghese <nvarghese@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:20:36 +00:00
Ankur Pawar
9597e077cd media: camera: remove t194 from nvcsi driver files
Refactor nvcsi driver files to replace t194, with
more general name. Modify the makefile as well
As t194 on dev-main is deprecated as a platform.

Compatible string "nvidia,tegra194-nvcsi" remains
to maintain backward compatibility and avoid any
device tree changes.

Bug 3790154

Change-Id: Iad742dfc75430a9b74bf9d03bf5e89c0912eeab1
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3313179
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-07-24 10:19:18 +00:00
Mohit Ingale
794163ce8e media: tegra: Conditionally disable L4T-specific drivers in embedded Linux builds
This change adds conditional compilation blocks to disable L4T-specific
camera and multimedia drivers when building for embedded Linux platforms.
Key changes include:

- Add ifneq ($(NV_BUILD_SYSTEM_TYPE),embedded-linux) checks in multiple
  Makefiles to exclude L4T-specific components
- Introduce NV_IS_L4T define to conditionally include L4T functionality
- Reorganize header includes to support both L4T and embedded Linux builds
- Conditionally wrap L4T-specific struct members and function calls
- Update module dependencies (cdi_mgr now depends on cdi_dev instead of cdi_pwm)

Jira CAMERASW-32251

Change-Id: I934fdd0188e914c07b456c0f6ad379d2a08555ca
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3294869
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
2025-07-24 10:19:15 +00:00
yangxu
ca53993417 kernel: nvidia-oot: Static Analysis MISSING_LOCK
Fix Static Analysis MISSING_LOCK for channel.c

Jira CAMERASW-30853

Change-Id: I691b5440d007f3eb68c998bea74c411540d87665
Signed-off-by: yangxu <yangxu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3285323
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sudhir Vyas <svyas@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Xiaoming Xiang <xxiang@nvidia.com>
2025-07-24 10:19:14 +00:00
Bob Zhang
3aa403fa33 kernel: nvidia-oot: Fix Linux KMD coverity defects
Fix INT30-C and INT08-C coverity defects for
capture-vi.c and tegracam_ctrls.c.

Fix MISSING_LOCK coverity defects for channel.c.

JIRA CAMERASW-30788

Change-Id: I6ad218cb9184f09d04d862a4c8f3f6db35db65cf
Signed-off-by: Bob Zhang <bozhang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3275901
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Xiaoming Xiang <xxiang@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
2025-07-24 10:19:13 +00:00
yangxu
a268e2a1d2 kernel: nvidia-oot: Fix CERT ARR30-C violations
Fix CERT ARR30-C coverity defects for channel.c

Jira CAMERASW-30796

Change-Id: I1db048087f0996956d95224c0caa6c35ff971eed
Signed-off-by: yangxu <yangxu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3276114
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Xiaoming Xiang <xxiang@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
2025-07-24 10:19:13 +00:00
Praveen AC
073fc28ecd [t23x][camera]: Fix VIDIOC_G/S_PARM v4l2-compliance test fail.
Implemented VIDIOC_G/S_PARM ioctl calls to fix
v4l2-compliance test fail.

Bug 4807063

Change-Id: Ia03b161b5659c710976084f277064a44d10aec15
Signed-off-by: Praveen AC <pac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3221436
(cherry picked from commit c3b8c1cd3e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3232021
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Ankur Pawar <ankurp@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
yangxu
e078bbbe94 kernel: nvidia-oot: Fix KMD coverity defects
Fix INT30-C, ARR30-C, EXP34-C, and MEM30-C coverity defects for channel.c

Jira CAMERASW-29897

Change-Id: I0ae0ee26273455b6e5a80a0ea5099e648dbc4097
Signed-off-by: yangxu <yangxu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3265973
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Xiaoming Xiang <xxiang@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
2025-07-24 10:19:12 +00:00
Praveen AC
d2fcc70dca camera: Fix v4l2-compliance test fails
Fix following test cases:
1.test invalid ioctls test
2.test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF

return proper error value from the driver.

Bug 4587577

Change-Id: Iee1114d4cc74ba27c3bef30190f936f69cbc32ac
Signed-off-by: Praveen AC <pac@nvidia.com>
(cherry picked from commit 7373b7bc0b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3195935
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
2024-08-20 17:51:39 -07:00
Jon Hunter
6255ffef44 media: camera: Fix v4l2-subdev for Linux v6.10
In Linux v6.10, the v4l2-subdev callbacks 'g_dv_timings' and
's_dv_timings' were moved from the v4l2_subdev_video_ops structure to
the v4l2_subdev_pad_ops structure. Fix the build for Linux v6.10 by
using conftest to determine which structure is used for these callbacks.

Bug 4593750

Change-Id: Ic54e88da22ed7d1da9b6026a45b9c4307637c7b4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142215
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-05-22 09:19:43 -07:00
Praveen AC
77ae24b275 camera:driver: Fix the race condition of setting bypass mode.
Add the check to see if the device is already in use or not,
while calling s_ctrl by multiple user apps on the same video node.

Here ,The "vb2_is_busy" function checks if the queue represented
by the vb2_queue instance is busy by checking if there are any
buffers in the active queue.If there are any buffers in the active queue,
it means that they are currently being processed by the device driver,
and the queue is considered busy.

Bug 3836336

Change-Id: I3d9b215f953c44d55cbbc287fe94c9b793da5955
Signed-off-by: Praveen AC <pac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2856359
(cherry picked from commit 780fcc55db93c62d5acd3a3866fd1c841c1fdb7c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3130746
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
2024-05-10 15:55:00 -07:00
Jon Hunter
ecf383265b drivers: Don't use strlcpy()
For Linux v6.8, the function strlcpy() has been removed. The function
strscpy() was added in Linux v4.3 and has been preferred over strlcpy().
See upstream Linux commit 30035e45753b ("string: provide strscpy()") for
more details. The Linux checkpatch.pl script warns against using
strlcpy().

The function strscpy() takes the same arguments as strlcpy(), but
returns a type of ssize_t instead of size_t. Update the drivers to use
strscpy() instead of strlcpy().

Bug 4448428

Change-Id: Id6f196f0e81decf1545f9aa4f74f5c63a7f72a48
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059457
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
2024-01-25 09:11:11 -08:00
Laxman Dewangan
1729ced2bf camera: channel: Make sure csi channels are initailized before access
There is case where CSI channels are initialized later before
accessing it. In this case, it can cause NULL pointer access.

Add checks before accessing it in the function
tegra_channel_find_linked_csi_subdev().

Bug 4346767

Change-Id: I752898af4b2164540cbd2e071ee36af4cd5f6fde
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3039709
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-24 11:51:56 -08:00
Laxman Dewangan
b40e45535e camera: Use conftest to find if media_entity_remote_pad() present
Use conftest to determine if media_entity_remote_pad()
function is present or not

This function is removed by commit b2e44430b634 ("media:
mc-entity: Rename media_entity_remote_pad to media_pad_remote_pad_first")
in Linux 6.0

Bug 4387902

Change-Id: I816016731ac44a3c093438310f8e60bd166f2fd7
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037917
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-19 19:39:02 -08:00
Anubhav rai
b66b703f0e camera: vi: Fix VI clk scaling for gangmode
gangmode uses single VI channel to stream simultaneously
from 2 CSI bricks. The VI clk should be scaled accordingly
to accommodate this bandwidth

bug 3814565

Signed-off-by: Anubhav rai <arai@nvidia.com>
Change-Id: I6912f1aeb878e53e63e3a04c7132219f030973d1
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2791338
(cherry picked from commit 7a95f84f1eb4f60a8e9740876db53b23c95f865e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2866932
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Ankur Pawar <ankurp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-17 20:05:03 -07:00
Ankur Pawar
5957f061b3 Camera: OOT: misc code fixes for drivers
1. Sensor deep power down and mclk enable
   and disable code.
2. Assign pads member in v4l2_subdev_state
   struct passed to v4l2_subdev_call.
3. emc and iso.emc clock are not available
   in K5.15. Disable clock get function.

Bug 3898807

Change-Id: If9e24ccd837af00df250571e6fc4c907886faf93
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2835934
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-02-15 23:54:02 -08:00
Frank Chen
ed8b9ea701 media: camera: update kernel config checks
kernel drivers can be built as built-in (=y) or module
(=m). The old ways of checking a driver is enabled or
not is to use "#if define(CONFIG_XXX)" for built-in and
"#if defined(CONFIG_xxx_MODULE)" for module.

Switch to the new IS_ENABLED() macro which can check
a driver is configured as built-in or module.

Jira CAMERASW-10141

Change-Id: I9b7e3e911a587da19ca56cdc5ef610d9b4c52850
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2828089
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Igor Mitsyanko <imitsyanko@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-16 03:34:49 -08:00
Frank Chen
92ac7bc35a media: camera: Build tegra-camera as OOT module
Port camera drivers below from /kenrel/nvidia to
/kernel/nvidia-oot as OOT modules:
- Fusa-capture driver
- Tegra V4L2 framework driver
- vi/csi driver
- tegra camera platform driver

Change-Id: I390af27096425bb11e0934201dd1a90f001bb3fa
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2780698
Reviewed-by: FNU Raunak <fraunak@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-13 06:15:42 -08:00