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 09:08:07 +0000 (10:08 +0100)
commit2290bfef3bbe84cc4fed51a8e25cd73043bb208e
treeb2003fb6689ab1ce37cf013212d9d12506453bba
parent963fc20cf561fdffbd36d6bffdacb4294ffbedf5
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