-
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.
ASoC: SOF: Introduce IPC3 PCM hw_free op
Add the IPC3 PCM ops, define the hw_free op and modify all users to use the op. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220317175044.1752400-14-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
- Loading branch information
Ranjani Sridharan
authored and
Mark Brown
committed
Mar 18, 2022
1 parent
442c712
commit 4123c24
Showing
7 changed files
with
72 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) | ||
// | ||
// This file is provided under a dual BSD/GPLv2 license. When using or | ||
// redistributing this file, you may do so under either license. | ||
// | ||
// Copyright(c) 2021 Intel Corporation. All rights reserved. | ||
// | ||
// | ||
|
||
#include <sound/pcm_params.h> | ||
#include "ipc3-ops.h" | ||
#include "ops.h" | ||
#include "sof-priv.h" | ||
#include "sof-audio.h" | ||
|
||
static int sof_ipc3_pcm_hw_free(struct snd_soc_component *component, | ||
struct snd_pcm_substream *substream) | ||
{ | ||
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); | ||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); | ||
struct sof_ipc_stream stream; | ||
struct sof_ipc_reply reply; | ||
struct snd_sof_pcm *spcm; | ||
|
||
spcm = snd_sof_find_spcm_dai(component, rtd); | ||
if (!spcm) | ||
return -EINVAL; | ||
|
||
if (!spcm->prepared[substream->stream]) | ||
return 0; | ||
|
||
stream.hdr.size = sizeof(stream); | ||
stream.hdr.cmd = SOF_IPC_GLB_STREAM_MSG | SOF_IPC_STREAM_PCM_FREE; | ||
stream.comp_id = spcm->stream[substream->stream].comp_id; | ||
|
||
/* send IPC to the DSP */ | ||
return sof_ipc_tx_message(sdev->ipc, stream.hdr.cmd, &stream, | ||
sizeof(stream), &reply, sizeof(reply)); | ||
} | ||
|
||
const struct sof_ipc_pcm_ops ipc3_pcm_ops = { | ||
.hw_free = sof_ipc3_pcm_hw_free, | ||
}; |
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