mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
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>
This commit is contained in:
committed by
mobile promotions
parent
1fc6fc17f2
commit
c3e3d472a3
@@ -3,6 +3,8 @@
|
||||
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/seq_buf.h>
|
||||
@@ -284,6 +286,9 @@ static const struct clk_ops tegra_bpmp_clk_gate_ops = {
|
||||
static const struct clk_ops tegra_bpmp_clk_mux_ops = {
|
||||
.prepare = tegra_bpmp_clk_prepare,
|
||||
.unprepare = tegra_bpmp_clk_unprepare,
|
||||
#if defined(NV_CLK_HW_DETERMINE_RATE_NO_REPARENT_PRESENT) /* Linux 6.4 */
|
||||
.determine_rate = clk_hw_determine_rate_no_reparent,
|
||||
#endif
|
||||
.is_prepared = tegra_bpmp_clk_is_prepared,
|
||||
.recalc_rate = tegra_bpmp_clk_recalc_rate,
|
||||
.set_parent = tegra_bpmp_clk_set_parent,
|
||||
|
||||
@@ -99,6 +99,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += bus_type_struct_uevent_has_const_dev_arg
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_attribute_struct_has_const_struct_class_attribute
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_create_has_no_owner_arg
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_struct_devnode_has_const_dev_arg
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += clk_hw_determine_rate_no_reparent
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += define_semaphore_has_number_arg
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += device_add_disk_has_int_return_type
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_tegra_core_dev_init_opp_table_common
|
||||
|
||||
@@ -6668,6 +6668,23 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_CLASS_STRUCT_DEVNODE_HAS_CONST_DEV_ARG" "" "types"
|
||||
;;
|
||||
|
||||
clk_hw_determine_rate_no_reparent)
|
||||
#
|
||||
# Determine if the function clk_hw_determine_rate_no_reparent() is present or not.
|
||||
#
|
||||
# commit 33b70fbc4f815f("clk: Introduce clk_hw_determine_rate_no_reparent()")
|
||||
# added the API clk_hw_determine_rate_no_reparent() to implement the clk_set_parent()
|
||||
# in Linux 6.4
|
||||
#
|
||||
CODE="
|
||||
#include <linux/clk-provider.h>
|
||||
void conftest_clk_hw_determine_rate_no_reparent(void) {
|
||||
clk_hw_determine_rate_no_reparent();
|
||||
}"
|
||||
|
||||
compile_check_conftest "$CODE" "NV_CLK_HW_DETERMINE_RATE_NO_REPARENT_PRESENT" "" "functions"
|
||||
;;
|
||||
|
||||
define_semaphore_has_number_arg)
|
||||
#
|
||||
# Determine if the macro DEFINE_SEMAPHORE has a number argument.
|
||||
|
||||
Reference in New Issue
Block a user