diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2018-02-13 02:03:12 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-02-14 10:44:19 +0000 |
commit | 0fe1daa6663ae9437c7168b81fe23c9ed50f55df (patch) | |
tree | f31a7178b5fd5cf2b0157ae67cd70bc0690bd677 /sound/soc/samsung | |
parent | 03a0ddeda7ebafea8e99078581a50d856e3587a4 (diff) | |
download | linux-0fe1daa6663ae9437c7168b81fe23c9ed50f55df.tar.bz2 |
ASoC: arizona: replace codec to component
Now we can replace Codec to Component. Let's do it.
Because there are many drivers which are using arizona,
we need to update these all related drivers in same time.
Otherwise compile error/warning happen
Note:
cs47l24
xxx_codec_xxx() -> xxx_component_xxx()
.idle_bias_off = 1 -> .idle_bias_on = 0
.ignore_pmdown_time = 0 -> .use_pmdown_time = 1
- -> .endianness = 1
- -> .non_legacy_dai_naming = 1
wm5102
xxx_codec_xxx() -> xxx_component_xxx()
.idle_bias_off = 1 -> .idle_bias_on = 0
.ignore_pmdown_time = 0 -> .use_pmdown_time = 1
- -> .endianness = 1
- -> .non_legacy_dai_naming = 1
wm5110
xxx_codec_xxx() -> xxx_component_xxx()
.idle_bias_off = 1 -> .idle_bias_on = 0
.ignore_pmdown_time = 0 -> .use_pmdown_time = 1
- -> .endianness = 1
- -> .non_legacy_dai_naming = 1
wm8997
xxx_codec_xxx() -> xxx_component_xxx()
.idle_bias_off = 1 -> .idle_bias_on = 0
.ignore_pmdown_time = 0 -> .use_pmdown_time = 1
- -> .endianness = 1
- -> .non_legacy_dai_naming = 1
wm8998
xxx_codec_xxx() -> xxx_component_xxx()
.idle_bias_off = 1 -> .idle_bias_on = 0
.ignore_pmdown_time = 0 -> .use_pmdown_time = 1
- -> .endianness = 1
- -> .non_legacy_dai_naming = 1
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r-- | sound/soc/samsung/tm2_wm5110.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/sound/soc/samsung/tm2_wm5110.c b/sound/soc/samsung/tm2_wm5110.c index a55d18703fe7..6faaec889d1b 100644 --- a/sound/soc/samsung/tm2_wm5110.c +++ b/sound/soc/samsung/tm2_wm5110.c @@ -31,7 +31,7 @@ #define TM2_DAI_AIF2 1 struct tm2_machine_priv { - struct snd_soc_codec *codec; + struct snd_soc_component *component; unsigned int sysclk_rate; struct gpio_desc *gpio_mic_bias; }; @@ -39,33 +39,33 @@ struct tm2_machine_priv { static int tm2_start_sysclk(struct snd_soc_card *card) { struct tm2_machine_priv *priv = snd_soc_card_get_drvdata(card); - struct snd_soc_codec *codec = priv->codec; + struct snd_soc_component *component = priv->component; int ret; - ret = snd_soc_codec_set_pll(codec, WM5110_FLL1_REFCLK, + ret = snd_soc_component_set_pll(component, WM5110_FLL1_REFCLK, ARIZONA_FLL_SRC_MCLK1, MCLK_RATE, priv->sysclk_rate); if (ret < 0) { - dev_err(codec->dev, "Failed to set FLL1 source: %d\n", ret); + dev_err(component->dev, "Failed to set FLL1 source: %d\n", ret); return ret; } - ret = snd_soc_codec_set_pll(codec, WM5110_FLL1, + ret = snd_soc_component_set_pll(component, WM5110_FLL1, ARIZONA_FLL_SRC_MCLK1, MCLK_RATE, priv->sysclk_rate); if (ret < 0) { - dev_err(codec->dev, "Failed to start FLL1: %d\n", ret); + dev_err(component->dev, "Failed to start FLL1: %d\n", ret); return ret; } - ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_SYSCLK, + ret = snd_soc_component_set_sysclk(component, ARIZONA_CLK_SYSCLK, ARIZONA_CLK_SRC_FLL1, priv->sysclk_rate, SND_SOC_CLOCK_IN); if (ret < 0) { - dev_err(codec->dev, "Failed to set SYSCLK source: %d\n", ret); + dev_err(component->dev, "Failed to set SYSCLK source: %d\n", ret); return ret; } @@ -75,19 +75,19 @@ static int tm2_start_sysclk(struct snd_soc_card *card) static int tm2_stop_sysclk(struct snd_soc_card *card) { struct tm2_machine_priv *priv = snd_soc_card_get_drvdata(card); - struct snd_soc_codec *codec = priv->codec; + struct snd_soc_component *component = priv->component; int ret; - ret = snd_soc_codec_set_pll(codec, WM5110_FLL1, 0, 0, 0); + ret = snd_soc_component_set_pll(component, WM5110_FLL1, 0, 0, 0); if (ret < 0) { - dev_err(codec->dev, "Failed to stop FLL1: %d\n", ret); + dev_err(component->dev, "Failed to stop FLL1: %d\n", ret); return ret; } - ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_SYSCLK, + ret = snd_soc_component_set_sysclk(component, ARIZONA_CLK_SYSCLK, ARIZONA_CLK_SRC_FLL1, 0, 0); if (ret < 0) { - dev_err(codec->dev, "Failed to stop SYSCLK: %d\n", ret); + dev_err(component->dev, "Failed to stop SYSCLK: %d\n", ret); return ret; } @@ -98,7 +98,7 @@ static int tm2_aif1_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_codec *codec = rtd->codec; + struct snd_soc_component *component = rtd->codec_dai->component; struct tm2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card); switch (params_rate(params)) { @@ -123,7 +123,7 @@ static int tm2_aif1_hw_params(struct snd_pcm_substream *substream, priv->sysclk_rate = 135475200U; break; default: - dev_err(codec->dev, "Not supported sample rate: %d\n", + dev_err(component->dev, "Not supported sample rate: %d\n", params_rate(params)); return -EINVAL; } @@ -139,7 +139,7 @@ static int tm2_aif2_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_codec *codec = rtd->codec; + struct snd_soc_component *component = rtd->codec_dai->component; unsigned int asyncclk_rate; int ret; @@ -155,35 +155,35 @@ static int tm2_aif2_hw_params(struct snd_pcm_substream *substream, asyncclk_rate = 45158400U; break; default: - dev_err(codec->dev, "Not supported sample rate: %d\n", + dev_err(component->dev, "Not supported sample rate: %d\n", params_rate(params)); return -EINVAL; } - ret = snd_soc_codec_set_pll(codec, WM5110_FLL2_REFCLK, + ret = snd_soc_component_set_pll(component, WM5110_FLL2_REFCLK, ARIZONA_FLL_SRC_MCLK1, MCLK_RATE, asyncclk_rate); if (ret < 0) { - dev_err(codec->dev, "Failed to set FLL2 source: %d\n", ret); + dev_err(component->dev, "Failed to set FLL2 source: %d\n", ret); return ret; } - ret = snd_soc_codec_set_pll(codec, WM5110_FLL2, + ret = snd_soc_component_set_pll(component, WM5110_FLL2, ARIZONA_FLL_SRC_MCLK1, MCLK_RATE, asyncclk_rate); if (ret < 0) { - dev_err(codec->dev, "Failed to start FLL2: %d\n", ret); + dev_err(component->dev, "Failed to start FLL2: %d\n", ret); return ret; } - ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_ASYNCCLK, + ret = snd_soc_component_set_sysclk(component, ARIZONA_CLK_ASYNCCLK, ARIZONA_CLK_SRC_FLL2, asyncclk_rate, SND_SOC_CLOCK_IN); if (ret < 0) { - dev_err(codec->dev, "Failed to set ASYNCCLK source: %d\n", ret); + dev_err(component->dev, "Failed to set ASYNCCLK source: %d\n", ret); return ret; } @@ -193,14 +193,14 @@ static int tm2_aif2_hw_params(struct snd_pcm_substream *substream, static int tm2_aif2_hw_free(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_codec *codec = rtd->codec; + struct snd_soc_component *component = rtd->codec_dai->component; int ret; /* disable FLL2 */ - ret = snd_soc_codec_set_pll(codec, WM5110_FLL2, ARIZONA_FLL_SRC_MCLK1, + ret = snd_soc_component_set_pll(component, WM5110_FLL2, ARIZONA_FLL_SRC_MCLK1, 0, 0); if (ret < 0) - dev_err(codec->dev, "Failed to stop FLL2: %d\n", ret); + dev_err(component->dev, "Failed to stop FLL2: %d\n", ret); return ret; } @@ -269,7 +269,7 @@ static int tm2_late_probe(struct snd_soc_card *card) rtd = snd_soc_get_pcm_runtime(card, card->dai_link[TM2_DAI_AIF1].name); aif1_dai = rtd->codec_dai; - priv->codec = rtd->codec; + priv->component = rtd->codec_dai->component; ret = snd_soc_dai_set_sysclk(aif1_dai, ARIZONA_CLK_SYSCLK, 0, 0); if (ret < 0) { |