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

dai: change to use new version of dai_config_get #6939

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,16 +378,18 @@ static int dai_comp_get_hw_params(struct comp_dev *dev,
int dir)
{
struct dai_data *dd = comp_get_drvdata(dev);
const struct dai_config *cfg = dai_config_get(dd->dai->dev, dir);
struct dai_config cfg;
int ret;

comp_dbg(dev, "dai_hw_params()");

if (!cfg)
return -EINVAL;
ret = dai_config_get(dd->dai->dev, &cfg, dir);
if (ret)
return ret;

params->rate = cfg->rate;
params->rate = cfg.rate;
params->buffer_fmt = 0;
params->channels = cfg->channels;
params->channels = cfg.channels;

/* dai_comp_get_hw_params() function fetches hardware dai parameters,
* which then are propagating back through the pipeline, so that any
Expand All @@ -397,7 +399,7 @@ static int dai_comp_get_hw_params(struct comp_dev *dev,
*/
params->frame_fmt = dev->ipc_config.frame_fmt;

return 0;
return ret;
}

static int dai_comp_hw_params(struct comp_dev *dev, struct sof_ipc_stream_params *params)
Expand Down
7 changes: 4 additions & 3 deletions src/lib/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,16 @@ const struct device *zephyr_dev[] = {

static const struct device *dai_get_zephyr_device(uint32_t type, uint32_t index)
{
const struct dai_config *cfg;
struct dai_config cfg;
int dir;
int i;

dir = (type == SOF_DAI_INTEL_DMIC) ? DAI_DIR_RX : DAI_DIR_BOTH;

for (i = 0; i < ARRAY_SIZE(zephyr_dev); i++) {
cfg = dai_config_get(zephyr_dev[i], dir);
if (cfg && cfg->type == type && cfg->dai_index == index)
if (dai_config_get(zephyr_dev[i], &cfg, dir))
continue;
if (cfg.type == type && cfg.dai_index == index)
return zephyr_dev[i];
}

Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ manifest:

- name: zephyr
repo-path: zephyr
revision: 0c0d73721edb808b51a7ab136cfe01d1b2c1f87d
revision: 9af2789cad17924298d705b99a1bca5f35ea88e2
remote: zephyrproject
# Import some projects listed in zephyr/west.yml@revision
#
Expand Down