]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: sun6i: Make external 32k oscillator optional
authorJernej Skrabec <jernej.skrabec@siol.net>
Sun, 8 Mar 2020 13:58:48 +0000 (14:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:44:12 +0000 (16:44 +0100)
commitef2ca1ac15ac592041613caacccc292e4aa0122a
tree121b61ec2eaeff6b3a8214939916ab1b290bb1ed
parent33cdecedb1227ff117961a8faf85290669405d06
rtc: sun6i: Make external 32k oscillator optional

[ Upstream commit 5da83b3aa133bcda526ab3a1e86a916ca8a935f4 ]

Some boards, like OrangePi PC2 (H5), OrangePi Plus 2E (H3) and Tanix TX6
(H6) don't have external 32kHz oscillator. Till H6, it didn't really
matter if external oscillator was enabled because HW detected error and
fall back to internal one. H6 has same functionality but it's the first
SoC which have "auto switch bypass" bit documented and always enabled in
driver. This prevents RTC to work correctly if external crystal is not
present on board. There are other side effects - all peripherals which
depends on this clock also don't work (HDMI CEC for example).

Make clocks property optional. If it is present, select external
oscillator. If not, stay on internal.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20200308135849.106333-2-jernej.skrabec@siol.net
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Stable-dep-of: 344f4030f6c5 ("rtc: sun6i: Always export the internal oscillator")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rtc/rtc-sun6i.c