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

ASoC: rt5670: replace codec to component

Now we can replace Codec to Component. Let's do it.

Note:
	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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7928b2cb
This diff is collapsed.
...@@ -1986,11 +1986,11 @@ enum { ...@@ -1986,11 +1986,11 @@ enum {
RT5670_DOWN_RATE_FILTER = (0x1 << 7), RT5670_DOWN_RATE_FILTER = (0x1 << 7),
}; };
int rt5670_sel_asrc_clk_src(struct snd_soc_codec *codec, int rt5670_sel_asrc_clk_src(struct snd_soc_component *component,
unsigned int filter_mask, unsigned int clk_src); unsigned int filter_mask, unsigned int clk_src);
struct rt5670_priv { struct rt5670_priv {
struct snd_soc_codec *codec; struct snd_soc_component *component;
struct rt5670_platform_data pdata; struct rt5670_platform_data pdata;
struct regmap *regmap; struct regmap *regmap;
struct snd_soc_jack *jack; struct snd_soc_jack *jack;
...@@ -2012,8 +2012,8 @@ struct rt5670_priv { ...@@ -2012,8 +2012,8 @@ struct rt5670_priv {
int jack_type_saved; int jack_type_saved;
}; };
void rt5670_jack_suspend(struct snd_soc_codec *codec); void rt5670_jack_suspend(struct snd_soc_component *component);
void rt5670_jack_resume(struct snd_soc_codec *codec); void rt5670_jack_resume(struct snd_soc_component *component);
int rt5670_set_jack_detect(struct snd_soc_codec *codec, int rt5670_set_jack_detect(struct snd_soc_component *component,
struct snd_soc_jack *jack); struct snd_soc_jack *jack);
#endif /* __RT5670_H__ */ #endif /* __RT5670_H__ */
...@@ -183,10 +183,10 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -183,10 +183,10 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
{ {
int ret; int ret;
struct snd_soc_dai *codec_dai = runtime->codec_dai; struct snd_soc_dai *codec_dai = runtime->codec_dai;
struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_component *component = codec_dai->component;
struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card); struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card);
if (devm_acpi_dev_add_driver_gpios(codec->dev, cht_rt5672_gpios)) if (devm_acpi_dev_add_driver_gpios(component->dev, cht_rt5672_gpios))
dev_warn(runtime->dev, "Unable to add GPIO mapping table\n"); dev_warn(runtime->dev, "Unable to add GPIO mapping table\n");
/* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */ /* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */
...@@ -201,7 +201,7 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -201,7 +201,7 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
* be supported by RT5672. Otherwise, ASRC will be disabled and cause * be supported by RT5672. Otherwise, ASRC will be disabled and cause
* noise. * noise.
*/ */
rt5670_sel_asrc_clk_src(codec, rt5670_sel_asrc_clk_src(component,
RT5670_DA_STEREO_FILTER RT5670_DA_STEREO_FILTER
| RT5670_DA_MONO_L_FILTER | RT5670_DA_MONO_L_FILTER
| RT5670_DA_MONO_R_FILTER | RT5670_DA_MONO_R_FILTER
...@@ -219,7 +219,7 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -219,7 +219,7 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
if (ret) if (ret)
return ret; return ret;
rt5670_set_jack_detect(codec, &ctx->headset); rt5670_set_jack_detect(component, &ctx->headset);
if (ctx->mclk) { if (ctx->mclk) {
/* /*
* The firmware might enable the clock at * The firmware might enable the clock at
...@@ -333,10 +333,9 @@ static int cht_suspend_pre(struct snd_soc_card *card) ...@@ -333,10 +333,9 @@ static int cht_suspend_pre(struct snd_soc_card *card)
list_for_each_entry(component, &card->component_dev_list, card_list) { list_for_each_entry(component, &card->component_dev_list, card_list) {
if (!strncmp(component->name, if (!strncmp(component->name,
ctx->codec_name, sizeof(ctx->codec_name))) { ctx->codec_name, sizeof(ctx->codec_name))) {
struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
dev_dbg(codec->dev, "disabling jack detect before going to suspend.\n"); dev_dbg(component->dev, "disabling jack detect before going to suspend.\n");
rt5670_jack_suspend(codec); rt5670_jack_suspend(component);
break; break;
} }
} }
...@@ -351,10 +350,9 @@ static int cht_resume_post(struct snd_soc_card *card) ...@@ -351,10 +350,9 @@ static int cht_resume_post(struct snd_soc_card *card)
list_for_each_entry(component, &card->component_dev_list, card_list) { list_for_each_entry(component, &card->component_dev_list, card_list) {
if (!strncmp(component->name, if (!strncmp(component->name,
ctx->codec_name, sizeof(ctx->codec_name))) { ctx->codec_name, sizeof(ctx->codec_name))) {
struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
dev_dbg(codec->dev, "enabling jack detect for resume.\n"); dev_dbg(component->dev, "enabling jack detect for resume.\n");
rt5670_jack_resume(codec); rt5670_jack_resume(component);
break; break;
} }
} }
......
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