Commit graph

3 commits

Author SHA1 Message Date
Jerzy Kasenberg f1e7a0dd6c drivers: clock_control: smartbond: Fix rc32k calibration
If RC32K oscillator was on during startup, calibration
work was never going to actually calibrate this oscillator.
It happen because lpc_clock_state.rc32k_started was only set when
oscillator was turned on after if was turned off.

Now lpc_clock_state.rc32k_started is also set when rc32k is already
started (possible during boot).

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2023-12-12 15:03:17 +01:00
Jerzy Kasenberg 7a9744e169 drivers: clock_control: smartbond: Add calibration
RCX and RC32K oscillators are not precisely trimmed.
This code allows to measure actual frequency of those two
oscillators.

Device tree binding were extended to specify calibration
interval. This interval (in seconds) is used to periodically
call work that will perform oscillator frequency measurement.

For XTAL32K settle time can be provided in device tree.
After this time (depending on actual oscillator used)
XTAL32K is assumed to be stable and low power clock driven by
XTAL32K is considered OK for precise usage in bluetooth.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2023-08-22 12:16:16 +02:00
Jerzy Kasenberg 884d7ea706 drivers: clock_control: smartbond: initial support
This commit adds basic support for the clock controller used in
SmartBond MCUs.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2023-04-05 15:09:04 +02:00