Commit Graph

104 Commits

Author SHA1 Message Date
Laxman Dewangan
00a95facef pci: Add conftest to determine if msi_get_virq() present
The API msi_get_virq() get added by commit 98043704f375 ("genirq/msi:
Make msi_get_virq() device domain aware") in Linux v6.1. Use
conftest to determine if this API is available or not.

Jira HOSTX-5375

Change-Id: I5e4cef9622d852fc889d9652e6631a79f2d21f9b
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3166766
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-07-03 07:47:50 -07:00
Laxman Dewangan
b260a8f442 pci: Use conf test to determine API change of pci_epc_write_header()
Add conftest to determine if the pci_epc_write_header() has the vfn
argument or not.

Commit 53fd3cbe5e9d791("PCI: endpoint: Add virtual function number
in pci_epc ops") added virtual function number as argument in the
APIs in Linux 5.14.

Jira HOSTX-5375

Change-Id: Ib0b1fbc2a33f9159f3497374d253e264a90f7b4d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3166765
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-07-03 07:47:40 -07:00
Laxman Dewangan
1707f60f8b conftest: Add macro to determine if MODULE_IMPORT_NS present
Add conftest to determine if the MODULE_IMPORT_NS macro present.
This macro is added in commit 80140a81f7f833 ("module.h: simplify
MODULE_IMPORT_NS") in Linux 5.18.

Jira HOSTX-5375

Change-Id: Ie61dd169d21a0169c44060eb0e3f3fe4a9c149e8
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3166547
2024-07-03 07:47:30 -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
Jon Hunter
9b118c56c7 pwm: tachometer: Fix build for Linux v6.10
In Linux v6.10, a pointer to a dynamically allocated 'struct device'
was replaced with a statically allocated 'struct device' in the
'pwm_chip' structure. Update the Tegra PWM Tachometer driver accordingly
to fix the build for Linux v6.10.

Bug 4593750

Change-Id: I9d629746290282b5c1858f8308128d94ff155c49
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3123219
(cherry picked from commit 0104837e60)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142227
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-06-29 12:18:13 -07:00
Jon Hunter
bcd5a6c812 thermal: Fix build for Linux v6.10
In Linux v6.10, commit b1ae92dcfa8e ("thermal: core: Make struct
thermal_zone_device definition internal") made the structure
'thermal_zone_device' internal and so the 'devdata' member is no longer
directly accessible. The function thermal_zone_device_priv() was added
in Linux v6.4 for retrieving the 'devdata' and so update the various
thermal drivers to use this function if present.

Bug 4593750

Change-Id: Ic53de9bbd5459c99a3ac26759aa8a966cd775fe5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3123221
(cherry picked from commit d95c0d0add)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3141886
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2024-06-29 12:18:03 -07:00
Jon Hunter
00cdac08b6 conftest: Add test for PCI_IRQ_INTX
In Linux v6.8, the definition 'PCI_IRQ_LEGACY' was deprecated and
renamed as 'PCI_IRQ_INTX'. Add a test for conftest to detect if
'PCI_IRQ_INTX' is defined so that drivers can migrate to the new
definition.

Bug 4593750

Change-Id: If34c258cfabe407bd15dc7078f2599737368dc58
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3143016
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-05-22 23:33:27 -07:00
Jon Hunter
c73cf3c92a block: virtual-storage: Allow build for Linux v6.10
The function blk_queue_max_hw_sectors() was removed in Linux v6.10 and
so add a test to conftest to see if this function is present or not to
allow the driver to build. The virtual-storage driver is currently
broken for Linux v5.19+ kernel due to other incompatibilities with these
newer kernels, but has been updated so that it still builds. Therefore,
allow the driver to build for Linux v6.10 while the driver is fixed
properly for these newer kernels.

Bug 4311184
Bug 4593750

Change-Id: Ic4054c87acdf3c77f03ff94fbdde513d84fe229b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142216
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-05-22 09:19:53 -07:00
Jon Hunter
6255ffef44 media: camera: Fix v4l2-subdev for Linux v6.10
In Linux v6.10, the v4l2-subdev callbacks 'g_dv_timings' and
's_dv_timings' were moved from the v4l2_subdev_video_ops structure to
the v4l2_subdev_pad_ops structure. Fix the build for Linux v6.10 by
using conftest to determine which structure is used for these callbacks.

Bug 4593750

Change-Id: Ic54e88da22ed7d1da9b6026a45b9c4307637c7b4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142215
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-05-22 09:19:43 -07:00
Jon Hunter
1a635bb0ea conftest: Fix tests for Linux v6.10
Some of the conftest tests are no longer working with the mainline
kernel and this is causing various build failures for drivers. Upstream
commit a3b00f10da80 ("objpool: enable inlining objpool_push() and
objpool_pop() operations") inlined some code that causes build error to
occur when the tests are built with 'Werror=address-of-packed-member'.

Upstream commit 6f303d60534c ("gcc-9: silence 'address-of-packed-member'
warning") disables the option 'address-of-packed-member' for the kernel
already and so fix these new build failures by disabling this option
for the conftest tests.

Bug 4593750

Change-Id: I37af97079bb7734fcd5bf10384b1afc071613594
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142214
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-05-22 09:19:33 -07:00
Laxman Dewangan
a1d5f342d5 pcie: endpoint: Add support to build with k6.9
Few of the APIs from msi are deprecated in the
kernel 6.9. These APIs are:
  platform_msi_domain_alloc_irqs
  platform_msi_domain_free_irqs

The change is with commit commit 1a4671ff7a903e87 ("platform-msi: Remove
unused interfaces")

Add support to not use these APIs via conftest.

Bug 4471899

Change-Id: I3b07236eeb69900b06c4e17b7675f6419b8321e4
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3131464
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-05-05 07:50:31 -07:00
Jon Hunter
2ff1c3c6c9 conftest: Add test for pci_epc_bar_desc
The pci_epc_features structure was updated in Linux v6.9 to move various
fields under a new pci_epc_bar_desc structure. Add a test to conftest to
determine if the new pci_epc_bar_desc structure is present.

Bug 4627271

Change-Id: I5c473cb5172ac10e6f36c165be5a03f1fb90ebeb
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3129468
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
2024-05-02 19:14:49 -07:00
Jon Hunter
971680aadb PCI: Fix endpoint DMA test for Linux v6.9
Building the PCI EPF DMA test driver for Linux v6.9 is failing because
the parameters for the pci_epf_alloc_space() function has been updated
to pass the alignment value via the 'pci_epc_features' structure instead
of passing the value directly.

Instead of hard-coding the endpoint alignment in the EPF DMA test driver
use the 'pcie_epc_get_features()' function to retrieve the endpoint
features structure which has the endpoint alignment.

By using the conftest script to detect the parameters for the
pci_epf_alloc_space() function, we can then pass the appropriate
arguments to the pci_epf_alloc_space() function.

Bug 4471899

Change-Id: Id80259a4c90d6f6ae2132cccbec1a96113d22be7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3116548
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-04-18 01:14:35 -07:00
Jon Hunter
72761b8276 net: nvethernet: Fix build for Linux v6.9
For Linux v6.9, the structure 'ethtool_eee' was replaced by
'ethtool_keee' and this new structure uses bitmaps for the structure
fields 'supported', 'advertised' and 'lp_advertised' as opposed to
'u32' types.

Add a test to conftest to detect the presence of the new 'ethtool_keee'
structure and update the nvethernet driver to use the various
linkmode_xxx helper functions for accessing the bitmap structure fields.

Bug 4471899

Change-Id: I275becfa665a36ed90e8bc227eaa4122825faa6a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3110494
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2024-04-17 08:47:15 -07:00
Jon Hunter
9458d6b97f media: camera: Ensure gpio_device_get_chip is present
In Linux v6.7, both gpio_device_find() and gpio_device_get_chip() were
added. However, don't assume that if one is present then so is the other
and so add a test to check if gpio_device_get_chip() is also present.

Bug 4471899

Change-Id: I0c547a52b0f397aef43884ab76d815573e8ed3f8
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3112133
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-04-11 12:24:27 -07:00
Jon Hunter
b8b92d5d5f conftest: Fix test for SLAB_MEM_SPREAD
The conftest test for detecting if the definition SLAB_MEM_SPREAD is
present is not working as expected because it is using the 'functions'
type which is intended for only checking if a function is present or
not. Fix this by correcting the type to 'types'.

Bug 4471899

Change-Id: Iba3c9fe70a97793576d9f188d50628acb55f44df
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3108683
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-04-04 06:47:58 -07:00
Jon Hunter
037fa78728 media: camera: Fix build for Linux v6.9
In Linux v6.9 the data argument of the function pointer passed to
gpio_device_find() was updated to be a const type. This breaks building
the CDI and ISC drivers for Linux v6.9. Update the test in conftest that
detects the presence of the gpio_device_find() function to perform a
second test to see if the argument for the function pointer is a const
type. Update the drivers that use the gpio_device_find() function
accordingly to fix the build.

Bug 4471899

Change-Id: I562451a401bcaebcf0acf9a7d563cb0ea1d87807
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3104559
Reviewed-by: svc-sw-mobile-l4t <svc-sw-mobile-l4t@nvidia.com>
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-04-04 06:47:48 -07:00
Jon Hunter
68e7840dd8 media: camera: Update conftest for gpio_device_find
When adding conftest tests for detecting if specific functions are
present, it is always better to check if the newly added function is
present versus the function that has been removed. The reason being that
is the newly added function is modified in the future then the conftest
tests can be extended to check for updates to the function.

Therefore, instead of checking if the function gpiochip_find() is
present, which was removed in Linux v6.7, check if the function
gpio_device_find() is present, which replaced gpiochip_find in Linux
v6.7.

Bug 4346767
Bug 4471899

Change-Id: I32bf1c3da32abbf3c8d3ef9ea350decf1564e0bc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3108643
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-04-04 06:47:43 -07:00
Jon Hunter
7acb255112 video: tegra: virt: Fix build for Linux v6.9
The definition SLAB_MEM_SPREAD was removed in Linux v6.9 and this breaks
the compilation of the Tegra Graphics Virtualization Comms driver. Add a
test to conftest to detect if SLAB_MEM_SPREAD is defined and update the
driver accordingly to fix the build.

Bug 4471899

Change-Id: Ibcac2dbc6538bcda92e818b333a9db6b8234f1d7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3104558
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-03-28 17:56:28 -07:00
Jon Hunter
9c180ac0c8 soc/tegra: bpmp: Fix build for Linux v6.9
In Linux v6.9-rc1, the typedef genpd_xlate_t was updated to make
'of_phandle_args' argument const. Add a test to the conftest script to
test if this argument is const and update the BPMP powergate driver
accordingly.

Bug 4471899

Change-Id: I85ddb3689ccf5dc769cd208575db69a2cf7b0a11
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3103819
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
2024-03-27 07:08:44 -07:00
Jon Hunter
3b9f5783b2 block: virtual-storage: Fix build for Linux v6.9
In Linux v6.9-rc1, the function blk_mq_init_queue() was renamed
blk_mq_alloc_queue() and the arguments passed to the function were
updated. Add a test to conftest to detect if the function
blk_mq_alloc_queue() is present and update the virtual-storage driver
accordingly.

Bug 4471899

Change-Id: I7dc937eaad27445b1c140c57aafd36f4a4b769ba
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3095926
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
2024-03-27 07:08:40 -07:00
Jian-Min Liu
1dc806cb91 Kleaf: add kernel modules in nvidia-oot
1. Add BUILD.bazel file.
2. Add build target of kernel module and required include folder
   srctree.* in Makefile to fix the build issue
3. The tr (a build tool defined by kleaf in the sandbox) which
   supported by toybox will cause the conversion of header files
   to file_define to fail. Fixed it by separating with two tr
   commands.

Bug 4344670

Change-Id: I56dcc148960f3b7703335943281589f42caa9af7
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3066225
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-03-19 06:50:10 -07:00
Laxman Dewangan
932f9757ab misc: nvscic2c-pcie: Drop usage of enum pci_epc_irq_type from Linux 6.8
The enum pci_epc_irq_type is dropped from Linux 6.8 with
commit 74955cb8ccc385 ("PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions")
Use alternative definition from mainline.

Bug 4448428

Change-Id: Ic248ee2522f171c311ac1086c2792bcf3ad6ed64
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3062520
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-25 17:26:42 -08:00
Jon Hunter
85692c2c64 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
(cherry picked from commit abeacc3534)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3054827
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-20 19:34:18 -08:00
Jon Hunter
293c8e7b85 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
(cherry picked from commit 3f5ba8f70b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032444
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-20 19:15:00 -08:00
Jon Hunter
93360eb080 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
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-17 08:09:54 -08:00
Jon Hunter
a1f59dfc30 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
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-16 15:23:25 -08:00
Jon Hunter
0356a563b3 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
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-16 15:23:19 -08:00
Jon Hunter
10fd025187 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>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-16 15:23:14 -08:00
Jon Hunter
8d5286c379 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
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-16 15:23:09 -08:00
Jon Hunter
9e2f7ecdf7 spi: Fix build for Linux v6.8
For Linux v6.8, support for SPI controllers with multiple chip-selects
was added to the SPI core and this updated the 'chip_select' member of
the 'spi_device' structure to be an array. This breaks building the
Tegra124 SPI Slave driver and Tegra210 QUAD SPI driver.

A helper function, spi_get_chipselect(), was added for Linux v6.3 to
retrieve the chip-select for a SPI device and can be used for retrieving
the chip-select for all Linux v6.3+ kernels.

Add a conftest rule to detecting if spi_get_chipselect() is present and
if so use this for getting the chip-select. This fixes the build issues
for Linux v6.8.

Bug 4448428

Change-Id: Ia4f95ed96b9a18cc7da7a4a52305fc64bc31905c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3050146
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-11 04:32:12 -08:00
Laxman Dewangan
8df8cfc8e6 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
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-30 08:53:39 -08:00
Laxman Dewangan
dfff2311c3 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
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Tested-by: Vishwaroop A <va@nvidia.com>
2023-12-20 16:41:16 -08:00
Laxman Dewangan
702def895c 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
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-19 19:39:07 -08:00
Laxman Dewangan
b40e45535e camera: Use conftest to find if media_entity_remote_pad() present
Use conftest to determine if media_entity_remote_pad()
function is present or not

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

Bug 4387902

Change-Id: I816016731ac44a3c093438310f8e60bd166f2fd7
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037917
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-19 19:39:02 -08:00
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
32516f4878 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
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-19 04:03:48 -08:00
Laxman Dewangan
b7cbe748e1 pwm: Use conftest to find if pwm_ops has config
Use conftest to determine if pwm_ops struct has config
callback or not. This call back is deprecated from
commit 0829c35dc534 ("pwm: Drop support for legacy drivers")
in Linux 6.0.

Bug 4387902

Change-Id: Ic56d5955e5cfd15acb664fc11b549b9b91277182
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037039
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-19 04:03:13 -08:00
Laxman Dewangan
9974fda1d2 spi: Use conftest to find return type of .remove of spi_driver struct
Use conftest to determine the return type of .remove() of
struct spi_driver is int or void type instead of kernel version.

The return type got changed with commit a0386bba7093
("spi: make remove callback a void function") in Linux 5.18

Bug 4387902

Change-Id: I644fe0610a76fbc4cea547c3295670599ae919bc
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037038
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-19 04:03:08 -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
Laxman Dewangan
6627276f82 {isc,cdi}_mgr: Use gpiod_count() for getting number of GPIO
The API gpiod_count() returns the number of the GPIO in given
property. This API is supported from long and continue to
support.

Use this API instead of of_gpio_named_count() which is deprecated
from Linux 6.2.

Bug 4387902

Change-Id: I2b647b8645e0dd8ff743515ac999fe035e636dc5
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3035503
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-15 15:06:09 -08:00
Jon Hunter
891d093a76 media: camera: Use conftest for devnode
Use confest in the camera CDI and ISC drivers to determine if the
'devnode' function pointer under the class structure to take a const
device struct.

Also fix the commit in conftest that introduced the change to the
'devnode' function pointer.

Bug 4346767

Change-Id: I66de39e079c13219e0ff3e7154c0e7ceb609a29d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3034763
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-15 14:54:00 -08:00
Laxman Dewangan
f777618023 bludroid_pm: Enable build of driver with Linux6.2
The build of driver is disabled from Linux 6.2 due to
changes in core kernel where API of_get_named_gpio_flags()
has been removed.

This APIS is removed in commit 40fc56ee608cdb ("gpiolib:
of: remove of_get_gpio[_flags]() and of_get_named_gpio_flags()")
in Linux 6.2.

Add support to use the new APIs for Linux 6.2 onwards.

Bug 4346767

Change-Id: I573c13398945db93d2a3a3db81bfd53f1be159f6
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031550
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-14 02:19:38 -08:00
Laxman Dewangan
c3e3d472a3 clk-bpmp: Use conftest to determine clk_hw_determine_rate_no_reparent()
The clock ops needs the determine_rate() callback in clock ops if
set_parent() is needed by commit 33b70fbc4f815f("clk: Introduce
clk_hw_determine_rate_no_reparent()") and commit 326cc42f9fdc3
("clk: Forbid to register a mux without determine_rate")
from Linux 6.4.

Add conftest method to determine if clk_hw_determine_rate_no_reparent()
present.

Bug 4346767

Change-Id: I8e4573e1a045fc76b7741aaa88b571574f14377e
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032325
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-12 09:29:15 -08:00
Laxman Dewangan
3e87d0a8ea conftest: Add test to find if gpiochip_add() present
Add conftest  Determine if function gpiochip_find()
present or not.

The function gpiochip_find() is removed from
commit 2654521d774f9 ("gpiolib: remove
gpiochip_find()") in Linux 6.7

Bug 4346767

Change-Id: I5b7c4b87c327ac69c8ff735940d086352665de2f
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031549
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-11 11:07:18 -08:00
Laxman Dewangan
05cf355367 conftest: Add test to find if struct gpio_chip has of_node
Determine if struct gpio_chip has the of_node member or not.

The of_node from struct gpio_chip is removed from
commit 70d0fc4288dab ("gpiolib: Get rid of not
used of_node member") in Linux 6.2

Bug 4346767

Change-Id: I5ebc86beb7ce527f2e38693dd59907cdd3a8fcf9
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031548
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-11 11:07:08 -08:00
Laxman Dewangan
5f188c61f5 conftest: Add test to find of_gpio_named_count()
Add conftest to find if of_gpio_named_count()
function is present.

This APIS is removed in commit c7835652a85df ("gpiolib: of: stop
exporting of_gpio_named_count()") in Linux 6.2.

Bug 4346767

Change-Id: Ia8339a4f0c7bfcbeed922c7045330ae2ba83f96c
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031547
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-11 11:06:57 -08:00
Laxman Dewangan
f78f96de71 conftest: Add test to find of_get_named_gpio_flags()
Add test to find out if of_get_named_gpio_flags() present
or not.

This APIS is removed in commit 40fc56ee608cdb ("gpiolib:
of: remove of_get_gpio[_flags]() and of_get_named_gpio_flags()")
in Linux 6.2.

Bug 4346767

Change-Id: I522097bdeb5fbd5a545b981a1a9b3f6f7ecb2806
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031546
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-11 11:06:47 -08:00
Bitan Biswas
2a9ce8d0e2 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
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-11 10:47:58 -08:00
Jon Hunter
f748f0ef72 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
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-11 01:17:26 -08:00