]> git.baikalelectronics.ru Git - kernel.git/commitdiff
clk: mmp: frac: Allow setting bits other than the numerator/denominator
authorLubomir Rintel <lkundrak@v3.sk>
Tue, 19 May 2020 22:41:40 +0000 (00:41 +0200)
committerStephen Boyd <sboyd@kernel.org>
Thu, 28 May 2020 00:55:11 +0000 (17:55 -0700)
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>
drivers/clk/mmp/clk-frac.c
drivers/clk/mmp/clk.h

index ed9928f5bdc7f6408bdc25ee13412c7c0d548c3e..48f592bd633dfa150072654bcb76480580609882 100644 (file)
@@ -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);
        }
 
index 971b4d6d992fb774e4730e343aca7d34739c997a..0efd5b0b2f01bb13563cb9baabdcc335cc65dbe6 100644 (file)
@@ -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 {