Lines Matching refs:pred_a
974 unsigned int prer, pred_a, pred_s, pred_a_max, pred_s_max, cr; in stm32_rtc_init() local
990 for (pred_a = 0; pred_a <= pred_a_max; pred_a++) { in stm32_rtc_init()
991 pred_s = (rate / (pred_a + 1)) - 1; in stm32_rtc_init()
993 if (pred_s <= pred_s_max && ((pred_s + 1) * (pred_a + 1)) == rate) in stm32_rtc_init()
997 for (pred_a = pred_a_max; pred_a + 1 > 0; pred_a--) { in stm32_rtc_init()
998 pred_s = (rate / (pred_a + 1)) - 1; in stm32_rtc_init()
1000 if (((pred_s + 1) * (pred_a + 1)) == rate) in stm32_rtc_init()
1009 if (pred_s > pred_s_max || pred_a > pred_a_max) { in stm32_rtc_init()
1010 pred_a = pred_a_max; in stm32_rtc_init()
1011 pred_s = (rate / (pred_a + 1)) - 1; in stm32_rtc_init()
1014 (rate < ((pred_a + 1) * (pred_s + 1))) ? in stm32_rtc_init()
1025 pred_a = (pred_a << STM32_RTC_PRER_PRED_A_SHIFT) & in stm32_rtc_init()
1029 if ((cr & STM32_RTC_CR_FMT) == 0 && prer == (pred_s | pred_a)) in stm32_rtc_init()
1042 writel_relaxed(pred_a | pred_s, rtc->base + regs->prer); in stm32_rtc_init()