In Linux v6.3, commit 03c835f498b5 ("i2c: Switch .probe() to not take an
id parameter") removed the ID parameter from the I2C probe function. The
max96712 does not build for Linux kernels prior to Linux v6.3 because it
assumes that the ID parameter has been removed. There is an existing
conftest that checks to see if the probe function requires and ID
parameter and so update the max967xx drivers accordingly to fix the build
for kernels prior to Linux v6.3.
Note we should avoid using explicit kernel version checks in out-of-tree
drivers because this does not work for 3rd party kernels. Therefore,
remove the kernel version.h because this is not used or needed.
Bug 5277201
Change-Id: Idbc569d782a952ee9ea0a91aace54df20f50701d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3506342
Tested-by: Shawn Bai <xueyuanb@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Shawn Bai <xueyuanb@nvidia.com>
This commit implements T264 ISP floorsweeping functionality in the Linux
kernel driver, extending the existing RCE firmware implementation to
provide transparent ISP unit redirection at the kernel level.
Changes:
- Add isp_capture_query_availability_mask_probe() function to query ISP
availability mask from RCE firmware during driver probe via IVC
- Add isp_capture_find_first_available() helper function to find the
first available ISP unit from a bitmask for HW assignment
- Integrate floorsweeping logic into isp_get_nvhost_device() to handle
SW-to-HW ISP unit mapping with thread-safe assignment
- Add isp_capture_get_capabilities() function to expose ISP availability
to userspace via new IOCTL (ISP_CAPTURE_GET_CAPABILITIES)
- Add probe-time caching of ISP availability mask to avoid repeated IVC
queries during runtime
- Add comprehensive error handling and safety mechanisms for unknown
configurations
Implementation details:
- Uses CAPTURE_ISP_FUSE_QUERY_REQ/RESP IVC messages for querying RCE
- Maintains SW-to-HW ISP unit mapping array protected by mutex
- The SW-to-HW mappings persist for the driver's lifetime, given that
multiple channels make use of the same SW unit ID's and we do not
have tracking of all open channels during runtime
- Integrates with existing ISP setup flow before buffer allocation
- Maintains backward compatibility with non-T264 hardware
- Conservative approach: blocks requests when no ISP units are available
Floorsweeping logic (handled by RCE firmware, exposed as bitmask):
- Mask bit N set = ISP N available (not fused off)
- Mask bit N clear = ISP N fused off (unavailable)
- Examples:
- 0x3 (0b11): Both ISP0/ISP1 available (no floorsweeping)
- 0x1 (0b01): Only ISP0 available → all requests map to ISP0
- 0x2 (0b10): Only ISP1 available → all requests map to ISP1
- 0x0: No ISP units available (block all requests)
Benefits:
- Transparent operation for applications using fusacapture library
- Automatic ISP unit redirection without API changes
- Improved hardware yield by supporting single-ISP configurations
- Robust error handling and safety mechanisms
- Minimal performance overhead with probe-time caching
The implementation complements the existing RCE firmware floorsweeping
support and provides a complete end-to-end solution for T264 ISP
floorsweeping across all software layers.
Bug 5640706
Change-Id: If85ee3178e857394300479dd42e636f5f5d3bd23
Signed-off-by: fraunak <fraunak@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3491180
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Evgeny Kornev <ekornev@nvidia.com>
Reviewed-by: Kalle Jokiniemi <kjokiniemi@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Tested-by: Akihiro Mizusawa <amizusawa@nvidia.com>
In Linux v6.16, the 'of_node' structure was removed from the
'i2c_board_info' structure and the 'cdi-mgr' driver fails to build.
Although it is possible to detect whether the 'i2c_board_info' structure
has the 'of_node' structure using conftest, the 'cdi-mgr' driver does
not even use this. Therefore, it is simpler to fix this by using memset
and strncpy to initialize the 'i2c_board_info' structure and this also
aligns the camera 'cdi-mgr' driver with the camera 'isc-mgr' driver that
initializes the 'i2c_board_info' structure in this way.
JIRA LINQPJ14-60
Change-Id: I1d9df0fb1ccea3d303f256f65d187a131b7352ad
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3374654
(cherry picked from commit 30cad15a2e832ad445003911a76627fb18f91b49)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461876
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
The 'no_llseek' definition was removed in Linux v6.12. Use
NV_NO_LLSEEK_PRESENT to check if it should be defined.
The 'remove' callback of the 'platform_driver" structure was updated in
Linux v6.11 to return void instead of int.
Update rtcpu-coe.c so that it properly handles the above cases.
Bug 5466808
Change-Id: I9306840f0b4a9e5a59a5c161ac3c58af2a70a4ed
Signed-off-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3436078
Reviewed-by: Igor Mitsyanko <imitsyanko@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
In fringe unexpected cases, HSB (Holoscan sensor bringe) sends image
byte offset larger then allocated image size (e.g. if HSB just sends
incorrect packet, or is configured incorrectly for a different image
size. or just packet corruption).
In such cases, we run into SMMU faults.
To mitigate this, a buffer size of two check was introduced so even
were this to happen, it would not cause SMMU errors.
However, the support for this in UMD is not complete.
Therefore, disable this check until UMD is able to comply with this
buffer constraint.
Jira L4T-7463
Change-Id: I2de31740284627ca117f1fa0a28bde2ef9a82785
Signed-off-by: Rakibul Hassan <rakibulh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3419644
Reviewed-by: Igor Mitsyanko <imitsyanko@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Modify CoE capture logic a bit to make it more robust and error-proof:
- RCE Rx queue limit size is 16, no point to have 32 elements long queue
in kernel.
- Pass kernel's queue length to RCE when opening a channel so it can be
validated (to not exceed RCE max depth)
- validate image buffers IOVA addresses and buffer length before queuing
to RCE
Jira CT26X-1892
Change-Id: I199143fe726ebab05a1236d4b14b59f0528d65a8
Signed-off-by: Igor Mitsyanko <imitsyanko@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3419638
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Raki Hassan <rakibulh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
* Add virtual i2c bus support for 2nd, 3rd
& 4th Hawks to read/write EEPROM data
while streaming
* Move MAX96712 function declarations to
a proper header file instead of using extern
declarations in .c files. This fixes checkpatch
warnings about externs in .c files and improves
code organization
Bug 4807682
Change-Id: Ie4e7f7b9adc6fe6255a517cd5f076afdc754384a
Signed-off-by: Praveen AC <pac@nvidia.com>
(cherry picked from commit 57dc20f5a8)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3365540
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
The original checking for cdi_dev_package buffer size is wrong,
it should not check the max size against max I2C payload size.
If the cdi_dev_package buffer size is too big for i2c transfer,
it will be breaking down to smaller sizes and transferred using
multiple I2C messages.
Define a new MAX_CDI_DEV_PACKAGE_BUFFER_SIZE for checking the
cdi_dev_package buffer size.
Bug 5107765
Jira CAMERASW-333779
Change-Id: Ieec049d51af4911dfd31410f43aa4733b75d265d
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3365281
Reviewed-by: Kevin Xie (SW-TEGRA) <kevixie@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ganesh Ram Savithri Sreenivas Murthy <ganeshrams@nvidia.com>
Reviewed-by: Samuel Hung <samuelh@nvidia.com>
Replace use of WARN or WARN_ON kernel with dev_warn to improve logging
behavior. This change ensures that error conditions are reported with
clear informative messages rather than kernel stack traces that can
flood logs.
Additional information:
- The files `drivers/platform/tegra/rtcpu/debug.c` and
`drivers/platform/tegra/rtcpu/hsp-combo.c` present in the original
codebase were deleted as part of unrelated refactoring in the
target repository; hence, changes related to these files in the
patch were not applied.
- Additional changes are done to replace WARN_ON at other places.
Bug 4719119
Change-Id: Id12f1b4de77f8b007b557de140257a3bd7478b52
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/3308911
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3352892
Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
In Linux v5.18, commit 20c238dfb26c ("media: v4l2-mediabus: Drop legacy
V4L2_MBUS_CSI2_*_LANE flags"), commit 5a6ac3f4b46f ("media:
v4l2-mediabus: Drop legacy V4L2_MBUS_CSI2_CHANNEL_* flags") and
commit b9f7caa7753a ("media: v4l2-mediabus: Drop
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flag") removed various CSI2 flags.
Out of these flags we only need to set the number of lanes. The other
flags are redundant. The configuration was moved by
commit 94d964e58ad6 ("media: v4l2-fwnode: Move bus config structure
to v4l2_mediabus.h") to the structure v4l2_mbus_config_mipi_csi2
which itself is under the structure v4l2_fwnode_endpoint. Use conftest
to detect if the structure v4l2_mbus_config_mipi_csi2 is present and
avoid using kernel version checks.
Bug 4425688
Change-Id: Icd597492e48831326c203a6556176ac3767472a3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3354475
(cherry picked from commit 2f83033498)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3354638
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Use DIV_ROUND_DOWN_ULL consistently for frequency calculations to match
QNX implementation. For 30Hz signals, reference ticks were calculated
as 1041667 for a value of 1041666.67, while QNX correctly uses 1041666.
When generating precise frequencies, this rounding difference affects
how extra ticks distribute across periods (covering the 0.67 gap over
3 periods). The QNX implementation works correctly because it rounds down,
while the Linux implementation was rounding up.
This change ensures proper fractional tick distribution and prevents
signal drift over time for frequencies that aren't exact multiples of
the TSC clock unit.
Bug 5223558
Change-Id: I5fbeafd1e37c92fe95f2f3605d1ae225eacb88c8
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3348278
Reviewed-by: Justin Kim (SW-TEGRA) <juskim@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Ian Kaszubski <ikaszubski@nvidia.com>
In Linux v6.15, the timer APIs hrtimer_init() and del_timer() have been
removed. The hrtimer_setup() was added in Linux v6.13 to replace
hrtimer_init() and hrtimer_init() have finally been removed. The
functions del_timer()/del_timer_sync() were renamed to
timer_delete()/timer_delete_sync() in Linux v6.15. Use conftest to
detect these changes and update the drivers as necessary.
JIRA LINQPJ14-47
Change-Id: Id3994900384aad4b91155507cda91e04898ab12c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3336168
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
The camera driver fails to build if the compiler option
-Werror=declaration-after-statement is enabled and the following error
is seen ...
drivers/media/platform/tegra/camera/tegracam_ctrls.c:1120:17: error:
ISO C90 forbids mixed declarations and code
[-Werror=declaration-after-statement]
1120 | int index = tegracam_get_ctrl_index(cid);
| ^~~
JIRA CAMERASW-32529
Fix this by moving the declaration of the 'index' and 'size' variables
to the start of the for-loop code block.
Change-Id: I69590c147e8effd031b962606a077856ad4f8d07
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3316537
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mike Jia <mijia@nvidia.com>
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>
Fix concurrent access issue in destroy_buffer_table().
The function is freeing buffers while only holding the
write lock during hash deletion. Other threads could
still be accessing the buffers.
Create a temporary list within the lock and then unmap
the addresses safely.
Bug 5017044
Change-Id: Ib262570aaa19f65c4cb3959123a85c5f66e5db68
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3306890
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Zuyi Hu <zuyih@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>