Linux RTC
 help / color / mirror / Atom feed
From: Stefan Kerkmann <s.kerkmann@pengutronix.de>
To: Hugo Villeneuve <hugo@hugovil.com>, alexandre.belloni@bootlin.com
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
	bruno.thomsen@gmail.com, giampiero@sferalabs.cc,
	p.rosenberger@kunbus.com, antonio@amsobr.com,
	Hugo Villeneuve <hvilleneuve@dimonoff.com>
Subject: Re: [PATCH 0/4] rtc: pcf2127: add support for battery low voltage detection
Date: Wed, 29 Jul 2026 17:18:59 +0200	[thread overview]
Message-ID: <84b6915f-328f-49b4-8466-1ea27a839cf3@pengutronix.de> (raw)
In-Reply-To: <20260311200237.3531981-1-hugo@hugovil.com>

Hello Hugo,

On 3/11/26 21:02, Hugo Villeneuve wrote:
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> 
> Hello,
> this patch series adds support for battery low voltage detection configuration
> for RTC devicesm, with specifc changes targeted at the pcf2127/2131 devices.
> 
> The origin of this patch goes back to the initial commit to add support for the
> PCF2131 device. On the PCF2131, the battery low voltage detection is disabled by
> default at the hardware level, contrary to the PCF2127 where it is enabled by
> default. Because of that, a lot of people are stuck with a PCF2131 RTC device
> using a battery backup, but unable to use it!
> 
> A lot of people are writing to me in private emails to report this as a bug
> in the PCF2131 driver. Others (and me) have proposed to implement device tree
> properties to enable these functions, but this was rejected [1][2][3].
> 
> It is important to note that some projects do not have the luxury to modify
> the bootloder to enable that function at boot, and for these having a DT
> property that could be put in a DT overlay would simplify a lot their life.
> Also having to rely on a userspace application to configure the RTC is also
> not ideal, as some projects use stock Debian distros (for example), and
> adding a new application to their repository is not trivial or easy.
> 
> So as the next best thing, this patch aims to add what is missing in the driver,
> the ability to enable/disable the battery low voltage detection with ioctls,
> similarly to what is done with the BSM.
> 

Thank you for the series. We have customer that has this exact use case:

Enabling the backup battery switch-over and low battery detection on a pcf2131 
rtc. With util-linux's hwclock the former can already be enabled e.g. hwclock 
--param-set bsm <xyz> and for the later this patch series would enable it as well.

> This patch has been tested on a custom board with a PCF2131 and using my
> userspace application:
> 
>      git clone -b batlow_param git@git.hugovil.com:repos/hvrtc.git
> 

If this series gets merged I can sent a PR to util-linux to enable the low 
battery detection via hwclock as well.

> Thank you.
> 
> Link: https://lore.kernel.org/linux-rtc/20190910143945.9364-1-bruno.thomsen@gmail.com/ [1]
> Link: https://lore.kernel.org/linux-rtc/20191211163354.GC1463890@piout.net/ [2]
> Link: https://lore.kernel.org/linux-rtc/20230123170731.6064430c50f5fb7b484d8734@hugovil.com/ [3]
> 
> Hugo Villeneuve (4):
>    rtc: pcf2127: remove redundant break statement in switch-case
>    rtc: pcf2127: add pcf2127_pwrmng_get/set
>    rtc: add battery low voltage detection feature
>    rtc: pcf2127: support battery low voltage detection function
> 
>   drivers/rtc/rtc-pcf2127.c | 94 ++++++++++++++++++++++++++++++---------
>   include/uapi/linux/rtc.h  |  7 ++-
>   2 files changed, 80 insertions(+), 21 deletions(-)
> 
> 
> base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f

Best regards,
Stefan

-- 
Pengutronix e.K.                       | Stefan Kerkmann             |
Steuerwalder Str. 21                   | https://www.pengutronix.de/ |
31137 Hildesheim, Germany              | Phone: +49-5121-206917-128  |
Amtsgericht Hildesheim, HRA 2686       | Fax:   +49-5121-206917-9    |


  parent reply	other threads:[~2026-07-29 15:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 20:02 [PATCH 0/4] rtc: pcf2127: add support for battery low voltage detection Hugo Villeneuve
2026-03-11 20:02 ` [PATCH 1/4] rtc: pcf2127: remove redundant break statement in switch-case Hugo Villeneuve
2026-03-11 20:02 ` [PATCH 2/4] rtc: pcf2127: add pcf2127_pwrmng_get/set Hugo Villeneuve
2026-08-06 12:53   ` Stefan Kerkmann
2026-03-11 20:02 ` [PATCH 3/4] rtc: add battery low voltage detection feature Hugo Villeneuve
2026-08-06 12:55   ` Stefan Kerkmann
2026-03-11 20:02 ` [PATCH 4/4] rtc: pcf2127: support battery low voltage detection function Hugo Villeneuve
2026-08-06 12:55   ` Stefan Kerkmann
2026-07-29 15:18 ` Stefan Kerkmann [this message]
2026-08-25 12:59   ` [PATCH 0/4] rtc: pcf2127: add support for battery low voltage detection Hugo Villeneuve
2026-08-25  7:31 ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84b6915f-328f-49b4-8466-1ea27a839cf3@pengutronix.de \
    --to=s.kerkmann@pengutronix.de \
    --cc=alexandre.belloni@bootlin.com \
    --cc=antonio@amsobr.com \
    --cc=bruno.thomsen@gmail.com \
    --cc=giampiero@sferalabs.cc \
    --cc=hugo@hugovil.com \
    --cc=hvilleneuve@dimonoff.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=p.rosenberger@kunbus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox