Lines Matching +full:dai +full:- +full:sample +full:- +full:format
1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm8524.c -- WM8524 ALSA SoC Audio driver
60 struct snd_soc_dai *dai) in wm8524_startup() argument
62 struct snd_soc_component *component = dai->component; in wm8524_startup()
65 /* The set of sample rates that can be supported depends on the in wm8524_startup()
66 * MCLK supplied to the CODEC - enforce this. in wm8524_startup()
68 if (!wm8524->sysclk) { in wm8524_startup()
69 dev_err(component->dev, in wm8524_startup()
71 return -EINVAL; in wm8524_startup()
74 snd_pcm_hw_constraint_list(substream->runtime, 0, in wm8524_startup()
76 &wm8524->rate_constraint); in wm8524_startup()
78 gpiod_set_value_cansleep(wm8524->mute, 1); in wm8524_startup()
84 struct snd_soc_dai *dai) in wm8524_shutdown() argument
86 struct snd_soc_component *component = dai->component; in wm8524_shutdown()
89 gpiod_set_value_cansleep(wm8524->mute, 0); in wm8524_shutdown()
95 struct snd_soc_component *component = codec_dai->component; in wm8524_set_dai_sysclk()
100 wm8524->sysclk = freq; in wm8524_set_dai_sysclk()
102 wm8524->rate_constraint.count = 0; in wm8524_set_dai_sysclk()
118 dev_dbg(component->dev, "Supported sample rate: %dHz\n", in wm8524_set_dai_sysclk()
120 wm8524->rate_constraint_list[j++] = val; in wm8524_set_dai_sysclk()
121 wm8524->rate_constraint.count++; in wm8524_set_dai_sysclk()
124 dev_dbg(component->dev, "Skipping sample rate: %dHz\n", in wm8524_set_dai_sysclk()
130 if (wm8524->rate_constraint.count == 0) in wm8524_set_dai_sysclk()
131 return -EINVAL; in wm8524_set_dai_sysclk()
143 dev_err(codec_dai->dev, "Invalid DAI format\n"); in wm8524_set_fmt()
144 return -EINVAL; in wm8524_set_fmt()
150 static int wm8524_mute_stream(struct snd_soc_dai *dai, int mute, int stream) in wm8524_mute_stream() argument
152 struct wm8524_priv *wm8524 = snd_soc_component_get_drvdata(dai->component); in wm8524_mute_stream()
154 if (wm8524->mute) in wm8524_mute_stream()
155 gpiod_set_value_cansleep(wm8524->mute, mute); in wm8524_mute_stream()
175 .name = "wm8524-hifi",
190 wm8524->rate_constraint.list = &wm8524->rate_constraint_list[0]; in wm8524_probe()
191 wm8524->rate_constraint.count = in wm8524_probe()
192 ARRAY_SIZE(wm8524->rate_constraint_list); in wm8524_probe()
220 wm8524 = devm_kzalloc(&pdev->dev, sizeof(struct wm8524_priv), in wm8524_codec_probe()
223 return -ENOMEM; in wm8524_codec_probe()
227 wm8524->mute = devm_gpiod_get(&pdev->dev, "wlf,mute", GPIOD_OUT_LOW); in wm8524_codec_probe()
228 if (IS_ERR(wm8524->mute)) { in wm8524_codec_probe()
229 ret = PTR_ERR(wm8524->mute); in wm8524_codec_probe()
230 dev_err(&pdev->dev, "Failed to get mute line: %d\n", ret); in wm8524_codec_probe()
234 ret = devm_snd_soc_register_component(&pdev->dev, in wm8524_codec_probe()
237 dev_err(&pdev->dev, "Failed to register component: %d\n", ret); in wm8524_codec_probe()
245 .name = "wm8524-codec",
253 MODULE_ALIAS("platform:wm8524-codec");