forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'thesofproject:main' into mtl-Es8326+HDMI-In
- Loading branch information
Showing
24 changed files
with
277 additions
and
138 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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,66 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// Copyright(c) 2020 Google LLC. All rights reserved. | ||
// | ||
// Author: Sebastiano Carlucci <[email protected]> | ||
|
||
#include <sof/audio/module_adapter/module/generic.h> | ||
#include <sof/trace/trace.h> | ||
#include <module/module/base.h> | ||
#include <ipc/control.h> | ||
#include <sof/audio/component.h> | ||
#include <sof/audio/data_blob.h> | ||
#include <module/module/interface.h> | ||
#include <ipc/stream.h> | ||
#include <sof/audio/buffer.h> | ||
#include <errno.h> | ||
|
||
#include "dcblock.h" | ||
|
||
LOG_MODULE_DECLARE(dcblock, CONFIG_SOF_LOG_LEVEL); | ||
|
||
/** | ||
* \brief Handles incoming get commands for DC Blocking Filter component. | ||
*/ | ||
int dcblock_get_ipc_config(struct processing_module *mod, | ||
uint8_t *fragment, size_t fragment_size) | ||
{ | ||
struct sof_ipc_ctrl_data *cdata = (struct sof_ipc_ctrl_data *)fragment; | ||
struct comp_data *cd = module_get_private_data(mod); | ||
|
||
comp_info(mod->dev, "dcblock_get_config()"); | ||
|
||
if (cdata->cmd != SOF_CTRL_CMD_BINARY) { | ||
comp_err(mod->dev, "dcblock_get_config(), invalid command"); | ||
return -EINVAL; | ||
} | ||
|
||
return comp_data_blob_get_cmd(cd->model_handler, cdata, fragment_size); | ||
} | ||
|
||
/** | ||
* \brief Handles incoming set commands for DC Blocking Filter component. | ||
*/ | ||
int dcblock_set_ipc_config(struct processing_module *mod, | ||
enum module_cfg_fragment_position pos, uint32_t data_offset_size, | ||
const uint8_t *fragment, size_t fragment_size) | ||
{ | ||
struct comp_data *cd = module_get_private_data(mod); | ||
|
||
comp_info(mod->dev, "dcblock_set_config()"); | ||
|
||
struct sof_ipc_ctrl_data *cdata = (struct sof_ipc_ctrl_data *)fragment; | ||
|
||
if (cdata->cmd != SOF_CTRL_CMD_BINARY) { | ||
comp_err(mod->dev, "dcblock_set_config(), invalid command %i", cdata->cmd); | ||
return -EINVAL; | ||
} | ||
|
||
return comp_data_blob_set(cd->model_handler, pos, data_offset_size, fragment, | ||
fragment_size); | ||
} | ||
|
||
void dcblock_params(struct processing_module *mod) | ||
{ | ||
} | ||
|
This file contains 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,70 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// Copyright(c) 2020 Google LLC. All rights reserved. | ||
// | ||
// Author: Sebastiano Carlucci <[email protected]> | ||
|
||
#include <sof/audio/module_adapter/module/generic.h> | ||
#include <sof/trace/trace.h> | ||
#include <module/module/base.h> | ||
#include <ipc/control.h> | ||
#include <sof/audio/component.h> | ||
#include <sof/audio/data_blob.h> | ||
#include <module/module/interface.h> | ||
#include <ipc/stream.h> | ||
#include <sof/audio/buffer.h> | ||
#include <module/ipc4/base-config.h> | ||
#include <sof/list.h> | ||
#include <errno.h> | ||
|
||
#include "dcblock.h" | ||
|
||
LOG_MODULE_DECLARE(dcblock, CONFIG_SOF_LOG_LEVEL); | ||
|
||
/** | ||
* \brief Handles incoming get commands for DC Blocking Filter component. | ||
*/ | ||
int dcblock_get_ipc_config(struct processing_module *mod, | ||
uint8_t *fragment, size_t fragment_size) | ||
{ | ||
struct sof_ipc_ctrl_data *cdata = (struct sof_ipc_ctrl_data *)fragment; | ||
struct comp_data *cd = module_get_private_data(mod); | ||
|
||
comp_info(mod->dev, "dcblock_get_ipc_config()"); | ||
|
||
return comp_data_blob_get_cmd(cd->model_handler, cdata, fragment_size); | ||
} | ||
|
||
/** | ||
* \brief Handles incoming set commands for DC Blocking Filter component. | ||
*/ | ||
int dcblock_set_ipc_config(struct processing_module *mod, | ||
enum module_cfg_fragment_position pos, uint32_t data_offset_size, | ||
const uint8_t *fragment, size_t fragment_size) | ||
{ | ||
struct comp_data *cd = module_get_private_data(mod); | ||
|
||
comp_info(mod->dev, "dcblock_set_ipc_config()"); | ||
|
||
return comp_data_blob_set(cd->model_handler, pos, data_offset_size, fragment, | ||
fragment_size); | ||
} | ||
|
||
void dcblock_params(struct processing_module *mod) | ||
{ | ||
struct sof_ipc_stream_params *params = mod->stream_params; | ||
struct comp_buffer *sinkb, *sourceb; | ||
struct comp_dev *dev = mod->dev; | ||
|
||
comp_dbg(dev, "dcblock_params()"); | ||
|
||
ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params); | ||
component_set_nearest_period_frames(dev, params->rate); | ||
|
||
sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); | ||
ipc4_update_buffer_format(sinkb, &mod->priv.cfg.base_cfg.audio_fmt); | ||
|
||
sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); | ||
ipc4_update_buffer_format(sourceb, &mod->priv.cfg.base_cfg.audio_fmt); | ||
} | ||
|
This file contains 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.