clk: si5341: Wait for DEVICE_READY on startup
authorRobert Hancock <robert.hancock@calian.com>
Thu, 25 Mar 2021 19:26:36 +0000 (13:26 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 15:07:22 +0000 (17:07 +0200)
commit91a1de176b941fcbcff9d4573411b2df8a22d228
tree80569c08ac13956a23adbc35a6635ce3b8800427
parent884a3988922881037c581941f3f144a3fbdead15
clk: si5341: Wait for DEVICE_READY on startup

[ Upstream commit 6e7d2de1e000d36990923ed80d2e78dfcb545cee ]

The Si5341 datasheet warns that before accessing any other registers,
including the PAGE register, we need to wait for the DEVICE_READY register
to indicate the device is ready, or the process of the device loading its
state from NVM can be corrupted. Wait for DEVICE_READY on startup before
continuing initialization. This is done using a raw I2C register read
prior to setting up regmap to avoid any potential unwanted automatic PAGE
register accesses from regmap at this stage.

Fixes: 3044a860fd ("clk: Add Si5341/Si5340 driver")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20210325192643.2190069-3-robert.hancock@calian.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/clk-si5341.c