Commit Graph

3051 Commits

Author SHA1 Message Date
Ankur Pawar
29e88ed17e camera: fix the kernel freeze after driver unbind
Kernel freeze is occurring due to incorrect cleanup
in vi5.c.

Fix for kernel freeze:
1 Don't call vi_channel_drv_unregister() and
  tegra_vi_media_controller_cleanup() in vi5_remove.
2 capture_vi_probe() is calling vi_channel_drv_register() and
  tegra_capture_vi_media_controller_init(), so capture_vi_remove()
  should call vi_channel_drv_unregister() and
  tegra_vi_media_controller_cleanup()
3 Use correct dev pointer in vi_channel_drv_unregister().

Code cleanup:
1 Remove use_legacy_path variable that was used for T186.
2 Removed unused t194_vi5_file_private struct.

Bug 4415340

Change-Id: I6153f65d62a9f7f4fc5d04c2ace948a29396e404
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3077660
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Ankur Pawar <ankurp@nvidia.com>
2024-02-21 23:10:25 -08:00
Jon Hunter
61319aef4d drm/tegra: Don't print error on probe defer
The following error messages are sometimes observed on boot ...

 tegra-nvjpg 15380000.nvjpg: failed to get icc write handle
 tegra-nvdec 15480000.nvdec: failed to get icc write handle
 tegra-nvjpg 15540000.nvjpg: failed to get icc write handle
 tegra-nvenc 154c0000.nvenc: failed to get icc write handle
 tegra-vic 15340000.vic: failed to get icc write handle
 tegra-nvjpg 15380000.nvjpg: failed to get icc write handle

The above messages are harmless because the ICC core is returning
-EPROBE_DEFER to indicate that the ICC provider is not available. When
-EPROBE_DEFER is returned the kernel will attempt to probe the device
again and so print an error on -EPROBE_DEFER can be misleading. Fix the
above by using the function dev_err_probe() to print error messages
because this function will only print an error message if the error code
is not -EPROBE_DEFER.

Bug 3436156
Bug 4496044

Change-Id: I47b77e5a0f2bdb817a832daa305246c8803f456b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3075237
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-13 02:24:56 -08:00
Praveen AC
518ae94bb4 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
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-09 01:09:27 -08:00
Praveen AC
6642085af9 i2c:nv_hawk_owl: Reduced sensor stream on time.
Following changes are done to reduce 400ms to 200ms:
1> I2c address trans during every power_on is moved to probe time.
   Since with virtual-i2c mux IMUs are handled and hence we don't need to
   do i2c address trans every time. So once during probe time is enough,
   that reduces ~120ms.
2> Reduced sleeping time during start stream call to 20ms, Which reduced
   ~100ms.

Bug 4180672

Change-Id: I027148f64b892d95e5432394f90bf171156ef9c0
Signed-off-by: Praveen AC <pac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3072821
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-09 01:09:17 -08:00
Praveen AC
e31d73fa20 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>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3072829
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-08 22:54:15 -08:00
Praveen AC
d7f14a85db t23x:P3762: Fix failed to read 2nd Hawk EEPROM serial number.
Changed EEPROM address to 0x15 for 2nd Hawks EEPROM
to avoid fail to read serial number.

Bug 4244937

Change-Id: Ia920ec6464b5bc374289728395da2bceb3f44d39
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3066257
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Praveen AC <pac@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
rel-36_eng_2024-02-05
2024-02-01 22:39:36 -08:00
Jon Hunter
05b82fc2fe nvhost: Remove legacy NVHOST support
Remove the legacy NVHOST support from the nvhost.h file that is no
longer needed. Eventually we will remove this file completely, but it is
currently still needed as it provides a shim layer for working with the
upstream host1x driver.

Bug 4475969

Change-Id: Id4d97b41de2590800e321e4eeb9c03b434e00dc5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3065976
(cherry picked from commit 5d2c7b6e3a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3066026
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-01 10:44:27 -08:00
Jon Hunter
b2e0445c73 video: tegra: Remove nvhost and host1x headers
The nvhost.h header in the ISP and VI drivers is a copy of the nvhost.h
header in the main top-level include directory. Remove these and use the
version in the top-level include directory.

Finally, remove the host1x.h header file that is not used at all.

Bug 4475969

Change-Id: I78133231203ee7eb2dc41eee7b8895ba9ce50e02
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3065975
(cherry picked from commit 4c229ee929)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3066025
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-01 10:44:22 -08:00
Jon Hunter
34ef06bd12 video: tegra: Don't use nvhost_get_private_data
The function nvhost_get_private_data() is a wrapper around the Linux
platform_get_drvdata() function. To remove all the legacy nvhost code
that is no longer supported or needed, update the camera drivers to use
platform_get_drvdata() directly. Note that there are places in these
drivers that already use platform_get_drvdata() and so this change makes
these drivers more consistent.

Bug 4475969

Change-Id: Ie474c46c438f69c2141f41d0702bf57525597ab5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3065974
(cherry picked from commit 73a4985dbd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3066024
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-01 10:44:16 -08:00
Jon Hunter
7f293be0be media: camera: Remove of_pwm_n_cells usage
The 'of_pwm_n_cells' has been removed from the pwm_chip structure in the
latest linux-next development branch that will eventually become Linux
v6.9. This parameter was used in function 'of_pwm_xlate_with_flags'.
The camera CDI and ISC drivers don't use the kernel's
of_pwm_xlate_with_flags xlate function and instead implement their own
xlate function. Therefore, it is safe to simply drop the usage of the
'of_pwm_n_cells' parameter completely in these drivers.

Bug 4471899

Change-Id: Id4cf4b7ac182d0654080e536457bab1a7128ad1d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3063806
(cherry picked from commit 072a881099)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3067933
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-01 08:24:16 -08:00
Johnny Liu
246e62b38e video: tegra: remove icc request in system resume
When dla resumes back from system sleep, it should not send any
bandwidth request through ICC framework since it is in idle state.

In the job submit path for dla, nvhost will try to wakeup the device
through nvhost_module_busy, and the associated runtime resume callback
is called in the dla driver. This is the time dla driver should send
bandwidth request to BPMP for bandwidth allocation through ICC
framework.

Bug 4478515

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Ie4b5cfad6593bd058860ee3be467d6a2384f1b5d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3067369
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-31 22:24:15 -08:00
Jon Hunter
233a7eb320 drivers: Fix missing headers for Linux v6.8
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.

Bug 4448428

Change-Id: Ia40ab13f865d5631c96855ecc49145848f99c996
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032442
(cherry picked from commit ab65399274)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3063003
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-25 13:55:11 -08:00
Jon Hunter
753583f1e3 misc: mods: Fix headers for Linux v6.8
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.

Bug 4448428

Change-Id: Ifb484189524a3ec86aa252e71b4489f4dba5aacd
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059458
(cherry picked from commit 0899829704)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3063002
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-25 13:55:06 -08:00
Jon Hunter
1ccb6edda2 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
(cherry picked from commit ecf383265b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3063000
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-25 13:55:01 -08:00
Anubhav Rai
1b6db0ce3c 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
(cherry picked from commit c3ddb23392)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3015613
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
rel-36_eng_2024-01-24
2024-01-23 19:09:34 -08:00
Jon Hunter
26e357d588 misc: mods: Drop DMAENGINE slave_id support
Only Tegra234+ devices are currently supported and for these devices the
only DMA drivers that are supported for Linux are the Tegra210 ADMA and
Tegra186 GPCDMA drivers. Neither of these drivers ever supported the
'slave_id' parameter for configuring the DMA request ID for a given
channel. These drivers have always used device-tree to retrieve this
information. Only the Tegra20 APBDMA controller supported the 'slave_id'
field and this was dropped in Linux v5.17. The Tegra20 APBDMA driver was
supported in Tegra devices up until Tegra210, but starting with Tegra186
it is no longer supported.

Given that this is a legacy feature only supported for legacy Tegra
devices and drivers, drop the 'slave_id' support completely.

Bug 4425688

Change-Id: Id9bb6440805826dfb0cf0d862d6b15fd856e61ff
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3038964
(cherry picked from commit c87f90c7b8)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3058562
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-22 05:11:28 -08:00
Jon Hunter
7635873f3d misc: mods: Fix build when OPTEE is a module
If the Linux kernel driver OPTEE is built as a module (CONFIG_OPTEE=m)
then building the MODS driver for Tegra fails with the following error
...

 drivers/misc/mods/mods_optee.c:22:5:
 error: no previous prototype for 'esc_mods_invoke_optee_ta'
 [-Werror=missing-prototypes]
   22 | int esc_mods_invoke_optee_ta(struct mods_client *client,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~

The problem is in the mods_internal.h file that wraps the prototype for
the above function with '#ifdef CONFIG_OPTEE'. This works fine for when
CONFIG_OPTEE=y but not if CONFIG_OPTEE=m. To ensure that this prototype
is present when the OPTEE driver is built into the kernel or a module,
we need to use '#if IS_ENABLED(CONFIG_OPTEE)'. Update the MODS driver
accordingly to fix this.

Bug 4429280

Change-Id: I48054f60cf26c04d2cacff8d8affc46254020aff
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3038965
(cherry picked from commit 0bd71e49bd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055962
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-22 05:11:23 -08:00
Laxman Dewangan
176a1bff8d tegra_hv: Use conftest to find if class_attribute function has const type arg
Determine if struct class_attribute function has const type
"struct class_attribute" argument or not.

Modified the argument by change
commit 75a2d4226b5371 ("driver core: class: mark the struct class
for sysfs callbacks as constant") for Linux 6.3

Bug 4346767

Change-Id: I2a36025b23af80761faf1da406481731289eedd2
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3030734
(cherry picked from commit de4295cfa6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059278
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-22 05:10:56 -08:00
Manish Bhardwaj
e997e8ae5a hv: port tegra hypervisor driver on noble kernel
Bug 4377196

Change-Id: Idecaac1915c444fe04c40f0e848e36bd3f90b78f
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3018492
(cherry picked from commit 912dda68d1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059277
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-22 05:10:51 -08:00
Laxman Dewangan
d1c969184b tegra_hv: Use const in class attributes APIs for Linux 6.4 and above
The callback APIs of class attribute are updated on
Linux6.4 and above to have the constant type pointer
argument.

Update the driver compatible with the updated APIs
for Linux 6.4 and above.

Bug 4370594

Change-Id: Ic06cb0d752797bb272f110aa0bb35bdd3afa1e6a
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3013107
(cherry picked from commit c8a83b5692)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059176
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-22 05:10:46 -08:00
Laxman Dewangan
e02b9efcc4 tegra_hv: Enable driver for Linux 6.2 and above
The driver tegra_hv was disabled for the Linux 6.2 and above
due to build failure. All build issue is fixed and re-enabling
driver for all kernel.

Bug 4370594

Change-Id: I9edef01a4f204b138204d583d9f7f61dc6112a25
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3014191
(cherry picked from commit af936f3b1e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059175
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-22 05:10:41 -08:00
Laxman Dewangan
2ac404f410 nvidia-oot: Remove unused CONFIG_TEGRA_IVC_LEGACY_DISABLE
The export of config CONFIG_TEGRA_IVC_LEGACY_DISABLE is
no more required as all drivers which was disabled from
build due to IVC API changes are ported to handle the
new APIs from core kernel.

Remove unused config CONFIG_TEGRA_IVC_LEGACY_DISABLE.

Bug 4346767

Change-Id: I7830f962735b293f9c78cd03acfa1413f9eb4cff
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3033025
(cherry picked from commit 2179242ba9)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059174
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-22 05:10:36 -08:00
Laxman Dewangan
e7868529f3 misc: Enable build of mods module
Build of mods module disabled due to not supporting legacy IVC
from Linux 6.2.
Enable build of mods.

Bug 4346767

Change-Id: I4eccc831dba2820467f5d455bb5cba387f879b23
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3033023
(cherry picked from commit 00f3315faf)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3038669
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-22 05:10:31 -08:00
Jon Hunter
3f5ba8f70b tty: wch: Fix build for Linux v6.8
In Linux v6.8, the argument for the struct tty_operations::send_xchar
function was updated from char to u8 and this breaks the build for the
'wch' driver. Add a test to the conftest script to detect the argument
type for this function and use the definition generated to fix the build
for the 'wch' driver.

Bug 4448428

Change-Id: I051861cf76e56cacb4b33053d4e6644265552df7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3057714
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-19 06:39:15 -08:00
Jon Hunter
f1f3771dec conftest: Fix 'type' compile tests
The Conftest Makefile was incorrectly updated changing variable
NV_CONFTEST_TYPE_COMPILE_TESTS to NV_CONFTEST_TYPES_COMPILE_TESTS. Fix
this by correcting the name.

Bug 4346767

Change-Id: Ia34c076526a1ee6870301382e01bfdcc8cd550d3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053809
(cherry picked from commit 93360eb080)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055874
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-17 20:39:37 -08:00
Laxman Dewangan
e30e21ebd1 v4l2: Add conftest for v4l2 API changes in Linux 6.6
Add conftest to determine the API changes/deprecation
for V4L2 in Linux6.6. The changes are:
  The device argument is added in the API v4l2_async_nf_init() with
  commit b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev
  in async notifier init") in Linux 6.6.

  The API is removed with commit bda8953e8c3e ("media: v4l: async: Drop
  v4l2_async_nf_parse_fwnode_endpoints()") in Linux 6.6

Bug 4346767

Change-Id: Ia225be8b4fb17003ec2899e872573dc05e9fde87
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3042900
(cherry picked from commit 8df8cfc8e6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055495
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-17 15:24:14 -08:00
Jon Hunter
ac6a53078b ufs: Remove UFSHCD_QUIRK_ENABLE_STREAM_ID
Remove the legacy downstream quirk 'UFSHCD_QUIRK_ENABLE_STREAM_ID' and
always use the supported upstream quirk from now on. The legacy quirk
will never be upstreamed and so to support 3rd Party Linux distributions
that will not have this quirk, we should only support the official
upstream quirk.

Bug 4346767
Bug 4450187

Change-Id: Iabec6beb63b99ada7e8893cfa2acc0ed5e7ee92f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3045039
(cherry picked from commit ce916e3f13)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055492
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2024-01-17 09:10:08 -08:00
Laxman Dewangan
56c05f8e3f ufs: Use UFS headers directly if it is public header in core kernel
The UFS headers are moved to include as public headers from
Linux 5.19. Use the headers directly from the core kernel
instead of making the copy in drivers-private for nvidia-oot.

Keep copy of only those drivers which are still in the
drivers folder in core kernel.

This will help to align all definition which driver needs to
sync with core driver available in the core kernel.

Bug 4346767

Change-Id: I1e59e32bee0f89591e50fff2f61e35d468f4207c
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3039312
(cherry picked from commit b2dcbdbc93)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055490
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
2024-01-17 09:10:02 -08:00
Laxman Dewangan
822abd1943 ufs: Port UFS driver to use headers from core kernel for Linux 6.7
Some of the drivers-private headers are now available in public
header path in core kernel. Use such headers directly from the
core kernel for Linux 6.7 and later instead of copying it in the
nvidia-oot/include/driver-private.

Also match the quirks definition with core kernel for Linux 6.0 and
later.

Bug 4346767

Change-Id: If994466a3cabc6df8eeb0e97018f48d48a8306dc
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3038489
(cherry picked from commit dfff2311c3)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055485
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-17 09:09:57 -08:00
Laxman Dewangan
71876127a2 UFS: Port driver-private headers for the Linux 6.7
The headers of UFS got changed for Linux 6.7 over Linux 6.1.
Make the copy the of the headers and modify according to
Linux 6.7 core kernel headers.

Note: These headers will be removed and use directly from
core kernel in follow on cleanups.

Bug 4346767

Change-Id: I12cb4eac187bb3414efcc5bfb6246a322e917094
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037996
(cherry picked from commit b282d21004)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055487
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
2024-01-17 09:09:46 -08:00
Jon Hunter
abeacc3534 scsi: ufs: Use conftest for Tegra264
The chip ID for Tegra264 was added in Linux v6.5 and not Linux v6.1 as
indicated in the Tegra UFS driver. Hence, the Tegra UFS driver does not
build against any generic Linux v6.1 to v6.4 kernel. Fix this by using
conftest to determine if the chip ID definition is present in the
kernel.

Bug 4221847

Change-Id: If2ca1202b2a69bf7de36fc327406f1579d2f4969
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3054870
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-17 06:54:45 -08:00
Jon Hunter
902712a236 scsi: ufs: Use conftest for suspend differences
In Linux v5.19, the arguments to the 'suspend' function pointer defined
in the structure 'ufs_hba_variant_ops' was updated to add a 'status'
argument. Add a new test to the conftest script that checks if the
'suspend' function has a 'status' argument and use the definition
created by conftest to select which structure member is used.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4221847

Change-Id: I05011a4a1aff7c54cd258147d6519b696904a2de
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996214
(cherry picked from commit f748f0ef72)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032086
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-17 06:54:34 -08:00
Jon Hunter
ff6f3c6916 scsi: ufs: Clean-up headers
Clean-up the UFS headers by adding a new top-level header for ufshcd.h,
ufshci.h and unipro.h that will include the appropriate header
depending on kernel version. This saves replicating the kernel version
check for every source file that includes these headers.

Note that the ufshcd-pltfrm.h header is identical between v5.15, v5.16
and 6.1 kernels and so remove the duplicated versions of this header and
just use a common header for all kernel versions.

Bug 4221847

Change-Id: I0e0ba2f4389af7e34ab62e3131141405d87aeeb1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996211
(cherry picked from commit 54e01347ea)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031885
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-17 06:54:24 -08:00
Jon Hunter
11e0abc8a3 media: camera: Fix build for Linux v6.8
In Linux v6.8, the 'g_frame_interval' function pointer was removed from
the 'v4l2_subdev_video_ops' structure and replaced by
'get_frame_interval' that was added to the 'v4l2_subdev_pad_ops'
structure. Add a test to conftest to detect if 'get_frame_interval' is
supported and update the camera CSI driver accordingly to populate the
appropriate function pointer.

Note that the new 'get_frame_interval' function pointer has an
additional 'state' argument but is otherwise the same as the previous
'g_frame_interval' function pointer.

Bug 4448428

Change-Id: Iff049c3bffda11c677ac879b2b91e10deb78060c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053901
(cherry picked from commit a1f59dfc30)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055255
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-17 04:40:24 -08:00
Jon Hunter
5d31085674 net: nvethernet: Fix build for Linux v6.8
The ethtool_ops function pointers get_rxfh and set_rxfh were updated for
Linux v6.8 to pass arguments via a new 'ethtool_rxfh_param' structure.
Add a new test for conftest to detect if the get_rxfh and set_rxfh
functions support the 'ethtool_rxfh_param' structure and update the
nvethernet driver accordingly for Linux v6.8.

Bug 4448428

Change-Id: Ia1c49d88c4ac73539454b010af92c261e14be4bf
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037949
(cherry picked from commit 0356a563b3)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055254
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-17 04:40:20 -08:00
Jon Hunter
a86b3af506 drivers: pwm: Fix build for Linux v6.8
Commit 54c86dd20bba ("pwm: Replace PWM chip unique base by unique ID")
removed the 'base' field of the 'pwm_chip' structure replacing it with
an 'id' field. The new 'id' is initialised by the PWM driver core and
does not need to be configured by the PWM drivers.

Add a test for conftest to detect if the 'pwm_chip' structure has the
'base' field and update the various PWM driver to only set this field if
present.

Bug 4448428

Change-Id: I7cf466eddba4aedb57db84534e3cbf99be64151e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3027486
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
(cherry picked from commit 10fd025187)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055253
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-17 04:40:15 -08:00
Jon Hunter
32f23c8ab2 gpu/drm: tegra: Fix build for Linux v6.8
Building the Tegra DRM driver with Linux v6.8 fails with the following
error ...

 drivers/gpu/drm/tegra/hdmi.c:623:25: error: implicit declaration of
 function ‘drm_eld_size’; did you mean ‘mm_cid_size’?
 [-Werror=implicit-function-declaration]
  623 |    size_t length = drm_eld_size(hdmi->output.connector.eld), i;
      |                    ^~~~~~~~~~~~

Commit ("8eb80946ab0c drm/edid: split out drm_eld.h from drm_edid.h")
added the header file 'drm/drm_eld.h' which now needs to be included to
build the Tegra DRM driver. Fix the build issue by using conftest to
detect the presence of the header 'drm/drm_eld.h' and include this
header if present.

Bug 4448428

Change-Id: Ifb17648d1dc721e1f0de3f864f4cc76450eea394
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3027485
(cherry picked from commit 8d5286c379)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055252
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-17 04:40:10 -08:00
Laxman Dewangan
259736545b crypto: Enable few of crypto driver for Linux6.6
Enable crypto drivers which are getting build properly
with Linux 6.6 and keep disabling the compilation of
build failed drivers.

Bug 4346767

Change-Id: Ia5c67759b6c839a874ea9e38d601c722596e0008
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3010492
(cherry picked from commit 9b0b059027)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053821
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-16 14:56:09 -08:00
Bitan Biswas
34fd7d68dc crypto: fix crypto_engine_ctx build error
struct crypto_engine_ctx removed in k6.6 hence use
conftest helper based macro to select updated data types

Bug 4346767

Change-Id: I2c00f99251e90f0dd3641703ba24a2a8ac23e927
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994021
(cherry picked from commit 48e59e9d42)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053820
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-16 14:56:04 -08:00
Bitan Biswas
4a32aa94e5 crypto: conftest struct crypto_engine_ctx support
struct crypto_engine_ctx removed in k6.6 hence use
conftest helper based macro to select updated data types

Bug 4346767

Change-Id: I23e8f054719f399877b11f42d355f940d8e07186
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3026513
(cherry picked from commit 2a9ce8d0e2)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053713
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-16 14:55:59 -08:00
Bitan Biswas
e4d4103ebe nvidia-oot: enable noble crypto
Enable crypto build with noble

Change-Id: Ib4ab440fdd75a3663c717992c3c80eae1fe77f88
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3011180
(cherry picked from commit b185ee48be)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053822
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-16 14:55:49 -08:00
Laxman Dewangan
7abc2d8726 camera: vi: Use proper APIs from v4l2 for Linux6.6
The earlier porting of the driver for Linux 6.6 is not
matching with the previous kernel implementation.

Few V4L2 APIs have been deprecated from Linux 6.6. and
added the new APIs.

Use the correct API available from Linux6.6 for the
replacement as the previous supported kernel APIs.

For reference, the changes in core kernels are:
  The device argument is added in the API v4l2_async_nf_init() with
  commit b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev
  in async notifier init") in Linux 6.6.

  The API is removed with commit bda8953e8c3e ("media: v4l: async: Drop
  v4l2_async_nf_parse_fwnode_endpoints()") in Linux 6.6

Bug 4346767

Change-Id: I94877a8fe6a6764fc3c913fea7ecdbfdc7c793d6
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3042993
(cherry picked from commit 7d931ef33d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053710
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-16 14:55:44 -08:00
Laxman Dewangan
f8e977a8c9 camera: Use conftest to find if v4l2_async_notifier_* present
use conftest to determine if APIs v4l2_async_notifier_*()
present or not.
These APIs have been renamed in
commit 3c8c15391481 ("media: v4l: async: Rename async
nf functions, clean up long lines") in Linux 5.16

Bug 4387902

Change-Id: Id2023543f487c3867ef4e140662141803ac63f04
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037918
(cherry picked from commit 702def895c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053709
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-16 14:55:39 -08:00
Laxman Dewangan
1f0954f43d media: Use conftest to find if v4l2_async_subdev_nf_init() present
Use conftest to find if function v4l2_async_subdev_nf_init() is present
or not.

In Linux 6.5, with change commit bda8953e8c3e7e ("media: v4l: async:
Drop v4l2_async_nf_parse_fwnode_endpoints()"), added the function
v4l2_async_subdev_nf_init() and dropped v4l2_async_nf_init().

Bug 4346767

Change-Id: I345db2acf0a07d05722611d9eacc7134aff0c35a
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028766
(cherry picked from commit 3839cecd1c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053708
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-16 14:55:29 -08:00
Laxman Dewangan
711d4aee8d media: Use conftest to find if enum v4l2_async_match_type present
Use conftest to determine if the 'enum v4l2_async_match_type'
has the "TYPE" in its name.

In Linux 6.5, with change commit 7a2259fc5182b ("media: v4l: async:
Rename V4L2_ASYNC_MATCH_ macros, add TYPE_"), the enum names has "TYPE" also.

Bug 4346767

Change-Id: I863da8496337d4003188b654673c67cdb3eef155
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028745
(cherry picked from commit 5f77d6d51a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053707
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-16 14:55:19 -08:00
Laxman Dewangan
afe9bdc7c0 media: Use conftest to find if struct v4l2_async_connection present
Use conftest to find if struct v4l2_async_connection present
or not. The struct v4l2_async_subdev is renamed to struct
v4l2_async_connection with change commit adb2dcd5f2d49d3
("media: v4l: async: Rename v4l2_async_subdev as v4l2_async_connection")
in Linux 6.5

Bug 4346767

Change-Id: Id15c8ce747a8642b7831b79f45e15f26e95744b2
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028744
(cherry picked from commit 234ba9c75f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053706
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-16 14:55:08 -08:00
Laxman Dewangan
5b4a093e24 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
(cherry picked from commit 1eab65044c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053705
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-16 06:39:23 -08:00
Laxman Dewangan
14abda2794 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
(cherry picked from commit 2884c4b380)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3054211
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-16 06:39:18 -08:00
Laxman Dewangan
6ad6325734 i2c: Use conftest to find if i2c_driver struct has new_probe
Use conftest method to find if i2c_driver struct has the
member as new_probe. This is dropped from Linux 6.6 with
commit 5eb1e6e459cf ("i2c: Drop legacy callback .probe_new()")

Bug 4346767

Change-Id: I10b539dfa1bb363ad6cf5fc28a9ebd0ca4e88b48
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028631
(cherry picked from commit 537a307ffd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053704
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
2024-01-16 02:10:25 -08:00
Laxman Dewangan
a39a2be24e serial: Use conftest to find if uart_ops has set_termios has const arg
Use conftest to determine if set_termios of struct uart_ops
has const type argument or not. The argument type is changed
from commit bec5b814d46c ("serial: Make ->set_termios() old
ktermios const") in Linux 6.1

Bug 4387902

Change-Id: I175aac51ac2c2b99b9eedc69260ccb6b0c38571e
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037040
(cherry picked from commit 32516f4878)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053703
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
2024-01-16 02:10:18 -08:00