Skip to content

Commit

Permalink
drivers: clock_control: Expose enabled_clock for clock driver library
Browse files Browse the repository at this point in the history
Expose the helper function enabled_clock so that it can be used in
other clock library sources.

(cherry picked from commit 3c3487a)

Original-Signed-off-by: Joakim Andersson <[email protected]>
GitOrigin-RevId: 3c3487a
Cr-Build-Id: 8736554896755799505
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8736554896755799505
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: Ibe02b73c2b0dfc379c2135414aefcd0a87f9503f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5870298
Reviewed-by: Keith Short <[email protected]>
Tested-by: Keith Short <[email protected]>
Tested-by: ChromeOS Prod (Robot) <[email protected]>
Commit-Queue: Keith Short <[email protected]>
  • Loading branch information
joerchan authored and Chromeos LUCI committed Sep 17, 2024
1 parent 924843a commit f45f1a1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions drivers/clock_control/clock_stm32_ll_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ static uint32_t get_msi_frequency(void)
}

/** @brief Verifies clock is part of active clock configuration */
__unused
static int enabled_clock(uint32_t src_clk)
int enabled_clock(uint32_t src_clk)
{
int r = 0;

Expand Down
1 change: 1 addition & 0 deletions drivers/clock_control/clock_stm32_ll_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void config_plli2s(void);
#endif
void config_enable_default_clocks(void);
void config_regulator_voltage(uint32_t hclk_freq);
int enabled_clock(uint32_t src_clk);

/* functions exported to the soc power.c */
int stm32_clock_control_init(const struct device *dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_h5.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static uint32_t get_sysclk_frequency(void)
}

/** @brief Verifies clock is part of active clock configuration */
static int enabled_clock(uint32_t src_clk)
int enabled_clock(uint32_t src_clk)
{
if ((src_clk == STM32_SRC_SYSCLK) ||
((src_clk == STM32_SRC_HSE) && IS_ENABLED(STM32_HSE_ENABLED)) ||
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_h7.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static uint32_t get_vco_output_range(uint32_t vco_input_range)
#endif /* ! CONFIG_CPU_CORTEX_M4 */

/** @brief Verifies clock is part of active clock configuration */
static int enabled_clock(uint32_t src_clk)
int enabled_clock(uint32_t src_clk)
{

if ((src_clk == STM32_SRC_SYSCLK) ||
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_u5.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static uint32_t get_sysclk_frequency(void)
}

/** @brief Verifies clock is part of active clock configuration */
static int enabled_clock(uint32_t src_clk)
int enabled_clock(uint32_t src_clk)
{
if ((src_clk == STM32_SRC_SYSCLK) ||
((src_clk == STM32_SRC_HSE) && IS_ENABLED(STM32_HSE_ENABLED)) ||
Expand Down
3 changes: 1 addition & 2 deletions drivers/clock_control/clock_stm32_ll_wba.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ static uint32_t get_bus_clock(uint32_t clock, uint32_t prescaler)
}

/** @brief Verifies clock is part of active clock configuration */
__unused
static int enabled_clock(uint32_t src_clk)
int enabled_clock(uint32_t src_clk)
{
if ((src_clk == STM32_SRC_SYSCLK) ||
((src_clk == STM32_SRC_HSE) && IS_ENABLED(STM32_HSE_ENABLED)) ||
Expand Down

0 comments on commit f45f1a1

Please sign in to comment.