Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: clk: fix K230 clk driver, use 64bit unsigend integer #161

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions drivers/clk/clk-k230.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ static unsigned long k230_clk_composite_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
struct k230_clk_composite *k230_composite = to_k230_clk_composite(hw);
uint32_t reg_mul;
uint32_t reg_div;
uint32_t rate_mul;
uint32_t rate_div;
uint64_t reg_mul;
uint64_t reg_div;
uint64_t rate_mul;
uint64_t rate_div;
unsigned long flags;

/* no divider */
Expand Down Expand Up @@ -890,8 +890,8 @@ static unsigned long k230_clk_pll_recalc_rate(struct clk_hw *hw,
{
struct k230_clk_pll *k230_pll = to_k230_clk_pll(hw);
unsigned long rate;
uint32_t pll_divide_value;
uint32_t fb_div, ref_div, out_div;
uint64_t pll_divide_value;
uint64_t fb_div, ref_div, out_div;
unsigned long flags;

/* lock dual cores */
Expand Down Expand Up @@ -1598,10 +1598,10 @@ static int pll_show_register_show(struct seq_file *s, void *data)
{
struct clk_hw *hw = s->private;
struct k230_clk_pll *k230_pll = to_k230_clk_pll(hw);
int reg_value;
int fb_div = 0;
int ref_div = 0;
int out_div = 0;
uint32_t reg_value;
uint64_t fb_div = 0;
uint64_t ref_div = 0;
uint64_t out_div = 0;

seq_puts(s, "1. rate info:\n");
seq_puts(s, "--------------\n");
Expand All @@ -1615,12 +1615,12 @@ static int pll_show_register_show(struct seq_file *s, void *data)
k230_pll->pll_ref_div_mask;
fb_div = (reg_value >> k230_pll->pll_fb_div_shift) &
k230_pll->pll_fb_div_mask;
seq_printf(s, " out_div : %d\n", out_div);
seq_printf(s, " ref_div : %d\n", ref_div);
seq_printf(s, " fb_div : %d\n", fb_div);
seq_printf(s, " out_div : %llu\n", out_div);
seq_printf(s, " ref_div : %llu\n", ref_div);
seq_printf(s, " fb_div : %llu\n", fb_div);
seq_printf(
s,
" freq = 24M * (fb_div+1) / (ref_div+1) / (out_div+1) = %d\n",
" freq = 24M * (fb_div+1) / (ref_div+1) / (out_div+1) = %llu\n",
24000000 * (fb_div + 1) / (ref_div + 1) / (out_div + 1));
seq_puts(s, "--------------\n\n");

Expand Down
Loading