Lines Matching +full:analog +full:- +full:out
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * This driver supports the analog controls for the internal codec
6 * Copyright 2016 Chen-Yu Tsai <wens@csie.org>
17 #include <sound/soc-dapm.h>
20 #include "sun8i-adda-pr-regmap.h"
22 /* Codec analog control register offsets and bit fields */
197 -450, 150, 0);
204 /* Mixer pre-gain */
316 static const DECLARE_TLV_DB_SCALE(sun8i_codec_hp_vol_scale, -6300, 100, 1);
346 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in sun8i_headphone_amp_event()
394 struct device *dev = cmpnt->dev; in sun8i_codec_add_headphone()
432 struct device *dev = cmpnt->dev; in sun8i_codec_add_mbias()
453 struct device *dev = cmpnt->dev; in sun8i_codec_add_hmic()
466 /* Mixer pre-gain */
490 struct device *dev = cmpnt->dev; in sun8i_codec_add_linein()
519 /* line out specific controls, widgets and routes */
522 2, 31, TLV_DB_SCALE_ITEM(-4350, 150, 0),
525 SOC_SINGLE_TLV("Line Out Playback Volume",
529 SOC_DOUBLE("Line Out Playback Switch",
546 SOC_DAPM_ENUM("Line Out Source Playback Route",
551 SND_SOC_DAPM_MUX("Line Out Source Playback Route",
554 SND_SOC_DAPM_SUPPLY("Line Out Enable", SUN8I_ADDA_PAEN_HP_CTRL,
560 { "Line Out Source Playback Route", "Stereo", "Left Mixer" },
561 { "Line Out Source Playback Route", "Stereo", "Right Mixer" },
562 { "Line Out Source Playback Route", "Mono Differential", "Left Mixer" },
563 { "Line Out Source Playback Route", "Mono Differential", "Right Mixer" },
564 { "LINEOUT", NULL, "Line Out Source Playback Route" },
565 { "LINEOUT", NULL, "Line Out Enable", },
571 struct device *dev = cmpnt->dev; in sun8i_codec_add_lineout()
578 dev_err(dev, "Failed to add Line Out controls: %d\n", ret); in sun8i_codec_add_lineout()
585 dev_err(dev, "Failed to add Line Out DAPM widgets: %d\n", ret); in sun8i_codec_add_lineout()
592 dev_err(dev, "Failed to add Line Out DAPM routes: %d\n", ret); in sun8i_codec_add_lineout()
601 /* Mixer pre-gain */
636 struct device *dev = cmpnt->dev; in sun8i_codec_add_mic2()
692 struct device *dev = cmpnt->dev; in sun8i_codec_analog_add_mixer()
695 if (!quirks->has_mic2 && !quirks->has_linein) { in sun8i_codec_analog_add_mixer()
737 struct device *dev = cmpnt->dev; in sun8i_codec_analog_cmpnt_probe()
753 if (quirks->has_headphone) { in sun8i_codec_analog_cmpnt_probe()
759 if (quirks->has_hmic) { in sun8i_codec_analog_cmpnt_probe()
765 if (quirks->has_linein) { in sun8i_codec_analog_cmpnt_probe()
771 if (quirks->has_lineout) { in sun8i_codec_analog_cmpnt_probe()
777 if (quirks->has_mbias) { in sun8i_codec_analog_cmpnt_probe()
783 if (quirks->has_mic2) { in sun8i_codec_analog_cmpnt_probe()
804 .compatible = "allwinner,sun8i-a23-codec-analog",
808 .compatible = "allwinner,sun8i-h3-codec-analog",
812 .compatible = "allwinner,sun8i-v3s-codec-analog",
826 dev_err(&pdev->dev, "Failed to map the registers\n"); in sun8i_codec_analog_probe()
830 regmap = sun8i_adda_pr_regmap_init(&pdev->dev, base); in sun8i_codec_analog_probe()
832 dev_err(&pdev->dev, "Failed to create regmap\n"); in sun8i_codec_analog_probe()
836 return devm_snd_soc_register_component(&pdev->dev, in sun8i_codec_analog_probe()
843 .name = "sun8i-codec-analog",
850 MODULE_DESCRIPTION("Allwinner internal codec analog controls driver");
851 MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>");
853 MODULE_ALIAS("platform:sun8i-codec-analog");