Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56b8ef69 authored by Amit Nischal's avatar Amit Nischal Committed by Taniya Das
Browse files

clk: qcom: Add handoff support for voter rpm clocks



Some voter rpm clocks are critical for system booting and should not be
gated until a unused clock tree late_init level.
So add support for handoff functionality for system critical clocks by
using CLK_ENABLE_HAND_OFF flag.

Change-Id: I9f9674a25fc5f7a2bc9b5672b00716b82223b06b
Signed-off-by: default avatarAmit Nischal <anischal@codeaurora.org>
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
parent 8ecd48cc
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -134,6 +134,16 @@ static unsigned long voter_clk_recalc_rate(struct clk_hw *hw,
	return v->rate;
}

int voter_clk_handoff(struct clk_hw *hw)
{
	struct clk_voter *v = to_clk_voter(hw);

	v->enabled = true;

	return 0;
}
EXPORT_SYMBOL(voter_clk_handoff);

const struct clk_ops clk_ops_voter = {
	.prepare = voter_clk_prepare,
	.unprepare = voter_clk_unprepare,
+4 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -36,6 +36,7 @@ extern const struct clk_ops clk_ops_voter;
		.hw.init = &(struct clk_init_data){			   \
			.ops = &clk_ops_voter,				   \
			.name = #clk_name,				   \
			.flags = CLK_ENABLE_HAND_OFF,			   \
			.parent_names = (const char *[]){ #_parent_name }, \
			.num_parents = 1,				   \
		},							   \
@@ -47,4 +48,6 @@ extern const struct clk_ops clk_ops_voter;
#define DEFINE_CLK_BRANCH_VOTER(clk_name, _parent_name) \
	 __DEFINE_CLK_VOTER(clk_name, _parent_name, 1000, 1)

int voter_clk_handoff(struct clk_hw *hw);

#endif