Skip to content
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

[DNM] dai: zephyr: add support for parsing new SAI/ESAI handshake encoding #8844

Conversation

LaurentiuM1234
Copy link
Contributor

For native SAI and ESAI, the channel and DMA slot are encoded differently in the handshake. As such, we need to add support for parsing this new encoding.

@kv2019i perhaps it may be worth adding a new function in the Zephyr DAI subsystem that will move all of this complexity to Zephyr. Something like:

enum dai_hs_attribute {
    DAI_HS_ATTRIBUTE_CHANNEL,
    DAI_HS_ATTRIBUTE_DMA_SLOT,
};

int dai_get_handshake_attribute(const struct device *dev, enum dai_dir dir, enum dai_hs_attribute hs_attr)
{
      /* do decoding here */
}

This ought to remove the need to use functions such as dai_dma_get_slot or dai_config_dma_channel. Of course, this all depends on how Intel does the encoding as well.

In the case of some DAIs, the DMA slot may be encoded
differently in the DAI configuration handshake. As such,
we can't count on the fact that the handshake itself can
be used as the DMA slot. To fix this, add a function which
parses the handshake and allows each DAI to use its own
encoding of the DMA slot inside the handshake.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The native SAI and ESAI drivers use a different handshake
encoding. As such, when using native Zephyr drivers use a
different function for decoding the channel from the handshake.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LaurentiuM1234 duplicate PR ? seen this merged into another Green PR IIRC.

@LaurentiuM1234
Copy link
Contributor Author

@LaurentiuM1234 duplicate PR ? seen this merged into another Green PR IIRC.

yep, patches from this PR have been added to #8859. Will close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants