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

Sdw rework #3

Closed
Closed
Changes from 1 commit
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
28 changes: 28 additions & 0 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,36 @@ static int sdw_config_stream(void *arg, void *s, void *dai,
return ret;
}

static int sdw_free_stream(void *arg, void *s, void *dai)
{
struct snd_sof_dev *sdev = arg;
struct sof_ipc_dai_config config;
struct sof_ipc_reply reply;
int size = sizeof(config);
int ret;

memset(&config, 0, size);
config.hdr.size = size;
config.hdr.cmd = SOF_IPC_GLB_DAI_MSG | SOF_IPC_DAI_CONFIG;
config.type = SOF_DAI_INTEL_ALH;
config.dai_index = 0; /* FIXME: make this dynamic */
config.alh.stream_id = 0xFFFFFFFF;

/* send message to DSP */
ret = sof_ipc_tx_message(sdev->ipc,
config.hdr.cmd, &config, size, &reply,
sizeof(reply));
if (ret < 0) {
dev_err(sdev->dev, "error: failed to set DAI hw_free for ALH %d\n",
config.dai_index);
}

return ret;
}

static const struct sdw_intel_ops sdw_callback = {
.config_stream = sdw_config_stream,
.free_stream = sdw_free_stream,
Copy link

Choose a reason for hiding this comment

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

@RanderWang where will this get called? Would it be in the hw_free dai op

};

static int hda_sdw_init(struct snd_sof_dev *sdev)
Expand Down