diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2018-01-28 23:24:17 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-02-12 04:56:14 -0500 |
commit | 7ec9b872f975a7ab7a466fdb63da9509bc2c9085 (patch) | |
tree | f001273f0fc2b928261ae3dcbd9131106c22fbcd | |
parent | 7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff) |
ASoC: sun8i: 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 = 0 -> .idle_bias_on = 1
.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>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/sunxi/sun8i-codec.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c index 7a15df924316..fb37dd927e33 100644 --- a/sound/soc/sunxi/sun8i-codec.c +++ b/sound/soc/sunxi/sun8i-codec.c | |||
@@ -184,7 +184,7 @@ static int sun8i_codec_get_hw_rate(struct snd_pcm_hw_params *params) | |||
184 | 184 | ||
185 | static int sun8i_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) | 185 | static int sun8i_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) |
186 | { | 186 | { |
187 | struct sun8i_codec *scodec = snd_soc_codec_get_drvdata(dai->codec); | 187 | struct sun8i_codec *scodec = snd_soc_component_get_drvdata(dai->component); |
188 | u32 value; | 188 | u32 value; |
189 | 189 | ||
190 | /* clock masters */ | 190 | /* clock masters */ |
@@ -304,7 +304,7 @@ static int sun8i_codec_hw_params(struct snd_pcm_substream *substream, | |||
304 | struct snd_pcm_hw_params *params, | 304 | struct snd_pcm_hw_params *params, |
305 | struct snd_soc_dai *dai) | 305 | struct snd_soc_dai *dai) |
306 | { | 306 | { |
307 | struct sun8i_codec *scodec = snd_soc_codec_get_drvdata(dai->codec); | 307 | struct sun8i_codec *scodec = snd_soc_component_get_drvdata(dai->component); |
308 | int sample_rate; | 308 | int sample_rate; |
309 | u8 bclk_div; | 309 | u8 bclk_div; |
310 | 310 | ||
@@ -500,13 +500,15 @@ static struct snd_soc_dai_driver sun8i_codec_dai = { | |||
500 | .ops = &sun8i_codec_dai_ops, | 500 | .ops = &sun8i_codec_dai_ops, |
501 | }; | 501 | }; |
502 | 502 | ||
503 | static const struct snd_soc_codec_driver sun8i_soc_codec = { | 503 | static const struct snd_soc_component_driver sun8i_soc_component = { |
504 | .component_driver = { | 504 | .dapm_widgets = sun8i_codec_dapm_widgets, |
505 | .dapm_widgets = sun8i_codec_dapm_widgets, | 505 | .num_dapm_widgets = ARRAY_SIZE(sun8i_codec_dapm_widgets), |
506 | .num_dapm_widgets = ARRAY_SIZE(sun8i_codec_dapm_widgets), | 506 | .dapm_routes = sun8i_codec_dapm_routes, |
507 | .dapm_routes = sun8i_codec_dapm_routes, | 507 | .num_dapm_routes = ARRAY_SIZE(sun8i_codec_dapm_routes), |
508 | .num_dapm_routes = ARRAY_SIZE(sun8i_codec_dapm_routes), | 508 | .idle_bias_on = 1, |
509 | }, | 509 | .use_pmdown_time = 1, |
510 | .endianness = 1, | ||
511 | .non_legacy_dai_naming = 1, | ||
510 | }; | 512 | }; |
511 | 513 | ||
512 | static const struct regmap_config sun8i_codec_regmap_config = { | 514 | static const struct regmap_config sun8i_codec_regmap_config = { |
@@ -566,7 +568,7 @@ static int sun8i_codec_probe(struct platform_device *pdev) | |||
566 | goto err_pm_disable; | 568 | goto err_pm_disable; |
567 | } | 569 | } |
568 | 570 | ||
569 | ret = snd_soc_register_codec(&pdev->dev, &sun8i_soc_codec, | 571 | ret = devm_snd_soc_register_component(&pdev->dev, &sun8i_soc_component, |
570 | &sun8i_codec_dai, 1); | 572 | &sun8i_codec_dai, 1); |
571 | if (ret) { | 573 | if (ret) { |
572 | dev_err(&pdev->dev, "Failed to register codec\n"); | 574 | dev_err(&pdev->dev, "Failed to register codec\n"); |
@@ -594,7 +596,6 @@ static int sun8i_codec_remove(struct platform_device *pdev) | |||
594 | if (!pm_runtime_status_suspended(&pdev->dev)) | 596 | if (!pm_runtime_status_suspended(&pdev->dev)) |
595 | sun8i_codec_runtime_suspend(&pdev->dev); | 597 | sun8i_codec_runtime_suspend(&pdev->dev); |
596 | 598 | ||
597 | snd_soc_unregister_codec(&pdev->dev); | ||
598 | clk_disable_unprepare(scodec->clk_module); | 599 | clk_disable_unprepare(scodec->clk_module); |
599 | clk_disable_unprepare(scodec->clk_bus); | 600 | clk_disable_unprepare(scodec->clk_bus); |
600 | 601 | ||