Lines Matching +full:dmic +full:- +full:sample +full:- +full:rate
1 // SPDX-License-Identifier: GPL-2.0+
13 #include <linux/input-event-codes.h>
18 #include <sound/soc-dapm.h>
27 #define ACP5X_NAU8821_COMP_NAME "i2c-NVTN2020:00"
28 #define ACP5X_NAU8821_DAI_NAME "nau8821-hifi"
29 #define ACP5X_CS35L41_COMP_LNAME "spi-VLV1776:00"
30 #define ACP5X_CS35L41_COMP_RNAME "spi-VLV1776:01"
31 #define ACP5X_CS35L41_DAI_NAME "cs35l41-pcm"
32 #define ACP5X_MAX98388_COMP_LNAME "i2c-ADS8388:00"
33 #define ACP5X_MAX98388_COMP_RNAME "i2c-ADS8388:01"
34 #define ACP5X_MAX98388_DAI_NAME "max98388-aif1"
64 struct snd_soc_dapm_context *dapm = w->dapm; in platform_clock_control()
65 struct snd_soc_card *card = dapm->card; in platform_clock_control()
71 dev_err(card->dev, "Codec dai not found\n"); in platform_clock_control()
72 return -EIO; in platform_clock_control()
78 dev_err(card->dev, "set sysclk err = %d\n", ret); in platform_clock_control()
79 return -EIO; in platform_clock_control()
84 dev_err(dai->dev, "can't set BLK clock %d\n", ret); in platform_clock_control()
87 dev_err(dai->dev, "can't set FLL: %d\n", ret); in platform_clock_control()
95 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; in acp5x_8821_init()
102 ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", in acp5x_8821_init()
107 dev_err(rtd->dev, "Headset Jack creation failed %d\n", ret); in acp5x_8821_init()
146 struct snd_pcm_runtime *runtime = substream->runtime; in acp5x_8821_startup()
148 struct acp5x_platform_info *machine = snd_soc_card_get_drvdata(rtd->card); in acp5x_8821_startup()
150 machine->play_i2s_instance = I2S_SP_INSTANCE; in acp5x_8821_startup()
151 machine->cap_i2s_instance = I2S_SP_INSTANCE; in acp5x_8821_startup()
153 runtime->hw.channels_max = DUAL_CHANNEL; in acp5x_8821_startup()
158 snd_pcm_hw_constraint_list(substream->runtime, 0, in acp5x_8821_startup()
169 struct snd_soc_card *card = rtd->card; in acp5x_nau8821_hw_params()
174 return -EINVAL; in acp5x_nau8821_hw_params()
178 dev_err(card->dev, "can't set FS clock %d\n", ret); in acp5x_nau8821_hw_params()
182 dev_err(dai->dev, "Fail to get BCLK rate: %d\n", bclk); in acp5x_nau8821_hw_params()
188 dev_err(card->dev, "can't set FLL: %d\n", ret); in acp5x_nau8821_hw_params()
201 struct acp5x_platform_info *machine = snd_soc_card_get_drvdata(rtd->card); in acp5x_cs35l41_startup()
202 struct snd_pcm_runtime *runtime = substream->runtime; in acp5x_cs35l41_startup()
204 machine->play_i2s_instance = I2S_HS_INSTANCE; in acp5x_cs35l41_startup()
206 runtime->hw.channels_max = DUAL_CHANNEL; in acp5x_cs35l41_startup()
219 unsigned int bclk, rate = params_rate(params); in acp5x_cs35l41_hw_params() local
223 switch (rate) { in acp5x_cs35l41_hw_params()
233 if (!(strcmp(comp->name, ACP5X_CS35L41_COMP_LNAME)) || in acp5x_cs35l41_hw_params()
234 !(strcmp(comp->name, ACP5X_CS35L41_COMP_RNAME))) { in acp5x_cs35l41_hw_params()
236 dev_err(comp->dev, "Invalid sample rate: 0x%x\n", rate); in acp5x_cs35l41_hw_params()
237 return -EINVAL; in acp5x_cs35l41_hw_params()
242 dev_err(comp->dev, "failed to set SYSCLK: %d\n", ret); in acp5x_cs35l41_hw_params()
274 .name = "acp5x-8821-play",
286 .name = "acp5x-CS35L41-Stereo",
308 /* HP jack connectors - unknown if we have jack detection */
313 { "DMIC", NULL, "Int Mic" },
338 struct acp5x_platform_info *machine = snd_soc_card_get_drvdata(rtd->card); in acp5x_max98388_startup()
339 struct snd_pcm_runtime *runtime = substream->runtime; in acp5x_max98388_startup()
341 machine->play_i2s_instance = I2S_HS_INSTANCE; in acp5x_max98388_startup()
343 runtime->hw.channels_max = DUAL_CHANNEL; in acp5x_max98388_startup()
373 .name = "acp5x-8821-play",
385 .name = "acp5x-max98388-play",
412 { "DMIC", NULL, "Int Mic" },
423 .name = "acp5x-max98388",
459 struct device *dev = &pdev->dev; in acp5x_probe()
464 if (!dmi_id || !dmi_id->driver_data) in acp5x_probe()
465 return -ENODEV; in acp5x_probe()
469 return -ENOMEM; in acp5x_probe()
471 card = dmi_id->driver_data; in acp5x_probe()
472 card->dev = dev; in acp5x_probe()
478 return dev_err_probe(dev, ret, "Register card (%s) failed\n", card->name); in acp5x_probe()