Lines Matching +full:- +full:32000

1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm8731.c -- WM8731 ALSA SoC Audio driver
6 * Copyright 2006-12 Wolfson Microelectronics, plc
66 static int wm8731_deemph[] = { 0, 32000, 44100, 48000 };
76 if (wm8731->deemph) {
79 if (abs(wm8731_deemph[i] - wm8731->playback_fs) <
80 abs(wm8731_deemph[best] - wm8731->playback_fs))
90 dev_dbg(component->dev, "Set deemphasis %d (%dHz)\n",
102 ucontrol->value.integer.value[0] = wm8731->deemph;
112 unsigned int deemph = ucontrol->value.integer.value[0];
116 return -EINVAL;
118 mutex_lock(&wm8731->lock);
119 if (wm8731->deemph != deemph) {
120 wm8731->deemph = deemph;
126 mutex_unlock(&wm8731->lock);
131 static const DECLARE_TLV_DB_SCALE(in_tlv, -3450, 150, 0);
132 static const DECLARE_TLV_DB_SCALE(sidetone_tlv, -1500, 300, 0);
133 static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1);
194 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
197 return wm8731->sysclk_type == WM8731_SYSCLK_XTAL;
245 {12288000, 32000, 384, 0x6, 0x0, 0x0},
246 {18432000, 32000, 576, 0x6, 0x1, 0x0},
247 {12000000, 32000, 375, 0x6, 0x0, 0x1},
274 8000, 32000, 44100, 48000, 96000, 88200,
278 8000, 32000, 48000, 96000,
317 struct snd_soc_component *component = dai->component;
320 int i = get_coeff(wm8731->sysclk, params_rate(params));
324 wm8731->playback_fs = params_rate(params);
351 struct snd_soc_component *component = dai->component;
364 struct snd_soc_component *component = codec_dai->component;
371 if (wm8731->mclk && clk_set_rate(wm8731->mclk, freq))
372 return -EINVAL;
373 wm8731->sysclk_type = clk_id;
376 return -EINVAL;
381 wm8731->constraints = NULL;
384 wm8731->constraints = &wm8731_constraints_12000000;
388 wm8731->constraints = &wm8731_constraints_12288000_18432000;
392 wm8731->constraints = &wm8731_constraints_11289600_16934400;
395 return -EINVAL;
398 wm8731->sysclk = freq;
409 struct snd_soc_component *component = codec_dai->component;
419 return -EINVAL;
439 return -EINVAL;
456 return -EINVAL;
474 if (wm8731->mclk) {
475 ret = clk_prepare_enable(wm8731->mclk);
484 ret = regulator_bulk_enable(ARRAY_SIZE(wm8731->supplies),
485 wm8731->supplies);
489 regcache_sync(wm8731->regmap);
492 /* Clear PWROFF, gate CLKOUT, everything else as-is */
497 if (wm8731->mclk)
498 clk_disable_unprepare(wm8731->mclk);
500 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
501 wm8731->supplies);
502 regcache_mark_dirty(wm8731->regmap);
511 struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(dai->component);
513 if (wm8731->constraints)
514 snd_pcm_hw_constraint_list(substream->runtime, 0,
516 wm8731->constraints);
536 .name = "wm8731-hifi",
571 wm8731->mclk = devm_clk_get(dev, "mclk");
572 if (IS_ERR(wm8731->mclk)) {
573 ret = PTR_ERR(wm8731->mclk);
574 if (ret == -ENOENT) {
575 wm8731->mclk = NULL;
583 mutex_init(&wm8731->lock);
585 for (i = 0; i < ARRAY_SIZE(wm8731->supplies); i++)
586 wm8731->supplies[i].supply = wm8731_supply_names[i];
588 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(wm8731->supplies),
589 wm8731->supplies);
595 ret = regulator_bulk_enable(ARRAY_SIZE(wm8731->supplies),
596 wm8731->supplies);
602 ret = wm8731_reset(wm8731->regmap);
609 regmap_write(wm8731->regmap, WM8731_PWR, 0x7f);
612 regmap_update_bits(wm8731->regmap, WM8731_LOUT1V, 0x100, 0);
613 regmap_update_bits(wm8731->regmap, WM8731_ROUT1V, 0x100, 0);
614 regmap_update_bits(wm8731->regmap, WM8731_LINVOL, 0x100, 0);
615 regmap_update_bits(wm8731->regmap, WM8731_RINVOL, 0x100, 0);
618 regmap_update_bits(wm8731->regmap, WM8731_APANA, 0x8, 0);
620 regcache_mark_dirty(wm8731->regmap);
633 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies);