Skip to content

Commit

Permalink
clk: at91: sam9x60: fix programmable clock prescaler
Browse files Browse the repository at this point in the history
The prescaler works as parent rate divided by (PRES + 1) (is_pres_direct == 1)
It does not work in the way of parent rate shifted to the right by (PRES + 1),
which means division by 2^(PRES + 1) (is_pres_direct == 0)
Thus is_pres_direct must be enabled for this SoC, to make the right computation.
This field was added in
commit 45b0668 ("clk: at91: fix programmable clock for sama5d2")
SAM9X60 has the same field as SAMA5D2 in the PCK

Fixes: 01e2113 ("clk: at91: add sam9x60 pmc driver")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Link: https://lkml.kernel.org/r/1575977088-16781-1-git-send-email-eugen.hristev@microchip.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Eugen Hristev authored and Stephen Boyd committed Jan 6, 2020
1 parent db2f448 commit 66d9f52
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/clk/at91/sam9x60.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static const struct clk_programmable_layout sam9x60_programmable_layout = {
.pres_shift = 8,
.css_mask = 0x1f,
.have_slck_mck = 0,
.is_pres_direct = 1,
};

static const struct clk_pcr_layout sam9x60_pcr_layout = {
Expand Down

0 comments on commit 66d9f52

Please sign in to comment.