Lines Matching +full:num +full:- +full:channels
1 // SPDX-License-Identifier: GPL-2.0-or-later
30 * AD193X volume/mute/de-emphasis etc. controls
37 static const DECLARE_TLV_DB_MINMAX(adau193x_tlv, -9563, 0);
67 /* DAC de-emphasis */
78 /* ADC high-pass filter */
105 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in ad193x_check_pll()
108 return !!ad193x->sysclk; in ad193x_check_pll()
131 switch (ad193x->type) { in ad193x_has_adc()
148 struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(dai->component); in ad193x_mute()
151 regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL2, in ad193x_mute()
155 regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL2, in ad193x_mute()
164 struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(dai->component); in ad193x_set_tdm_slot()
165 unsigned int channels; in ad193x_set_tdm_slot() local
169 channels = AD193X_2_CHANNELS; in ad193x_set_tdm_slot()
172 channels = AD193X_4_CHANNELS; in ad193x_set_tdm_slot()
175 channels = AD193X_8_CHANNELS; in ad193x_set_tdm_slot()
178 channels = AD193X_16_CHANNELS; in ad193x_set_tdm_slot()
181 return -EINVAL; in ad193x_set_tdm_slot()
184 regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL1, in ad193x_set_tdm_slot()
185 AD193X_DAC_CHAN_MASK, channels << AD193X_DAC_CHAN_SHFT); in ad193x_set_tdm_slot()
187 regmap_update_bits(ad193x->regmap, AD193X_ADC_CTRL2, in ad193x_set_tdm_slot()
189 channels << AD193X_ADC_CHAN_SHFT); in ad193x_set_tdm_slot()
197 struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(codec_dai->component); in ad193x_set_dai_fmt()
218 return -EINVAL; in ad193x_set_dai_fmt()
239 return -EINVAL; in ad193x_set_dai_fmt()
264 return -EINVAL; in ad193x_set_dai_fmt()
268 regmap_update_bits(ad193x->regmap, AD193X_ADC_CTRL1, in ad193x_set_dai_fmt()
270 regmap_update_bits(ad193x->regmap, AD193X_ADC_CTRL2, in ad193x_set_dai_fmt()
273 regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL0, in ad193x_set_dai_fmt()
275 regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL1, in ad193x_set_dai_fmt()
284 struct snd_soc_component *component = codec_dai->component; in ad193x_set_dai_sysclk()
291 return -EINVAL; in ad193x_set_dai_sysclk()
293 regmap_update_bits(ad193x->regmap, AD193X_PLL_CLK_CTRL1, in ad193x_set_dai_sysclk()
306 ad193x->sysclk = freq; in ad193x_set_dai_sysclk()
309 return -EINVAL; in ad193x_set_dai_sysclk()
317 struct snd_soc_component *component = dai->component; in ad193x_hw_params()
319 bool is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in ad193x_hw_params()
322 dev_dbg(dai->dev, "%s() rate=%u format=%#x width=%u channels=%u\n", in ad193x_hw_params()
341 switch (ad193x->sysclk) { in ad193x_hw_params()
368 dev_err(dai->dev, "invalid sampling rate: %d\n", params_rate(params)); in ad193x_hw_params()
369 return -EINVAL; in ad193x_hw_params()
372 regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL0, AD193X_DAC_SR_MASK, dacc0); in ad193x_hw_params()
375 regmap_update_bits(ad193x->regmap, AD193X_PLL_CLK_CTRL0, in ad193x_hw_params()
378 regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL2, in ad193x_hw_params()
383 regmap_update_bits(ad193x->regmap, AD193X_ADC_CTRL1, in ad193x_hw_params()
392 return snd_pcm_hw_constraint_list(substream->runtime, 0, in ad193x_startup()
409 .name = "ad193x-hifi",
431 .name = "ad193x-hifi",
448 { 1, 0x04 }, /* PLL_CLK_CTRL1: no on-chip Vref */ in ad193x_reg_default_init()
451 { 4, 0x1A }, /* DAC_CTRL2: 48kHz de-emphasis, unmute dac */ in ad193x_reg_default_init()
452 { 5, 0x00 }, /* DAC_CHNL_MUTE: unmute DAC channels */ in ad193x_reg_default_init()
463 { 14, 0x03 }, /* ADC_CTRL0: high-pass filter enable */ in ad193x_reg_default_init()
468 regmap_multi_reg_write(ad193x->regmap, reg_init, ARRAY_SIZE(reg_init)); in ad193x_reg_default_init()
471 regmap_multi_reg_write(ad193x->regmap, reg_adc_init, in ad193x_reg_default_init()
480 int num, ret; in ad193x_component_probe() local
488 num = ARRAY_SIZE(ad193x_adc_snd_controls); in ad193x_component_probe()
491 num); in ad193x_component_probe()
496 num = ARRAY_SIZE(ad193x_adc_widgets); in ad193x_component_probe()
499 num); in ad193x_component_probe()
504 num = ARRAY_SIZE(ad193x_adc_audio_paths); in ad193x_component_probe()
507 num); in ad193x_component_probe()
529 .max_register = AD193X_NUM_REGS - 1,
543 return -ENOMEM; in ad193x_probe()
545 ad193x->regmap = regmap; in ad193x_probe()
546 ad193x->type = type; in ad193x_probe()