Lines Matching +full:static +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0-only
3 // nau8315.c -- NAU8315 ALSA SoC Audio Amplifier Driver
22 #include <sound/soc-dai.h>
23 #include <sound/soc-dapm.h>
26 struct gpio_desc *enable; member
30 static int nau8315_daiops_trigger(struct snd_pcm_substream *substream, in nau8315_daiops_trigger()
33 struct snd_soc_component *component = dai->component; in nau8315_daiops_trigger()
37 if (!nau8315->enable) in nau8315_daiops_trigger()
44 if (nau8315->enpin_switch) { in nau8315_daiops_trigger()
45 gpiod_set_value(nau8315->enable, 1); in nau8315_daiops_trigger()
46 dev_dbg(component->dev, "set enable to 1"); in nau8315_daiops_trigger()
52 gpiod_set_value(nau8315->enable, 0); in nau8315_daiops_trigger()
53 dev_dbg(component->dev, "set enable to 0"); in nau8315_daiops_trigger()
60 static int nau8315_enpin_event(struct snd_soc_dapm_widget *w, in nau8315_enpin_event()
64 snd_soc_dapm_to_component(w->dapm); in nau8315_enpin_event()
69 nau8315->enpin_switch = 1; in nau8315_enpin_event()
71 nau8315->enpin_switch = 0; in nau8315_enpin_event()
76 static const struct snd_soc_dapm_widget nau8315_dapm_widgets[] = {
83 static const struct snd_soc_dapm_route nau8315_dapm_routes[] = {
88 static const struct snd_soc_component_driver nau8315_component_driver = {
98 static const struct snd_soc_dai_ops nau8315_dai_ops = {
105 static struct snd_soc_dai_driver nau8315_dai_driver = {
106 .name = "nau8315-hifi",
117 static int nau8315_platform_probe(struct platform_device *pdev) in nau8315_platform_probe()
121 nau8315 = devm_kzalloc(&pdev->dev, sizeof(*nau8315), GFP_KERNEL); in nau8315_platform_probe()
123 return -ENOMEM; in nau8315_platform_probe()
125 nau8315->enable = devm_gpiod_get_optional(&pdev->dev, in nau8315_platform_probe()
126 "enable", GPIOD_OUT_LOW); in nau8315_platform_probe()
127 if (IS_ERR(nau8315->enable)) in nau8315_platform_probe()
128 return PTR_ERR(nau8315->enable); in nau8315_platform_probe()
130 dev_set_drvdata(&pdev->dev, nau8315); in nau8315_platform_probe()
132 return devm_snd_soc_register_component(&pdev->dev, in nau8315_platform_probe()
138 static const struct of_device_id nau8315_device_id[] = {
147 static const struct acpi_device_id nau8315_acpi_match[] = {
155 static struct platform_driver nau8315_platform_driver = {
165 MODULE_DESCRIPTION("ASoC NAU8315 Mono Class-D Amplifier Driver");