Lines Matching +full:vref +full:- +full:out +full:- +full:en

1 // SPDX-License-Identifier: GPL-2.0-only
3 * alc5632.c -- ALC5632 ALSA SoC Audio Codec
36 { 2, 0x8080 }, /* R2 - Speaker Output Volume */
37 { 4, 0x8080 }, /* R4 - Headphone Output Volume */
38 { 6, 0x8080 }, /* R6 - AUXOUT Volume */
39 { 8, 0xC800 }, /* R8 - Phone Input */
40 { 10, 0xE808 }, /* R10 - LINE_IN Volume */
41 { 12, 0x1010 }, /* R12 - STEREO DAC Input Volume */
42 { 14, 0x0808 }, /* R14 - MIC Input Volume */
43 { 16, 0xEE0F }, /* R16 - Stereo DAC and MIC Routing Control */
44 { 18, 0xCBCB }, /* R18 - ADC Record Gain */
45 { 20, 0x7F7F }, /* R20 - ADC Record Mixer Control */
46 { 24, 0xE010 }, /* R24 - Voice DAC Volume */
47 { 28, 0x8008 }, /* R28 - Output Mixer Control */
48 { 34, 0x0000 }, /* R34 - Microphone Control */
49 { 36, 0x00C0 }, /* R36 - Codec Digital MIC/Digital Boost
51 { 46, 0x0000 }, /* R46 - Stereo DAC/Voice DAC/Stereo ADC
53 { 52, 0x8000 }, /* R52 - Main Serial Data Port Control
55 { 54, 0x0000 }, /* R54 - Extend Serial Data Port Control
57 { 58, 0x0000 }, /* R58 - Power Management Addition 1 */
58 { 60, 0x0000 }, /* R60 - Power Management Addition 2 */
59 { 62, 0x8000 }, /* R62 - Power Management Addition 3 */
60 { 64, 0x0C0A }, /* R64 - General Purpose Control Register 1 */
61 { 66, 0x0000 }, /* R66 - General Purpose Control Register 2 */
62 { 68, 0x0000 }, /* R68 - PLL1 Control */
63 { 70, 0x0000 }, /* R70 - PLL2 Control */
64 { 76, 0xBE3E }, /* R76 - GPIO Pin Configuration */
65 { 78, 0xBE3E }, /* R78 - GPIO Pin Polarity */
66 { 80, 0x0000 }, /* R80 - GPIO Pin Sticky */
67 { 82, 0x0000 }, /* R82 - GPIO Pin Wake Up */
68 { 86, 0x0000 }, /* R86 - Pin Sharing */
69 { 90, 0x0009 }, /* R90 - Soft Volume Control Setting */
70 { 92, 0x0000 }, /* R92 - GPIO_Output Pin Control */
71 { 94, 0x3000 }, /* R94 - MISC Control */
72 { 96, 0x3075 }, /* R96 - Stereo DAC Clock Control_1 */
73 { 98, 0x1010 }, /* R98 - Stereo DAC Clock Control_2 */
74 { 100, 0x3110 }, /* R100 - VoDAC_PCM Clock Control_1 */
75 { 104, 0x0553 }, /* R104 - Pseudo Stereo and Spatial Effect
77 { 106, 0x0000 }, /* R106 - Private Register Address */
116 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in amp_mixer_event()
118 /* to power-on/off class-d amp generators/speaker */ in amp_mixer_event()
119 /* need to write to 'index-46h' register : */ in amp_mixer_event()
140 /* -34.5db min scale, 1.5db steps, no mute */
141 static const DECLARE_TLV_DB_SCALE(vol_tlv, -3450, 150, 0);
142 /* -46.5db min scale, 1.5db steps, no mute */
143 static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0);
144 /* -16.5db min scale, 1.5db steps, no mute */
145 static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0);
153 static const DECLARE_TLV_DB_SCALE(vdac_tlv, -3525, 75, 0);
157 /* 31 steps (5 bit), -46.5db scale */
198 SOC_SINGLE("DMIC En Capture Switch",
279 "RN/-R", "RP/+R", "LN/-R", "Mute"};
334 SOC_DAPM_ENUM("AB-D Amp Mux", alc5632_amp_enum);
343 /* I2S out select */
425 SND_SOC_DAPM_PGA("Aux Out", ALC5632_PWR_MANAG_ADD3, 14, 0, NULL, 0),
440 SND_SOC_DAPM_MUX("AB-D Amp Mux", ALC5632_PWR_MANAG_ADD1, 10, 0,
465 /* virtual mixer - mixes left & right channels */
472 {"AUXOUT", NULL, "Aux Out"},
537 /* speaker out mux */
543 /* Mono/Aux Out mux */
554 {"Aux Out", NULL, "AuxOut Mux"},
580 /* Digital I2S out */
591 {"SpeakerOut N Mux", "RN/-R", "Left Speaker"},
593 {"SpeakerOut N Mux", "LN/-R", "Left Speaker"},
596 {"SpeakerOut N Mux", "RN/-R", "Right Speaker"},
598 {"SpeakerOut N Mux", "LN/-R", "Right Speaker"},
603 {"AB-D Amp Mux", "AB Amp", "AB Amp"},
604 {"AB-D Amp Mux", "D Amp", "D Amp"},
605 {"Left Speaker", NULL, "AB-D Amp Mux"},
606 {"Right Speaker", NULL, "AB-D Amp Mux"},
663 same as for 5623 - thanks!
681 struct snd_soc_component *component = codec_dai->component; in alc5632_set_dai_pll()
686 return -EINVAL; in alc5632_set_dai_pll()
738 return -EINVAL; in alc5632_set_dai_pll()
742 return -EINVAL; in alc5632_set_dai_pll()
781 if (coeff_div[i].fs * rate == alc5632->sysclk) in get_coeff()
784 return -EINVAL; in get_coeff()
793 struct snd_soc_component *component = codec_dai->component; in alc5632_set_dai_sysclk()
806 alc5632->sysclk = freq; in alc5632_set_dai_sysclk()
809 return -EINVAL; in alc5632_set_dai_sysclk()
815 struct snd_soc_component *component = codec_dai->component; in alc5632_set_dai_fmt()
827 return -EINVAL; in alc5632_set_dai_fmt()
845 return -EINVAL; in alc5632_set_dai_fmt()
861 return -EINVAL; in alc5632_set_dai_fmt()
870 struct snd_soc_component *component = dai->component; in alc5632_pcm_hw_params()
889 return -EINVAL; in alc5632_pcm_hw_params()
897 return -EINVAL; in alc5632_pcm_hw_params()
907 struct snd_soc_component *component = dai->component; in alc5632_mute()
944 /* set all PR0-7 mixers to 0 */ in enable_power_depop()
976 /* everything off except vref/vmid, */ in alc5632_set_bias_level()
1016 .name = "alc5632-hifi",
1043 regcache_sync(alc5632->regmap); in alc5632_resume()
1055 switch (alc5632->id) { in alc5632_probe()
1061 return -EINVAL; in alc5632_probe()
1113 alc5632 = devm_kzalloc(&client->dev, in alc5632_i2c_probe()
1116 return -ENOMEM; in alc5632_i2c_probe()
1120 alc5632->regmap = devm_regmap_init_i2c(client, &alc5632_regmap); in alc5632_i2c_probe()
1121 if (IS_ERR(alc5632->regmap)) { in alc5632_i2c_probe()
1122 ret = PTR_ERR(alc5632->regmap); in alc5632_i2c_probe()
1123 dev_err(&client->dev, "regmap_init() failed: %d\n", ret); in alc5632_i2c_probe()
1127 ret1 = regmap_read(alc5632->regmap, ALC5632_VENDOR_ID1, &vid1); in alc5632_i2c_probe()
1128 ret2 = regmap_read(alc5632->regmap, ALC5632_VENDOR_ID2, &vid2); in alc5632_i2c_probe()
1130 dev_err(&client->dev, in alc5632_i2c_probe()
1132 return -EIO; in alc5632_i2c_probe()
1139 if ((vid1 != 0x10EC) || (vid2 != id->driver_data)) { in alc5632_i2c_probe()
1140 dev_err(&client->dev, in alc5632_i2c_probe()
1142 return -EINVAL; in alc5632_i2c_probe()
1145 ret = alc5632_reset(alc5632->regmap); in alc5632_i2c_probe()
1147 dev_err(&client->dev, "Failed to issue reset\n"); in alc5632_i2c_probe()
1151 alc5632->id = vid2; in alc5632_i2c_probe()
1152 switch (alc5632->id) { in alc5632_i2c_probe()
1154 alc5632_dai.name = "alc5632-hifi"; in alc5632_i2c_probe()
1157 return -EINVAL; in alc5632_i2c_probe()
1160 ret = devm_snd_soc_register_component(&client->dev, in alc5632_i2c_probe()
1164 dev_err(&client->dev, "Failed to register component: %d\n", ret); in alc5632_i2c_probe()