clk: add function documentation for clk_hw_round_rate()
PATCH 1/1 clk: add function documentation for clk_hw_round_rate()
Information about usage and prerequisites for this API.
--- drivers/clk/clk.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/clk/clk.c +13 -0
@@ -1400,6 +1400,19 @@ int __clk_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) }EXPORT_SYMBOL_GPL (__clk_determine_rate); +/** +* clk_hw_round_rate - round the given rate for a hw clk +* @hw: the hw clk for which we are rounding a rate +* @rate: the rate which is to be rounded +* +* Takes in a rate as input and rounds it to a rate that the clk can actually +* use which is then returned. If clk doesn't support round_rate operation +* then the parent rate is returned. +* +* Useful for clk providers to call from within clk_ops such as .round_rate, +* .determine_rate. Requires prepare_lock to be held before calling this +* function. +*/ unsigned long clk_hw_round_rate (struct clk_hw *hw,unsigned long rate) {int ret;
Signature · 1 line
2.17.1
Stephen Boyd
maintainerQuoting Sarang Mairal (2020-06-10 08:17:44)
Quoted 17 lines
Information about usage and prerequisites for this API.
Signed-off-by Sarang Mairal <[email protected]>--- drivers/clk/clk.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/clk/clk.c +2
-0@@ -1400,6 +1400,19 @@ int __clk_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) }EXPORT_SYMBOL_GPL (__clk_determine_rate); +/** +* clk_hw_round_rate - round the given rate for a hw clk
drivers/clk/clk.c int __clk_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) · line 1414
Quoted 10 lines
drivers/clk/clk.c +10
-0+* @hw: the hw clk for which we are rounding a rate +* @rate: the rate which is to be rounded +* +* Takes in a rate as input and rounds it to a rate that the clk can actually +* use which is then returned. If clk doesn't support round_rate operation +* then the parent rate is returned. +* +* Useful for clk providers to call from within clk_ops such as .round_rate, +* .determine_rate. Requires prepare_lock to be held before calling this +* function.
I think we can use the 'Return:' and the 'Context:' sections in kernel-doc[1]. Can you reword using those please?
drivers/clk/clk.c int __clk_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) · line 1418
Quoted 4 lines
drivers/clk/clk.c +1
-0+*/ unsigned long clk_hw_round_rate (struct clk_hw *hw,unsigned long rate) {int ret;
[1] Documentation/doc-guide/kernel-doc.rst
Quoted 2 lines
I think we can use the 'Return:' and the 'Context:' sections in kernel-doc[1]. Can you reword using those please?
Yes, nice suggestion! Thanks.
Hopefully v2 addresses your expectation.
-Regards,
Sarang.
PATCH v2 1/1 clk: add function documentation for clk_hw_round_rate()
Information about usage and prerequisites for this API.
--- drivers/clk/clk.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/clk/clk.c +15 -0
@@ -1400,6 +1400,21 @@ int __clk_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) }EXPORT_SYMBOL_GPL (__clk_determine_rate); +/** +* clk_hw_round_rate() - round the given rate for a hw clk +* @hw: the hw clk for which we are rounding a rate +* @rate: the rate which is to be rounded +* +* Takes in a rate as input and rounds it to a rate that the clk can actually +* use. +* +* Context: prepare_lock must be held. +* For clk providers to call from within clk_ops such as .round_rate, +* .determine_rate. +* +* Return: returns rounded rate of hw clk if clk supports round_rate operation +* else returns the parent rate. +*/ unsigned long clk_hw_round_rate (struct clk_hw *hw,unsigned long rate) {int ret;
Signature · 1 line
2.17.1
Quoting Sarang Mairal (2020-06-10 19:19:41)
Quoted 4 lines
Information about usage and prerequisites for this API.
Signed-off-by Sarang Mairal <[email protected]>---
Applied to clk-next