Lines Matching +full:gpio +full:- +full:mux +full:- +full:clock
2 * alc5632.c -- ALC5632 ALSA SoC Audio Codec
39 { 2, 0x8080 }, /* R2 - Speaker Output Volume */
40 { 4, 0x8080 }, /* R4 - Headphone Output Volume */
41 { 6, 0x8080 }, /* R6 - AUXOUT Volume */
42 { 8, 0xC800 }, /* R8 - Phone Input */
43 { 10, 0xE808 }, /* R10 - LINE_IN Volume */
44 { 12, 0x1010 }, /* R12 - STEREO DAC Input Volume */
45 { 14, 0x0808 }, /* R14 - MIC Input Volume */
46 { 16, 0xEE0F }, /* R16 - Stereo DAC and MIC Routing Control */
47 { 18, 0xCBCB }, /* R18 - ADC Record Gain */
48 { 20, 0x7F7F }, /* R20 - ADC Record Mixer Control */
49 { 24, 0xE010 }, /* R24 - Voice DAC Volume */
50 { 28, 0x8008 }, /* R28 - Output Mixer Control */
51 { 34, 0x0000 }, /* R34 - Microphone Control */
52 { 36, 0x00C0 }, /* R36 - Codec Digital MIC/Digital Boost
54 { 46, 0x0000 }, /* R46 - Stereo DAC/Voice DAC/Stereo ADC
56 { 52, 0x8000 }, /* R52 - Main Serial Data Port Control
58 { 54, 0x0000 }, /* R54 - Extend Serial Data Port Control
60 { 58, 0x0000 }, /* R58 - Power Management Addition 1 */
61 { 60, 0x0000 }, /* R60 - Power Management Addition 2 */
62 { 62, 0x8000 }, /* R62 - Power Management Addition 3 */
63 { 64, 0x0C0A }, /* R64 - General Purpose Control Register 1 */
64 { 66, 0x0000 }, /* R66 - General Purpose Control Register 2 */
65 { 68, 0x0000 }, /* R68 - PLL1 Control */
66 { 70, 0x0000 }, /* R70 - PLL2 Control */
67 { 76, 0xBE3E }, /* R76 - GPIO Pin Configuration */
68 { 78, 0xBE3E }, /* R78 - GPIO Pin Polarity */
69 { 80, 0x0000 }, /* R80 - GPIO Pin Sticky */
70 { 82, 0x0000 }, /* R82 - GPIO Pin Wake Up */
71 { 86, 0x0000 }, /* R86 - Pin Sharing */
72 { 90, 0x0009 }, /* R90 - Soft Volume Control Setting */
73 { 92, 0x0000 }, /* R92 - GPIO_Output Pin Control */
74 { 94, 0x3000 }, /* R94 - MISC Control */
75 { 96, 0x3075 }, /* R96 - Stereo DAC Clock Control_1 */
76 { 98, 0x1010 }, /* R98 - Stereo DAC Clock Control_2 */
77 { 100, 0x3110 }, /* R100 - VoDAC_PCM Clock Control_1 */
78 { 104, 0x0553 }, /* R104 - Pseudo Stereo and Spatial Effect
80 { 106, 0x0000 }, /* R106 - Private Register Address */
119 /* to power-on/off class-d amp generators/speaker */ in amp_mixer_event()
120 /* need to write to 'index-46h' register : */ in amp_mixer_event()
123 snd_soc_write(w->codec, ALC5632_HID_CTRL_INDEX, 0x46); in amp_mixer_event()
127 snd_soc_write(w->codec, ALC5632_HID_CTRL_DATA, 0xFFFF); in amp_mixer_event()
130 snd_soc_write(w->codec, ALC5632_HID_CTRL_DATA, 0); in amp_mixer_event()
141 /* -34.5db min scale, 1.5db steps, no mute */
142 static const DECLARE_TLV_DB_SCALE(vol_tlv, -3450, 150, 0);
143 /* -46.5db min scale, 1.5db steps, no mute */
144 static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0);
145 /* -16.5db min scale, 1.5db steps, no mute */
146 static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0);
156 static const DECLARE_TLV_DB_SCALE(vdac_tlv, -3525, 075, 0);
160 /* 31 steps (5 bit), -46.5db scale */
268 "RN/-R", "RP/+R", "LN/-R", "Mute"};
278 /* auxout output mux */
282 SOC_DAPM_ENUM("AuxOut Mux", alc5632_aux_out_input_enum);
284 /* speaker output mux */
288 SOC_DAPM_ENUM("SpeakerOut Mux", alc5632_spkout_input_enum);
290 /* headphone left output mux */
294 SOC_DAPM_ENUM("Left Headphone Mux", alc5632_hpl_out_input_enum);
296 /* headphone right output mux */
300 SOC_DAPM_ENUM("Right Headphone Mux", alc5632_hpr_out_input_enum);
306 SOC_DAPM_ENUM("SpeakerOut N Mux", alc5632_spk_n_sour_enum);
313 SOC_DAPM_ENUM("AB-D Amp Mux", alc5632_amp_enum);
318 SND_SOC_DAPM_MUX("AuxOut Mux", SND_SOC_NOPM, 0, 0,
320 SND_SOC_DAPM_MUX("SpeakerOut Mux", SND_SOC_NOPM, 0, 0,
322 SND_SOC_DAPM_MUX("Left Headphone Mux", SND_SOC_NOPM, 0, 0,
324 SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0,
326 SND_SOC_DAPM_MUX("SpeakerOut N Mux", SND_SOC_NOPM, 0, 0,
388 SND_SOC_DAPM_MUX("AB-D Amp Mux", ALC5632_PWR_MANAG_ADD1, 10, 0,
407 /* virtual mixer - mixes left & right channels */
469 /* headphone left mux */
470 {"Left Headphone Mux", "HP Left Mix", "HPL Mix"},
471 {"Left Headphone Mux", "Vmid", "Vmid"},
473 /* headphone right mux */
474 {"Right Headphone Mux", "HP Right Mix", "HPR Mix"},
475 {"Right Headphone Mux", "Vmid", "Vmid"},
477 /* speaker out mux */
478 {"SpeakerOut Mux", "Vmid", "Vmid"},
479 {"SpeakerOut Mux", "HPOut Mix", "HPOut Mix"},
480 {"SpeakerOut Mux", "Speaker Mix", "Speaker Mix"},
481 {"SpeakerOut Mux", "Mono Mix", "Mono Mix"},
483 /* Mono/Aux Out mux */
484 {"AuxOut Mux", "Vmid", "Vmid"},
485 {"AuxOut Mux", "HPOut Mix", "HPOut Mix"},
486 {"AuxOut Mux", "Speaker Mix", "Speaker Mix"},
487 {"AuxOut Mux", "Mono Mix", "Mono Mix"},
491 {"Left Headphone", NULL, "Left Headphone Mux"},
493 {"Right Headphone", NULL, "Right Headphone Mux"},
494 {"Aux Out", NULL, "AuxOut Mux"},
511 {"SpeakerOut N Mux", "RN/-R", "Left Speaker"},
512 {"SpeakerOut N Mux", "RP/+R", "Left Speaker"},
513 {"SpeakerOut N Mux", "LN/-R", "Left Speaker"},
514 {"SpeakerOut N Mux", "Mute", "Vmid"},
516 {"SpeakerOut N Mux", "RN/-R", "Right Speaker"},
517 {"SpeakerOut N Mux", "RP/+R", "Right Speaker"},
518 {"SpeakerOut N Mux", "LN/-R", "Right Speaker"},
519 {"SpeakerOut N Mux", "Mute", "Vmid"},
521 {"AB Amp", NULL, "SpeakerOut Mux"},
522 {"D Amp", NULL, "SpeakerOut Mux"},
523 {"AB-D Amp Mux", "AB Amp", "AB Amp"},
524 {"AB-D Amp Mux", "D Amp", "D Amp"},
525 {"Left Speaker", NULL, "AB-D Amp Mux"},
526 {"Right Speaker", NULL, "AB-D Amp Mux"},
531 {"SPKOUTN", NULL, "SpeakerOut N Mux"},
583 same as for 5623 - thanks!
601 struct snd_soc_codec *codec = codec_dai->codec; in alc5632_set_dai_pll()
606 return -EINVAL; in alc5632_set_dai_pll()
650 /* PLL source from voice clock */ in alc5632_set_dai_pll()
658 return -EINVAL; in alc5632_set_dai_pll()
662 return -EINVAL; in alc5632_set_dai_pll()
666 /* choose PLL1 clock rate */ in alc5632_set_dai_pll()
689 /* codec hifi mclk (after PLL) clock divider coefficients */
701 if (coeff_div[i].fs * rate == alc5632->sysclk) in get_coeff()
704 return -EINVAL; in get_coeff()
708 * Clock after PLL and dividers
713 struct snd_soc_codec *codec = codec_dai->codec; in alc5632_set_dai_sysclk()
725 alc5632->sysclk = freq; in alc5632_set_dai_sysclk()
728 return -EINVAL; in alc5632_set_dai_sysclk()
734 struct snd_soc_codec *codec = codec_dai->codec; in alc5632_set_dai_fmt()
746 return -EINVAL; in alc5632_set_dai_fmt()
764 return -EINVAL; in alc5632_set_dai_fmt()
767 /* clock inversion */ in alc5632_set_dai_fmt()
780 return -EINVAL; in alc5632_set_dai_fmt()
789 struct snd_soc_pcm_runtime *rtd = substream->private_data; in alc5632_pcm_hw_params()
790 struct snd_soc_codec *codec = rtd->codec; in alc5632_pcm_hw_params()
809 return -EINVAL; in alc5632_pcm_hw_params()
817 return -EINVAL; in alc5632_pcm_hw_params()
827 struct snd_soc_codec *codec = dai->codec; in alc5632_mute()
864 /* set all PR0-7 mixers to 0 */ in enable_power_depop()
919 codec->dapm.bias_level = level; in alc5632_set_bias_level()
936 .name = "alc5632-hifi",
969 regcache_sync(alc5632->regmap); in alc5632_resume()
984 codec->control_data = alc5632->regmap; in alc5632_probe()
988 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); in alc5632_probe()
995 switch (alc5632->id) { in alc5632_probe()
1001 return -EINVAL; in alc5632_probe()
1052 alc5632 = devm_kzalloc(&client->dev, in alc5632_i2c_probe()
1055 return -ENOMEM; in alc5632_i2c_probe()
1059 alc5632->regmap = regmap_init_i2c(client, &alc5632_regmap); in alc5632_i2c_probe()
1060 if (IS_ERR(alc5632->regmap)) { in alc5632_i2c_probe()
1061 ret = PTR_ERR(alc5632->regmap); in alc5632_i2c_probe()
1062 dev_err(&client->dev, "regmap_init() failed: %d\n", ret); in alc5632_i2c_probe()
1066 ret1 = regmap_read(alc5632->regmap, ALC5632_VENDOR_ID1, &vid1); in alc5632_i2c_probe()
1067 ret2 = regmap_read(alc5632->regmap, ALC5632_VENDOR_ID2, &vid2); in alc5632_i2c_probe()
1069 dev_err(&client->dev, in alc5632_i2c_probe()
1071 regmap_exit(alc5632->regmap); in alc5632_i2c_probe()
1072 return -EIO; in alc5632_i2c_probe()
1077 if ((vid1 != 0x10EC) || (vid2 != id->driver_data)) { in alc5632_i2c_probe()
1078 dev_err(&client->dev, in alc5632_i2c_probe()
1080 regmap_exit(alc5632->regmap); in alc5632_i2c_probe()
1081 return -EINVAL; in alc5632_i2c_probe()
1084 ret = alc5632_reset(alc5632->regmap); in alc5632_i2c_probe()
1086 dev_err(&client->dev, "Failed to issue reset\n"); in alc5632_i2c_probe()
1087 regmap_exit(alc5632->regmap); in alc5632_i2c_probe()
1091 alc5632->id = vid2; in alc5632_i2c_probe()
1092 switch (alc5632->id) { in alc5632_i2c_probe()
1094 alc5632_dai.name = "alc5632-hifi"; in alc5632_i2c_probe()
1097 return -EINVAL; in alc5632_i2c_probe()
1100 ret = snd_soc_register_codec(&client->dev, in alc5632_i2c_probe()
1104 dev_err(&client->dev, "Failed to register codec: %d\n", ret); in alc5632_i2c_probe()
1105 regmap_exit(alc5632->regmap); in alc5632_i2c_probe()
1115 snd_soc_unregister_codec(&client->dev); in alc5632_i2c_remove()
1116 regmap_exit(alc5632->regmap); in alc5632_i2c_remove()