Commit Graph

55 Commits

Author SHA1 Message Date
Praveen AC
459e781d79 virtual i2c mux support for other Hawks
* 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>
2025-07-24 10:20:35 +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
Ankur Pawar
c581e5211d media: i2c: IMX390: modify mode table
-Add gain, exposure and short exposure functions.
-Modify WDR and SDR mode table as per the settings
 provided by Sony in their camera SDK.
-Analog gain is fixed in mode table. Driver will only
 update digital gain.

Bug 4774547

Change-Id: Ia04f42062d6f1e56f16c7fbcc6e671529cb714b6
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3189759
(cherry picked from commit 3ff44d5400)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3283633
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2025-07-24 10:19:14 +00:00
Ankur Pawar
ea7b98682a media: i2c: fix IMX390 SDR mode corruption
Bottom two lines in IMX390 SDR mode are completely
black. Fix issue in SDR mode table. Also change the
image resolution to 1936x1096.

Last two line are removed by disabling SMPG(Safety Mechanism Pattern Generator) using register 0x2DFC, 0x2E24.

Bug 4505240

Change-Id: I92047ea83d20f1b4ca4e712718051a9c6e69cfcb
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3147214
(cherry picked from commit 3c87c18fcf)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3228151
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Addarsh Srivastava <addarshs@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:07 +00:00
Shubham Chandra
7b1b8e17b5 nv_hawk_owl: add error check for reading gpio prop
Add error checks for reading GPIO properties from
device-tree nodes in nv_hawk_owl driver.

Bug 4715132

Change-Id: I6f539d04430883ab839aeaab957809ebb6049238
Signed-off-by: Shubham Chandra <shubhamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3168601
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
2025-07-24 10:19:07 +00:00
Ankur Pawar
6c9bba8912 media: i2c: enable IMX390 WDR mode
Enable WDR(wide dynamic range) mode for IMX390.
The following modification and addition are done:
1 Add WDR mode table
2 Restructure IMX390 driver for WDR gain and framerate
3 Use common driver to configure serializer(max9295) and
  deserializer(max9296)

Bug 4505240

Change-Id: I52fc3f03a66fe4e2446d7b41f409ed4154c42f02
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3105249
(cherry picked from commit adc35280cb)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3117215
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:07 +00:00
Praveen AC
ebb6c5604b nv_hawk_owl:Fix fail to read 2nd Hawk EEPROM.
Changed the i2c trans address from 0x42 to 0x15 for
2nd Hawks EEPROM to avoid fail to read serial number.

Bug 4244937

Change-Id: Ib118e921294031df32e1f0d9389edbb3f4269dfd
Signed-off-by: Praveen AC <pac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2964334
(cherry picked from commit 49f817e90dcc4609dfea6005fe20e47c5346835d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3130799
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
2024-08-01 19:01:13 -07:00
Praveen AC
8ba7c4a320 media: i2c: update ar0234 EEPROM data structure
- Integrate calibration data structure from
  Leopard Imaging hawk driver into NVIDIA
  hawk driver
- Rearrange EEPROM calibration data structure to
  maintain backward compatibility with HAWK, OWL
  modules with EEPROMs programmed using earlier
  calibration data structure
- Use separate structures for tracking imu noise
  parameters and place it after the module
  serial number.
- Change module serial number length used for
  reading the serial number from EEPROM data

L4T-4649

Change-Id: I17613905e63fef3fc690dca42a0a10bd1f4fc24d
Signed-off-by: Praveen AC <pac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3072846
(cherry picked from commit 518ae94bb4)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3073820
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2024-07-19 03:05:51 -07:00
Jon Hunter
24acf38e0b media: camera: Fix crash in sensor drivers
When CONFIG_V4L2_ASYNC is not enabled and CONFIG_DEBUG_LIST is enabled
then the following kernel panic is observed ...

 imx219: probe of 9-0010 failed with error -524
 list_add corruption. next->prev should be prev (ffffb2b2e95dad78),
  but was 0000000000000000. (next=ffff000088baf508).
 ------------[ cut here ]------------
 kernel BUG at lib/list_debug.c:23!
 Internal error: Oops - BUG: 00000000f2000800 [#1] SMP

If CONFIG_V4L2_ASYNC is not enabled in the kernel, then the function
tegracam_v4l2subdev_register() will return -ENOTSUPP and this will cause
the probe of the sensor drivers to fail. Although failing to probe the
driver is expected in this case, it is not expected that this will
trigger a kernel panic if CONFIG_DEBUG_LIST is enabled. The panic is
caused because tegracam_device_unregister() is not being called in the
exit path of the probe function when tegracam_v4l2subdev_register()
returns an error.

Bug 4704110

Change-Id: I4875a31e55c24b5ab0932a683f16a7a74695a6b6
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3162389
(cherry picked from commit 118cd4e0a6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3173737
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-07-14 05:22:05 -07:00
Jon Hunter
65900a51a9 media: virtual-i2c-mux: Fix build for Linux v6.10
In Linux v6.10, the 'class' argument was removed from the
i2c_mux_add_adapter() function. Add a test to conftest to detect the
correct number of arguments for i2c_mux_add_adapter() and update the
virtual-i2c-mux driver accordingly to fix the build for Linux v6.10.

Bug 4593750

Change-Id: I7333a511b487b7c2f2fa0ce7c34f2df5f061fbe4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142398
(cherry picked from commit 5e0562c90d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142376
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-06-29 12:18:28 -07:00
Praveen AC
bd232ba9c5 nv_hawk_owl:Fix 3rd Hawk streaming fail.
Enable video pipe line for Hawk3 i.e video pipe 4 & 5.

Bug 4564878

Change-Id: Ib39a5afc332722e5e8476f689a243f7dc71a6a2c
Signed-off-by: Praveen AC <pac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3099879
(cherry picked from commit e3f09d3989)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3100940
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2024-05-22 23:10:25 -07:00
Shubham Chandra
6de4acf3fd nvidia-oot: imx318: fix probe failure
V4l2 ctrl values are 0 during init time s_ctrl call
from v4l2. Since framerate val parameter is 0, when
set_framerate_ex is called from set_ctrl_ex during
initialization for probing of imx318 sensor, this
results in invalid error and probe failure for imx318.

Assign framerate 'val' to a value from imx318 sensor
device-tree properties within the given range to avoid
probe failure due to this.

Bug 3692128

Change-Id: Ib5f50e64f99c8443bf604066eda315dc96fbde03
Signed-off-by: Shubham Chandra <shubhamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3089350
(cherry picked from commit 17e0946ce0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3096300
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-05-21 16:33:00 -07:00
Praveen AC
ea4dfb33dc media: i2c: ar0234: Fix dual hawk corruption
- Fixes the frame corruption issue encountered
  when simultaneously streaming from two
  hawks via E3653 GMSL2 board
- Route each serializer output to a different
  deserializer output CSI port instead of
  routing video data from both serializers
  to the same deserializer output port
- Route data through two virtual channels for
  each of the two output ports instead of four
  virtual channels all through a single output
  port
- Fix serdes programming comments

Bug 4032165
Bug 3753423
JEC-286

Change-Id: I7b4e929e9f5330cc6eb0aa72646ce429a713df7a
Signed-off-by: Praveen AC <pac@nvidia.com>
(cherry picked from commit e31d73fa20)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3073819
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-05-21 16:31:20 -07:00
Ankur Pawar
0018354fcf media:i2c: fix imx477 partial frame output
Fix imx477 partial frame issue and wrong frame-length
/exposure time calculations.
Uses hardcoded sensor internal clock frequency
instead of clock values from sensor device tree.

Adding clock frequency to device tree also require
deskew_initial_enable = "true". Setting deskew in
device tree is causing kernel panic in function
nvcsi_deskew_setup(). For unblocking the IMX477
use case, set hardcoded clock in driver for now.

Bug 4384649

Change-Id: Iedb02673c6f4da140aee22adc991805b6aa1eb7e
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3086503
cherry-picked from <4d4e68569911d4424073a3b39f5b2642346a077a>
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3087470
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-03-06 04:26:38 -08:00
Ankur Pawar
41762524a3 media:i2c: fix ar1335 control command
When ar1335_common.c was ported to K5.15 it was refactored
based on the review comments. During that process index
in mcu_send_ctrl_cmd() was set to 0xFFFF which was causing
issue in setting sensor format. Pass the index from the
caller of mcu_send_ctrl_cmd().

Bug 4389285

Change-Id: Ic84a8de58051fe947f0f4d6597d1a55bc29ef9e6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3024535
cherry-picked fom <7096cb09a537bb6385489bc93148b80ff5e8fdd9>
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2848593
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-27 20:30:09 -08:00
Jon Hunter
9de3e799ae camera: Fix build when CONFIG_MEDIA_SUPPORT is not enabled
Some camera drivers are dependent upon CONFIG_MEDIA_SUPPORT being
enabled in the kernel and if it is not enabled, building these drivers
fail. Fix this by only building the camera drivers dependent upon
CONFIG_MEDIA_SUPPORT when this option is actually enabled.

Bug 4449072

Change-Id: I3637b5763667fbc9965bbeaf126115010e711c7e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3050559
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-12 14:46:15 -08:00
Jon Hunter
8b3ebff940 media: i2c: Fix build for GCC 6/7
Building nv_ar0234 and nv_hawk_owl sensor drivers with GCC 6/7 fails
with the following errors ...

 drivers/media/i2c/nv_ar0234.c:797:66: error: initialiser element is not
 constant
 .compound_ctrl_size = {sizeof(struct NvCamSyncSensorCalibData),
                        alternating_exposure_cfg_size},
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 drivers/media/i2c/nv_hawk_owl.c:883:59: error: initialiser element is
 not constant
 .compound_ctrl_size = {sizeof(NvCamSyncSensorCalibData),
                        alternating_exposure_cfg_size},
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These older versions of GCC are not able to reconcile the size from the
variable 'alternating_exposure_cfg_size' even though it is defined as
const. Given that the variable 'alternating_exposure_cfg_size' is only
used here, fix this by removing this variable and directly defining the
size in the declaration of the 'compound_ctrl_size' parameter.

Note that the minimum GCC compiler currently supported by the Linux
kernel is v5.1.

Bug 4448563

Change-Id: I4d3ac6eeb961a944901e73a1d92e753cae44220c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3050272
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-11 17:22:22 -08:00
Jian-Min Liu
a067801e61 nvidia-oot: Clean-up check ACK by NV_BUILD_KERNEL_OPTIONS
Control ACK feature only by CONFIG_TEGRA_SYSTEM_TYPE_ACK from
kernel-build. This can make build nv-oot clearer.

Bug 4405208

Change-Id: Ia3f036f9a59b829d762ced15b01f4342720f291d
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3027994
Reviewed-by: Ankita Garg <ankitag@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-08 06:47:23 -08:00
Laxman Dewangan
90e2ac6ac7 media: nv_hawk_owl: Use conftest instead of linux version
use conftest to determine if function i2c_new_device() present
or not instead of the Linux version.
This function is removed with commit 390fd0475af5
("i2c: remove deprecated i2c_new_device API")

Bug 4387902

Change-Id: Ie69a06b486745416ec104fea8359403e589a5cc7
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037916
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-19 19:38:57 -08:00
Laxman Dewangan
e49269929e media: ar1335: Use conftest to determine remove return type
Use conftest to determine the return type of .remove() of
struct i2c_driver is int or void type instead of kernel version.

The return type got changed with commit ed5c2f5fd10d ("i2c:
Make remove callback return void")

Bug 4387902

Change-Id: Iceb50b0c9cd78fefb35aef0831b1ea7e8f74d619
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037915
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-19 19:38:51 -08:00
Laxman Dewangan
1eab65044c i2c: Use conftest to find return type of .remove of i2c_driver struct
Use conftest to determine the return type of .remove() of
struct i2c_driver is int or void type instead of kernel version.

The return type got changed with commmit ed5c2f5fd10d ("i2c:
Make remove callback return void")

Bug 4387902

Change-Id: Id64466613156e0efaf6cce7492d70cab1c1d1af7
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3036799
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-18 22:09:58 -08:00
Jon Hunter
d5391a25ab drivers: Enable -Wmissing-prototypes
The compiler option -Wmissing-prototypes is being enabled globally in
the upstream Linux kernel and this causes build failures for various
drivers. The build failures occur because either the driver is missing
an include file which has the prototype or because the function is not
declared statically when it should be (ie. there are no external users).

Fix the various build failures and enable -Wmissing-prototypes to
prevent any new instances from occurring. Note that the only driver that
is not fixed at the moment is rtl8822ce due to large number of failures
and so build this with '-Wno-missing-prototypes' for now, which is not
different to how it was being compiled prior to this change.

Bug 4404965

Change-Id: Ie5572d23659e0346fa035d645d9043b0a6da5fdc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3027488
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-14 02:07:24 -08:00
Laxman Dewangan
2884c4b380 i2c: Use conftest to find if i2c driver probe has i2c_device_i2d arg
Determine if probe of struct i2c_driver has i2c_device_id argument
or not.

This argument get removed from commit 03c835f498b5 ("i2c: Switch
.probe() to not take an id parameter") form Linux 6.3.

Bug 4346767

Change-Id: Ife73b29946246fce5bfcedcabe15992432d86348
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3030809
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-08 18:37:09 -08:00
Anubhav Rai
c3ddb23392 camera: lt6911uxc update with Shadow EDID
Update the Lontium driver to flash shadow EDID
to lt6911uxc chip. This will ensure that the requested
resolution through the application is flashed to the
chip and the source is forced to select the
requested resolution only.

bug 4266018
bug 4301203
bug 4168489
Signed-off-by: Anubhav Rai <arai@nvidia.com>

Change-Id: I945a9658b52c82956535f3710312d317c0098be7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3007702
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Anubhav Rai <arai@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-08 03:27:10 -08:00
Shashank Kumar
c56189df5d drivers: media: add alternating exposure support
- update ar0234 driver to support ar0234 sensor
  hardware provided support for capturing frames
  using alternating exposure time and analog gain
  settings through automatic context switching
- added new v4l2 control having control id
  TEGRA_CAMERA_CID_ALTERNATING_EXPOSURE for
  configuring alternating exposure settings
- other changes to support aforementioned changes

Bug 4064517
Jira L4T-4501

Change-Id: Id1d3d745345836436b16da1fd00cc97f2e3b5553
Signed-off-by: Shashank Kumar <shaskumar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2881141
(cherry picked from commit e973475525c9a7a99552282316e06126b8fff625)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2987067
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Anubhav Rai <arai@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-04 09:59:43 -07:00
Kartik Rajput
e0558096ef oot: drivers: Replace gpio_cansleep() with gpiod_cansleep()
Upstream commit "7d0b80647f73"

[gpiolib: remove unused gpio_cansleep()]

Removed gpio_cansleep() API as there are no upstream users.

Replace the usage of gpio_cansleep() with gpiod_cansleep(). This is also
backwards compatible with older Kernels.

Bug 4276500

Change-Id: I37230d4371298d724e2311c803409108e93a4fed
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2978834
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-14 20:45:05 -07:00
Jon Hunter
79e8e9cf3a media: Allow drivers to be built without V4L2
When building the NVIDIA out-of-tree drivers against 3rd party Linux
kernels where V4L2 support is not be enabled by default, the camera
drivers fail to build. Although this is expected, it is preferred that
the driver can still be built but then fail when loaded. Update the
camera drivers to guard around the V4L2 functions so that the drivers
can still be built but will return an error where needed.

Bug 4119327

Change-Id: I3a1115e5f0451153831c396244c01d7525cb51a1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979254
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-14 13:32:09 -07:00
Ankur Pawar
f4b8e44a5e media: i2c: camera cert-c and coverity fixes
Cert-C fixes in camera ar1335, imx219 and imx477 driver.

Cert-C
CID:566165
CID:566166
CID:566168
CID:566169
CID:566170
CID:566171
CID:683423
CID:566021

Coverity
CID:10179834

Bug 3959323

Change-Id: Id68deab8051206b6eae3da917d83c32365186fc5
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2939548
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-13 22:21:06 -07:00
Ankur Pawar
8c434bce54 media: i2c: fix imx185 sensor driver
Don't set the err value when setting parent clock.
Only print the error.

Bug 4191790

Change-Id: Ibab5c8bac08ea1451474ebd43cf9ff0f8200d8f1
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2965648
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-04 08:13:04 -07:00
Praveen AC
f62619388d t23x:Add virtual i2c mux support & enable IMU.
This change consists of following changes:
1> Add Virtual i2c-mux driver support for P3762.
2> Ser/Dser reg programming to map 1st Hawk's respective MFP's.
   Accel (MFP0) Ser --> Deser (MFP5)
   Gyro (MFP3) Ser --> Deser (MFP7)
3> Disable IMU's for 2nd,3rd & 4th Hawk.
4> Code cleanup.

Bug 4146784

Change-Id: I3f69bd57b1368451d8e2db06366a57b06b5ff0f4
Signed-off-by: Praveen AC <pac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971156
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-01 12:52:13 -07:00
Praveen AC
8ad7be0833 nv_hawk_owl:Enable external/internal Fsync.
Following support is added:
1.Add external Fsync support for HAWK & OWL.
2.Made Internal Fsync as default mode.
3.External Fsync is set only when TSC driver is called.
4.Swap i2c address translation for Hawks.
5.Add sync mechanism to protect i2c read/write.
6.Move sensor mode table during probe.
7.Code cleanup.

Bug 4125757
Bug 4143918
Bug 4151001
Bug 4161719

Change-Id: I15f1a41a838c883b11c14ed689adeb6d11aa2630
Signed-off-by: Praveen AC <pac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971153
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-01 12:52:07 -07:00
Praveen AC
35335a44b6 nv_hakw_owl: Add 4xHawk and 4xOwl support.
Following changes are made to add support 4xHawk & 4xOwl
on P3762 / P3783 GMSL board.
1) Driver changes to add i2c address translation.
2) Fix simultaneous streaming of Owl & Hawk.
3) Update ar0234 EEPROM Calibration.
4) Add support for 4xHawks.
5) Add internal Fsync support.
6) Add multiple link combinations for Hawk & Owl.
7) Enable EEPROM support for 4xHawk.

Bug 3620984
Bug 3562348
Bug 3866131
Bug 3817827
Bug 3932004
Bug 4071347
Bug 4095571
Bug 4096788

Change-Id: Ic6289f60258d446f259277fdd1d6d52e687dc74e
Signed-off-by: Praveen AC <pac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971143
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-01 12:51:51 -07:00
Anubhav Rai
b2b703f13d camera: fix rgba format for lt6911uxc
Fix RGB format streamed by the Lontium HDMI
CSI chip.
Fix Lontium HDMI driver for print. Probe is
info and not error flagged in kwarn scripts

bug 4168439

Change-Id: I7323fa5d6fd0b2c0cdefd9ea7248335b76726b94
Signed-off-by: Anubhav Rai <arai@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2927531
(cherry picked from commit d12b72d44508ff8c36d26dcbb50aa6a05e6a7bdf)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2966743
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-31 05:40:20 -07:00
Ankur Pawar
834dbf0781 i2c: camera: add updated ar1335 firmware
This new firmware provided by E-CON, starts ar1335 sensor
streaming at 100fps for mode0.

Bug 4111978

Change-Id: I2ba6aa3a2aec23c24319995224880e2fc24ca8ac
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2941192
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Addarsh Srivastava <addarshs@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-22 02:13:17 -07:00
Ankur Pawar
804feada07 media: add imx477 sensor driver
Add imx477 camera sensor driver code,
mode tables and makefile changes.

Bug 3583587

Change-Id: Ib218e7d67f60f381a0e75edad71e9e5b35288dd3
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2864577
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-08-20 07:04:10 -07:00
Ankur Pawar
ff01ad1318 media: add imx219 sensor driver
Add imx219 camera sensor driver code,
mode tables and makefile changes.

Bug 3583587

Change-Id: Ic7693de3cbdeeaecd7d9118a1e7819eaab5fdb3a
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2862964
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-08-19 12:38:50 -07:00
Ankur Pawar
630aa8bba7 media: add pca9570.c driver
Enable pca9570 for IO Expander.
This is used by IMX185.

Bug 4191790

Change-Id: Ia0051718803cc1c898969739a0cb975c7432b647
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2889570
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-18 10:44:06 -07:00
Ankur Pawar
0d04975aed media: i2c: Fix camera driver Coverity defects
Fix the below Coverity defects for lt6911uxc driver

Unchecked return value
CID: 10174208

Dereference null return value
CID: 10174210

Unchecked return value
CID: 10175851

Bug 3952896

Change-Id: I43132879e31f8a27db8fd41c717d598fb2c33490
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2915435
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-21 01:24:49 -07:00
Ankur Pawar
8a40c778bf media: add ar1335 sensor driver
Add ar1335 camera sensor driver code,
firmware bin and makefile changes.

Bug 3583587
Bug 4111978

Change-Id: I340eb797233fb62ca9e107d0f774f1110e4c27fe
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2889070
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-24 07:23:21 -07:00
Jon Hunter
af59e64885 media: lt6911uxc: Fix build for Linux v6.3
Upstream Linux commit 03c835f498b5 ("i2c: Switch .probe() to not
take an id parameter") removes the 'id' argument from the I2C probe
callback. Update the ov5693 driver, which defines an I2C probe callback
function, to fix building the driver for Linux v6.3.

Bug 4014315

Change-Id: I8c8954b7c1e1e322fb3f560f6348caac54e5e43d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2919423
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-14 22:56:36 -07:00
brucex
7069cb6650 nvidia-oot: disable nv_imx*
Disable nv_imx* modules on android as CONFIG_VIDEO_CAMERA is not enabled
in android config. Building these with clang result in build errors.

Bug 3974840

Signed-off-by: Bruce Xu <brucex@nvidia.com>
Change-Id: I420b1332143917a1ce169cbfba2a6fde1bcc40b6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2865365
Tested-by: Ankita Garg <ankitag@nvidia.com>
Reviewed-by: Ankita Garg <ankitag@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-14 22:55:29 -07:00
Ankur Pawar
f93dd37a22 media: add lt6911uxc sensor driver
Add lt6911uxc HDMI->CSI sensor driver code,
This driver is copied K5.10 camera driver repo.

Bug 3583587
Bug 4111965

Change-Id: Ib01ac4c4d7d44073858009a8b41c42fa7083c020
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2793944
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-30 07:33:01 -07:00
Ankur Pawar
3be100e555 media: i2c: Fix camera driver Coverity defects
Fix the below Coverity defects for IMX390 and
AR0234 sensor driver

Memory corruptions
CID: 10171410

Unchecked return value
CID: 10171825

Bug 3952896

Change-Id: Iff8a557ea3240a7aafd3e8e66fd6716dd28ac201
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2888806
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-20 06:47:49 -07:00
Jon Hunter
3cadadc11c media: Fix build for Linux v6.3
Upstream Linux commit 03c835f498b5 ("i2c: Switch .probe() to not take an
id parameter") removes the 'id' argument from the I2C probe callback.
Update the various sensor drivers, which define an I2C probe callback
function, to fix building the drivers for Linux v6.3.

Bug 4014315
Bug 4075345

Change-Id: I2dc06188d1d19e086f108013c63439d9381d6c58
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2889877
Reviewed-by: Rohit Khanna <rokhanna@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-19 10:58:01 -07:00
Ankur Pawar
2ceba857fd media: add imx390 sensor driver
Add imx390 camera sensor driver code,
mode tables and makefile changes.

Bug 3583587
Bug 4058151

Change-Id: I2b67d355d2684ccb6ab12881ac0d0d5b30447cc4
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2879227
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 20:00:58 -07:00
Ankur Pawar
c9858e1282 media: add ar0234 sensor driver
Add ar0234 camera sensor driver code,
max96712 GMSL serializer code, mode tables
and makefile changes. These drivers are copied
from K5.10 camera driver repo. Changes include
svcacv warning fix and eeprom read status is
ignored due to bug 4064490.

Bug 3583587
Bug 4064490

Change-Id: I7ea0ecf959caccafd283c8db5fb7c3be912cf8bb
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2868422
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-14 15:45:38 -07:00
Ankur Pawar
c10d814337 media: i2c: Fix camera driver Coverity defects
Fix the below Coverity defects for IMX318 sensor driver

Copy paste error
CID: 10171759

Null return check
CID: 10171758

Unchecked return value
CID: 10171760

Bug 3952896

Change-Id: I9da2c14911dc119853fa5c96c9c4dcc9f1827c7e
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2885966
Reviewed-by: Chinmay Mahajan <cmahajan@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-14 08:18:38 -07:00
Ankur Pawar
c5fa6476ee media: i2c: Fix camera driver Coverity defects
Fix the below Coverity defects for OV5693

Dereference null return
CID: 10171403

Unchecked return value
CID: 10171401

Bug 3952896

Change-Id: I657cb0ae9a2baf6c6cac7faa84debb754582534d
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2885152
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Michael Stevens (SW-TEGRA) <michaelst@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-13 12:24:36 -07:00
Ankur Pawar
2a2ce69017 media: add imx318 sensor driver
Add imx318 camera sensor driver code,
mode tables and makefile changes.

Bug 3583587

Change-Id: I9854909823b67856edc50c2364e519e853134178
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2870729
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-06 00:42:04 -07:00
Jon Hunter
b66cb3fc6e media: ov5693: Fix build for Linux v6.3
Upstream Linux commit 03c835f498b5 ("i2c: Switch .probe() to not take an
id parameter") removes the 'id' argument from the I2C probe callback.
Update the ov5693 driver, which defines an I2C probe callback function,
to fix building the driver for Linux v6.3.

Bug 4014315

Change-Id: Ic037da06b1999801fb62e6ccd39b92fe86b5402a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2875027
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-25 02:49:57 -07:00