Lines Matching +full:max +full:- +full:bus +full:- +full:freq

5  * SPDX-License-Identifier: Apache-2.0
40 {.bus = STM32_SRC_LSI, .enr = LPTIM1_SEL(1)}
42 {.bus = STM32_SRC_LSE, .enr = LPTIM1_SEL(3)}
54 * - system clock based on an LPTIM instance, clocked by LSI or LSE
55 * - prescaler is set to a 2^value from 1 (division of the LPTIM source clock by 1)
57 * - using LPTIM AutoReload capability to trig the IRQ (timeout irq)
58 * - when timeout irq occurs the counter is already reset
59 * - the maximum timeout duration is reached with the lptim_time_base value
60 * - with prescaler of 1, the max timeout (LPTIM_TIMEBASE) is 2 seconds:
61 * 0xFFFF / (LSE freq (32768Hz) / 1)
62 * - with prescaler of 128, the max timeout (LPTIM_TIMEBASE) is 256 seconds:
63 * 0xFFFF / (LSE freq (32768Hz) / 128)
88 (COND_CODE_1(CONFIG_SMP, (arch_curr_cpu()->id), (_current_cpu->id)))
212 if (next->state == PM_STATE_SUSPEND_TO_RAM) { in sys_clock_set_timeout()
217 if ((next->state == PM_STATE_SUSPEND_TO_IDLE) && (next->substate_id == 4)) { in sys_clock_set_timeout()
235 * Needed rump-up/setting time, lower accurency etc. should be in sys_clock_set_timeout()
236 * included in the exit-latency in the power state definition. in sys_clock_set_timeout()
259 * When CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE = y, ticks equals to -1 in sys_clock_set_timeout()
282 ticks = CLAMP(ticks - 1, 1, lptim_time_base); in sys_clock_set_timeout()
293 || ((autoreload - lp_time) < LPTIM_GUARD_VALUE)) { in sys_clock_set_timeout()
324 next_arr = next_arr - 1; in sys_clock_set_timeout()
337 /* In case of counter roll-over, add the autoreload value, in sys_clock_lp_time_get()
412 return -ENODEV; in sys_clock_driver_init()
415 /* Enable LPTIM bus clock */ in sys_clock_driver_init()
418 return -EIO; in sys_clock_driver_init()
430 return -EIO; in sys_clock_driver_init()
433 /* Get LPTIM clock freq */ in sys_clock_driver_init()
438 return -EIO; in sys_clock_driver_init()
441 /* Driver only supports freqs up to 32768Hz. On L0, LSI freq is 37KHz, in sys_clock_driver_init()
448 if (lptim_clk[1].bus == STM32_SRC_LSI) { in sys_clock_driver_init()
457 * max lptim period is 0xFFFF/(lptim_clock_freq/lptim_clock_presc) in sys_clock_driver_init()
461 return -EIO; in sys_clock_driver_init()
473 /* Set LPTIM time base based on clock source freq */ in sys_clock_driver_init()
479 return -EIO; in sys_clock_driver_init()
500 /* Actual lptim clock freq when the clock source is reduced by the prescaler */ in sys_clock_driver_init()
516 /* the LPTIM clock freq is affected by the prescaler */ in sys_clock_driver_init()
543 /* LPTIM interrupt set-up before enabling */ in sys_clock_driver_init()
574 lptim_set_autoreload(count_per_tick - 1); in sys_clock_driver_init()
621 (counter_get_top_value(stdby_timer) - stdby_timer_pre_stdby) + in sys_clock_idle_exit()
625 stdby_timer_diff = stdby_timer_post - stdby_timer_pre_stdby; in sys_clock_idle_exit()