Lines Matching full:rtc
8 #include <drivers/rtc.h>
190 * struct rtc_device - RTC device data
191 * @base: RTC IOMEM base address
192 * @compat: RTC compatible data
193 * @pclk: RTC bus clock
194 * @rtc_ck: RTC kernel clock
195 * @conf_data: RTC RIF configuration data, when supported
196 * @nb_res: Number of protectible RTC resources
198 * @flags: RTC driver flags
199 * @is_secured: True if the RTC is fully secured
205 * @rtc: information for OP-TEE RTC device
222 struct rtc *rtc; member
225 /* Expect a single RTC instance */
267 * Number of subseconds in a second is linked to RTC PREDIV_S value.
337 panic("Bad RTC seccfgr configuration"); in apply_rif_config()
356 panic("Bad RTC privcfgr configuration"); in apply_rif_config()
452 panic("Not enough memory capacity for RTC RIF config"); in parse_dt()
468 * or the RTC is not secured. in parse_dt()
486 rtc_dev.rtc->is_wakeup_source = true; in parse_dt()
602 * 1 Hz output not possible, give priority to RTC power in stm32_rtc_init()
630 EMSG("Can't enter init mode. Fail to initialize RTC."); in stm32_rtc_init()
646 EMSG("Can't exit init mode. Fail to initialize RTC."); in stm32_rtc_init()
653 static TEE_Result stm32_rtc_get_time(struct rtc *rtc __unused, in stm32_rtc_get_time()
674 * In our RTC we start : in stm32_rtc_get_time()
692 static TEE_Result stm32_rtc_set_time(struct rtc *rtc, struct optee_rtc_time *tm) in stm32_rtc_set_time() argument
700 * In our RTC we start : in stm32_rtc_set_time()
723 (SHIFT_U32((tm->tm_year - rtc->range_min.tm_year) % 10, in stm32_rtc_set_time()
725 (SHIFT_U32((tm->tm_year - rtc->range_min.tm_year) / 10, in stm32_rtc_set_time()
821 static TEE_Result stm32_rtc_read_alarm(struct rtc *rtc, in stm32_rtc_read_alarm() argument
834 res = stm32_rtc_get_time(rtc, ¤t_tm); in stm32_rtc_read_alarm()
872 static TEE_Result stm32_rtc_enable_alarm(struct rtc *rtc __unused, bool enabled) in stm32_rtc_enable_alarm()
903 static TEE_Result stm32_rtc_valid_alarm_time(struct rtc *rtc, in stm32_rtc_valid_alarm_time() argument
912 * RTC alarm can't be set on a specific month and year. in stm32_rtc_valid_alarm_time()
917 res = stm32_rtc_get_time(rtc, ¤t_tm); in stm32_rtc_valid_alarm_time()
935 static TEE_Result stm32_rtc_set_alarm(struct rtc *rtc, in stm32_rtc_set_alarm() argument
946 /* tm_year and tm_mon are not used because not supported by RTC */ in stm32_rtc_set_alarm()
967 EMSG("RTC Alarm conditions not met"); in stm32_rtc_set_alarm()
973 res = stm32_rtc_valid_alarm_time(rtc, alarm_time); in stm32_rtc_set_alarm()
985 stm32_rtc_enable_alarm(rtc, alarm->enabled); in stm32_rtc_set_alarm()
992 static TEE_Result stm32_rtc_cancel_wait_alarm(struct rtc *rtc __unused) in stm32_rtc_cancel_wait_alarm()
1001 stm32_rtc_wait_alarm(struct rtc *rtc __unused, in stm32_rtc_wait_alarm()
1016 stm32_rtc_enable_alarm(rtc, 0); in stm32_rtc_wait_alarm()
1024 static TEE_Result stm32_rtc_set_alarm_wakeup_status(struct rtc *rtc __unused, in stm32_rtc_set_alarm_wakeup_status()
1027 if (!rtc_dev.rtc->is_wakeup_source) in stm32_rtc_set_alarm_wakeup_status()
1046 static struct rtc stm32_rtc = {
1059 rtc_dev.rtc = &stm32_rtc; in stm32_rtc_probe()
1073 /* Unbalanced clock enable to ensure RTC core clock is always on */ in stm32_rtc_probe()
1076 panic("Couldn't enable RTC clock"); in stm32_rtc_probe()
1084 panic("Could not enable RTC bus clock"); in stm32_rtc_probe()
1094 panic("Incompatible RTC RIF configuration"); in stm32_rtc_probe()
1154 .compatible = "st,stm32mp25-rtc",
1158 .compatible = "st,stm32mp1-rtc",
1162 .compatible = "st,stm32mp13-rtc",
1169 .name = "stm32-rtc",