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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 08:05:39 +0000 (09:05 +0100)
commit66a761e47319b61863845b28f7d9a1da6595d94e
tree40121d68a35082f9dcbb6af8b260f9cb045fccee
parentc6f85c6d007b7a189aefad5240cf15e141b0a0cb
clk: at91: clk-main: update key before writing AT91_CKGR_MOR

[ Upstream commit 85d071e7f19a6a9abf30476b90b3819642568756 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/at91/clk-main.c