Lines Matching +full:dac +full:- +full:mode +full:- +full:mask

1 // SPDX-License-Identifier: GPL-2.0-or-later
20 #include <sound/soc-dapm.h>
97 struct snd_soc_component *component = dai->component; in mc13783_pcm_hw_params_dac()
109 return -EINVAL; in mc13783_pcm_hw_params_dac()
116 struct snd_soc_component *component = dai->component; in mc13783_pcm_hw_params_codec()
128 return -EINVAL; in mc13783_pcm_hw_params_codec()
141 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in mc13783_pcm_hw_params_sync()
150 struct snd_soc_component *component = dai->component; in mc13783_set_fmt()
152 unsigned int mask = AUDIO_CFS(3) | AUDIO_BCL_INV | AUDIO_CFS_INV | in mc13783_set_fmt() local
156 /* DAI mode */ in mc13783_set_fmt()
165 return -EINVAL; in mc13783_set_fmt()
192 return -EINVAL; in mc13783_set_fmt()
197 snd_soc_component_update_bits(component, reg, mask, val); in mc13783_set_fmt()
204 if (dai->id == MC13783_ID_STEREO_DAC) in mc13783_set_fmt_async()
219 * In synchronous mode force the voice codec into consumer mode in mc13783_set_fmt_sync()
220 * so that the clock / framesync from the stereo DAC is used in mc13783_set_fmt_sync()
233 -1,
235 -1, /* 12000000, invalid for voice codec */
236 -1, /* 3686400, invalid for voice codec */
244 struct snd_soc_component *component = dai->component; in mc13783_set_sysclk()
247 unsigned int mask = AUDIO_CLK(0x7) | AUDIO_CLK_SEL; in mc13783_set_sysclk() local
257 return -EINVAL; in mc13783_set_sysclk()
264 snd_soc_component_update_bits(component, reg, mask, val); in mc13783_set_sysclk()
297 struct snd_soc_component *component = dai->component; in mc13783_set_tdm_slot_dac()
299 unsigned int mask = SSI_NETWORK_DAC_SLOT_MASK | in mc13783_set_tdm_slot_dac() local
313 return -EINVAL; in mc13783_set_tdm_slot_dac()
330 return -EINVAL; in mc13783_set_tdm_slot_dac()
333 snd_soc_component_update_bits(component, MC13783_SSI_NETWORK, mask, val); in mc13783_set_tdm_slot_dac()
342 struct snd_soc_component *component = dai->component; in mc13783_set_tdm_slot_codec()
344 unsigned int mask = 0x3f; in mc13783_set_tdm_slot_codec() local
347 return -EINVAL; in mc13783_set_tdm_slot_codec()
350 return -EINVAL; in mc13783_set_tdm_slot_codec()
355 snd_soc_component_update_bits(component, MC13783_SSI_NETWORK, mask, val); in mc13783_set_tdm_slot_codec()
514 SND_SOC_DAPM_DAC("DAC", "Playback", MC13783_AUDIO_RX0, 22, 0),
515 SND_SOC_DAPM_PGA("DAC PGA", MC13783_AUDIO_RX1, 5, 0, NULL, 0),
542 { "Speaker Amp Source MUX", "Right", "DAC PGA"},
545 { "Headset Amp Source MUX", "Mixer", "DAC PGA"},
556 { "Line out Amp Left", NULL, "DAC PGA"},
557 { "Line out Amp Right", NULL, "DAC PGA"},
558 { "DAC PGA", NULL, "DAC"},
559 { "DAC", NULL, "DAC_E"},
600 dev_get_regmap(component->dev->parent, NULL)); in mc13783_probe()
603 mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_RX0, 0x25893); in mc13783_probe()
604 mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_RX1, 0x00d35A); in mc13783_probe()
605 mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_TX, 0x420000); in mc13783_probe()
606 mc13xxx_reg_write(priv->mc13xxx, MC13783_SSI_NETWORK, 0x013060); in mc13783_probe()
607 mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_CODEC, 0x180027); in mc13783_probe()
608 mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_DAC, 0x0e0004); in mc13783_probe()
610 if (priv->adc_ssi_port == MC13783_SSI1_PORT) in mc13783_probe()
611 mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_CODEC, in mc13783_probe()
614 mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_CODEC, in mc13783_probe()
617 if (priv->dac_ssi_port == MC13783_SSI1_PORT) in mc13783_probe()
618 mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_DAC, in mc13783_probe()
621 mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_DAC, in mc13783_probe()
632 mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_RX0, 0x3, 0); in mc13783_remove()
656 * to the voice codec or the stereo DAC. When two different SSI ports
657 * are used for the voice codec and the stereo DAC we can do different
659 * (mc13783-hifi-playback and mc13783-hifi-capture). Using the same port
660 * forces us to use symmetric rates (mc13783-hifi).
664 .name = "mc13783-hifi-playback",
675 .name = "mc13783-hifi-capture",
697 .name = "mc13783-hifi",
735 struct mc13xxx_codec_platform_data *pdata = pdev->dev.platform_data; in mc13783_codec_probe()
739 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in mc13783_codec_probe()
741 return -ENOMEM; in mc13783_codec_probe()
744 priv->adc_ssi_port = pdata->adc_ssi_port; in mc13783_codec_probe()
745 priv->dac_ssi_port = pdata->dac_ssi_port; in mc13783_codec_probe()
747 np = of_get_child_by_name(pdev->dev.parent->of_node, "codec"); in mc13783_codec_probe()
749 return -ENOSYS; in mc13783_codec_probe()
751 ret = of_property_read_u32(np, "adc-port", &priv->adc_ssi_port); in mc13783_codec_probe()
757 ret = of_property_read_u32(np, "dac-port", &priv->dac_ssi_port); in mc13783_codec_probe()
766 dev_set_drvdata(&pdev->dev, priv); in mc13783_codec_probe()
767 priv->mc13xxx = dev_get_drvdata(pdev->dev.parent); in mc13783_codec_probe()
769 if (priv->adc_ssi_port == priv->dac_ssi_port) in mc13783_codec_probe()
770 ret = devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_mc13783, in mc13783_codec_probe()
773 ret = devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_mc13783, in mc13783_codec_probe()
781 .name = "mc13783-codec",