Commit Graph

15 Commits

Author SHA1 Message Date
Jon Hunter
2cc58560db ASoC: tegra: Fix build for Linux v6.4
In Linux v6.4, the 'params' member of the snd_soc_dai_link was replaced
with the 'c2c_params' member. Add a new test to the conftest script that
checks if the 'c2c_params' structure member is present and use the
definition created by conftest to select which structure member is used.

Bug 4221847

Change-Id: I7ebb4187fd1cd70097bf65409bda3b2a6830a303
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989731
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-07 13:03:26 -07:00
Jon Hunter
d021a4fbae drm/tegra: Fix build for Linux v6.4
In Linux v6.4, the various drm_scdc_get/set functions were updated to
take an argument of type 'struct drm_connector'. Add a new test to the
conftest script that checks if this argument is used and use the
definition created by conftest to select which version of the function
is used.

Bug 4221847

Change-Id: Id6b6396bbe875a0268f8fe2f68ae08f78a32c954
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989035
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-07 13:03:15 -07:00
Jon Hunter
ce678a37b1 drivers: Add conftest test for class_create
In Linux v6.4, the module pointer argument is removed from the
class_create() function. Add a test to the conftest script that checks
if this argument for the class_create() function has been removed and
use the definition created by conftest to select which version of the
function is used.

Bug 4183168
Bug 4221847

Change-Id: I440e4b318001886cd0319bb3499ba33178475e8c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989020
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-05 17:54:05 -07:00
Jon Hunter
86dafc35bb tty: serial: ch384: Fix build for Linux v6.4
In Linux v6.4, the macro DEFINE_SEMAPHORE was updated and this breaks
the build for the ch384 serial driver. Add a new test to the conftest
script that checks if the macro DEFINE_SEMAPHORE takes a number argument
and use the definition created by conftest to select which version of
the macro is used.

Bug 4183168
Bug 4221847

Change-Id: Ie1bcb95b07e792c70fa52e22465bdf565dc456af
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989732
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-05 17:53:54 -07:00
Akhil R
2659fcd46a crypto: tegra: Add updated Tegra SE driver
Add the updated Tegra SE driver with the below improvements.
- Remove dependency with nvhost apis and use upstream Host1x APIs.
- Implement software fallbacks for keys/plaintexts unsupported by
hardware.
- Support only T234 and later. Prior chips will use tegra-se-nvhost
driver.

Bug 4221414
Bug 3579794

Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Change-Id: I398a5b7cc3f752b44d01d6d1c81f813f862e4cd9
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2977810
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-03 18:59:24 -07:00
Jon Hunter
ece68dd0d1 net: Use conftest
Instead of relying on kernel version to determine if functions or
specific versions of functions are present in the kernel, add compile
time tests to the conftest.sh script to determine this at compile time
for the kernel being 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 4119327

Change-Id: I79e701940ca70ca4d66500c75b5992f9d92b54b0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985744
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-03 04:01:15 -07:00
Jon Hunter
19fb93666d platform: tegra: dce: Use conftest
Instead of relying on kernel version to determine if the 'tegra_ivc'
structure has a member that is of type 'struct iosys_map', add a compile
time test to the conftest.sh script to determine this at compile time
for the kernel being 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 4119327

Change-Id: Ia993ca9df7694347252a795c7dee1e95f2f9fa2f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985743
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-30 06:46:02 -07:00
Jon Hunter
02d724565b platform: tegra: rtcpu: Use conftest
Instead of relying on kernel version to determine if the 'remove'
callback for the 'bus_type' structure return an integer or void, add a
compile time test to the conftest.sh script to determine this at compile
time for the kernel being 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 4119327

Change-Id: I5457300619f5fb3b6afe61742bc6fce4cbefcd5d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985719
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-30 06:45:51 -07:00
Jon Hunter
b272a83282 video: tegra: nvmap: Use conftest
Instead of relying on kernel version to determine if the
register_shrinker() function has the 'fmt' argument, use the conftest.sh
script to test if this argument is present at compile time. 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 4119327

Change-Id: I0cbde2dfc2affc41e93eee1f3a195dbc0f8f5667
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984429
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-28 21:45:38 -07:00
Jon Hunter
ae64ed46c8 gpu: host1x: Add conftest support
Instead of relying on kernel version to determine if certain functions
or structure are present in the kernel, use the conftest.sh script to
test which functions, structures, etc are present at compile time. 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 4119327

Change-Id: I56281fa5d95862338bd8a43d6e22225c27590462
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984422
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-28 21:45:27 -07:00
Jon Hunter
5a26b0ef9d drm/tegra: Add conftest support
Instead of relying on kernel version to determine if certain functions
or structure are present in the kernel, use the conftest.sh script to
test which functions, structures, etc are present at compile time. 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 4119327

Change-Id: If315b18af74c830e9ba3993208de3a3326c4187d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984415
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-28 21:45:17 -07:00
Gautham Srinivasan
6fec90c658 drivers: bmi088: Fix build for post-Linux v6.2
BMI088 driver was failing to build for Kernel version
> 6.2 and the following error is seen:

drivers/bmi088/bmi088_core.c:1043:42: error: 'struct iio_dev'
has no member named 'mlock'
  mutex_lock(&st->snsrs[hw].bmi_iio->mlock);

mlock field is moved from indio_dev to iio_dev_opaque
structure from v6.2 onwards.  Instead of using kernel
version, use conftest.sh script which checks for the
'mlock' field in iio_dev_opaque structure or not.

Bug 4190630

Change-Id: Icc540edd916718d30460b314600c20e70144b1d6
Signed-off-by: Gautham Srinivasan <gauthams@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983266
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-27 02:27:51 -07:00
Jon Hunter
ed3fdebc33 thermal: max77851: Fix build for pre-Linux v6.1 kernels
The max77851 driver is failing to build for Linux kernels v5.16 to v6.0
and the following error is seen ...

 drivers/thermal/max77851_thermal.c:173:30: error: implicit declaration
 of function 'devm_thermal_of_zone_register'; did you mean
 'devm_thermal_zone_of_sensor_register'?
 [-Werror=implicit-function-declaration]
   thermal->tz_device = devm_thermal_of_zone_register(&pdev->dev, 0,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The function devm_thermal_of_zone_register() was introduced in Linux
kernel v6.1 and not v5.16.

Instead of relying on kernel version to determine if this function is
present using the conftest.sh script which checks the kernel that is
being compiled to see if this function is present or not. This is also
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 either.

Bug 200749982

Change-Id: I8d5e70d2d39497d7f513c82cd3a45312b2bc016a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2980925
2023-09-23 14:34:00 -07:00
Jon Hunter
1212fd6023 scripts: Add copyright/license for conftest
The conftest script and Makefile are distributed as part of the
'open-gpu-kernel-modules' project [0]. These files don't have a explicit
copyright and license appended to the file, but per the COPYING file for
the files are licensed as MIT. Add the copyright and MIT license header
to the conftest files.

[0] https://github.com/NVIDIA/open-gpu-kernel-modules

Bug 4119327

Change-Id: I3f5dd44a4a8475a943660589432ebdf67ac3b255
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2978871
Reviewed-by: svc-sw-mobile-l4t <svc-sw-mobile-l4t@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-12 22:14:21 -07:00
Jon Hunter
2360391866 scripts: Add conftest.sh support
The script conftest.sh can be used at build time to determine which
kernel headers or versions of kernel functions/macros are present in the
kernel that drivers are being compiled against. This is useful for cases
where changes are backported from upstream Linux kernels that may change
kernel functions and so we can no longer rely on the kernel version to
indicate which version of the kernel function to use.

The conftest.h header file is a top-level header file that includes all
the header files that are generated by the conftest.sh script. This
header file can be included by drivers so that they can use the various
definitions that are generated by conftest.sh. This file is located
along with the conftest.sh script because this is copied to the output
directory where all the generated header files are placed.

Bug 4119327
Bug 4228080

Change-Id: I781884e359e9688640661548620e01a178debac9
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2974065
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-09-05 23:08:03 -07:00