drivers: Update timer APIs for Linux v6.15

In Linux v6.15, the timer APIs hrtimer_init() and del_timer() have been
removed. The hrtimer_setup() was added in Linux v6.13 to replace
hrtimer_init() and hrtimer_init() have finally been removed. The
functions del_timer()/del_timer_sync() were renamed to
timer_delete()/timer_delete_sync() in Linux v6.15. Use conftest to
detect these changes and update the drivers as necessary.

JIRA LINQPJ14-47

Change-Id: Id3994900384aad4b91155507cda91e04898ab12c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3336168
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
This commit is contained in:
Jon Hunter
2025-04-08 13:30:51 +01:00
parent 1d9d3c1755
commit a59a10dfeb
13 changed files with 125 additions and 23 deletions

View File

@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#include <nvidia/conftest.h>
// SPDX-FileCopyrightText: Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#include <nvidia/conftest.h>
@@ -267,7 +265,11 @@ static ssize_t lpm_write_proc(struct file *file, const char __user *buffer,
bluedroid_pm_gpio_set_value(
bluedroid_pm->ext_wake, 1);
__pm_stay_awake(&bluedroid_pm->wake_lock);
#if defined(NV_TIMER_DELETE_PRESENT) /* Linux v6.15 */
timer_delete(&bluedroid_pm_timer);
#else
del_timer(&bluedroid_pm_timer);
#endif
set_bit(BT_WAKE, &bluedroid_pm->flags);
} else {
kfree(buf);
@@ -507,7 +509,11 @@ static int bluedroid_pm_remove(struct platform_device *pdev)
if ((bluedroid_pm->ext_wake)) {
wakeup_source_destroy(&bluedroid_pm->wake_lock);
remove_bt_proc_interface();
#if defined(NV_TIMER_DELETE_PRESENT) /* Linux v6.15 */
timer_delete(&bluedroid_pm_timer);
#else
del_timer(&bluedroid_pm_timer);
#endif
}
if (((bluedroid_pm->gpio_reset)) ||
((bluedroid_pm->gpio_shutdown)) ||