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>
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>
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>
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>
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>
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>
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
(cherry picked from commit 8b3ebff940)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3051959
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
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>
(cherry picked from commit f777618023)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3050579
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
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
(cherry picked from commit 9e2f7ecdf7)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3051189
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
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
(cherry picked from commit d5391a25ab)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3034644
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
The Tegra124 SPI slave driver declares a prototype for the function
tegra_spi_slave_register_callback() that does not exist. The correct
function name is tegra124_spi_slave_register_callback() and so fix the
prototype accordingly. Move the prototype to an actual header because
this is the correct place for defining prototypes for other drivers to
reference. This was caught by enabling the compiler flag
-Wmissing-prototype.
Bug 4404965
Change-Id: I765723d0a5ed6369784e5f6c480a6f03500659f3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3027487
(cherry picked from commit 19a85c968c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031243
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>