-
Notifications
You must be signed in to change notification settings - Fork 349
hw hda chain managment #6624
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
Closed
makarukp
wants to merge
9
commits into
thesofproject:main
from
makarukp:prv-pmakaruk-hw_hda_chain_managment_mtl-002-drop-stable
Closed
hw hda chain managment #6624
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d725d3b
dmic workaround
softwarecki fb63108
mtl: enable comp up down mixer
4fd043d
src:change error to warning when checking buffer
fkwasowi 0714872
audio: up_down_mixer: fix build warnings on discarding const
kv2019i 9fbcce1
west: update to newer Zephyr baseline
abonislawski c24359a
lib: dma: free dma channels when ref count is 0
ranj063 071f46c
lib: dma: return NULL when DMA init fails
ranj063 3216d45
dai-zephyr: Free DMA config block during reset
ranj063 79289e0
hda: Add chain dma management
makarukp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,5 @@ add_local_sources(sof | |
| pipeline-params.c | ||
| pipeline-xrun.c | ||
| pipeline-schedule.c | ||
| chain_dma.c | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| #include <sof/audio/chain_dma.h> | ||
| #include <ipc4/error_status.h> | ||
| #include <ipc4/module.h> | ||
|
|
||
| /* 6a0a274f-27cc-4afb-a3e7-3444723f432e */ | ||
| DECLARE_SOF_RT_UUID("chain_dma", chain_dma_uuid, 0x6a0a274f, 0x27cc, 0x4afb, | ||
| 0xa3, 0xe7, 0x34, 0x44, 0x72, 0x3f, 0x43, 0x2e); | ||
| DECLARE_TR_CTX(chain_dma_tr, SOF_UUID(chain_dma_uuid), LOG_LEVEL_INFO); | ||
|
|
||
| int chain_dma_start(struct comp_dev *dev, uint8_t host_dma_id) | ||
| { | ||
| return IPC4_SUCCESS; | ||
| } | ||
|
|
||
| int chain_dma_pause(struct comp_dev *dev, uint8_t host_dma_id) | ||
| { | ||
| return IPC4_SUCCESS; | ||
| } | ||
|
|
||
| int chain_dma_trigger(struct comp_dev *dev, int cmd) | ||
| { | ||
| switch (cmd) { | ||
| case COMP_TRIGGER_START: | ||
| chain_dma_start(dev, cmd); | ||
| break; | ||
| case COMP_TRIGGER_PAUSE: | ||
| chain_dma_pause(dev, cmd); | ||
| break; | ||
| default: | ||
| return 0; | ||
| } | ||
| return IPC4_SUCCESS; | ||
| } | ||
|
|
||
| int chain_dma_remove(struct comp_dev *dev, uint8_t host_dma_id) | ||
| { | ||
| return IPC4_SUCCESS; | ||
| } | ||
|
|
||
| int chain_dma_create(const struct comp_driver *drv, uint8_t host_dma_id, uint8_t link_dma_id, uint32_t fifo_size, bool scs) | ||
| { | ||
| struct comp_dev *dev; | ||
|
|
||
| dev = comp_alloc(drv, sizeof(*dev)); | ||
| if (!dev) | ||
| return IPC4_INVALID_REQUEST; | ||
|
|
||
| int comp_id = IPC4_COMP_ID(host_dma_id + IPC4_MAX_MODULE_COUNT, | ||
| link_dma_id); | ||
|
|
||
| struct chain_dma_data *cd = comp_get_drvdata(dev); | ||
| size_t size = sizeof(*cd); | ||
| cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, size); | ||
| return IPC4_SUCCESS; | ||
| } | ||
|
|
||
|
|
||
|
|
||
| static const struct comp_driver comp_chain_dma = { | ||
| .type = SOF_COMP_CHAIN_DMA, | ||
| .uid = SOF_RT_UUID(chain_dma_uuid), | ||
| .tctx = &chain_dma_tr, | ||
| .ops = { | ||
| .chain_dma_create = chain_dma_create, | ||
| .trigger = chain_dma_trigger, | ||
| .free = chain_dma_remove, | ||
| }, | ||
| }; | ||
|
|
||
| static SHARED_DATA struct comp_driver_info comp_chain_dma_info = { | ||
| .drv = &comp_chain_dma, | ||
| }; | ||
|
|
||
| static void sys_comp_chain_dma_init(void) | ||
| { | ||
| comp_register(platform_shared_get(&comp_chain_dma_info, | ||
| sizeof(comp_chain_dma_info))); | ||
| } | ||
|
|
||
| DECLARE_MODULE(sys_comp_chain_dma_init); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #include <sof/audio/buffer.h> | ||
| #include <sof/audio/component.h> | ||
| #include <sof/audio/component_ext.h> | ||
| #include <sof/audio/pipeline.h> | ||
| #include <sof/common.h> | ||
| #include <sof/ipc/topology.h> | ||
| #include <sof/ipc/common.h> | ||
| #include <ipc/dai.h> | ||
|
|
||
| static const uint32_t MAX_CHAIN_NUMBER = DAI_NUM_HDA_OUT + DAI_NUM_HDA_IN; | ||
|
|
||
| /* chain dma component private data */ | ||
| struct chain_dma_data { | ||
| bool first_data_received_; | ||
| //! Node id of host HD/A DMA | ||
| uint32_t output_node_id_; | ||
| //! Node id of link HD/A DMA | ||
| uint32_t input_node_id_; | ||
| uint32_t* hw_buffer_; | ||
| bool under_over_run_notification_sent_; | ||
| }; | ||
|
|
||
| int chain_dma_create(const struct comp_driver *drv, uint8_t host_dma_id, uint8_t link_dma_id, uint32_t fifo_size, bool scs); | ||
|
|
||
| int chain_dma_start(struct comp_dev *dev, uint8_t host_dma_id); | ||
|
|
||
| int chain_dma_pause(struct comp_dev *dev, uint8_t host_dma_id); | ||
|
|
||
| int chain_dma_remove(struct comp_dev *dev, uint8_t host_dma_id); | ||
|
|
||
| int chain_dma_trigger(struct comp_dev *dev, int cmd); | ||
|
|
||
| void SetReadPointer(uint32_t read_pointer); | ||
|
|
||
| void SetWritePointer(uint32_t write_pointer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.