Commit 5d2d1a48 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: intel: avs: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871qf4qnfz.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 50cd92e0
...@@ -90,7 +90,7 @@ static const struct snd_soc_jack_pin card_headset_pins[] = { ...@@ -90,7 +90,7 @@ static const struct snd_soc_jack_pin card_headset_pins[] = {
static int avs_da7219_codec_init(struct snd_soc_pcm_runtime *runtime) static int avs_da7219_codec_init(struct snd_soc_pcm_runtime *runtime)
{ {
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
struct snd_soc_component *component = codec_dai->component; struct snd_soc_component *component = codec_dai->component;
struct snd_soc_card *card = runtime->card; struct snd_soc_card *card = runtime->card;
struct snd_soc_jack_pin *pins; struct snd_soc_jack_pin *pins;
...@@ -140,7 +140,7 @@ static int avs_da7219_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -140,7 +140,7 @@ static int avs_da7219_codec_init(struct snd_soc_pcm_runtime *runtime)
static void avs_da7219_codec_exit(struct snd_soc_pcm_runtime *rtd) static void avs_da7219_codec_exit(struct snd_soc_pcm_runtime *rtd)
{ {
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL); snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
} }
static int static int
......
...@@ -97,7 +97,7 @@ static struct snd_soc_jack_pin card_headset_pins[] = { ...@@ -97,7 +97,7 @@ static struct snd_soc_jack_pin card_headset_pins[] = {
static int avs_es8336_codec_init(struct snd_soc_pcm_runtime *runtime) static int avs_es8336_codec_init(struct snd_soc_pcm_runtime *runtime)
{ {
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
struct snd_soc_component *component = codec_dai->component; struct snd_soc_component *component = codec_dai->component;
struct snd_soc_card *card = runtime->card; struct snd_soc_card *card = runtime->card;
struct snd_soc_jack_pin *pins; struct snd_soc_jack_pin *pins;
...@@ -138,7 +138,7 @@ static int avs_es8336_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -138,7 +138,7 @@ static int avs_es8336_codec_init(struct snd_soc_pcm_runtime *runtime)
static void avs_es8336_codec_exit(struct snd_soc_pcm_runtime *runtime) static void avs_es8336_codec_exit(struct snd_soc_pcm_runtime *runtime)
{ {
struct avs_card_drvdata *data = snd_soc_card_get_drvdata(runtime->card); struct avs_card_drvdata *data = snd_soc_card_get_drvdata(runtime->card);
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
snd_soc_component_set_jack(codec_dai->component, NULL, NULL); snd_soc_component_set_jack(codec_dai->component, NULL, NULL);
gpiod_put(data->gpiod); gpiod_put(data->gpiod);
...@@ -147,8 +147,8 @@ static void avs_es8336_codec_exit(struct snd_soc_pcm_runtime *runtime) ...@@ -147,8 +147,8 @@ static void avs_es8336_codec_exit(struct snd_soc_pcm_runtime *runtime)
static int avs_es8336_hw_params(struct snd_pcm_substream *substream, static int avs_es8336_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
struct snd_soc_pcm_runtime *runtime = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *runtime = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
int clk_freq; int clk_freq;
int ret; int ret;
......
...@@ -32,7 +32,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in ...@@ -32,7 +32,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
return -ENOMEM; return -ENOMEM;
dl->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", ssp_port); dl->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", ssp_port);
dl->codecs = &asoc_dummy_dlc; dl->codecs = &snd_soc_dummy_dlc;
if (!dl->cpus->dai_name || !dl->codecs->name || !dl->codecs->dai_name) if (!dl->cpus->dai_name || !dl->codecs->name || !dl->codecs->dai_name)
return -ENOMEM; return -ENOMEM;
......
...@@ -66,7 +66,7 @@ avs_max98373_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_par ...@@ -66,7 +66,7 @@ avs_max98373_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_par
static int avs_max98373_hw_params(struct snd_pcm_substream *substream, static int avs_max98373_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
struct snd_soc_pcm_runtime *runtime = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *runtime = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai; struct snd_soc_dai *codec_dai;
int ret, i; int ret, i;
......
...@@ -66,7 +66,7 @@ avs_max98927_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_par ...@@ -66,7 +66,7 @@ avs_max98927_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_par
static int avs_max98927_hw_params(struct snd_pcm_substream *substream, static int avs_max98927_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
struct snd_soc_pcm_runtime *runtime = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *runtime = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai; struct snd_soc_dai *codec_dai;
int ret = 0; int ret = 0;
int i; int i;
......
...@@ -106,12 +106,12 @@ static int avs_nau8825_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -106,12 +106,12 @@ static int avs_nau8825_codec_init(struct snd_soc_pcm_runtime *runtime)
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
return snd_soc_component_set_jack(asoc_rtd_to_codec(runtime, 0)->component, jack, NULL); return snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, jack, NULL);
} }
static void avs_nau8825_codec_exit(struct snd_soc_pcm_runtime *rtd) static void avs_nau8825_codec_exit(struct snd_soc_pcm_runtime *rtd)
{ {
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL); snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
} }
static int static int
...@@ -138,8 +138,8 @@ avs_nau8825_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_para ...@@ -138,8 +138,8 @@ avs_nau8825_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_para
static int avs_nau8825_trigger(struct snd_pcm_substream *substream, int cmd) static int avs_nau8825_trigger(struct snd_pcm_substream *substream, int cmd)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_runtime *rtm = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtm = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtm, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtm, 0);
int ret = 0; int ret = 0;
switch (cmd) { switch (cmd) {
......
...@@ -87,7 +87,7 @@ static struct snd_soc_jack_pin card_headset_pins[] = { ...@@ -87,7 +87,7 @@ static struct snd_soc_jack_pin card_headset_pins[] = {
static int avs_rt274_codec_init(struct snd_soc_pcm_runtime *runtime) static int avs_rt274_codec_init(struct snd_soc_pcm_runtime *runtime)
{ {
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
struct snd_soc_component *component = codec_dai->component; struct snd_soc_component *component = codec_dai->component;
struct snd_soc_jack_pin *pins; struct snd_soc_jack_pin *pins;
struct snd_soc_jack *jack; struct snd_soc_jack *jack;
...@@ -121,7 +121,7 @@ static int avs_rt274_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -121,7 +121,7 @@ static int avs_rt274_codec_init(struct snd_soc_pcm_runtime *runtime)
static void avs_rt274_codec_exit(struct snd_soc_pcm_runtime *rtd) static void avs_rt274_codec_exit(struct snd_soc_pcm_runtime *rtd)
{ {
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL); snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
} }
static int avs_rt274_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params) static int avs_rt274_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params)
......
...@@ -67,12 +67,12 @@ static int avs_rt286_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -67,12 +67,12 @@ static int avs_rt286_codec_init(struct snd_soc_pcm_runtime *runtime)
if (ret) if (ret)
return ret; return ret;
return snd_soc_component_set_jack(asoc_rtd_to_codec(runtime, 0)->component, jack, NULL); return snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, jack, NULL);
} }
static void avs_rt286_codec_exit(struct snd_soc_pcm_runtime *rtd) static void avs_rt286_codec_exit(struct snd_soc_pcm_runtime *rtd)
{ {
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL); snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
} }
static int avs_rt286_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params) static int avs_rt286_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params)
...@@ -98,8 +98,8 @@ static int avs_rt286_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pc ...@@ -98,8 +98,8 @@ static int avs_rt286_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pc
static int static int
avs_rt286_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) avs_rt286_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params)
{ {
struct snd_soc_pcm_runtime *runtime = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *runtime = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
int ret; int ret;
ret = snd_soc_dai_set_sysclk(codec_dai, RT286_SCLK_S_PLL, 24000000, SND_SOC_CLOCK_IN); ret = snd_soc_dai_set_sysclk(codec_dai, RT286_SCLK_S_PLL, 24000000, SND_SOC_CLOCK_IN);
......
...@@ -78,12 +78,12 @@ static int avs_rt298_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -78,12 +78,12 @@ static int avs_rt298_codec_init(struct snd_soc_pcm_runtime *runtime)
if (ret) if (ret)
return ret; return ret;
return snd_soc_component_set_jack(asoc_rtd_to_codec(runtime, 0)->component, jack, NULL); return snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, jack, NULL);
} }
static void avs_rt298_codec_exit(struct snd_soc_pcm_runtime *rtd) static void avs_rt298_codec_exit(struct snd_soc_pcm_runtime *rtd)
{ {
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL); snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
} }
static int avs_rt298_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params) static int avs_rt298_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params)
...@@ -109,8 +109,8 @@ static int avs_rt298_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pc ...@@ -109,8 +109,8 @@ static int avs_rt298_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pc
static int static int
avs_rt298_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) avs_rt298_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
unsigned int clk_freq; unsigned int clk_freq;
int ret; int ret;
......
...@@ -79,14 +79,14 @@ static int avs_rt5663_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -79,14 +79,14 @@ static int avs_rt5663_codec_init(struct snd_soc_pcm_runtime *runtime)
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
snd_soc_component_set_jack(asoc_rtd_to_codec(runtime, 0)->component, jack, NULL); snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, jack, NULL);
return 0; return 0;
} }
static void avs_rt5663_codec_exit(struct snd_soc_pcm_runtime *runtime) static void avs_rt5663_codec_exit(struct snd_soc_pcm_runtime *runtime)
{ {
snd_soc_component_set_jack(asoc_rtd_to_codec(runtime, 0)->component, NULL, NULL); snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, NULL, NULL);
} }
static int static int
...@@ -113,8 +113,8 @@ avs_rt5663_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_param ...@@ -113,8 +113,8 @@ avs_rt5663_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_param
static int avs_rt5663_hw_params(struct snd_pcm_substream *substream, static int avs_rt5663_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
int ret; int ret;
/* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */ /* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */
......
...@@ -92,7 +92,7 @@ static struct snd_soc_jack_pin card_jack_pins[] = { ...@@ -92,7 +92,7 @@ static struct snd_soc_jack_pin card_jack_pins[] = {
static int avs_rt5682_codec_init(struct snd_soc_pcm_runtime *runtime) static int avs_rt5682_codec_init(struct snd_soc_pcm_runtime *runtime)
{ {
struct snd_soc_component *component = asoc_rtd_to_codec(runtime, 0)->component; struct snd_soc_component *component = snd_soc_rtd_to_codec(runtime, 0)->component;
struct snd_soc_card *card = runtime->card; struct snd_soc_card *card = runtime->card;
struct snd_soc_jack_pin *pins; struct snd_soc_jack_pin *pins;
struct snd_soc_jack *jack; struct snd_soc_jack *jack;
...@@ -137,14 +137,14 @@ static int avs_rt5682_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -137,14 +137,14 @@ static int avs_rt5682_codec_init(struct snd_soc_pcm_runtime *runtime)
static void avs_rt5682_codec_exit(struct snd_soc_pcm_runtime *rtd) static void avs_rt5682_codec_exit(struct snd_soc_pcm_runtime *rtd)
{ {
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL); snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
} }
static int static int
avs_rt5682_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) avs_rt5682_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params)
{ {
struct snd_soc_pcm_runtime *runtime = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *runtime = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
int pll_source, freq_in, freq_out; int pll_source, freq_in, freq_out;
int ret; int ret;
......
...@@ -50,12 +50,12 @@ static int avs_ssm4567_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -50,12 +50,12 @@ static int avs_ssm4567_codec_init(struct snd_soc_pcm_runtime *runtime)
int ret; int ret;
/* Slot 1 for left */ /* Slot 1 for left */
ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_codec(runtime, 0), 0x01, 0x01, 2, 48); ret = snd_soc_dai_set_tdm_slot(snd_soc_rtd_to_codec(runtime, 0), 0x01, 0x01, 2, 48);
if (ret < 0) if (ret < 0)
return ret; return ret;
/* Slot 2 for right */ /* Slot 2 for right */
ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_codec(runtime, 1), 0x02, 0x02, 2, 48); ret = snd_soc_dai_set_tdm_slot(snd_soc_rtd_to_codec(runtime, 1), 0x02, 0x02, 2, 48);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -58,7 +58,7 @@ avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction) ...@@ -58,7 +58,7 @@ avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction)
static int avs_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai, bool is_fe, static int avs_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai, bool is_fe,
const struct snd_soc_dai_ops *ops) const struct snd_soc_dai_ops *ops)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct avs_dev *adev = to_avs_dev(dai->dev); struct avs_dev *adev = to_avs_dev(dai->dev);
struct avs_tplg_path_template *template; struct avs_tplg_path_template *template;
struct avs_dma_data *data; struct avs_dma_data *data;
...@@ -127,7 +127,7 @@ static int avs_dai_be_hw_params(struct snd_pcm_substream *substream, ...@@ -127,7 +127,7 @@ static int avs_dai_be_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *fe, *be; struct snd_soc_pcm_runtime *fe, *be;
struct snd_soc_dpcm *dpcm; struct snd_soc_dpcm *dpcm;
be = asoc_substream_to_rtd(substream); be = snd_soc_substream_to_rtd(substream);
for_each_dpcm_fe(be, substream->stream, dpcm) { for_each_dpcm_fe(be, substream->stream, dpcm) {
fe = dpcm->fe; fe = dpcm->fe;
fe_hw_params = &fe->dpcm[substream->stream].hw_params; fe_hw_params = &fe->dpcm[substream->stream].hw_params;
...@@ -167,7 +167,7 @@ static int avs_dai_nonhda_be_startup(struct snd_pcm_substream *substream, struct ...@@ -167,7 +167,7 @@ static int avs_dai_nonhda_be_startup(struct snd_pcm_substream *substream, struct
static void avs_dai_nonhda_be_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) static void avs_dai_nonhda_be_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct avs_dev *adev = to_avs_dev(dai->dev); struct avs_dev *adev = to_avs_dev(dai->dev);
struct avs_dma_data *data; struct avs_dma_data *data;
...@@ -216,7 +216,7 @@ static int avs_dai_nonhda_be_prepare(struct snd_pcm_substream *substream, struct ...@@ -216,7 +216,7 @@ static int avs_dai_nonhda_be_prepare(struct snd_pcm_substream *substream, struct
static int avs_dai_nonhda_be_trigger(struct snd_pcm_substream *substream, int cmd, static int avs_dai_nonhda_be_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct avs_dma_data *data; struct avs_dma_data *data;
int ret = 0; int ret = 0;
...@@ -303,7 +303,7 @@ static int avs_dai_hda_be_hw_params(struct snd_pcm_substream *substream, ...@@ -303,7 +303,7 @@ static int avs_dai_hda_be_hw_params(struct snd_pcm_substream *substream,
static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
{ {
struct avs_dma_data *data; struct avs_dma_data *data;
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct hdac_ext_stream *link_stream; struct hdac_ext_stream *link_stream;
struct hdac_ext_link *link; struct hdac_ext_link *link;
struct hda_codec *codec; struct hda_codec *codec;
...@@ -320,7 +320,7 @@ static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct sn ...@@ -320,7 +320,7 @@ static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct sn
data->path = NULL; data->path = NULL;
/* clear link <-> stream mapping */ /* clear link <-> stream mapping */
codec = dev_to_hda_codec(asoc_rtd_to_codec(rtd, 0)->dev); codec = dev_to_hda_codec(snd_soc_rtd_to_codec(rtd, 0)->dev);
link = snd_hdac_ext_bus_get_hlink_by_addr(&codec->bus->core, codec->core.addr); link = snd_hdac_ext_bus_get_hlink_by_addr(&codec->bus->core, codec->core.addr);
if (!link) if (!link)
return -EINVAL; return -EINVAL;
...@@ -333,7 +333,7 @@ static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct sn ...@@ -333,7 +333,7 @@ static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct sn
static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct hdac_ext_stream *link_stream = runtime->private_data; struct hdac_ext_stream *link_stream = runtime->private_data;
struct hdac_ext_link *link; struct hdac_ext_link *link;
...@@ -345,7 +345,7 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn ...@@ -345,7 +345,7 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn
if (link_stream->link_prepared) if (link_stream->link_prepared)
return 0; return 0;
codec = dev_to_hda_codec(asoc_rtd_to_codec(rtd, 0)->dev); codec = dev_to_hda_codec(snd_soc_rtd_to_codec(rtd, 0)->dev);
bus = &codec->bus->core; bus = &codec->bus->core;
format_val = snd_hdac_calc_stream_format(runtime->rate, runtime->channels, runtime->format, format_val = snd_hdac_calc_stream_format(runtime->rate, runtime->channels, runtime->format,
runtime->sample_bits, 0); runtime->sample_bits, 0);
...@@ -372,7 +372,7 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn ...@@ -372,7 +372,7 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn
static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd, static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct hdac_ext_stream *link_stream; struct hdac_ext_stream *link_stream;
struct avs_dma_data *data; struct avs_dma_data *data;
int ret = 0; int ret = 0;
...@@ -500,7 +500,7 @@ static int avs_dai_fe_startup(struct snd_pcm_substream *substream, struct snd_so ...@@ -500,7 +500,7 @@ static int avs_dai_fe_startup(struct snd_pcm_substream *substream, struct snd_so
static void avs_dai_fe_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) static void avs_dai_fe_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct avs_dev *adev = to_avs_dev(dai->dev); struct avs_dev *adev = to_avs_dev(dai->dev);
struct avs_dma_data *data; struct avs_dma_data *data;
...@@ -534,7 +534,7 @@ static int avs_dai_fe_hw_params(struct snd_pcm_substream *substream, ...@@ -534,7 +534,7 @@ static int avs_dai_fe_hw_params(struct snd_pcm_substream *substream,
hdac_stream(host_stream)->period_bytes = 0; hdac_stream(host_stream)->period_bytes = 0;
hdac_stream(host_stream)->format_val = 0; hdac_stream(host_stream)->format_val = 0;
fe = asoc_substream_to_rtd(substream); fe = snd_soc_substream_to_rtd(substream);
for_each_dpcm_be(fe, substream->stream, dpcm) { for_each_dpcm_be(fe, substream->stream, dpcm) {
be = dpcm->be; be = dpcm->be;
be_hw_params = &be->dpcm[substream->stream].hw_params; be_hw_params = &be->dpcm[substream->stream].hw_params;
...@@ -639,7 +639,7 @@ static int avs_dai_fe_prepare(struct snd_pcm_substream *substream, struct snd_so ...@@ -639,7 +639,7 @@ static int avs_dai_fe_prepare(struct snd_pcm_substream *substream, struct snd_so
static int avs_dai_fe_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) static int avs_dai_fe_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct avs_dma_data *data; struct avs_dma_data *data;
struct hdac_ext_stream *host_stream; struct hdac_ext_stream *host_stream;
struct hdac_bus *bus; struct hdac_bus *bus;
...@@ -869,7 +869,7 @@ static int avs_dai_resume_hw_params(struct snd_soc_dai *dai, struct avs_dma_data ...@@ -869,7 +869,7 @@ static int avs_dai_resume_hw_params(struct snd_soc_dai *dai, struct avs_dma_data
int ret; int ret;
substream = data->substream; substream = data->substream;
rtd = asoc_substream_to_rtd(substream); rtd = snd_soc_substream_to_rtd(substream);
ret = dai->driver->ops->hw_params(substream, &rtd->dpcm[substream->stream].hw_params, dai); ret = dai->driver->ops->hw_params(substream, &rtd->dpcm[substream->stream].hw_params, dai);
if (ret) if (ret)
...@@ -964,7 +964,7 @@ static int avs_component_pm_op(struct snd_soc_component *component, bool be, ...@@ -964,7 +964,7 @@ static int avs_component_pm_op(struct snd_soc_component *component, bool be,
for_each_component_dais(component, dai) { for_each_component_dais(component, dai) {
data = snd_soc_dai_dma_data_get_playback(dai); data = snd_soc_dai_dma_data_get_playback(dai);
if (data) { if (data) {
rtd = asoc_substream_to_rtd(data->substream); rtd = snd_soc_substream_to_rtd(data->substream);
if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) { if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) {
ret = op(dai, data); ret = op(dai, data);
if (ret < 0) { if (ret < 0) {
...@@ -977,7 +977,7 @@ static int avs_component_pm_op(struct snd_soc_component *component, bool be, ...@@ -977,7 +977,7 @@ static int avs_component_pm_op(struct snd_soc_component *component, bool be,
data = snd_soc_dai_dma_data_get_capture(dai); data = snd_soc_dai_dma_data_get_capture(dai);
if (data) { if (data) {
rtd = asoc_substream_to_rtd(data->substream); rtd = snd_soc_substream_to_rtd(data->substream);
if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) { if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) {
ret = op(dai, data); ret = op(dai, data);
if (ret < 0) { if (ret < 0) {
...@@ -1081,7 +1081,7 @@ static const struct snd_pcm_hardware avs_pcm_hardware = { ...@@ -1081,7 +1081,7 @@ static const struct snd_pcm_hardware avs_pcm_hardware = {
static int avs_component_open(struct snd_soc_component *component, static int avs_component_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream) struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
/* only FE DAI links are handled here */ /* only FE DAI links are handled here */
if (rtd->dai_link->no_pcm) if (rtd->dai_link->no_pcm)
...@@ -1099,12 +1099,12 @@ static unsigned int avs_hda_stream_dpib_read(struct hdac_ext_stream *stream) ...@@ -1099,12 +1099,12 @@ static unsigned int avs_hda_stream_dpib_read(struct hdac_ext_stream *stream)
static snd_pcm_uframes_t static snd_pcm_uframes_t
avs_component_pointer(struct snd_soc_component *component, struct snd_pcm_substream *substream) avs_component_pointer(struct snd_soc_component *component, struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct avs_dma_data *data; struct avs_dma_data *data;
struct hdac_ext_stream *host_stream; struct hdac_ext_stream *host_stream;
unsigned int pos; unsigned int pos;
data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream); data = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
if (!data->host_stream) if (!data->host_stream)
return 0; return 0;
...@@ -1129,7 +1129,7 @@ static int avs_component_mmap(struct snd_soc_component *component, ...@@ -1129,7 +1129,7 @@ static int avs_component_mmap(struct snd_soc_component *component,
static int avs_component_construct(struct snd_soc_component *component, static int avs_component_construct(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd) struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_dai *dai = asoc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *dai = snd_soc_rtd_to_cpu(rtd, 0);
struct snd_pcm *pcm = rtd->pcm; struct snd_pcm *pcm = rtd->pcm;
if (dai->driver->playback.channels_min) if (dai->driver->playback.channels_min)
...@@ -1430,7 +1430,7 @@ static void avs_component_hda_remove(struct snd_soc_component *component) ...@@ -1430,7 +1430,7 @@ static void avs_component_hda_remove(struct snd_soc_component *component)
static int avs_component_hda_open(struct snd_soc_component *component, static int avs_component_hda_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream) struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct hdac_ext_stream *link_stream; struct hdac_ext_stream *link_stream;
struct hda_codec *codec; struct hda_codec *codec;
...@@ -1464,7 +1464,7 @@ static int avs_component_hda_open(struct snd_soc_component *component, ...@@ -1464,7 +1464,7 @@ static int avs_component_hda_open(struct snd_soc_component *component,
return snd_soc_set_runtime_hwparams(substream, &hwparams); return snd_soc_set_runtime_hwparams(substream, &hwparams);
} }
codec = dev_to_hda_codec(asoc_rtd_to_codec(rtd, 0)->dev); codec = dev_to_hda_codec(snd_soc_rtd_to_codec(rtd, 0)->dev);
link_stream = snd_hdac_ext_stream_assign(&codec->bus->core, substream, link_stream = snd_hdac_ext_stream_assign(&codec->bus->core, substream,
HDAC_EXT_STREAM_TYPE_LINK); HDAC_EXT_STREAM_TYPE_LINK);
if (!link_stream) if (!link_stream)
...@@ -1477,7 +1477,7 @@ static int avs_component_hda_open(struct snd_soc_component *component, ...@@ -1477,7 +1477,7 @@ static int avs_component_hda_open(struct snd_soc_component *component,
static int avs_component_hda_close(struct snd_soc_component *component, static int avs_component_hda_close(struct snd_soc_component *component,
struct snd_pcm_substream *substream) struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct hdac_ext_stream *link_stream; struct hdac_ext_stream *link_stream;
/* only BE DAI links are handled here */ /* only BE DAI links are handled here */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment