Re: [PATCH v7 2/3] rtc: sophgo: add rtc support for Sophgo CV1800 SoC

From: Alexandre Belloni
Date: Mon Jan 22 2024 - 03:17:39 EST


On 22/01/2024 16:06:30+0800, Jingbao Qiu wrote:
> Implement the RTC driver for CV1800, which able to provide time alarm
> and calibrate functionality.
>
> Signed-off-by: Jingbao Qiu <qiujingbao.dlmu@xxxxxxxxx>
> ---
>
> Depends on https://lore.kernel.org/all/IA1PR20MB4953C774D41EDF1EADB6EC18BB6D2@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/

What is the dependency?


Also, please fix the checkpatch.pl --strict warnings

> +/**
> + * cv1800_rtc_32k_coarse_val_calib() - Using an external
> + * clock to coarse calibrate the crystal oscillator
> + * @info: the device of calibrated
> + *
> + * @return 0 on success, or -1 on fail
> + *
> + * This RTC has an independent 32KHz oscillator. However,
> + * the accuracy of this oscillator is easily affected by
> + * external environmental interference,resulting in lower
> + * accuracy than the internal oscillator.Therefore, a 25M
> + * crystal oscillator is used as a reference source to
> + * calibrate the RTC and improve its accuracy.Calibration
> + * is completed through two steps, namely rough calibration
> + * and fine calibration.
> + */
> +static int cv1800_rtc_32k_coarse_val_calib(struct cv1800_rtc_priv *info)

This is still not working as well as you think it is. You should
Implement the offset callbacks instead.


--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com