Lines Matching +full:0 +full:xc400

32 #define WM9713_VENDOR_ID 0x574d4c13
33 #define WM9713_VENDOR_ID_MASK 0xffffffff
43 #define HPL_MIXER 0
70 SOC_ENUM_SINGLE(AC97_LINE, 3, 4, wm9713_mic_mixer), /* record mic mixer 0 */
74 SOC_ENUM_SINGLE(AC97_VIDEO, 0, 8, wm9713_rec_src), /* record mux right 4*/
83 SOC_ENUM_SINGLE(AC97_REC_GAIN, 0, 4, wm9713_out4_pga), /* out 4 source 13 */
92 static const DECLARE_TLV_DB_SCALE(out_tlv, -4650, 150, 0);
93 static const DECLARE_TLV_DB_SCALE(main_tlv, -3450, 150, 0);
94 static const DECLARE_TLV_DB_SCALE(misc_tlv, -1500, 300, 0);
96 0, 2, TLV_DB_SCALE_ITEM(1200, 600, 0),
97 3, 3, TLV_DB_SCALE_ITEM(3000, 0, 0)
101 SOC_DOUBLE_TLV("Speaker Playback Volume", AC97_MASTER, 8, 0, 31, 1, out_tlv),
103 SOC_DOUBLE_TLV("Headphone Playback Volume", AC97_HEADPHONE, 8, 0, 31, 1,
106 SOC_DOUBLE_TLV("Line In Volume", AC97_PC_BEEP, 8, 0, 31, 1, main_tlv),
107 SOC_DOUBLE_TLV("PCM Playback Volume", AC97_PHONE, 8, 0, 31, 1, main_tlv),
109 SOC_SINGLE_TLV("Mic 2 Volume", AC97_MIC, 0, 31, 1, main_tlv),
110 SOC_SINGLE_TLV("Mic 1 Preamp Volume", AC97_3D_CONTROL, 10, 3, 0, mic_tlv),
111 SOC_SINGLE_TLV("Mic 2 Preamp Volume", AC97_3D_CONTROL, 12, 3, 0, mic_tlv),
113 SOC_SINGLE("Mic Boost (+20dB) Switch", AC97_LINE, 5, 1, 0),
114 SOC_SINGLE("Mic Headphone Mixer Volume", AC97_LINE, 0, 7, 1),
118 SOC_DOUBLE("Capture Volume", AC97_CD, 8, 0, 31, 0),
119 SOC_SINGLE("Capture ZC Switch", AC97_CD, 7, 1, 0),
122 SOC_SINGLE("Capture to Mono Boost (+20dB) Switch", AC97_VIDEO, 8, 1, 0),
123 SOC_SINGLE("Capture ADC Boost (+20dB) Switch", AC97_VIDEO, 6, 1, 0),
125 SOC_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0),
126 SOC_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0),
127 SOC_SINGLE("ALC Decay Time", AC97_CODEC_CLASS_REV, 4, 15, 0),
128 SOC_SINGLE("ALC Attack Time", AC97_CODEC_CLASS_REV, 0, 15, 0),
130 SOC_SINGLE("ALC Max Volume", AC97_PCI_SVID, 11, 7, 0),
131 SOC_SINGLE("ALC ZC Timeout", AC97_PCI_SVID, 9, 3, 0),
132 SOC_SINGLE("ALC ZC Switch", AC97_PCI_SVID, 8, 1, 0),
133 SOC_SINGLE("ALC NG Switch", AC97_PCI_SVID, 7, 1, 0),
135 SOC_SINGLE("ALC NG Threshold", AC97_PCI_SVID, 0, 31, 0),
137 SOC_DOUBLE("Speaker Playback ZC Switch", AC97_MASTER, 14, 6, 1, 0),
138 SOC_DOUBLE("Headphone Playback ZC Switch", AC97_HEADPHONE, 14, 6, 1, 0),
141 SOC_SINGLE("Out4 Playback ZC Switch", AC97_MASTER_MONO, 14, 1, 0),
145 SOC_SINGLE("Out3 Playback ZC Switch", AC97_MASTER_MONO, 6, 1, 0),
146 SOC_SINGLE_TLV("Out3 Playback Volume", AC97_MASTER_MONO, 0, 31, 1, out_tlv),
150 SOC_SINGLE("Mono Playback ZC Switch", AC97_MASTER_TONE, 6, 1, 0),
151 SOC_SINGLE_TLV("Mono Playback Volume", AC97_MASTER_TONE, 0, 31, 1, out_tlv),
183 SOC_SINGLE("Playback Attenuate (-6dB) Switch", AC97_GENERAL_PURPOSE, 6, 1, 0),
185 SOC_SINGLE("Tone Volume", AC97_GENERAL_PURPOSE, 0, 15, 1),
187 SOC_SINGLE("3D Upper Cut-off Switch", AC97_REC_GAIN_MIC, 5, 1, 0),
188 SOC_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0),
189 SOC_SINGLE("3D Depth", AC97_REC_GAIN_MIC, 0, 15, 1),
201 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0f00, 0x0200); in wm9713_voice_shutdown()
203 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0f00, 0x0f00); in wm9713_voice_shutdown()
204 snd_soc_component_update_bits(component, AC97_EXTENDED_MID, 0x1000, 0x1000); in wm9713_voice_shutdown()
206 return 0; in wm9713_voice_shutdown()
230 unsigned int val = ucontrol->value.integer.value[0]; in wm9713_hp_mixer_put()
238 shift = mc->shift & 0xff; in wm9713_hp_mixer_put()
243 if (ucontrol->value.integer.value[0]) in wm9713_hp_mixer_put()
252 update.mask = 0x8000; in wm9713_hp_mixer_put()
253 if ((wm9713->hp_mixer[0] & mask) || in wm9713_hp_mixer_put()
255 update.val = 0x0; in wm9713_hp_mixer_put()
257 update.val = 0x8000; in wm9713_hp_mixer_put()
279 shift = mc->shift & 0xff; in wm9713_hp_mixer_get()
281 ucontrol->value.integer.value[0] = in wm9713_hp_mixer_get()
284 return 0; in wm9713_hp_mixer_get()
292 xshift, xmixer, 1, 0, 0) \
302 WM9713_HP_MIXER_CTRL("Bypass Playback Switch", HPL_MIXER, 0),
312 WM9713_HP_MIXER_CTRL("Bypass Playback Switch", HPR_MIXER, 0),
321 SOC_DAPM_ENUM("Route", wm9713_enum[0]);
402 SND_SOC_DAPM_MUX("Capture Headphone Mux", SND_SOC_NOPM, 0, 0,
404 SND_SOC_DAPM_MUX("Sidetone Mux", SND_SOC_NOPM, 0, 0,
406 SND_SOC_DAPM_MUX("Capture Mono Mux", SND_SOC_NOPM, 0, 0,
408 SND_SOC_DAPM_MUX("Mono Out Mux", SND_SOC_NOPM, 0, 0,
410 SND_SOC_DAPM_MUX("Left Speaker Out Mux", SND_SOC_NOPM, 0, 0,
412 SND_SOC_DAPM_MUX("Right Speaker Out Mux", SND_SOC_NOPM, 0, 0,
414 SND_SOC_DAPM_MUX("Left Headphone Out Mux", SND_SOC_NOPM, 0, 0,
416 SND_SOC_DAPM_MUX("Right Headphone Out Mux", SND_SOC_NOPM, 0, 0,
418 SND_SOC_DAPM_MUX("Out 3 Mux", SND_SOC_NOPM, 0, 0,
420 SND_SOC_DAPM_MUX("Out 4 Mux", SND_SOC_NOPM, 0, 0,
422 SND_SOC_DAPM_MUX("DAC Inv Mux 1", SND_SOC_NOPM, 0, 0,
424 SND_SOC_DAPM_MUX("DAC Inv Mux 2", SND_SOC_NOPM, 0, 0,
426 SND_SOC_DAPM_MUX("Left Capture Source", SND_SOC_NOPM, 0, 0,
428 SND_SOC_DAPM_MUX("Right Capture Source", SND_SOC_NOPM, 0, 0,
430 SND_SOC_DAPM_MUX("Mic A Source", SND_SOC_NOPM, 0, 0,
432 SND_SOC_DAPM_MUX("Mic B Source", SND_SOC_NOPM, 0, 0,
435 &wm9713_hpl_mixer_controls[0], ARRAY_SIZE(wm9713_hpl_mixer_controls)),
437 &wm9713_hpr_mixer_controls[0], ARRAY_SIZE(wm9713_hpr_mixer_controls)),
438 SND_SOC_DAPM_MIXER("Mono Mixer", AC97_EXTENDED_MID, 0, 1,
439 &wm9713_mono_mixer_controls[0], ARRAY_SIZE(wm9713_mono_mixer_controls)),
441 &wm9713_speaker_mixer_controls[0],
445 SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
446 SND_SOC_DAPM_MIXER("HP Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
447 SND_SOC_DAPM_MIXER("Line Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
448 SND_SOC_DAPM_MIXER("Capture Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
452 SND_SOC_DAPM_PGA("Left ADC", AC97_EXTENDED_MID, 5, 1, NULL, 0),
453 SND_SOC_DAPM_PGA("Right ADC", AC97_EXTENDED_MID, 4, 1, NULL, 0),
454 SND_SOC_DAPM_ADC("Left HiFi ADC", "Left HiFi Capture", SND_SOC_NOPM, 0, 0),
455 SND_SOC_DAPM_ADC("Right HiFi ADC", "Right HiFi Capture", SND_SOC_NOPM, 0, 0),
456 SND_SOC_DAPM_ADC("Left Voice ADC", "Left Voice Capture", SND_SOC_NOPM, 0, 0),
457 SND_SOC_DAPM_ADC("Right Voice ADC", "Right Voice Capture", SND_SOC_NOPM, 0, 0),
458 SND_SOC_DAPM_PGA("Left Headphone", AC97_EXTENDED_MSTATUS, 10, 1, NULL, 0),
459 SND_SOC_DAPM_PGA("Right Headphone", AC97_EXTENDED_MSTATUS, 9, 1, NULL, 0),
460 SND_SOC_DAPM_PGA("Left Speaker", AC97_EXTENDED_MSTATUS, 8, 1, NULL, 0),
461 SND_SOC_DAPM_PGA("Right Speaker", AC97_EXTENDED_MSTATUS, 7, 1, NULL, 0),
462 SND_SOC_DAPM_PGA("Out 3", AC97_EXTENDED_MSTATUS, 11, 1, NULL, 0),
463 SND_SOC_DAPM_PGA("Out 4", AC97_EXTENDED_MSTATUS, 12, 1, NULL, 0),
464 SND_SOC_DAPM_PGA("Mono Out", AC97_EXTENDED_MSTATUS, 13, 1, NULL, 0),
465 SND_SOC_DAPM_PGA("Left Line In", AC97_EXTENDED_MSTATUS, 6, 1, NULL, 0),
466 SND_SOC_DAPM_PGA("Right Line In", AC97_EXTENDED_MSTATUS, 5, 1, NULL, 0),
467 SND_SOC_DAPM_PGA("Mono In", AC97_EXTENDED_MSTATUS, 4, 1, NULL, 0),
468 SND_SOC_DAPM_PGA("Mic A PGA", AC97_EXTENDED_MSTATUS, 3, 1, NULL, 0),
469 SND_SOC_DAPM_PGA("Mic B PGA", AC97_EXTENDED_MSTATUS, 2, 1, NULL, 0),
470 SND_SOC_DAPM_PGA("Mic A Pre Amp", AC97_EXTENDED_MSTATUS, 1, 1, NULL, 0),
471 SND_SOC_DAPM_PGA("Mic B Pre Amp", AC97_EXTENDED_MSTATUS, 0, 1, NULL, 0),
654 case AC97_GPIO_CFG ... 0x5c: in wm9713_readable_reg()
656 case 0x74 ... AC97_VENDOR_ID2: in wm9713_readable_reg()
675 { 0x02, 0x8080 }, /* Speaker Output Volume */
676 { 0x04, 0x8080 }, /* Headphone Output Volume */
677 { 0x06, 0x8080 }, /* Out3/OUT4 Volume */
678 { 0x08, 0xc880 }, /* Mono Volume */
679 { 0x0a, 0xe808 }, /* LINEIN Volume */
680 { 0x0c, 0xe808 }, /* DAC PGA Volume */
681 { 0x0e, 0x0808 }, /* MIC PGA Volume */
682 { 0x10, 0x00da }, /* MIC Routing Control */
683 { 0x12, 0x8000 }, /* Record PGA Volume */
684 { 0x14, 0xd600 }, /* Record Routing */
685 { 0x16, 0xaaa0 }, /* PCBEEP Volume */
686 { 0x18, 0xaaa0 }, /* VxDAC Volume */
687 { 0x1a, 0xaaa0 }, /* AUXDAC Volume */
688 { 0x1c, 0x0000 }, /* Output PGA Mux */
689 { 0x1e, 0x0000 }, /* DAC 3D control */
690 { 0x20, 0x0f0f }, /* DAC Tone Control*/
691 { 0x22, 0x0040 }, /* MIC Input Select & Bias */
692 { 0x24, 0x0000 }, /* Output Volume Mapping & Jack */
693 { 0x26, 0x7f00 }, /* Powerdown Ctrl/Stat*/
694 { 0x28, 0x0405 }, /* Extended Audio ID */
695 { 0x2a, 0x0410 }, /* Extended Audio Start/Ctrl */
696 { 0x2c, 0xbb80 }, /* Audio DACs Sample Rate */
697 { 0x2e, 0xbb80 }, /* AUXDAC Sample Rate */
698 { 0x32, 0xbb80 }, /* Audio ADCs Sample Rate */
699 { 0x36, 0x4523 }, /* PCM codec control */
700 { 0x3a, 0x2000 }, /* SPDIF control */
701 { 0x3c, 0xfdff }, /* Powerdown 1 */
702 { 0x3e, 0xffff }, /* Powerdown 2 */
703 { 0x40, 0x0000 }, /* General Purpose */
704 { 0x42, 0x0000 }, /* Fast Power-Up Control */
705 { 0x44, 0x0080 }, /* MCLK/PLL Control */
706 { 0x46, 0x0000 }, /* MCLK/PLL Control */
707 { 0x4c, 0xfffe }, /* GPIO Pin Configuration */
708 { 0x4e, 0xffff }, /* GPIO Pin Polarity / Type */
709 { 0x50, 0x0000 }, /* GPIO Pin Sticky */
710 { 0x52, 0x0000 }, /* GPIO Pin Wake-Up */
712 { 0x56, 0xfffe }, /* GPIO Pin Sharing */
713 { 0x58, 0x4000 }, /* GPIO PullUp/PullDown */
714 { 0x5a, 0x0000 }, /* Additional Functions 1 */
715 { 0x5c, 0x0000 }, /* Additional Functions 2 */
716 { 0x60, 0xb032 }, /* ALC Control */
717 { 0x62, 0x3e00 }, /* ALC / Noise Gate Control */
718 { 0x64, 0x0000 }, /* AUXDAC input control */
719 { 0x74, 0x0000 }, /* Digitiser Reg 1 */
720 { 0x76, 0x0006 }, /* Digitiser Reg 2 */
721 { 0x78, 0x0001 }, /* Digitiser Reg 3 */
722 { 0x7a, 0x0000 }, /* Digitiser Read Back */
729 .max_register = 0x7e,
770 pll_div->divctl = 0; in pll_factors()
773 pll_div->divsel = 0; in pll_factors()
774 pll_div->divctl = 0; in pll_factors()
784 pll_div->lf = 0; in pll_factors()
798 K = Kpart & 0xFFFFFFFF; in pll_factors()
822 if (freq_in == 0) { in wm9713_set_pll()
824 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0080, 0x0080); in wm9713_set_pll()
825 snd_soc_component_update_bits(component, AC97_EXTENDED_MID, 0x0200, 0x0200); in wm9713_set_pll()
826 wm9713->pll_in = 0; in wm9713_set_pll()
827 return 0; in wm9713_set_pll()
832 if (pll_div.k == 0) { in wm9713_set_pll()
837 /* write the fractional k to the reg 0x46 pages */ in wm9713_set_pll()
842 reg = reg2 | (0x5 << 4) | (pll_div.k >> 20); in wm9713_set_pll()
846 reg = reg2 | (0x4 << 4) | ((pll_div.k >> 16) & 0xf); in wm9713_set_pll()
850 reg = reg2 | (0x3 << 4) | ((pll_div.k >> 12) & 0xf); in wm9713_set_pll()
854 reg = reg2 | (0x2 << 4) | ((pll_div.k >> 8) & 0xf); in wm9713_set_pll()
858 reg = reg2 | (0x1 << 4) | ((pll_div.k >> 4) & 0xf); in wm9713_set_pll()
861 reg = reg2 | (0x0 << 4) | (pll_div.k & 0xf); /* K [3:0] */ in wm9713_set_pll()
866 snd_soc_component_update_bits(component, AC97_EXTENDED_MID, 0x0200, 0x0000); in wm9713_set_pll()
867 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0080, 0x0000); in wm9713_set_pll()
872 return 0; in wm9713_set_pll()
893 0x6000, 0x0000); in wm9713_set_dai_tristate()
895 return 0; in wm9713_set_dai_tristate()
909 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0f00, div); in wm9713_set_dai_clkdiv()
912 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0002, div); in wm9713_set_dai_clkdiv()
915 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0004, div); in wm9713_set_dai_clkdiv()
918 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x7000, div); in wm9713_set_dai_clkdiv()
921 snd_soc_component_update_bits(component, AC97_CENTER_LFE_MASTER, 0x0e00, div); in wm9713_set_dai_clkdiv()
925 0x007f, div | 0x60); in wm9713_set_dai_clkdiv()
929 0x007f, div | 0x70); in wm9713_set_dai_clkdiv()
935 return 0; in wm9713_set_dai_clkdiv()
942 u16 gpio = snd_soc_component_read(component, AC97_GPIO_CFG) & 0xffc5; in wm9713_set_dai_fmt()
943 u16 reg = 0x8000; in wm9713_set_dai_fmt()
948 reg |= 0x4000; in wm9713_set_dai_fmt()
949 gpio |= 0x0010; in wm9713_set_dai_fmt()
952 reg |= 0x6000; in wm9713_set_dai_fmt()
953 gpio |= 0x0018; in wm9713_set_dai_fmt()
956 reg |= 0x2000; in wm9713_set_dai_fmt()
957 gpio |= 0x001a; in wm9713_set_dai_fmt()
960 gpio |= 0x0012; in wm9713_set_dai_fmt()
967 reg |= 0x00c0; in wm9713_set_dai_fmt()
970 reg |= 0x0080; in wm9713_set_dai_fmt()
973 reg |= 0x0040; in wm9713_set_dai_fmt()
980 reg |= 0x0002; in wm9713_set_dai_fmt()
985 reg |= 0x0001; in wm9713_set_dai_fmt()
988 reg |= 0x0003; in wm9713_set_dai_fmt()
991 reg |= 0x0043; in wm9713_set_dai_fmt()
997 return 0; in wm9713_set_dai_fmt()
1012 0x000c, 0x0004); in wm9713_pcm_hw_params()
1016 0x000c, 0x0008); in wm9713_pcm_hw_params()
1020 0x000c, 0x000c); in wm9713_pcm_hw_params()
1023 return 0; in wm9713_pcm_hw_params()
1033 snd_soc_component_update_bits(component, AC97_EXTENDED_STATUS, 0x0001, 0x0001); in ac97_hifi_prepare()
1049 snd_soc_component_update_bits(component, AC97_EXTENDED_STATUS, 0x0001, 0x0001); in ac97_aux_prepare()
1050 snd_soc_component_update_bits(component, AC97_PCI_SID, 0x8000, 0x8000); in ac97_aux_prepare()
1147 snd_soc_component_update_bits(component, AC97_EXTENDED_MID, 0xe400, 0x0000); in wm9713_set_bias_level()
1153 snd_soc_component_update_bits(component, AC97_EXTENDED_MID, 0xc400, 0x0000); in wm9713_set_bias_level()
1154 snd_soc_component_write(component, AC97_POWERDOWN, 0x0000); in wm9713_set_bias_level()
1158 snd_soc_component_write(component, AC97_EXTENDED_MID, 0xffff); in wm9713_set_bias_level()
1159 snd_soc_component_write(component, AC97_EXTENDED_MSTATUS, 0xffff); in wm9713_set_bias_level()
1160 snd_soc_component_write(component, AC97_POWERDOWN, 0xffff); in wm9713_set_bias_level()
1163 return 0; in wm9713_set_bias_level()
1171 snd_soc_component_update_bits(component, AC97_EXTENDED_MID, 0x7fff, in wm9713_soc_suspend()
1172 0x7fff); in wm9713_soc_suspend()
1173 snd_soc_component_write(component, AC97_EXTENDED_MSTATUS, 0xffff); in wm9713_soc_suspend()
1174 snd_soc_component_write(component, AC97_POWERDOWN, 0x6f00); in wm9713_soc_suspend()
1175 snd_soc_component_write(component, AC97_POWERDOWN, 0xffff); in wm9713_soc_suspend()
1177 return 0; in wm9713_soc_suspend()
1187 if (ret < 0) in wm9713_soc_resume()
1194 wm9713_set_pll(component, 0, wm9713->pll_in, 0); in wm9713_soc_resume()
1197 if (ret == 0) { in wm9713_soc_resume()
1230 snd_soc_component_update_bits(component, AC97_CD, 0x7fff, 0x0000); in wm9713_soc_probe()
1232 return 0; in wm9713_soc_probe()