Lines Matching +full:tegra +full:- +full:audio +full:- +full:wm8903 +full:- +full:harmony

1 // SPDX-License-Identifier: GPL-2.0-only
3 * tegra_wm8903.c - Tegra machine ASoC driver for boards using WM8903 codec.
6 * Copyright (C) 2010-2012 - NVIDIA, Inc.
26 #include "../codecs/wm8903.h"
57 struct tegra_machine *machine = snd_soc_card_get_drvdata(rtd->card); in tegra_wm8903_init()
58 struct snd_soc_card *card = rtd->card; in tegra_wm8903_init()
63 * forcing it to active-low. This means that all older device-trees in tegra_wm8903_init()
64 * which set the polarity to active-high are wrong and we need to fix in tegra_wm8903_init()
67 if (machine->asoc->hp_jack_gpio_active_low) { in tegra_wm8903_init()
68 bool active_low = gpiod_is_active_low(machine->gpiod_hp_det); in tegra_wm8903_init()
70 machine->hp_jack_gpio->invert = !active_low; in tegra_wm8903_init()
77 if (!machine->gpiod_mic_det && machine->asoc->add_mic_jack) { in tegra_wm8903_init()
79 struct snd_soc_component *component = codec_dai->component; in tegra_wm8903_init()
82 err = snd_soc_card_jack_new_pins(rtd->card, "Mic Jack", in tegra_wm8903_init()
84 machine->mic_jack, in tegra_wm8903_init()
88 dev_err(rtd->dev, "Mic Jack creation failed: %d\n", err); in tegra_wm8903_init()
92 if (of_property_read_bool(card->dev->of_node, "nvidia,headset")) in tegra_wm8903_init()
95 wm8903_mic_detect(component, machine->mic_jack, in tegra_wm8903_init()
99 snd_soc_dapm_force_enable_pin(&card->dapm, "MICBIAS"); in tegra_wm8903_init()
106 struct snd_soc_dai_link *link = &card->dai_link[0]; in tegra_wm8903_remove()
109 struct snd_soc_component *component = codec_dai->component; in tegra_wm8903_remove()
118 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8903-hifi")),
122 .name = "WM8903",
123 .stream_name = "WM8903 PCM",
132 .components = "codec:wm8903",
140 /* older device-trees used wrong polarity for the headphones-detection GPIO */
163 { .compatible = "ad,tegra-audio-plutux", .data = &tegra_wm8903_data_legacy },
164 { .compatible = "ad,tegra-audio-wm8903-medcom-wide", .data = &tegra_wm8903_data_legacy },
165 { .compatible = "ad,tegra-audio-wm8903-tec", .data = &tegra_wm8903_data_legacy },
166 { .compatible = "nvidia,tegra-audio-wm8903-cardhu", .data = &tegra_wm8903_data_legacy },
167 { .compatible = "nvidia,tegra-audio-wm8903-harmony", .data = &tegra_wm8903_data_legacy },
168 { .compatible = "nvidia,tegra-audio-wm8903-picasso", .data = &tegra_wm8903_data_legacy },
169 { .compatible = "nvidia,tegra-audio-wm8903-seaboard", .data = &tegra_wm8903_data_legacy },
170 { .compatible = "nvidia,tegra-audio-wm8903-ventana", .data = &tegra_wm8903_data_legacy },
171 { .compatible = "nvidia,tegra-audio-wm8903", .data = &tegra_wm8903_data },
178 .name = "tegra-wm8903",
187 MODULE_DESCRIPTION("Tegra+WM8903 machine ASoC driver");