18 #include <linux/module.h>
20 #include <linux/slab.h>
30 #include "../codecs/alc5632.h"
34 #define DRV_NAME "tegra-alc5632"
48 struct tegra_alc5632 *alc5632 = snd_soc_card_get_drvdata(card);
57 dev_err(card->
dev,
"Can't configure clocks\n");
64 dev_err(card->
dev,
"codec_dai clock not set\n");
71 static struct snd_soc_ops tegra_alc5632_asoc_ops = {
72 .hw_params = tegra_alc5632_asoc_hw_params,
83 .pin =
"Headset Stereophone",
88 static struct snd_soc_jack_gpio tegra_alc5632_hp_jack_gpio = {
89 .name =
"Headset detection",
113 &tegra_alc5632_hs_jack);
116 tegra_alc5632_hs_jack_pins);
119 tegra_alc5632_hp_jack_gpio.gpio = machine->
gpio_hp_det;
120 snd_soc_jack_add_gpios(&tegra_alc5632_hs_jack,
122 &tegra_alc5632_hp_jack_gpio);
132 .stream_name =
"ALC5632 PCM",
133 .codec_dai_name =
"alc5632-hifi",
134 .init = tegra_alc5632_asoc_init,
135 .ops = &tegra_alc5632_asoc_ops,
142 .name =
"tegra-alc5632",
144 .dai_link = &tegra_alc5632_dai,
146 .controls = tegra_alc5632_controls,
147 .num_controls =
ARRAY_SIZE(tegra_alc5632_controls),
148 .dapm_widgets = tegra_alc5632_dapm_widgets,
149 .num_dapm_widgets =
ARRAY_SIZE(tegra_alc5632_dapm_widgets),
150 .fully_routed =
true,
163 dev_err(&pdev->
dev,
"Can't allocate tegra_alc5632\n");
169 platform_set_drvdata(pdev, card);
170 snd_soc_card_set_drvdata(card, alc5632);
172 if (!(pdev->
dev.of_node)) {
173 dev_err(&pdev->
dev,
"Must be instantiated using device tree\n");
178 alc5632->
gpio_hp_det = of_get_named_gpio(np,
"nvidia,hp-det-gpios", 0);
191 pdev->
dev.of_node,
"nvidia,audio-codec", 0);
195 "Property 'nvidia,audio-codec' missing or invalid\n");
201 pdev->
dev.of_node,
"nvidia,i2s-controller", 0);
204 "Property 'nvidia,i2s-controller' missing or invalid\n");
217 dev_err(&pdev->
dev,
"snd_soc_register_card failed (%d)\n",
233 struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(card);
235 snd_soc_jack_free_gpios(&tegra_alc5632_hs_jack, 1,
236 &tegra_alc5632_hp_jack_gpio);
246 { .compatible =
"nvidia,tegra-audio-alc5632", },
255 .of_match_table = tegra_alc5632_of_match,
257 .probe = tegra_alc5632_probe,