mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
ASoC: rockchip: mdais: add startup && shutdown ops
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com> Change-Id: I55ac91252bfb3f1ec8ed0f028541fa7ea0f428ca
This commit is contained in:
@@ -95,6 +95,40 @@ static int rockchip_mdais_trigger(struct snd_pcm_substream *substream,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rockchip_mdais_startup(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->startup) {
|
||||
ret = child->driver->ops->startup(substream, child);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rockchip_mdais_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct rk_mdais_dev *mdais = to_info(dai);
|
||||
struct snd_soc_dai *child;
|
||||
int i = 0;
|
||||
|
||||
for (i = 0; i < mdais->num_dais; i++) {
|
||||
child = mdais->dais[i].dai;
|
||||
if (child->driver->ops && child->driver->ops->shutdown) {
|
||||
child->driver->ops->shutdown(substream, child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int rockchip_mdais_set_sysclk(struct snd_soc_dai *cpu_dai, int clk_id,
|
||||
unsigned int freq, int dir)
|
||||
{
|
||||
@@ -184,6 +218,8 @@ static const struct snd_soc_dai_ops rockchip_mdais_dai_ops = {
|
||||
.set_fmt = rockchip_mdais_set_fmt,
|
||||
.set_tdm_slot = rockchip_mdais_tdm_slot,
|
||||
.trigger = rockchip_mdais_trigger,
|
||||
.startup = rockchip_mdais_startup,
|
||||
.shutdown = rockchip_mdais_shutdown,
|
||||
};
|
||||
|
||||
static const struct snd_soc_component_driver rockchip_mdais_component = {
|
||||
|
||||
Reference in New Issue
Block a user