Skip to content

Commit

Permalink
clk: mmp: frac: Allow setting bits other than the numerator/denominator
Browse files Browse the repository at this point in the history
For the I2S fractional clocks, there are more bits that need to be set
for the clock to run. Their actual meaning is unknown.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Link: https://lkml.kernel.org/r/20200519224151.2074597-3-lkundrak@v3.sk
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Lubomir Rintel authored and Stephen Boyd committed May 28, 2020
1 parent 06030c4 commit 5278acc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/clk/mmp/clk-frac.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ static int clk_factor_init(struct clk_hw *hw)
val &= ~(masks->den_mask << masks->den_shift);
val |= (factor->ftbl[0].den & masks->den_mask) <<
masks->den_shift;
}

if (!(val & masks->enable_mask) || i >= factor->ftbl_cnt) {
val |= masks->enable_mask;
writel(val, factor->base);
}

Expand Down
1 change: 1 addition & 0 deletions drivers/clk/mmp/clk.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct mmp_clk_factor_masks {
unsigned int den_mask;
unsigned int num_shift;
unsigned int den_shift;
unsigned int enable_mask;
};

struct mmp_clk_factor_tbl {
Expand Down

0 comments on commit 5278acc

Please sign in to comment.