linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] rtc: pcf8523: Make DSM for battery switch-over configurable from DT and enable it for the cubox-i
@ 2020-07-19 14:50 miguelborgesdefreitas
  2020-07-19 14:50 ` [PATCH 1/2] rtc: pcf8523: Make DSM for battery switch-over configurable from DT miguelborgesdefreitas
  2020-07-19 14:50 ` [PATCH 2/2] ARM: dts: imx6qdl-cubox-i: enable DSM for the RTC miguelborgesdefreitas
  0 siblings, 2 replies; 26+ messages in thread
From: miguelborgesdefreitas @ 2020-07-19 14:50 UTC (permalink / raw)
  To: a.zummo
  Cc: linux, alexandre.belloni, robh+dt, shawnguo, s.hauer, kernel,
	festevam, linux-imx, miguelborgesdefreitas, devicetree,
	linux-arm-kernel, linux-kernel

From: Miguel Borges de Freitas <miguelborgesdefreitas@gmail.com>

The pcf8523 has two configurable modes for the battery switch-over functionality:
(i) the default mode and (ii) the direct switching mode. For the default mode to work (at the
moment the only driver option), a filtering circuit consisting of a series resistor of 1 kOhm
and a capacitor of 3.3 microF must be added to the VDD pin input to guarantee a voltage drop
of less 0.7V/ms for the oscillator operation reliability (see pp.54 of the datasheet).
Some boards (e.g. the cubox-i) do not include such circuitry and are designed to work only in
direct switching mode. In fact, this is the recommended mode in the datasheet for hw designs
where VDD is always expected to be higher than VBAT.
If DSM is not enabled, after a power cycle, the voltage drop may be too high causing the
oscillator to stop working momentarily and the REG_SECONDS_OS bit to be set.
This causes userspace applications such as timedatectl and hwclock to fail when obtaining
the RTC time (RTC_RD_TIME: Invalid argument).
Hence, this patch set makes DSM configurable for the pcf8523 RTC in the device-tree and enables it
for the board where this issue was detected - the cubox-i. Note that if the RTC comes from an
inconsistent state, the software reset will override any power management options set during the
probe phase. Thus, pm is also enforced in pcf8523_start_rtc.


Miguel Borges de Freitas (2):
  rtc: pcf8523: Make DSM for battery switch-over configurable from DT
  ARM: dts: imx6qdl-cubox-i: enable DSM for the RTC

 Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt |  7 ++++++-
 Documentation/devicetree/bindings/rtc/rtc.yaml        |  7 +++++++
 arch/arm/boot/dts/imx6qdl-cubox-i.dtsi                |  1 +
 drivers/rtc/rtc-pcf8523.c                             | 13 ++++++++++---
 4 files changed, 24 insertions(+), 4 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2020-08-25 20:08 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-19 14:50 [PATCH 0/2] rtc: pcf8523: Make DSM for battery switch-over configurable from DT and enable it for the cubox-i miguelborgesdefreitas
2020-07-19 14:50 ` [PATCH 1/2] rtc: pcf8523: Make DSM for battery switch-over configurable from DT miguelborgesdefreitas
2020-07-19 14:50 ` [PATCH 2/2] ARM: dts: imx6qdl-cubox-i: enable DSM for the RTC miguelborgesdefreitas
2020-07-19 15:00   ` Baruch Siach
2020-07-20 11:23   ` [PATCH v2 0/3] rtc: pcf8523: imx6qdl-cubox-i: Make DSM for battery switch-over configurable from DT and enable it for the cubox-i miguelborgesdefreitas
2020-07-20 11:23     ` [PATCH v2 1/3] dt-bindings: rtc: pcf8523: add DSM pm option for battery switch-over miguelborgesdefreitas
2020-07-23 17:49       ` Rob Herring
2020-07-23 19:57         ` Alexandre Belloni
2020-07-23 20:41           ` Miguel Borges de Freitas
2020-07-27  9:19             ` Jon Nettleton
2020-07-27  9:45           ` Russell King - ARM Linux admin
2020-07-27 13:33             ` Jon Nettleton
2020-07-27 14:17               ` Russell King - ARM Linux admin
2020-07-27 14:52                 ` Jon Nettleton
2020-07-27 14:49             ` Alexandre Belloni
2020-07-27 15:24               ` Russell King - ARM Linux admin
2020-07-27 15:41                 ` Alexandre Belloni
2020-07-27 15:43                   ` Russell King - ARM Linux admin
2020-07-27 15:55                     ` Jon Nettleton
2020-07-27 16:16                       ` Alexandre Belloni
2020-07-27 17:04                         ` Jon Nettleton
2020-07-27 17:30                         ` Russell King - ARM Linux admin
2020-07-27 21:13                           ` Miguel Borges de Freitas
2020-08-25 20:08                             ` Alexandre Belloni
2020-07-20 11:24     ` [PATCH v2 2/3] rtc: pcf8523: Make DSM for battery switch-over configurable from DT miguelborgesdefreitas
2020-07-20 11:24     ` [PATCH v2 3/3] ARM: dts: imx6qdl-cubox-i: enable DSM for the RTC miguelborgesdefreitas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).