linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: at91: sam9x60: fix programmable clock prescaler
@ 2019-12-10 11:25 Eugen.Hristev
  2020-01-06  3:07 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Eugen.Hristev @ 2019-12-10 11:25 UTC (permalink / raw)
  To: mturquette, sboyd, alexandre.belloni
  Cc: linux-kernel, Eugen.Hristev, linux-arm-kernel, linux-clk

From: Eugen Hristev <eugen.hristev@microchip.com>

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 45b06682113b ("clk: at91: fix programmable clock for sama5d2")
SAM9X60 has the same field as SAMA5D2 in the PCK

Fixes: 01e2113de9a5 ("clk: at91: add sam9x60 pmc driver")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
 drivers/clk/at91/sam9x60.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c
index 86238d5..77398ae 100644
--- a/drivers/clk/at91/sam9x60.c
+++ b/drivers/clk/at91/sam9x60.c
@@ -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 = {
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] clk: at91: sam9x60: fix programmable clock prescaler
  2019-12-10 11:25 [PATCH] clk: at91: sam9x60: fix programmable clock prescaler Eugen.Hristev
@ 2020-01-06  3:07 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2020-01-06  3:07 UTC (permalink / raw)
  To: Eugen.Hristev, alexandre.belloni, mturquette
  Cc: linux-kernel, Eugen.Hristev, linux-arm-kernel, linux-clk

Quoting Eugen.Hristev@microchip.com (2019-12-10 03:25:19)
> From: Eugen Hristev <eugen.hristev@microchip.com>
> 
> 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 45b06682113b ("clk: at91: fix programmable clock for sama5d2")
> SAM9X60 has the same field as SAMA5D2 in the PCK
> 
> Fixes: 01e2113de9a5 ("clk: at91: add sam9x60 pmc driver")
> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
> ---

Applied to clk-next


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-06  3:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 11:25 [PATCH] clk: at91: sam9x60: fix programmable clock prescaler Eugen.Hristev
2020-01-06  3:07 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).