Merge tag 'rtc-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni:
"This includes new ioctls to get and set parameters and in particular
the backup switch mode that is needed for some RTCs to actually enable
the backup voltage (and have a useful RTC).
The same interface can also be used to get the actual features
supported by the RTC so userspace has a better way than trying and
failing.
Summary:
Subsystem:
- Add new ioctl to get and set extra RTC parameters, this includes
backup switch mode
- Expose available features to userspace, in particular, when alarmas
have a resolution of one minute instead of a second.
- Let the core handle those alarms with a minute resolution
New driver:
- MSTAR MSC313 RTC
Drivers:
- Add SPI ID table where necessary
- Add BSM support for rv3028, rv3032 and pcf8523
- s3c: set RTC range
- rx8025: set range, implement .set_offset and .read_offset"
* tag 'rtc-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (50 commits)
rtc: rx8025: use .set_offset/.read_offset
rtc: rx8025: use rtc_add_group
rtc: rx8025: clear RTC_FEATURE_ALARM when alarm are not supported
rtc: rx8025: set range
rtc: rx8025: let the core handle the alarm resolution
rtc: rx8025: switch to devm_rtc_allocate_device
rtc: ab8500: let the core handle the alarm resolution
rtc: ab-eoz9: support UIE when available
rtc: ab-eoz9: use RTC_FEATURE_UPDATE_INTERRUPT
rtc: rv3032: let the core handle the alarm resolution
rtc: s35390a: let the core handle the alarm resolution
rtc: handle alarms with a minute resolution
rtc: pcf85063: silence cppcheck warning
rtc: rv8803: fix writing back ctrl in flag register
rtc: s3c: Add time range
rtc: s3c: Extract read/write IO into separate functions
rtc: s3c: Remove usage of devm_rtc_device_register()
rtc: tps80031: Remove driver
rtc: sun6i: Allow probing without an early clock provider
rtc: pcf8523: add BSM support
...
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <linux/const.h>
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* The struct used to pass data via the following ioctl. Similar to the
|
||||
@@ -66,6 +67,17 @@ struct rtc_pll_info {
|
||||
long pll_clock; /* base PLL frequency */
|
||||
};
|
||||
|
||||
struct rtc_param {
|
||||
__u64 param;
|
||||
union {
|
||||
__u64 uvalue;
|
||||
__s64 svalue;
|
||||
__u64 ptr;
|
||||
};
|
||||
__u32 index;
|
||||
__u32 __pad;
|
||||
};
|
||||
|
||||
/*
|
||||
* ioctl calls that are permitted to the /dev/rtc interface, if
|
||||
* any of the RTC drivers are enabled.
|
||||
@@ -95,6 +107,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_PARAM_GET _IOW('p', 0x13, struct rtc_param) /* Get parameter */
|
||||
#define RTC_PARAM_SET _IOW('p', 0x14, struct rtc_param) /* Set parameter */
|
||||
|
||||
#define RTC_VL_DATA_INVALID _BITUL(0) /* Voltage too low, RTC data is invalid */
|
||||
#define RTC_VL_BACKUP_LOW _BITUL(1) /* Backup voltage is low */
|
||||
#define RTC_VL_BACKUP_EMPTY _BITUL(2) /* Backup empty or not present */
|
||||
@@ -114,7 +129,21 @@ struct rtc_pll_info {
|
||||
#define RTC_FEATURE_ALARM 0
|
||||
#define RTC_FEATURE_ALARM_RES_MINUTE 1
|
||||
#define RTC_FEATURE_NEED_WEEK_DAY 2
|
||||
#define RTC_FEATURE_CNT 3
|
||||
#define RTC_FEATURE_ALARM_RES_2S 3
|
||||
#define RTC_FEATURE_UPDATE_INTERRUPT 4
|
||||
#define RTC_FEATURE_CORRECTION 5
|
||||
#define RTC_FEATURE_BACKUP_SWITCH_MODE 6
|
||||
#define RTC_FEATURE_CNT 7
|
||||
|
||||
/* parameter list */
|
||||
#define RTC_PARAM_FEATURES 0
|
||||
#define RTC_PARAM_CORRECTION 1
|
||||
#define RTC_PARAM_BACKUP_SWITCH_MODE 2
|
||||
|
||||
#define RTC_BSM_DISABLED 0
|
||||
#define RTC_BSM_DIRECT 1
|
||||
#define RTC_BSM_LEVEL 2
|
||||
#define RTC_BSM_STANDBY 3
|
||||
|
||||
#define RTC_MAX_FREQ 8192
|
||||
|
||||
|
||||
Reference in New Issue
Block a user