Lines Matching +full:vl +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0-only
9 * Based on cs4270.c - Copyright (c) Freescale Semiconductor
12 * - Only I2C is support. Not SPI
13 * - master mode *NOT* supported
38 "VL",
47 unsigned int audio_mode; /* The mode (I2S or left-justified) */
66 ucontrol->value.enumerated.item[0] = 0; in cs42l51_get_chan_mix()
71 ucontrol->value.enumerated.item[0] = 1; in cs42l51_get_chan_mix()
74 ucontrol->value.enumerated.item[0] = 2; in cs42l51_get_chan_mix()
91 switch (ucontrol->value.enumerated.item[0]) { in cs42l51_set_chan_mix()
109 static const DECLARE_TLV_DB_SCALE(adc_pcm_tlv, -5150, 50, 0);
110 static const DECLARE_TLV_DB_SCALE(tone_tlv, -1050, 150, 0);
112 static const DECLARE_TLV_DB_SCALE(aout_tlv, -10200, 50, 0);
122 static const DECLARE_TLV_DB_SCALE(pga_tlv, -300, 50, 0);
123 static const DECLARE_TLV_DB_SCALE(adc_att_tlv, -9600, 100, 0);
148 SOC_SINGLE("Auto-Mute Switch", CS42L51_DAC_CTL, 2, 1, 0),
165 * 2.) enable power-down for the select channels
171 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in cs42l51_pdn_event()
248 SND_SOC_DAPM_MUX("PGA-ADC Mux Left", SND_SOC_NOPM, 0, 0,
250 SND_SOC_DAPM_MUX("PGA-ADC Mux Right", SND_SOC_NOPM, 0, 0,
257 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in mclk_event()
262 return clk_prepare_enable(cs42l51->mclk_handle); in mclk_event()
264 /* Delay mclk shutdown to fulfill power-down sequence requirements */ in mclk_event()
266 clk_disable_unprepare(cs42l51->mclk_handle); in mclk_event()
294 {"PGA-ADC Mux Left", "AIN1 Left", "AIN1L" },
295 {"PGA-ADC Mux Left", "AIN2 Left", "AIN2L" },
296 {"PGA-ADC Mux Left", "MIC Left", "MICL" },
297 {"PGA-ADC Mux Left", "MIC+preamp Left", "Mic Preamp Left" },
298 {"PGA-ADC Mux Right", "AIN1 Right", "AIN1R" },
299 {"PGA-ADC Mux Right", "AIN2 Right", "AIN2R" },
300 {"PGA-ADC Mux Right", "MIC Right", "MICR" },
301 {"PGA-ADC Mux Right", "MIC+preamp Right", "Mic Preamp Right" },
303 {"Left PGA", NULL, "PGA-ADC Mux Left"},
304 {"Right PGA", NULL, "PGA-ADC Mux Right"},
310 struct snd_soc_component *component = codec_dai->component; in cs42l51_set_dai_fmt()
317 cs42l51->audio_mode = format & SND_SOC_DAIFMT_FORMAT_MASK; in cs42l51_set_dai_fmt()
320 dev_err(component->dev, "invalid DAI format\n"); in cs42l51_set_dai_fmt()
321 return -EINVAL; in cs42l51_set_dai_fmt()
326 cs42l51->func = MODE_MASTER; in cs42l51_set_dai_fmt()
329 cs42l51->func = MODE_SLAVE_AUTO; in cs42l51_set_dai_fmt()
332 dev_err(component->dev, "Unknown master/slave configuration\n"); in cs42l51_set_dai_fmt()
333 return -EINVAL; in cs42l51_set_dai_fmt()
372 * Recommended configurations are SSM for 4-50khz and DSM for 50-100kHz ranges
386 struct snd_soc_component *component = codec_dai->component; in cs42l51_set_dai_sysclk()
389 cs42l51->mclk = freq; in cs42l51_set_dai_sysclk()
397 struct snd_soc_component *component = dai->component; in cs42l51_hw_params()
407 switch (cs42l51->func) { in cs42l51_hw_params()
424 ratio = cs42l51->mclk / rate; /* MCLK/LRCK ratio */ in cs42l51_hw_params()
432 dev_err(component->dev, "could not find matching ratio\n"); in cs42l51_hw_params()
433 return -EINVAL; in cs42l51_hw_params()
444 switch (cs42l51->func) { in cs42l51_hw_params()
466 switch (cs42l51->audio_mode) { in cs42l51_hw_params()
489 dev_err(component->dev, "unknown format\n"); in cs42l51_hw_params()
490 return -EINVAL; in cs42l51_hw_params()
495 dev_err(component->dev, "unknown format\n"); in cs42l51_hw_params()
496 return -EINVAL; in cs42l51_hw_params()
515 struct snd_soc_component *component = dai->component; in cs42l51_dai_mute()
545 .name = "cs42l51-hifi",
572 if (cs42l51->mclk_handle) in cs42l51_component_probe()
577 * - Use signal processor in cs42l51_component_probe()
578 * - auto mute in cs42l51_component_probe()
579 * - vol changes immediate in cs42l51_component_probe()
580 * - no de-emphasize in cs42l51_component_probe()
722 return -ENOMEM; in cs42l51_probe()
725 cs42l51->regmap = regmap; in cs42l51_probe()
727 cs42l51->mclk_handle = devm_clk_get_optional(dev, "MCLK"); in cs42l51_probe()
728 if (IS_ERR(cs42l51->mclk_handle)) in cs42l51_probe()
729 return PTR_ERR(cs42l51->mclk_handle); in cs42l51_probe()
731 for (i = 0; i < ARRAY_SIZE(cs42l51->supplies); i++) in cs42l51_probe()
732 cs42l51->supplies[i].supply = cs42l51_supply_names[i]; in cs42l51_probe()
734 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(cs42l51->supplies), in cs42l51_probe()
735 cs42l51->supplies); in cs42l51_probe()
741 ret = regulator_bulk_enable(ARRAY_SIZE(cs42l51->supplies), in cs42l51_probe()
742 cs42l51->supplies); in cs42l51_probe()
748 cs42l51->reset_gpio = devm_gpiod_get_optional(dev, "reset", in cs42l51_probe()
750 if (IS_ERR(cs42l51->reset_gpio)) { in cs42l51_probe()
751 ret = PTR_ERR(cs42l51->reset_gpio); in cs42l51_probe()
755 if (cs42l51->reset_gpio) { in cs42l51_probe()
757 gpiod_set_value_cansleep(cs42l51->reset_gpio, 0); in cs42l51_probe()
771 ret = -ENODEV; in cs42l51_probe()
785 gpiod_set_value_cansleep(cs42l51->reset_gpio, 1); in cs42l51_probe()
786 regulator_bulk_disable(ARRAY_SIZE(cs42l51->supplies), in cs42l51_probe()
787 cs42l51->supplies); in cs42l51_probe()
797 gpiod_set_value_cansleep(cs42l51->reset_gpio, 1); in cs42l51_remove()
799 ret = regulator_bulk_disable(ARRAY_SIZE(cs42l51->supplies), in cs42l51_remove()
800 cs42l51->supplies); in cs42l51_remove()
812 regcache_cache_only(cs42l51->regmap, true); in cs42l51_suspend()
813 regcache_mark_dirty(cs42l51->regmap); in cs42l51_suspend()
823 regcache_cache_only(cs42l51->regmap, false); in cs42l51_resume()
825 return regcache_sync(cs42l51->regmap); in cs42l51_resume()
829 MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");