rtc: introduce features bitfield
Introduce a bitfield to allow the drivers to announce the available features for an RTC. The main use case would be to better handle alarms, that could be present or not or have a minute resolution or may need a correct week day to be set. Use the newly introduced RTC_FEATURE_ALARM bit to then test whether alarms are available instead of relying on the presence of ops->set_alarm. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210110231752.1418816-2-alexandre.belloni@bootlin.com
This commit is contained in:
parent
3be95d2774
commit
7ae41220ef
4 changed files with 18 additions and 6 deletions
|
|
@ -110,6 +110,11 @@ struct rtc_pll_info {
|
|||
#define RTC_AF 0x20 /* Alarm interrupt */
|
||||
#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */
|
||||
|
||||
/* feature list */
|
||||
#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_MAX_FREQ 8192
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue