diff mbox series

[v7,1/3] clk: qcom: clk-rcg2: document calc_rate function

Message ID 20241024-starqltechn_integration_upstream-v7-1-78eaf21ecee9@gmail.com
State New
Headers show
Series [v7,1/3] clk: qcom: clk-rcg2: document calc_rate function | expand

Commit Message

Dzmitry Sankouski Oct. 24, 2024, 10:13 a.m. UTC
Update calc_rate docs to reflect, that pre_div
is not pure divisor, but a register value, and requires conversion.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
---
 drivers/clk/qcom/clk-rcg2.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Stephen Boyd Oct. 28, 2024, 11:45 p.m. UTC | #1
Quoting Dzmitry Sankouski (2024-10-24 03:13:09)
> diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
> index bf26c5448f00..0fc23a87b432 100644
> --- a/drivers/clk/qcom/clk-rcg2.c
> +++ b/drivers/clk/qcom/clk-rcg2.c
> @@ -153,7 +153,14 @@ static int clk_rcg2_set_parent(struct clk_hw *hw, u8 index)
>   *
>   *          parent_rate     m
>   *   rate = ----------- x  ---
> - *            hid_div       n
> + *            pre_div       n
> + *
> + * @param rate - Parent rate.
> + * @param m - Multiplier.
> + * @param n - Divisor.
> + * @param mode - Use zero to ignore m/n calculation.
> + * @param hid_div - Pre divisor register value. Pre divisor value
> + *                  relates to hid_div as pre_div = (hid_div + 1) / 2

Can you use kernel-doc instead? Then our tooling can easily extract it.

>   */
>  static unsigned long
>  calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 hid_div)
>
diff mbox series

Patch

diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
index bf26c5448f00..0fc23a87b432 100644
--- a/drivers/clk/qcom/clk-rcg2.c
+++ b/drivers/clk/qcom/clk-rcg2.c
@@ -153,7 +153,14 @@  static int clk_rcg2_set_parent(struct clk_hw *hw, u8 index)
  *
  *          parent_rate     m
  *   rate = ----------- x  ---
- *            hid_div       n
+ *            pre_div       n
+ *
+ * @param rate - Parent rate.
+ * @param m - Multiplier.
+ * @param n - Divisor.
+ * @param mode - Use zero to ignore m/n calculation.
+ * @param hid_div - Pre divisor register value. Pre divisor value
+ *                  relates to hid_div as pre_div = (hid_div + 1) / 2
  */
 static unsigned long
 calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 hid_div)