aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-01-28 23:09:20 -0500
committerMark Brown <broonie@kernel.org>2018-02-12 04:49:57 -0500
commit4b51e9f1c386dbd7bd7bc5a342a6ac90a6c54904 (patch)
tree0a46f6b5d255a232dd8a32fc114687b35991e62e
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff)
ASoC: max98357a: 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/codecs/max98357a.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/sound/soc/codecs/max98357a.c b/sound/soc/codecs/max98357a.c
index 426ed2dae6ca..d469576b5a7b 100644
--- a/sound/soc/codecs/max98357a.c
+++ b/sound/soc/codecs/max98357a.c
@@ -59,27 +59,29 @@ static const struct snd_soc_dapm_route max98357a_dapm_routes[] = {
59 {"Speaker", NULL, "HiFi Playback"}, 59 {"Speaker", NULL, "HiFi Playback"},
60}; 60};
61 61
62static int max98357a_codec_probe(struct snd_soc_codec *codec) 62static int max98357a_component_probe(struct snd_soc_component *component)
63{ 63{
64 struct gpio_desc *sdmode; 64 struct gpio_desc *sdmode;
65 65
66 sdmode = devm_gpiod_get_optional(codec->dev, "sdmode", GPIOD_OUT_LOW); 66 sdmode = devm_gpiod_get_optional(component->dev, "sdmode", GPIOD_OUT_LOW);
67 if (IS_ERR(sdmode)) 67 if (IS_ERR(sdmode))
68 return PTR_ERR(sdmode); 68 return PTR_ERR(sdmode);
69 69
70 snd_soc_codec_set_drvdata(codec, sdmode); 70 snd_soc_component_set_drvdata(component, sdmode);
71 71
72 return 0; 72 return 0;
73} 73}
74 74
75static const struct snd_soc_codec_driver max98357a_codec_driver = { 75static const struct snd_soc_component_driver max98357a_component_driver = {
76 .probe = max98357a_codec_probe, 76 .probe = max98357a_component_probe,
77 .component_driver = { 77 .dapm_widgets = max98357a_dapm_widgets,
78 .dapm_widgets = max98357a_dapm_widgets, 78 .num_dapm_widgets = ARRAY_SIZE(max98357a_dapm_widgets),
79 .num_dapm_widgets = ARRAY_SIZE(max98357a_dapm_widgets), 79 .dapm_routes = max98357a_dapm_routes,
80 .dapm_routes = max98357a_dapm_routes, 80 .num_dapm_routes = ARRAY_SIZE(max98357a_dapm_routes),
81 .num_dapm_routes = ARRAY_SIZE(max98357a_dapm_routes), 81 .idle_bias_on = 1,
82 }, 82 .use_pmdown_time = 1,
83 .endianness = 1,
84 .non_legacy_dai_naming = 1,
83}; 85};
84 86
85static const struct snd_soc_dai_ops max98357a_dai_ops = { 87static const struct snd_soc_dai_ops max98357a_dai_ops = {
@@ -107,14 +109,13 @@ static struct snd_soc_dai_driver max98357a_dai_driver = {
107 109
108static int max98357a_platform_probe(struct platform_device *pdev) 110static int max98357a_platform_probe(struct platform_device *pdev)
109{ 111{
110 return snd_soc_register_codec(&pdev->dev, &max98357a_codec_driver, 112 return devm_snd_soc_register_component(&pdev->dev,
113 &max98357a_component_driver,
111 &max98357a_dai_driver, 1); 114 &max98357a_dai_driver, 1);
112} 115}
113 116
114static int max98357a_platform_remove(struct platform_device *pdev) 117static int max98357a_platform_remove(struct platform_device *pdev)
115{ 118{
116 snd_soc_unregister_codec(&pdev->dev);
117
118 return 0; 119 return 0;
119} 120}
120 121