linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: linux-rtc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Subject: [PATCH 01/17] rtc: define RTC_VL_READ values
Date: Sat, 14 Dec 2019 23:02:43 +0100	[thread overview]
Message-ID: <20191214220259.621996-2-alexandre.belloni@bootlin.com> (raw)
In-Reply-To: <20191214220259.621996-1-alexandre.belloni@bootlin.com>

Currently, the meaning of the value returned by RTC_VL_READ is undocumented
and left to the driver implementation. In order to get more meaningful
values, define a set of values to use as to make clear to userspace what is
the status of the various voltages feeding the RTC.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 include/uapi/linux/rtc.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/rtc.h b/include/uapi/linux/rtc.h
index 2ad1788968d0..095af360326a 100644
--- a/include/uapi/linux/rtc.h
+++ b/include/uapi/linux/rtc.h
@@ -92,7 +92,12 @@ 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_DATA_INVALID	BIT(0) /* Voltage too low, RTC data is invalid */
+#define RTC_VL_BACKUP_LOW	BIT(1) /* Backup voltage is low */
+#define RTC_VL_BACKUP_EMPTY	BIT(2) /* Backup empty or not present */
+#define RTC_VL_ACCURACY_LOW	BIT(3) /* Voltage is low, RTC accuracy is reduced */
+
+#define RTC_VL_READ	_IOR('p', 0x13, unsigned int)	/* Voltage low detection */
 #define RTC_VL_CLR	_IO('p', 0x14)		/* Clear voltage low information */
 
 /* interrupt flags */
-- 
2.23.0


  reply	other threads:[~2019-12-14 22:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 22:02 [PATCH 00/17] rtc: Unify RTC_VL_READ meaning Alexandre Belloni
2019-12-14 22:02 ` Alexandre Belloni [this message]
2019-12-14 22:02 ` [PATCH 02/17] rtc: Document RTC_VL_READ and RTC_VL_CLR ioctls Alexandre Belloni
2019-12-14 22:02 ` [PATCH 03/17] rtc: abx80x: return meaningful value for RTC_VL_READ Alexandre Belloni
2019-12-14 22:02 ` [PATCH 04/17] rtc: pcf2127: " Alexandre Belloni
2019-12-14 22:02 ` [PATCH 05/17] rtc: pcf8523: " Alexandre Belloni
2019-12-14 22:02 ` [PATCH 06/17] rtc: pcf8563: remove RTC_VL_CLR handling Alexandre Belloni
2019-12-14 22:02 ` [PATCH 07/17] rtc: pcf8563: remove conditional compilation Alexandre Belloni
2019-12-14 22:02 ` [PATCH 08/17] rtc: pcf8563: stop caching voltage_low Alexandre Belloni
2019-12-14 22:02 ` [PATCH 09/17] rtc: pcf8563: return meaningful value for RTC_VL_READ Alexandre Belloni
2019-12-14 22:02 ` [PATCH 10/17] rtc: pcf85063: remove RTC_VL_CLR handling Alexandre Belloni
2019-12-14 22:02 ` [PATCH 11/17] rtc: pcf85063: return meaningful value for RTC_VL_READ Alexandre Belloni
2019-12-14 22:02 ` [PATCH 12/17] rtc: rv3028: remove RTC_VL_CLR handling Alexandre Belloni
2019-12-14 22:02 ` [PATCH 13/17] rtc: rv3028: return meaningful value for RTC_VL_READ Alexandre Belloni
2019-12-14 22:02 ` [PATCH 14/17] rtc: rv8803: avoid clearing RV8803_FLAG_V2F in RTC_VL_CLR Alexandre Belloni
2019-12-14 22:02 ` [PATCH 15/17] rtc: rv8803: return meaningful value for RTC_VL_READ Alexandre Belloni
2019-12-14 22:02 ` [PATCH 16/17] rtc: rx8010: remove RTC_VL_CLR handling Alexandre Belloni
2019-12-14 22:02 ` [PATCH 17/17] rtc: rx8010: return meaningful value for RTC_VL_READ Alexandre Belloni

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=20191214220259.621996-2-alexandre.belloni@bootlin.com \
    --to=alexandre.belloni@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).