aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/tegra/tegra_max98090.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/tegra/tegra_max98090.c')
-rw-r--r--sound/soc/tegra/tegra_max98090.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sound/soc/tegra/tegra_max98090.c b/sound/soc/tegra/tegra_max98090.c
index 0283cfb7c031..ce73e1f62c4b 100644
--- a/sound/soc/tegra/tegra_max98090.c
+++ b/sound/soc/tegra/tegra_max98090.c
@@ -145,6 +145,18 @@ static int tegra_max98090_asoc_init(struct snd_soc_pcm_runtime *rtd)
145 return 0; 145 return 0;
146} 146}
147 147
148static int tegra_max98090_card_remove(struct snd_soc_card *card)
149{
150 struct tegra_max98090 *machine = snd_soc_card_get_drvdata(card);
151
152 if (gpio_is_valid(machine->gpio_hp_det)) {
153 snd_soc_jack_free_gpios(&tegra_max98090_hp_jack, 1,
154 &tegra_max98090_hp_jack_gpio);
155 }
156
157 return 0;
158}
159
148static struct snd_soc_dai_link tegra_max98090_dai = { 160static struct snd_soc_dai_link tegra_max98090_dai = {
149 .name = "max98090", 161 .name = "max98090",
150 .stream_name = "max98090 PCM", 162 .stream_name = "max98090 PCM",
@@ -158,6 +170,7 @@ static struct snd_soc_dai_link tegra_max98090_dai = {
158static struct snd_soc_card snd_soc_tegra_max98090 = { 170static struct snd_soc_card snd_soc_tegra_max98090 = {
159 .name = "tegra-max98090", 171 .name = "tegra-max98090",
160 .owner = THIS_MODULE, 172 .owner = THIS_MODULE,
173 .remove = tegra_max98090_card_remove,
161 .dai_link = &tegra_max98090_dai, 174 .dai_link = &tegra_max98090_dai,
162 .num_links = 1, 175 .num_links = 1,
163 .controls = tegra_max98090_controls, 176 .controls = tegra_max98090_controls,
@@ -241,9 +254,6 @@ static int tegra_max98090_remove(struct platform_device *pdev)
241 struct snd_soc_card *card = platform_get_drvdata(pdev); 254 struct snd_soc_card *card = platform_get_drvdata(pdev);
242 struct tegra_max98090 *machine = snd_soc_card_get_drvdata(card); 255 struct tegra_max98090 *machine = snd_soc_card_get_drvdata(card);
243 256
244 snd_soc_jack_free_gpios(&tegra_max98090_hp_jack, 1,
245 &tegra_max98090_hp_jack_gpio);
246
247 snd_soc_unregister_card(card); 257 snd_soc_unregister_card(card);
248 258
249 tegra_asoc_utils_fini(&machine->util_data); 259 tegra_asoc_utils_fini(&machine->util_data);