Functions for Clock Driver. More...
Functions | |
| clk_status_en | clk_init_tree (clk_pll_config_en pll_config) |
| clk_status_en | clk_enable (clk_ids_en clk_id) |
| clk_status_en | clk_disable (clk_ids_en clk_id) |
| clk_status_en | clk_force_disable (clk_ids_en clk_id) |
| clk_status_en | clk_is_enabled (clk_ids_en clk_id, clk_enable_status_en *out_status) |
| clk_status_en | clk_get_rate (clk_ids_en clk_id, uint32_t *rate) |
| clk_status_en | clk_set_rate (clk_ids_en clk_id, uint32_t requested_rate, uint32_t *actual_rate) |
| clk_status_en | clk_get_divider (clk_ids_en clk_id, int32_t *divider) |
| clk_status_en | clk_set_pll_config (clk_pll_en pll, clk_pll_config_en pll_config) |
| clk_status_en | clk_get_pll_config (clk_pll_en pll, clk_pll_config_en *pll_config) |
| clk_status_en | clk_set_mux (clk_ids_en clk_id, uint8_t mux_out) |
Functions for Clock Driver.
| clk_status_en clk_init_tree | ( | clk_pll_config_en | pll_config | ) |
Initializes the clock tree with the specified PLL configuration.
| pll_config | PLL configuration to apply. Valid values:
|
| clk_status_en clk_enable | ( | clk_ids_en | clk_id | ) |
Enables the specified clock.
| clk_id | Clock ID to enable. |
| clk_status_en clk_disable | ( | clk_ids_en | clk_id | ) |
Disables the specified clock.
| clk_id | Clock ID to disable. |
| clk_status_en clk_force_disable | ( | clk_ids_en | clk_id | ) |
Forcibly disables the specified clock regardless of downstream dependencies.
| clk_id | Clock ID to forcibly disable. |
| clk_status_en clk_is_enabled | ( | clk_ids_en | clk_id, |
| clk_enable_status_en * | out_status ) |
Checks whether the specified clock is currently enabled.
| clk_id | Clock ID to check. |
| out_status | Pointer to store the clock enable status. Returns: |
| clk_status_en clk_get_rate | ( | clk_ids_en | clk_id, |
| uint32_t * | rate ) |
Retrieves the current operating frequency of the specified clock.
| clk_id | Clock ID. |
| rate | Pointer to store the current rate in Hz. |
| clk_status_en clk_set_rate | ( | clk_ids_en | clk_id, |
| uint32_t | requested_rate, | ||
| uint32_t * | actual_rate ) |
Sets the frequency of the specified clock. The behavior depends on the clock type:
| clk_id | Clock ID to configure. |
| requested_rate | Desired frequency in Hz. |
| actual_rate | Pointer to store the actual configured rate in Hz. |
| clk_status_en clk_get_divider | ( | clk_ids_en | clk_id, |
| int32_t * | divider ) |
Retrieves the current divider value for the specified clock.
| clk_id | Clock ID. |
| divider | Pointer to store the current divider value. |
| clk_status_en clk_set_pll_config | ( | clk_pll_en | pll, |
| clk_pll_config_en | pll_config ) |
Configures the specified PLL with a predefined frequency setup. This involves writing appropriate values to the PLL's reference divider, feedback divider, fractional divider, and post-dividers to achieve the target frequency. Special configurations like bypass and power-down modes are also supported.
| pll | Clock PLL to configure. Valid values: |
| pll_config | PLL configuration to apply. Valid values:
|
| clk_status_en clk_get_pll_config | ( | clk_pll_en | pll, |
| clk_pll_config_en * | pll_config ) |
Retrieves the current configuration of the specified PLL. This is done by reading the PLL's hardware divider settings - reference divider, feedback divider, fractional divider, and post-dividers and matching them against known PLL configuration presets. The function also detects if the PLL is operating in bypass mode or is powered down.
| pll | Clock PLL to query. |
| pll_config | Pointer to store the current PLL configuration. |
| clk_status_en clk_set_mux | ( | clk_ids_en | clk_id, |
| uint8_t | mux_out ) |
Sets the mux output configuration for the specified clock. This function configures the clock source selection (mux) for a given clock ID. It applies to clocks that support mux switching, such as PLL muxes or CGL clock muxes.
| clk_id | Clock ID for which the mux configuration is to be set. |
| mux_out | Desired mux output configuration. Valid values:
|