Integrate linux-imx-kuk/backport-bsm-support-for-RTC
Commit: seco-ne/kernel/linux-imx-kuk@2385e71b
dts/dual-espresso: use new backup-switch-mode node for rv3028 RTC
dual-espresso uses RTC RV3028 whose factory-default for the BSM is disabled. This new devicetree entry makes sure to always set it to DSM mode, which is required for the proper function of the boot selection.
BCS 746-001336
--
Commit: seco-ne/kernel/linux-imx-kuk@92daec58
rtc: rv3028: add support for setting BSM mode in device tree
This commit adds the devicetree node "backup-switch-mode" to the rv3028 driver. It supports the following values:
- direct
- level
- disabled
The values correspond to the different BSM options in the datasheet. When the setting is present in the devicetree, the driver checks the current mode during the probing phase. If the desired value differs from the current value, it is written to the RTC and a message is printed to dmesg, stating the new mode.
BCS 746-001336
--
Commit: seco-ne/kernel/linux-imx-kuk@f6f84368
rtc: rv3028: Fix codestyle errors
Compiler warnings:
drivers/rtc/rtc-rv3028.c: In function 'rv3028_param_set': drivers/rtc/rtc-rv3028.c:559:20: warning: statement will never be executed [-Wswitch-unreachable] 559 | u8 mode; | ^~~~ drivers/rtc/rtc-rv3028.c: In function 'rv3028_param_get': drivers/rtc/rtc-rv3028.c:526:21: warning: statement will never be executed [-Wswitch-unreachable] 526 | u32 value; | ^~~~~
Fix it by moving the variable declaration to the beginning of the function.
Cc: Alessandro Zummo a.zummo@towertech.it Cc: Alexandre Belloni alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reported-by: k2ci kernel-bot@kylinos.cn Signed-off-by: Ke Sun sunke@kylinos.cn Link: https://lore.kernel.org/r/20221008071321.1799971-1-sunke@kylinos.cn Signed-off-by: Alexandre Belloni alexandre.belloni@bootlin.com
--
Commit: seco-ne/kernel/linux-imx-kuk@6466aa50
rtc: rv3028: add BSM support
Backup Switch Mode controls how the RTC decides when to switch to the backup power supply. As it is disabled by default, provide a way to enable and configure it.
Signed-off-by: Alexandre Belloni alexandre.belloni@bootlin.com Link: https://lore.kernel.org/r/20211018151933.76865-7-alexandre.belloni@bootlin.com
--
Commit: seco-ne/kernel/linux-imx-kuk@8e95d93f
rtc: add BSM parameter
BSM or Backup Switch Mode is a common feature on RTCs, allowing to select how the RTC will decide when to switch from its primary power supply to the backup power supply. It is necessary to be able to set it from userspace as there are uses cases where it has to be done dynamically.
Supported values are: RTC_BSM_DISABLED: disabled RTC_BSM_DIRECT: switching will happen as soon as Vbackup > Vdd RTC_BSM_LEVEL: switching will happen around a threshold, usually with an hysteresis RTC_BSM_STANDBY: switching will not happen until Vdd > Vbackup, this is useful to ensure the RTC doesn't draw any power until the device is first powered on.
Signed-off-by: Alexandre Belloni alexandre.belloni@bootlin.com Link: https://lore.kernel.org/r/20211018151933.76865-6-alexandre.belloni@bootlin.com
--
Commit: seco-ne/kernel/linux-imx-kuk@e673a92b
rtc: add correction parameter
Add a new parameter allowing the get and set the correction using ioctls instead of just sysfs.
Signed-off-by: Alexandre Belloni alexandre.belloni@bootlin.com Link: https://lore.kernel.org/r/20211018151933.76865-5-alexandre.belloni@bootlin.com
--
Commit: seco-ne/kernel/linux-imx-kuk@880dce44
rtc: expose correction feature
Add a new feature for RTCs able to correct the oscillator imprecision. This is also called offset or trimming. Such drivers have a .set_offset callback, use that to set the feature bit from the core.
Signed-off-by: Alexandre Belloni alexandre.belloni@bootlin.com Link: https://lore.kernel.org/r/20211018151933.76865-4-alexandre.belloni@bootlin.com
--
Commit: seco-ne/kernel/linux-imx-kuk@c6173ca9
rtc: add parameter ioctl
Add an ioctl allowing to get and set extra parameters for an RTC. For now, only handle getting available features.
Signed-off-by: Alexandre Belloni alexandre.belloni@bootlin.com Link: https://lore.kernel.org/r/20211018151933.76865-3-alexandre.belloni@bootlin.com
--
Commit: seco-ne/kernel/linux-imx-kuk@50fe7054
rtc: add alarm related features
Add more alarm related features to be declared by drivers.
Signed-off-by: Alexandre Belloni alexandre.belloni@bootlin.com Link: https://lore.kernel.org/r/20211018151933.76865-2-alexandre.belloni@bootlin.com