Skip to content

Commit

Permalink
clock_control: imx_ccm: Add support for i.MX93's SAI clocks
Browse files Browse the repository at this point in the history
This commit introduces support for querying
i.MX93's SAI clocks.

Signed-off-by: Laurentiu Mihalcea <[email protected]>
  • Loading branch information
LaurentiuM1234 committed Dec 6, 2023
1 parent 7ff69f3 commit 593cd6d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions drivers/clock_control/clock_control_mcux_ccm_rev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
break;
#endif

#if defined(CONFIG_SOC_MIMX93_A55) && defined(CONFIG_DAI_NXP_SAI)
case IMX_CCM_SAI1_CLK:
case IMX_CCM_SAI2_CLK:
case IMX_CCM_SAI3_CLK:
clock_root = kCLOCK_Root_Sai1 + instance;
uint32_t mux = CLOCK_GetRootClockMux(clock_root);
uint32_t divider = CLOCK_GetRootClockDiv(clock_root);

/* assumption: SAI's SRC is AUDIO_PLL */
if (mux != 1) {
return -EINVAL;
}

/* assumption: AUDIO_PLL's frequency is 393216000 Hz */
*rate = 393216000 / divider;

return 0;
#endif
default:
return -EINVAL;
}
Expand Down

0 comments on commit 593cd6d

Please sign in to comment.