clk: at91: clk-main: update key before writing AT91_CKGR_MOR
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Tue, 25 Aug 2020 06:59:10 +0000 (09:59 +0300)
committerStephen Boyd <sboyd@kernel.org>
Wed, 14 Oct 2020 02:59:01 +0000 (19:59 -0700)
commit85d071e7f19a6a9abf30476b90b3819642568756
tree5a24c02bd18829f39e874fdce1c46518db2a76b3
parenteddfb2e1eed6440db9ee36cc4d2a0abeeabeb942
clk: at91: clk-main: update key before writing AT91_CKGR_MOR

SAMA5D2 datasheet specifies on chapter 33.22.8 (PMC Clock Generator
Main Oscillator Register) that writing any value other than
0x37 on KEY field aborts the write operation. Use the key when
selecting main clock parent.

Fixes: 27cb1c2083373 ("clk: at91: rework main clk implementation")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/1598338751-20607-3-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/at91/clk-main.c