public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: rtc-linux@googlegroups.com
Cc: Alexander Stein <alexander.stein@systec-electronic.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	linux-kernel@vger.kernel.org
Subject: Re: [rtc-linux] [PATCH 1/2 RFC] rtc: Add ioctl to get/clear battery low voltage status
Date: Wed, 4 Apr 2012 15:23:47 -0700	[thread overview]
Message-ID: <20120404152347.2982ec50.akpm@linux-foundation.org> (raw)
In-Reply-To: <1329236025-31323-1-git-send-email-alexander.stein@systec-electronic.com>

On Tue, 14 Feb 2012 17:13:44 +0100
Alexander Stein <alexander.stein@systec-electronic.com> wrote:

> Currently there is no generic way to get the RTC battery status within
> an application. So add an ioctl to read the status bit.
> The idea is that the bit is set once a low voltage is detected. It stays
> there until it is reset using the RTC_VL_CLR ioctl.
> 
> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
> ---
>  include/linux/rtc.h |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/rtc.h b/include/linux/rtc.h
> index 93f4d03..1a6ec5f 100644
> --- a/include/linux/rtc.h
> +++ b/include/linux/rtc.h
> @@ -91,6 +91,9 @@ struct rtc_pll_info {
>  #define RTC_PLL_GET	_IOR('p', 0x11, struct rtc_pll_info)  /* Get PLL correction */
>  #define RTC_PLL_SET	_IOW('p', 0x12, struct rtc_pll_info)  /* Set PLL correction */
>  
> +#define RTC_VL_READ	_IOR('p', 0x13, int)	/* Voltage low detector */
> +#define RTC_VL_CLR	_IO('p', 0x14)		/* Clear voltage low information */
> +
>  /* interrupt flags */
>  #define RTC_IRQF 0x80	/* Any of the following is active */
>  #define RTC_PF 0x40	/* Periodic interrupt */

Looks good to me, but I'd like to hear from other RTC driver
maintainers, please.

Which other devices provide support for reading the batttery status,
and is the proposed interface suitable for their drivers?


      parent reply	other threads:[~2012-04-04 22:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14 16:13 [PATCH 1/2 RFC] rtc: Add ioctl to get/clear battery low voltage status Alexander Stein
2012-02-14 16:13 ` [PATCH 2/2 RFC] rtc-pcf8563: Add RTC_VL_READ/RTC_VL_CLR ioctl feature Alexander Stein
2012-04-04 22:27   ` [rtc-linux] " Andrew Morton
2012-04-05  9:59     ` Jesper Nilsson
2012-03-20 13:16 ` [PATCH 1/2 RFC] rtc: Add ioctl to get/clear battery low voltage status Alexander Stein
2012-04-04 22:23 ` Andrew Morton [this message]

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=20120404152347.2982ec50.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.zummo@towertech.it \
    --cc=alexander.stein@systec-electronic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.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