Lines Matching +full:dmic +full:- +full:freq
1 // SPDX-License-Identifier: GPL-2.0
254 static const char *const cic_mux_text[] = { "AMIC", "DMIC" };
331 /* Digital Gain control -84 dB to +40 dB in 1 dB steps */
332 static const DECLARE_TLV_DB_SCALE(digital_gain, -8400, 100, -8400);
334 /* Cutoff Freq for High Pass Filter at -3dB */
360 snd_soc_dapm_to_component(w->dapm); in msm8x16_wcd_codec_set_iir_gain()
365 if (w->shift == 0) in msm8x16_wcd_codec_set_iir_gain()
367 else if (w->shift == 1) in msm8x16_wcd_codec_set_iir_gain()
429 (struct wcd_iir_filter_ctl *)kcontrol->private_value; in msm8x16_wcd_get_iir_band_audio_mixer()
430 struct soc_bytes_ext *params = &ctl->bytes_ext; in msm8x16_wcd_get_iir_band_audio_mixer()
431 int iir_idx = ctl->iir_idx; in msm8x16_wcd_get_iir_band_audio_mixer()
432 int band_idx = ctl->band_idx; in msm8x16_wcd_get_iir_band_audio_mixer()
441 memcpy(ucontrol->value.bytes.data, &coeff[0], params->max); in msm8x16_wcd_get_iir_band_audio_mixer()
462 /* Mask top 2 bits, 7-8 are reserved */ in set_iir_band_coeff()
475 (struct wcd_iir_filter_ctl *)kcontrol->private_value; in msm8x16_wcd_put_iir_band_audio_mixer()
476 struct soc_bytes_ext *params = &ctl->bytes_ext; in msm8x16_wcd_put_iir_band_audio_mixer()
477 int iir_idx = ctl->iir_idx; in msm8x16_wcd_put_iir_band_audio_mixer()
478 int band_idx = ctl->band_idx; in msm8x16_wcd_put_iir_band_audio_mixer()
481 memcpy(&coeff[0], ucontrol->value.bytes.data, params->max); in msm8x16_wcd_put_iir_band_audio_mixer()
502 (struct wcd_iir_filter_ctl *)kcontrol->private_value; in wcd_iir_filter_info()
503 struct soc_bytes_ext *params = &ctl->bytes_ext; in wcd_iir_filter_info()
505 ucontrol->type = SNDRV_CTL_ELEM_TYPE_BYTES; in wcd_iir_filter_info()
506 ucontrol->count = params->max; in wcd_iir_filter_info()
513 -84, 40, digital_gain),
515 -84, 40, digital_gain),
517 -84, 40, digital_gain),
519 -84, 40, digital_gain),
521 -84, 40, digital_gain),
557 -84, 40, digital_gain),
559 -84, 40, digital_gain),
561 -84, 40, digital_gain),
563 -84, 40, digital_gain),
565 -84, 40, digital_gain),
567 -84, 40, digital_gain),
569 -84, 40, digital_gain),
571 -84, 40, digital_gain),
580 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in msm8916_wcd_digital_enable_interpolator()
586 snd_soc_component_write(component, rx_gain_reg[w->shift], in msm8916_wcd_digital_enable_interpolator()
587 snd_soc_component_read(component, rx_gain_reg[w->shift])); in msm8916_wcd_digital_enable_interpolator()
591 1 << w->shift, 1 << w->shift); in msm8916_wcd_digital_enable_interpolator()
593 1 << w->shift, 0x0); in msm8916_wcd_digital_enable_interpolator()
603 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in msm8916_wcd_digital_enable_dec()
604 unsigned int decimator = w->shift + 1; in msm8916_wcd_digital_enable_dec()
609 tx_vol_ctl_reg = LPASS_CDC_TX1_VOL_CTL_CFG + 32 * (decimator - 1); in msm8916_wcd_digital_enable_dec()
610 tx_mux_ctl_reg = LPASS_CDC_TX1_MUX_CTL + 32 * (decimator - 1); in msm8916_wcd_digital_enable_dec()
622 /* set cut of freq to CF_MIN_3DB_150HZ (0x1) */ in msm8916_wcd_digital_enable_dec()
634 snd_soc_component_write(component, tx_gain_reg[w->shift], in msm8916_wcd_digital_enable_dec()
635 snd_soc_component_read(component, tx_gain_reg[w->shift])); in msm8916_wcd_digital_enable_dec()
648 snd_soc_component_update_bits(component, dec_reset_reg, 1 << w->shift, in msm8916_wcd_digital_enable_dec()
649 1 << w->shift); in msm8916_wcd_digital_enable_dec()
650 snd_soc_component_update_bits(component, dec_reset_reg, 1 << w->shift, 0x0); in msm8916_wcd_digital_enable_dec()
666 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in msm8916_wcd_digital_enable_dmic()
667 unsigned int dmic; in msm8916_wcd_digital_enable_dmic() local
669 /* get dmic number out of widget name */ in msm8916_wcd_digital_enable_dmic()
670 char *dmic_num = strpbrk(w->name, "12"); in msm8916_wcd_digital_enable_dmic()
673 dev_err(component->dev, "Invalid DMIC\n"); in msm8916_wcd_digital_enable_dmic()
674 return -EINVAL; in msm8916_wcd_digital_enable_dmic()
676 ret = kstrtouint(dmic_num, 10, &dmic); in msm8916_wcd_digital_enable_dmic()
677 if (ret < 0 || dmic > 2) { in msm8916_wcd_digital_enable_dmic()
678 dev_err(component->dev, "Invalid DMIC line on the component\n"); in msm8916_wcd_digital_enable_dmic()
679 return -EINVAL; in msm8916_wcd_digital_enable_dmic()
687 switch (dmic) { in msm8916_wcd_digital_enable_dmic()
808 SND_SOC_DAPM_SUPPLY_S("CDC_CONN", -2, LPASS_CDC_CLK_OTHR_CTL, 2, 0,
827 struct device *dev = &pdev->dev; in msm8916_wcd_digital_get_clks()
829 priv->ahbclk = devm_clk_get(dev, "ahbix-clk"); in msm8916_wcd_digital_get_clks()
830 if (IS_ERR(priv->ahbclk)) { in msm8916_wcd_digital_get_clks()
832 return PTR_ERR(priv->ahbclk); in msm8916_wcd_digital_get_clks()
835 priv->mclk = devm_clk_get(dev, "mclk"); in msm8916_wcd_digital_get_clks()
836 if (IS_ERR(priv->mclk)) { in msm8916_wcd_digital_get_clks()
838 return PTR_ERR(priv->mclk); in msm8916_wcd_digital_get_clks()
846 struct msm8916_wcd_digital_priv *priv = dev_get_drvdata(component->dev); in msm8916_wcd_digital_component_probe()
855 unsigned int freq, int dir) in msm8916_wcd_digital_component_set_sysclk() argument
857 struct msm8916_wcd_digital_priv *p = dev_get_drvdata(component->dev); in msm8916_wcd_digital_component_set_sysclk()
859 return clk_set_rate(p->mclk, freq); in msm8916_wcd_digital_component_set_sysclk()
887 dev_err(dai->component->dev, "Invalid sampling rate %d\n", in msm8916_wcd_digital_hw_params()
889 return -EINVAL; in msm8916_wcd_digital_hw_params()
892 switch (substream->stream) { in msm8916_wcd_digital_hw_params()
894 snd_soc_component_update_bits(dai->component, LPASS_CDC_CLK_TX_I2S_CTL, in msm8916_wcd_digital_hw_params()
898 snd_soc_component_update_bits(dai->component, LPASS_CDC_CLK_RX_I2S_CTL, in msm8916_wcd_digital_hw_params()
902 return -EINVAL; in msm8916_wcd_digital_hw_params()
907 snd_soc_component_update_bits(dai->component, LPASS_CDC_CLK_TX_I2S_CTL, in msm8916_wcd_digital_hw_params()
910 snd_soc_component_update_bits(dai->component, LPASS_CDC_CLK_RX_I2S_CTL, in msm8916_wcd_digital_hw_params()
916 snd_soc_component_update_bits(dai->component, LPASS_CDC_CLK_TX_I2S_CTL, in msm8916_wcd_digital_hw_params()
919 snd_soc_component_update_bits(dai->component, LPASS_CDC_CLK_RX_I2S_CTL, in msm8916_wcd_digital_hw_params()
924 dev_err(dai->dev, "%s: wrong format selected\n", __func__); in msm8916_wcd_digital_hw_params()
925 return -EINVAL; in msm8916_wcd_digital_hw_params()
941 {"CIC1 MUX", "DMIC", "DEC1 MUX"},
943 {"CIC2 MUX", "DMIC", "DEC2 MUX"},
1075 struct snd_soc_component *component = dai->component; in msm8916_wcd_digital_startup()
1087 mclk_rate = clk_get_rate(msm8916_wcd->mclk); in msm8916_wcd_digital_startup()
1100 dev_err(component->dev, "Invalid mclk rate %ld\n", mclk_rate); in msm8916_wcd_digital_startup()
1109 snd_soc_component_update_bits(dai->component, LPASS_CDC_CLK_PDM_CTL, in msm8916_wcd_digital_shutdown()
1171 struct device *dev = &pdev->dev; in msm8916_wcd_digital_probe()
1178 return -ENOMEM; in msm8916_wcd_digital_probe()
1185 devm_regmap_init_mmio(&pdev->dev, base, in msm8916_wcd_digital_probe()
1194 ret = clk_prepare_enable(priv->ahbclk); in msm8916_wcd_digital_probe()
1200 ret = clk_prepare_enable(priv->mclk); in msm8916_wcd_digital_probe()
1217 clk_disable_unprepare(priv->mclk); in msm8916_wcd_digital_probe()
1219 clk_disable_unprepare(priv->ahbclk); in msm8916_wcd_digital_probe()
1225 struct msm8916_wcd_digital_priv *priv = dev_get_drvdata(&pdev->dev); in msm8916_wcd_digital_remove()
1227 clk_disable_unprepare(priv->mclk); in msm8916_wcd_digital_remove()
1228 clk_disable_unprepare(priv->ahbclk); in msm8916_wcd_digital_remove()
1232 { .compatible = "qcom,msm8916-wcd-digital-codec" },
1240 .name = "msm8916-wcd-digital-codec",