-
Notifications
You must be signed in to change notification settings - Fork 8.1k
drivers: i2s: stm32 sai add mclk-divider property #91404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: i2s: stm32 sai add mclk-divider property #91404
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments
9c89e5f to
4afd8a5
Compare
cf21f4c to
ec1b131
Compare
ec1b131 to
41d0ef2
Compare
41d0ef2 to
38af4aa
Compare
|
Hi @erwango @etienne-lms, FYI, I have created a draft to add sai support to stm32h5 series #91555. |
38af4aa to
ccaa92e
Compare
This property enables the user to configure the Master Clock Divider. Signed-off-by: Mario Paja <mariopaja@hotmail.com>
ccaa92e to
37265ce
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change requires a note to be added in the migration guide? @erwango
| .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(index), \ | ||
| .mclk_enable = DT_INST_PROP(index, mclk_enable), \ | ||
| .mclk_div_enable = DT_INST_PROP(index, mclk_div_enable), \ | ||
| .mclk_div = (enum mclk_divider)DT_ENUM_IDX(DT_DRV_INST(index), mclk_divider), \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: instead of the unstable DT_ENUM_IDX, something more stable like this could be used:
| .mclk_div = (enum mclk_divider)DT_ENUM_IDX(DT_DRV_INST(index), mclk_divider), \ | |
| .mclk_div = CONCAT(MCLK_, DT_INST_STRING_UPPER_TOKEN(index, mclk_divider)), \ |
| hsai->Init.NoDivider = SAI_MASTERDIVIDER_DISABLED; | ||
| } else { | ||
| hsai->Init.NoDivider = SAI_MASTERDIVIDER_ENABLE; | ||
| if (cfg->mclk_div == (enum mclk_divider)MCLK_DIV_256) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: cast should not be needed?
| if (cfg->mclk_div == (enum mclk_divider)MCLK_DIV_256) { | |
| if (cfg->mclk_div == MCLK_DIV_256) { |
| if (cfg->mclk_div_enable) { | ||
| hsai->Init.NoDivider = SAI_MASTERDIVIDER_ENABLE; | ||
| } else { | ||
| if (cfg->mclk_div == (enum mclk_divider)MCLK_NO_DIV) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: cast should not be needed?
| if (cfg->mclk_div == (enum mclk_divider)MCLK_NO_DIV) { | |
| if (cfg->mclk_div == MCLK_NO_DIV) { |
Not required. SAI was introduced in current release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 since note in migration guide is not required. My previous nits still apply but are non-blocking.
|
@mathieuchopstm I can make the changes only starting from next week. If it doesn't get merged I can implement your suggestions immediately then. |



This property enables the user to configure the Master Clock Divider
The property sets nodiv or osr value
MCKDIV[5:0] = SAI_CK_x / (FS * (FRL + 1))
MCKDIV[5:0] = SAI_CK_x / (FS * (OSR + 1) * 256)