Lines Matching +full:clock +full:- +full:divider
4 * SPDX-License-Identifier: Apache-2.0
12 #include <zephyr/dt-bindings/clock/imx_ccm_rev2.h>
21 uint32_t divider; in flexspi_clock_set_freq() local
35 return -ENOTSUP; in flexspi_clock_set_freq()
39 /* Get clock root frequency */ in flexspi_clock_set_freq()
41 /* Select a divider based on root clock frequency. We round the in flexspi_clock_set_freq()
42 * divider up, so that the resulting clock frequency is lower than in flexspi_clock_set_freq()
45 divider = ((root_rate + (rate - 1)) / rate); in flexspi_clock_set_freq()
46 /* Cap divider to max value */ in flexspi_clock_set_freq()
47 divider = MIN(divider, CCM_CLOCK_ROOT_CONTROL_DIV_MASK); in flexspi_clock_set_freq()
56 CLOCK_SetRootClockDiv(flexspi_clk, divider); in flexspi_clock_set_freq()