From: Zhengxun Li <zhengxunli.mxic@gmail.com>
To: shubhrajyoti.datta@xilinx.com
Cc: git@xilinx.com, gregkh@linuxfoundation.org,
linux-clk@vger.kernel.org, linux-staging@lists.linux.dev,
michals@xilinx.com, mturquette@baylibre.com, robh+dt@kernel.org,
sboyd@kernel.org, zhengxunli.mxic@gmail.com,
zhengxunli@mxic.com.tw
Subject: Re: [PATCH v11 2/5] clk: clocking-wizard: Add the clockwizard to clk directory
Date: Wed, 21 Apr 2021 16:58:26 +0000 [thread overview]
Message-ID: <CACY_kjR9rvB3dZ9dUAoa9mEp9P=aiYzy7jW1w24t2RUL5OUNUw@mail.gmail.com> (raw)
Hi Shubhrajyoti,
Overflow still occurs.
+static int clk_wzrd_dynamic_reconfig_f(struct clk_hw *hw, unsigned long rate,
+ unsigned long parent_rate)
+{
+ int err;
+ u32 value, pre;
+ unsigned long rate_div, f, clockout0_div;
+ struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw);
+ void __iomem *div_addr = divider->base + divider->offset;
+
+ rate_div = DIV_ROUND_DOWN_ULL(parent_rate * 1000, rate);
rate_div = DIV_ROUND_DOWN_ULL((u64)parent_rate * 1000, rate);
+ clockout0_div = rate_div / 1000;
+
+ pre = DIV_ROUND_CLOSEST((parent_rate * 1000), rate);
pre = DIV_ROUND_CLOSEST_ULL((u64)parent_rate * 1000, rate);
The rest looks good to me.
Thanks,
Zhengxun Li
next reply other threads:[~2021-04-21 8:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 16:58 Zhengxun Li [this message]
2021-04-21 16:58 ` [PATCH v11 2/5] clk: clocking-wizard: Add the clockwizard to clk directory Zhengxun Li
-- strict thread matches above, loose matches on Subject: below --
2021-04-08 12:58 [PATCH v11 0/5] clk: clocking-wizard: Driver updates Shubhrajyoti Datta
2021-04-08 12:58 ` [PATCH v11 2/5] clk: clocking-wizard: Add the clockwizard to clk directory Shubhrajyoti Datta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACY_kjR9rvB3dZ9dUAoa9mEp9P=aiYzy7jW1w24t2RUL5OUNUw@mail.gmail.com' \
--to=zhengxunli.mxic@gmail.com \
--cc=git@xilinx.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=michals@xilinx.com \
--cc=mturquette@baylibre.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=shubhrajyoti.datta@xilinx.com \
--cc=zhengxunli@mxic.com.tw \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.