Lines Matching +full:boost +full:- +full:bypass
2 * wm8900.c -- WM8900 ALSA Soc Audio driver
13 * - Tristating.
14 * - TDM.
15 * - Jack detect.
16 * - FLL source configuration, currently only MCLK is supported.
227 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm8900_hp_event()
289 static const DECLARE_TLV_DB_SCALE(out_pga_tlv, -5700, 100, 0);
291 static const DECLARE_TLV_DB_SCALE(out_mix_tlv, -1500, 300, 0);
293 static const DECLARE_TLV_DB_SCALE(in_boost_tlv, -1200, 600, 0);
295 static const DECLARE_TLV_DB_SCALE(in_pga_tlv, -1200, 100, 0);
299 static const DECLARE_TLV_DB_SCALE(dac_tlv, -7200, 75, 1);
301 static const DECLARE_TLV_DB_SCALE(adc_svol_tlv, -3600, 300, 0);
303 static const DECLARE_TLV_DB_SCALE(adc_tlv, -7200, 75, 1);
323 "Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3"
372 SOC_SINGLE("DAC Sigma-Delta Modulator Clock Switch", WM8900_REG_DACCTRL,
376 SOC_ENUM("ADC HPF Cut-Off", adc_hpf_cut),
385 SOC_SINGLE_TLV("DAC Input Boost Volume", WM8900_REG_AUDIO2, 10, 4, 0,
399 SOC_SINGLE_TLV("LINPUT3 Bypass Volume", WM8900_REG_LOUTMIXCTL1, 4, 7, 0,
401 SOC_SINGLE_TLV("RINPUT3 Bypass Volume", WM8900_REG_ROUTMIXCTL1, 4, 7, 0,
403 SOC_SINGLE_TLV("Left AUX Bypass Volume", WM8900_REG_AUXOUT_CTL, 4, 7, 0,
405 SOC_SINGLE_TLV("Right AUX Bypass Volume", WM8900_REG_AUXOUT_CTL, 0, 7, 0,
417 SOC_SINGLE_TLV("IN2L Boost Volume", WM8900_REG_INBOOSTMIX1, 0, 3, 0,
419 SOC_SINGLE_TLV("IN3L Boost Volume", WM8900_REG_INBOOSTMIX1, 4, 3, 0,
421 SOC_SINGLE_TLV("IN2R Boost Volume", WM8900_REG_INBOOSTMIX2, 0, 3, 0,
423 SOC_SINGLE_TLV("IN3R Boost Volume", WM8900_REG_INBOOSTMIX2, 4, 3, 0,
425 SOC_SINGLE_TLV("Left AUX Boost Volume", WM8900_REG_AUXBOOST, 4, 3, 0,
427 SOC_SINGLE_TLV("Right AUX Boost Volume", WM8900_REG_AUXBOOST, 0, 3, 0,
444 SOC_SINGLE("LINEOUT2 LP -12dB", WM8900_REG_LOUTMIXCTL1,
456 SOC_DAPM_SINGLE("LINPUT3 Bypass Switch", WM8900_REG_LOUTMIXCTL1, 7, 1, 0),
457 SOC_DAPM_SINGLE("AUX Bypass Switch", WM8900_REG_AUXOUT_CTL, 7, 1, 0),
464 SOC_DAPM_SINGLE("RINPUT3 Bypass Switch", WM8900_REG_ROUTMIXCTL1, 7, 1, 0),
465 SOC_DAPM_SINGLE("AUX Bypass Switch", WM8900_REG_AUXOUT_CTL, 3, 1, 0),
609 {"Left Output Mixer", "LINPUT3 Bypass Switch", "LINPUT3"},
610 {"Left Output Mixer", "AUX Bypass Switch", "AUX"},
615 {"Right Output Mixer", "RINPUT3 Bypass Switch", "RINPUT3"},
616 {"Right Output Mixer", "AUX Bypass Switch", "AUX"},
638 struct snd_soc_component *component = dai->component; in wm8900_hw_params()
656 return -EINVAL; in wm8900_hw_params()
661 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in wm8900_hw_params()
696 return -EINVAL; in fll_factors()
698 /* The FLL must run at 90-100MHz which is then scaled down to in fll_factors()
714 return -EINVAL; in fll_factors()
717 fll_div->fllclk_div = div >> 2; in fll_factors()
720 fll_div->fll_slow_lock_ref = 1; in fll_factors()
722 fll_div->fll_slow_lock_ref = 0; in fll_factors()
727 fll_div->fll_ratio = 8; in fll_factors()
729 fll_div->fll_ratio = 1; in fll_factors()
731 fll_div->n = Ndiv / fll_div->fll_ratio; in fll_factors()
732 Nmod = (target / fll_div->fll_ratio) % Fref; in fll_factors()
734 /* Calculate fractional part - scale up so we can round. */ in fll_factors()
745 fll_div->k = K / 10; in fll_factors()
747 if (WARN_ON(target != Fout * (fll_div->fllclk_div << 2)) || in fll_factors()
748 WARN_ON(!K && target != Fref * fll_div->fll_ratio * fll_div->n)) in fll_factors()
749 return -EINVAL; in fll_factors()
760 if (wm8900->fll_in == freq_in && wm8900->fll_out == freq_out) in wm8900_set_fll()
773 wm8900->fll_in = freq_in; in wm8900_set_fll()
774 wm8900->fll_out = freq_out; in wm8900_set_fll()
782 wm8900->fll_in = freq_in; in wm8900_set_fll()
783 wm8900->fll_out = freq_out; in wm8900_set_fll()
821 return wm8900_set_fll(codec_dai->component, pll_id, freq_in, freq_out); in wm8900_set_dai_pll()
827 struct snd_soc_component *component = codec_dai->component; in wm8900_set_dai_clkdiv()
859 return -EINVAL; in wm8900_set_dai_clkdiv()
869 struct snd_soc_component *component = codec_dai->component; in wm8900_set_dai_fmt()
900 return -EINVAL; in wm8900_set_dai_fmt()
924 return -EINVAL; in wm8900_set_dai_fmt()
940 return -EINVAL; in wm8900_set_dai_fmt()
964 return -EINVAL; in wm8900_set_dai_fmt()
968 return -EINVAL; in wm8900_set_dai_fmt()
981 struct snd_soc_component *component = codec_dai->component; in wm8900_digital_mute()
1013 .name = "wm8900-hifi",
1126 int fll_out = wm8900->fll_out; in wm8900_suspend()
1127 int fll_in = wm8900->fll_in; in wm8900_suspend()
1133 dev_err(component->dev, "Failed to stop FLL\n"); in wm8900_suspend()
1137 wm8900->fll_out = fll_out; in wm8900_suspend()
1138 wm8900->fll_in = fll_in; in wm8900_suspend()
1152 ret = regcache_sync(wm8900->regmap); in wm8900_resume()
1154 dev_err(component->dev, "Failed to restore cache: %d\n", ret); in wm8900_resume()
1161 if (wm8900->fll_out) { in wm8900_resume()
1162 int fll_out = wm8900->fll_out; in wm8900_resume()
1163 int fll_in = wm8900->fll_in; in wm8900_resume()
1165 wm8900->fll_in = 0; in wm8900_resume()
1166 wm8900->fll_out = 0; in wm8900_resume()
1170 dev_err(component->dev, "Failed to restart FLL\n"); in wm8900_resume()
1184 dev_err(component->dev, "Device is not a WM8900 - ID %x\n", reg); in wm8900_probe()
1185 return -ENODEV; in wm8900_probe()
1246 wm8900 = devm_kzalloc(&spi->dev, sizeof(struct wm8900_priv), in wm8900_spi_probe()
1249 return -ENOMEM; in wm8900_spi_probe()
1251 wm8900->regmap = devm_regmap_init_spi(spi, &wm8900_regmap); in wm8900_spi_probe()
1252 if (IS_ERR(wm8900->regmap)) in wm8900_spi_probe()
1253 return PTR_ERR(wm8900->regmap); in wm8900_spi_probe()
1257 ret = devm_snd_soc_register_component(&spi->dev, in wm8900_spi_probe()
1284 wm8900 = devm_kzalloc(&i2c->dev, sizeof(struct wm8900_priv), in wm8900_i2c_probe()
1287 return -ENOMEM; in wm8900_i2c_probe()
1289 wm8900->regmap = devm_regmap_init_i2c(i2c, &wm8900_regmap); in wm8900_i2c_probe()
1290 if (IS_ERR(wm8900->regmap)) in wm8900_i2c_probe()
1291 return PTR_ERR(wm8900->regmap); in wm8900_i2c_probe()
1295 ret = devm_snd_soc_register_component(&i2c->dev, in wm8900_i2c_probe()