Lines Matching +full:aux +full:- +full:output +full:- +full:source
1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm8940.c -- WM8940 ALSA Soc Audio driver
145 { 0x31, 0x0002 }, /* Output Control */
153 static const char *wm8940_companding[] = { "Off", "NC", "u-law", "A-law" };
171 static DECLARE_TLV_DB_SCALE(wm8940_spk_vol_tlv, -5700, 100, 1);
172 static DECLARE_TLV_DB_SCALE(wm8940_att_tlv, -1000, 1000, 0);
173 static DECLARE_TLV_DB_SCALE(wm8940_pga_vol_tlv, -1200, 75, 0);
174 static DECLARE_TLV_DB_SCALE(wm8940_alc_min_tlv, -1200, 600, 0);
176 static DECLARE_TLV_DB_SCALE(wm8940_alc_tar_tlv, -2250, 50, 0);
178 static DECLARE_TLV_DB_SCALE(wm8940_lim_thresh_tlv, -600, 100, 0);
179 static DECLARE_TLV_DB_SCALE(wm8940_adc_tlv, -12750, 50, 1);
246 SOC_DAPM_SINGLE("Aux Playback Switch", WM8940_SPKMIX, 5, 1, 0),
252 SOC_DAPM_SINGLE("Aux Playback Switch", WM8940_MONOMIX, 2, 1, 0),
256 static DECLARE_TLV_DB_SCALE(wm8940_boost_vol_tlv, -1500, 300, 1);
259 SOC_DAPM_SINGLE_TLV("Aux Volume", WM8940_ADCBOOST,
266 SOC_DAPM_SINGLE("AUX Switch", WM8940_INPUTCTL, 2, 1, 0),
287 SND_SOC_DAPM_PGA("Aux Input", WM8940_POWER1, 6, 0, NULL, 0),
299 SND_SOC_DAPM_INPUT("AUX"),
303 /* Mono output mixer */
305 {"Mono Mixer", "Aux Playback Switch", "Aux Input"},
308 /* Speaker output mixer */
310 {"Speaker Mixer", "Aux Playback Switch", "Aux Input"},
324 {"Mic PGA", "AUX Switch", "AUX"},
329 {"Boost Mixer", "Aux Volume", "Aux Input"},
339 struct snd_soc_component *component = codec_dai->component; in wm8940_set_dai_fmt()
350 return -EINVAL; in wm8940_set_dai_fmt()
394 struct snd_soc_component *component = dai->component; in wm8940_i2s_hw_params()
402 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE in wm8940_i2s_hw_params()
457 struct snd_soc_component *component = dai->component; in wm8940_mute()
493 ret = regcache_sync(wm8940->regmap); in wm8940_set_bias_level()
495 dev_err(component->dev, "Failed to sync cache: %d\n", ret); in wm8940_set_bias_level()
524 static void pll_factors(unsigned int target, unsigned int source) in pll_factors() argument
529 Ndiv = target / source; in pll_factors()
532 source <<= 1; in pll_factors()
535 Ndiv = target / source; in pll_factors()
537 source >>= 2; in pll_factors()
540 Ndiv = target / source; in pll_factors()
542 source >>= 1; in pll_factors()
545 Ndiv = target / source; in pll_factors()
555 Nmod = target % source; in pll_factors()
558 do_div(Kpart, source); in pll_factors()
574 int source, unsigned int freq_in, unsigned int freq_out) in wm8940_set_dai_pll() argument
576 struct snd_soc_component *component = codec_dai->component; in wm8940_set_dai_pll()
617 struct snd_soc_component *component = codec_dai->component; in wm8940_set_dai_sysclk()
626 wm8940->sysclk = freq; in wm8940_set_dai_sysclk()
629 return -EINVAL; in wm8940_set_dai_sysclk()
635 struct snd_soc_component *component = codec_dai->component; in wm8940_set_dai_clkdiv()
675 .name = "wm8940-hifi",
696 struct wm8940_setup_data *pdata = component->dev->platform_data; in wm8940_probe()
702 dev_err(component->dev, "Failed to issue reset\n"); in wm8940_probe()
713 dev_warn(component->dev, "No platform data supplied\n"); in wm8940_probe()
716 ret = snd_soc_component_write(component, WM8940_OUTPUTCTL, reg | pdata->vroi); in wm8940_probe()
759 wm8940 = devm_kzalloc(&i2c->dev, sizeof(struct wm8940_priv), in wm8940_i2c_probe()
762 return -ENOMEM; in wm8940_i2c_probe()
764 wm8940->regmap = devm_regmap_init_i2c(i2c, &wm8940_regmap); in wm8940_i2c_probe()
765 if (IS_ERR(wm8940->regmap)) in wm8940_i2c_probe()
766 return PTR_ERR(wm8940->regmap); in wm8940_i2c_probe()
770 ret = devm_snd_soc_register_component(&i2c->dev, in wm8940_i2c_probe()