clk: renesas: rzg2l: Add divider clock for RZ/G3S
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Fri, 6 Oct 2023 10:39:58 +0000 (13:39 +0300)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 10 Oct 2023 07:27:08 +0000 (09:27 +0200)
commit62b1feac485866494f111e3a6aa4a9ae03a7a2b9
tree6de93893edf441bc786fd46e005873aafa7dcf83
parent16b86e5c03c5b3ef35bf5126b35384faa97428f0
clk: renesas: rzg2l: Add divider clock for RZ/G3S

Add a divider clock driver for RZ/G3S.  This will be used on RZ/G3S for
the SDHI, SPI, OCTA, I, I2, I3, P0, P1, P2, and P3 core clocks.
The divider has some limitation for SDHI, OCTA and SPI clocks:
  - SDHI div cannot be 1 if parent rate is 800MHz,
  - OCTA, SPI div cannot be 1 if parent rate is 400MHz.
To handle these limitations, a notifier is registered from platform
specific clock driver, which makes sure proper actions are taken before
the clock rate is changed, when needed.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20231006103959.197485-4-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/clk/renesas/rzg2l-cpg.c
drivers/clk/renesas/rzg2l-cpg.h