Commit 1a72df80 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rockchip: 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/878r9cqngq.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5f444041
...@@ -66,9 +66,9 @@ static int rk_hw_params(struct snd_pcm_substream *substream, ...@@ -66,9 +66,9 @@ static int rk_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
int ret = 0; int ret = 0;
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 *cpu_dai = asoc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
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 mclk; int mclk;
switch (params_rate(params)) { switch (params_rate(params)) {
......
...@@ -68,13 +68,13 @@ static const struct snd_kcontrol_new rockchip_controls[] = { ...@@ -68,13 +68,13 @@ static const struct snd_kcontrol_new rockchip_controls[] = {
static int rockchip_sound_max98357a_hw_params(struct snd_pcm_substream *substream, static int rockchip_sound_max98357a_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);
unsigned int mclk; unsigned int mclk;
int ret; int ret;
mclk = params_rate(params) * SOUND_FS; mclk = params_rate(params) * SOUND_FS;
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0), 0, mclk, 0); ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_cpu(rtd, 0), 0, mclk, 0);
if (ret) { if (ret) {
dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n",
__func__, mclk, ret); __func__, mclk, ret);
...@@ -87,9 +87,9 @@ static int rockchip_sound_max98357a_hw_params(struct snd_pcm_substream *substrea ...@@ -87,9 +87,9 @@ static int rockchip_sound_max98357a_hw_params(struct snd_pcm_substream *substrea
static int rockchip_sound_rt5514_hw_params(struct snd_pcm_substream *substream, static int rockchip_sound_rt5514_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 *cpu_dai = asoc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
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 mclk; unsigned int mclk;
int ret; int ret;
...@@ -119,9 +119,9 @@ static int rockchip_sound_rt5514_hw_params(struct snd_pcm_substream *substream, ...@@ -119,9 +119,9 @@ static int rockchip_sound_rt5514_hw_params(struct snd_pcm_substream *substream,
static int rockchip_sound_da7219_hw_params(struct snd_pcm_substream *substream, static int rockchip_sound_da7219_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 *cpu_dai = asoc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
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 mclk, ret; int mclk, ret;
/* in bypass mode, the mclk has to be one of the frequencies below */ /* in bypass mode, the mclk has to be one of the frequencies below */
...@@ -172,7 +172,7 @@ static struct snd_soc_jack cdn_dp_card_jack; ...@@ -172,7 +172,7 @@ static struct snd_soc_jack cdn_dp_card_jack;
static int rockchip_sound_cdndp_init(struct snd_soc_pcm_runtime *rtd) static int rockchip_sound_cdndp_init(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
struct snd_soc_card *card = rtd->card; struct snd_soc_card *card = rtd->card;
int ret; int ret;
...@@ -189,8 +189,8 @@ static int rockchip_sound_cdndp_init(struct snd_soc_pcm_runtime *rtd) ...@@ -189,8 +189,8 @@ static int rockchip_sound_cdndp_init(struct snd_soc_pcm_runtime *rtd)
static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd) static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
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;
/* We need default MCLK and PLL settings for the accessory detection */ /* We need default MCLK and PLL settings for the accessory detection */
...@@ -238,13 +238,13 @@ static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd) ...@@ -238,13 +238,13 @@ static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd)
static int rockchip_sound_dmic_hw_params(struct snd_pcm_substream *substream, static int rockchip_sound_dmic_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);
unsigned int mclk; unsigned int mclk;
int ret; int ret;
mclk = params_rate(params) * SOUND_FS; mclk = params_rate(params) * SOUND_FS;
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0), 0, mclk, 0); ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_cpu(rtd, 0), 0, mclk, 0);
if (ret) { if (ret) {
dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n", dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n",
__func__, mclk, ret); __func__, mclk, ret);
......
...@@ -352,7 +352,7 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream, ...@@ -352,7 +352,7 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct rk_i2s_dev *i2s = to_info(dai); struct rk_i2s_dev *i2s = to_info(dai);
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
unsigned int val = 0; unsigned int val = 0;
unsigned int mclk_rate, bclk_rate, div_bclk, div_lrck; unsigned int mclk_rate, bclk_rate, div_bclk, div_lrck;
......
...@@ -144,9 +144,9 @@ static int rk_aif1_hw_params(struct snd_pcm_substream *substream, ...@@ -144,9 +144,9 @@ static int rk_aif1_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
int ret = 0; int ret = 0;
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 *cpu_dai = asoc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
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 mclk; int mclk;
switch (params_rate(params)) { switch (params_rate(params)) {
...@@ -226,7 +226,7 @@ static struct snd_soc_jack rk_hdmi_jack; ...@@ -226,7 +226,7 @@ static struct snd_soc_jack rk_hdmi_jack;
static int rk_hdmi_init(struct snd_soc_pcm_runtime *runtime) static int rk_hdmi_init(struct snd_soc_pcm_runtime *runtime)
{ {
struct snd_soc_card *card = runtime->card; struct snd_soc_card *card = runtime->card;
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;
int ret; int ret;
/* enable jack detection */ /* enable jack detection */
......
...@@ -65,9 +65,9 @@ static int rk_aif1_hw_params(struct snd_pcm_substream *substream, ...@@ -65,9 +65,9 @@ static int rk_aif1_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
int ret = 0; int ret = 0;
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 *cpu_dai = asoc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
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 mclk; int mclk;
switch (params_rate(params)) { switch (params_rate(params)) {
...@@ -125,7 +125,7 @@ static int rk_init(struct snd_soc_pcm_runtime *runtime) ...@@ -125,7 +125,7 @@ static int rk_init(struct snd_soc_pcm_runtime *runtime)
return ret; return ret;
} }
return rt5645_set_jack_detect(asoc_rtd_to_codec(runtime, 0)->component, return rt5645_set_jack_detect(snd_soc_rtd_to_codec(runtime, 0)->component,
&headset_jack, &headset_jack,
&headset_jack, &headset_jack,
&headset_jack); &headset_jack);
......
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