ASoC: rockchip: mdais: add prepare ops

Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: I795e9d32ea51a4bf0f229d4e052b52aaeb34df2f
This commit is contained in:
XiaoTan Luo
2022-09-05 10:15:42 +08:00
committed by Tao Huang
parent 843fd2249d
commit bf5984992b

View File

@@ -129,6 +129,25 @@ static void rockchip_mdais_shutdown(struct snd_pcm_substream *substream,
}
}
static int rockchip_mdais_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct rk_mdais_dev *mdais = to_info(dai);
struct snd_soc_dai *child;
int ret = 0, i = 0;
for (i = 0; i < mdais->num_dais; i++) {
child = mdais->dais[i].dai;
if (child->driver->ops && child->driver->ops->prepare) {
ret = child->driver->ops->prepare(substream, child);
if (ret < 0)
return ret;
}
}
return 0;
}
static int rockchip_mdais_set_sysclk(struct snd_soc_dai *cpu_dai, int clk_id,
unsigned int freq, int dir)
{
@@ -220,6 +239,7 @@ static const struct snd_soc_dai_ops rockchip_mdais_dai_ops = {
.trigger = rockchip_mdais_trigger,
.startup = rockchip_mdais_startup,
.shutdown = rockchip_mdais_shutdown,
.prepare = rockchip_mdais_prepare,
};
static const struct snd_soc_component_driver rockchip_mdais_component = {