Skip to content

Commit e8c849c

Browse files
smairalbebarino
authored andcommitted
clk: add function documentation for clk_hw_round_rate()
Information about usage and prerequisites for this API. Signed-off-by: Sarang Mairal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent b3a9e3b commit e8c849c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/clk/clk.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,21 @@ int __clk_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
14001400
}
14011401
EXPORT_SYMBOL_GPL(__clk_determine_rate);
14021402

1403+
/**
1404+
* clk_hw_round_rate() - round the given rate for a hw clk
1405+
* @hw: the hw clk for which we are rounding a rate
1406+
* @rate: the rate which is to be rounded
1407+
*
1408+
* Takes in a rate as input and rounds it to a rate that the clk can actually
1409+
* use.
1410+
*
1411+
* Context: prepare_lock must be held.
1412+
* For clk providers to call from within clk_ops such as .round_rate,
1413+
* .determine_rate.
1414+
*
1415+
* Return: returns rounded rate of hw clk if clk supports round_rate operation
1416+
* else returns the parent rate.
1417+
*/
14031418
unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate)
14041419
{
14051420
int ret;

0 commit comments

Comments
 (0)