Lines Matching +full:codec +full:- +full:aif1
1 // SPDX-License-Identifier: GPL-2.0-only
3 * tegra_rt5640.c - Tegra machine ASoC driver for boards using RT5640 codec.
9 * Copyright (C) 2010-2012 - NVIDIA, Inc.
31 #define DRV_NAME "tegra-snd-rt5640"
44 struct snd_soc_card *card = rtd->card; in tegra_rt5640_asoc_hw_params()
52 err = tegra_asoc_utils_set_rate(&machine->util_data, srate, mclk); in tegra_rt5640_asoc_hw_params()
54 dev_err(card->dev, "Can't configure clocks\n"); in tegra_rt5640_asoc_hw_params()
61 dev_err(card->dev, "codec_dai clock not set\n"); in tegra_rt5640_asoc_hw_params()
100 struct tegra_rt5640 *machine = snd_soc_card_get_drvdata(rtd->card); in tegra_rt5640_asoc_init()
102 snd_soc_card_jack_new(rtd->card, "Headphones", SND_JACK_HEADPHONE, in tegra_rt5640_asoc_init()
106 if (gpio_is_valid(machine->gpio_hp_det)) { in tegra_rt5640_asoc_init()
107 tegra_rt5640_hp_jack_gpio.gpio = machine->gpio_hp_det; in tegra_rt5640_asoc_init()
109 !!(machine->gpio_hp_det_flags & OF_GPIO_ACTIVE_LOW); in tegra_rt5640_asoc_init()
118 SND_SOC_DAILINK_DEFS(aif1,
120 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "rt5640-aif1")),
130 SND_SOC_DAILINK_REG(aif1),
134 .name = "tegra-rt5640",
148 struct device_node *np = pdev->dev.of_node; in tegra_rt5640_probe()
153 machine = devm_kzalloc(&pdev->dev, in tegra_rt5640_probe()
156 return -ENOMEM; in tegra_rt5640_probe()
158 card->dev = &pdev->dev; in tegra_rt5640_probe()
161 machine->gpio_hp_det = of_get_named_gpio_flags( in tegra_rt5640_probe()
162 np, "nvidia,hp-det-gpios", 0, &machine->gpio_hp_det_flags); in tegra_rt5640_probe()
163 if (machine->gpio_hp_det == -EPROBE_DEFER) in tegra_rt5640_probe()
164 return -EPROBE_DEFER; in tegra_rt5640_probe()
170 ret = snd_soc_of_parse_audio_routing(card, "nvidia,audio-routing"); in tegra_rt5640_probe()
174 tegra_rt5640_dai.codecs->of_node = of_parse_phandle(np, in tegra_rt5640_probe()
175 "nvidia,audio-codec", 0); in tegra_rt5640_probe()
176 if (!tegra_rt5640_dai.codecs->of_node) { in tegra_rt5640_probe()
177 dev_err(&pdev->dev, in tegra_rt5640_probe()
178 "Property 'nvidia,audio-codec' missing or invalid\n"); in tegra_rt5640_probe()
179 return -EINVAL; in tegra_rt5640_probe()
182 tegra_rt5640_dai.cpus->of_node = of_parse_phandle(np, in tegra_rt5640_probe()
183 "nvidia,i2s-controller", 0); in tegra_rt5640_probe()
184 if (!tegra_rt5640_dai.cpus->of_node) { in tegra_rt5640_probe()
185 dev_err(&pdev->dev, in tegra_rt5640_probe()
186 "Property 'nvidia,i2s-controller' missing or invalid\n"); in tegra_rt5640_probe()
187 return -EINVAL; in tegra_rt5640_probe()
190 tegra_rt5640_dai.platforms->of_node = tegra_rt5640_dai.cpus->of_node; in tegra_rt5640_probe()
192 ret = tegra_asoc_utils_init(&machine->util_data, &pdev->dev); in tegra_rt5640_probe()
196 ret = devm_snd_soc_register_card(&pdev->dev, card); in tegra_rt5640_probe()
198 dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", in tegra_rt5640_probe()
207 { .compatible = "nvidia,tegra-audio-rt5640", },