diff options
-rw-r--r-- | sound/soc/codecs/max98357a.c | 29 |
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 | ||
62 | static int max98357a_codec_probe(struct snd_soc_codec *codec) | 62 | static 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 | ||
75 | static const struct snd_soc_codec_driver max98357a_codec_driver = { | 75 | static 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 | ||
85 | static const struct snd_soc_dai_ops max98357a_dai_ops = { | 87 | static const struct snd_soc_dai_ops max98357a_dai_ops = { |
@@ -107,14 +109,13 @@ static struct snd_soc_dai_driver max98357a_dai_driver = { | |||
107 | 109 | ||
108 | static int max98357a_platform_probe(struct platform_device *pdev) | 110 | static 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 | ||
114 | static int max98357a_platform_remove(struct platform_device *pdev) | 117 | static 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 | ||