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()
288 SOC_DOUBLE_EXT(xname, SND_SOC_NOPM, xshift, xmixer, 1, 0, \
298 WM9713_HP_MIXER_CTRL("Bypass Playback Switch", HPL_MIXER, 0),
308 WM9713_HP_MIXER_CTRL("Bypass Playback Switch", HPR_MIXER, 0),
317 SOC_DAPM_ENUM("Route", wm9713_enum[0]);
398 SND_SOC_DAPM_MUX("Capture Headphone Mux", SND_SOC_NOPM, 0, 0,
400 SND_SOC_DAPM_MUX("Sidetone Mux", SND_SOC_NOPM, 0, 0,
402 SND_SOC_DAPM_MUX("Capture Mono Mux", SND_SOC_NOPM, 0, 0,
404 SND_SOC_DAPM_MUX("Mono Out Mux", SND_SOC_NOPM, 0, 0,
406 SND_SOC_DAPM_MUX("Left Speaker Out Mux", SND_SOC_NOPM, 0, 0,
408 SND_SOC_DAPM_MUX("Right Speaker Out Mux", SND_SOC_NOPM, 0, 0,
410 SND_SOC_DAPM_MUX("Left Headphone Out Mux", SND_SOC_NOPM, 0, 0,
412 SND_SOC_DAPM_MUX("Right Headphone Out Mux", SND_SOC_NOPM, 0, 0,
414 SND_SOC_DAPM_MUX("Out 3 Mux", SND_SOC_NOPM, 0, 0,
416 SND_SOC_DAPM_MUX("Out 4 Mux", SND_SOC_NOPM, 0, 0,
418 SND_SOC_DAPM_MUX("DAC Inv Mux 1", SND_SOC_NOPM, 0, 0,
420 SND_SOC_DAPM_MUX("DAC Inv Mux 2", SND_SOC_NOPM, 0, 0,
422 SND_SOC_DAPM_MUX("Left Capture Source", SND_SOC_NOPM, 0, 0,
424 SND_SOC_DAPM_MUX("Right Capture Source", SND_SOC_NOPM, 0, 0,
426 SND_SOC_DAPM_MUX("Mic A Source", SND_SOC_NOPM, 0, 0,
428 SND_SOC_DAPM_MUX("Mic B Source", SND_SOC_NOPM, 0, 0,
431 &wm9713_hpl_mixer_controls[0], ARRAY_SIZE(wm9713_hpl_mixer_controls)),
433 &wm9713_hpr_mixer_controls[0], ARRAY_SIZE(wm9713_hpr_mixer_controls)),
434 SND_SOC_DAPM_MIXER("Mono Mixer", AC97_EXTENDED_MID, 0, 1,
435 &wm9713_mono_mixer_controls[0], ARRAY_SIZE(wm9713_mono_mixer_controls)),
437 &wm9713_speaker_mixer_controls[0],
441 SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
442 SND_SOC_DAPM_MIXER("HP Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
443 SND_SOC_DAPM_MIXER("Line Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
444 SND_SOC_DAPM_MIXER("Capture Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
448 SND_SOC_DAPM_PGA("Left ADC", AC97_EXTENDED_MID, 5, 1, NULL, 0),
449 SND_SOC_DAPM_PGA("Right ADC", AC97_EXTENDED_MID, 4, 1, NULL, 0),
450 SND_SOC_DAPM_ADC("Left HiFi ADC", "Left HiFi Capture", SND_SOC_NOPM, 0, 0),
451 SND_SOC_DAPM_ADC("Right HiFi ADC", "Right HiFi Capture", SND_SOC_NOPM, 0, 0),
452 SND_SOC_DAPM_ADC("Left Voice ADC", "Left Voice Capture", SND_SOC_NOPM, 0, 0),
453 SND_SOC_DAPM_ADC("Right Voice ADC", "Right Voice Capture", SND_SOC_NOPM, 0, 0),
454 SND_SOC_DAPM_PGA("Left Headphone", AC97_EXTENDED_MSTATUS, 10, 1, NULL, 0),
455 SND_SOC_DAPM_PGA("Right Headphone", AC97_EXTENDED_MSTATUS, 9, 1, NULL, 0),
456 SND_SOC_DAPM_PGA("Left Speaker", AC97_EXTENDED_MSTATUS, 8, 1, NULL, 0),
457 SND_SOC_DAPM_PGA("Right Speaker", AC97_EXTENDED_MSTATUS, 7, 1, NULL, 0),
458 SND_SOC_DAPM_PGA("Out 3", AC97_EXTENDED_MSTATUS, 11, 1, NULL, 0),
459 SND_SOC_DAPM_PGA("Out 4", AC97_EXTENDED_MSTATUS, 12, 1, NULL, 0),
460 SND_SOC_DAPM_PGA("Mono Out", AC97_EXTENDED_MSTATUS, 13, 1, NULL, 0),
461 SND_SOC_DAPM_PGA("Left Line In", AC97_EXTENDED_MSTATUS, 6, 1, NULL, 0),
462 SND_SOC_DAPM_PGA("Right Line In", AC97_EXTENDED_MSTATUS, 5, 1, NULL, 0),
463 SND_SOC_DAPM_PGA("Mono In", AC97_EXTENDED_MSTATUS, 4, 1, NULL, 0),
464 SND_SOC_DAPM_PGA("Mic A PGA", AC97_EXTENDED_MSTATUS, 3, 1, NULL, 0),
465 SND_SOC_DAPM_PGA("Mic B PGA", AC97_EXTENDED_MSTATUS, 2, 1, NULL, 0),
466 SND_SOC_DAPM_PGA("Mic A Pre Amp", AC97_EXTENDED_MSTATUS, 1, 1, NULL, 0),
467 SND_SOC_DAPM_PGA("Mic B Pre Amp", AC97_EXTENDED_MSTATUS, 0, 1, NULL, 0),
650 case AC97_GPIO_CFG ... 0x5c: in wm9713_readable_reg()
652 case 0x74 ... AC97_VENDOR_ID2: in wm9713_readable_reg()
671 { 0x02, 0x8080 }, /* Speaker Output Volume */
672 { 0x04, 0x8080 }, /* Headphone Output Volume */
673 { 0x06, 0x8080 }, /* Out3/OUT4 Volume */
674 { 0x08, 0xc880 }, /* Mono Volume */
675 { 0x0a, 0xe808 }, /* LINEIN Volume */
676 { 0x0c, 0xe808 }, /* DAC PGA Volume */
677 { 0x0e, 0x0808 }, /* MIC PGA Volume */
678 { 0x10, 0x00da }, /* MIC Routing Control */
679 { 0x12, 0x8000 }, /* Record PGA Volume */
680 { 0x14, 0xd600 }, /* Record Routing */
681 { 0x16, 0xaaa0 }, /* PCBEEP Volume */
682 { 0x18, 0xaaa0 }, /* VxDAC Volume */
683 { 0x1a, 0xaaa0 }, /* AUXDAC Volume */
684 { 0x1c, 0x0000 }, /* Output PGA Mux */
685 { 0x1e, 0x0000 }, /* DAC 3D control */
686 { 0x20, 0x0f0f }, /* DAC Tone Control*/
687 { 0x22, 0x0040 }, /* MIC Input Select & Bias */
688 { 0x24, 0x0000 }, /* Output Volume Mapping & Jack */
689 { 0x26, 0x7f00 }, /* Powerdown Ctrl/Stat*/
690 { 0x28, 0x0405 }, /* Extended Audio ID */
691 { 0x2a, 0x0410 }, /* Extended Audio Start/Ctrl */
692 { 0x2c, 0xbb80 }, /* Audio DACs Sample Rate */
693 { 0x2e, 0xbb80 }, /* AUXDAC Sample Rate */
694 { 0x32, 0xbb80 }, /* Audio ADCs Sample Rate */
695 { 0x36, 0x4523 }, /* PCM codec control */
696 { 0x3a, 0x2000 }, /* SPDIF control */
697 { 0x3c, 0xfdff }, /* Powerdown 1 */
698 { 0x3e, 0xffff }, /* Powerdown 2 */
699 { 0x40, 0x0000 }, /* General Purpose */
700 { 0x42, 0x0000 }, /* Fast Power-Up Control */
701 { 0x44, 0x0080 }, /* MCLK/PLL Control */
702 { 0x46, 0x0000 }, /* MCLK/PLL Control */
703 { 0x4c, 0xfffe }, /* GPIO Pin Configuration */
704 { 0x4e, 0xffff }, /* GPIO Pin Polarity / Type */
705 { 0x50, 0x0000 }, /* GPIO Pin Sticky */
706 { 0x52, 0x0000 }, /* GPIO Pin Wake-Up */
708 { 0x56, 0xfffe }, /* GPIO Pin Sharing */
709 { 0x58, 0x4000 }, /* GPIO PullUp/PullDown */
710 { 0x5a, 0x0000 }, /* Additional Functions 1 */
711 { 0x5c, 0x0000 }, /* Additional Functions 2 */
712 { 0x60, 0xb032 }, /* ALC Control */
713 { 0x62, 0x3e00 }, /* ALC / Noise Gate Control */
714 { 0x64, 0x0000 }, /* AUXDAC input control */
715 { 0x74, 0x0000 }, /* Digitiser Reg 1 */
716 { 0x76, 0x0006 }, /* Digitiser Reg 2 */
717 { 0x78, 0x0001 }, /* Digitiser Reg 3 */
718 { 0x7a, 0x0000 }, /* Digitiser Read Back */
725 .max_register = 0x7e,
766 pll_div->divctl = 0; in pll_factors()
769 pll_div->divsel = 0; in pll_factors()
770 pll_div->divctl = 0; in pll_factors()
780 pll_div->lf = 0; in pll_factors()
794 K = Kpart & 0xFFFFFFFF; in pll_factors()
818 if (freq_in == 0) { in wm9713_set_pll()
820 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0080, 0x0080); in wm9713_set_pll()
821 snd_soc_component_update_bits(component, AC97_EXTENDED_MID, 0x0200, 0x0200); in wm9713_set_pll()
822 wm9713->pll_in = 0; in wm9713_set_pll()
823 return 0; in wm9713_set_pll()
828 if (pll_div.k == 0) { in wm9713_set_pll()
833 /* write the fractional k to the reg 0x46 pages */ in wm9713_set_pll()
838 reg = reg2 | (0x5 << 4) | (pll_div.k >> 20); in wm9713_set_pll()
842 reg = reg2 | (0x4 << 4) | ((pll_div.k >> 16) & 0xf); in wm9713_set_pll()
846 reg = reg2 | (0x3 << 4) | ((pll_div.k >> 12) & 0xf); in wm9713_set_pll()
850 reg = reg2 | (0x2 << 4) | ((pll_div.k >> 8) & 0xf); in wm9713_set_pll()
854 reg = reg2 | (0x1 << 4) | ((pll_div.k >> 4) & 0xf); in wm9713_set_pll()
857 reg = reg2 | (0x0 << 4) | (pll_div.k & 0xf); /* K [3:0] */ in wm9713_set_pll()
862 snd_soc_component_update_bits(component, AC97_EXTENDED_MID, 0x0200, 0x0000); in wm9713_set_pll()
863 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0080, 0x0000); in wm9713_set_pll()
868 return 0; in wm9713_set_pll()
889 0x6000, 0x0000); in wm9713_set_dai_tristate()
891 return 0; in wm9713_set_dai_tristate()
905 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0f00, div); in wm9713_set_dai_clkdiv()
908 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0002, div); in wm9713_set_dai_clkdiv()
911 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x0004, div); in wm9713_set_dai_clkdiv()
914 snd_soc_component_update_bits(component, AC97_HANDSET_RATE, 0x7000, div); in wm9713_set_dai_clkdiv()
917 snd_soc_component_update_bits(component, AC97_CENTER_LFE_MASTER, 0x0e00, div); in wm9713_set_dai_clkdiv()
921 0x007f, div | 0x60); in wm9713_set_dai_clkdiv()
925 0x007f, div | 0x70); in wm9713_set_dai_clkdiv()
931 return 0; in wm9713_set_dai_clkdiv()
938 u16 gpio = snd_soc_component_read(component, AC97_GPIO_CFG) & 0xffc5; in wm9713_set_dai_fmt()
939 u16 reg = 0x8000; in wm9713_set_dai_fmt()
944 reg |= 0x4000; in wm9713_set_dai_fmt()
945 gpio |= 0x0010; in wm9713_set_dai_fmt()
948 reg |= 0x6000; in wm9713_set_dai_fmt()
949 gpio |= 0x0018; in wm9713_set_dai_fmt()
952 reg |= 0x2000; in wm9713_set_dai_fmt()
953 gpio |= 0x001a; in wm9713_set_dai_fmt()
956 gpio |= 0x0012; in wm9713_set_dai_fmt()
963 reg |= 0x00c0; in wm9713_set_dai_fmt()
966 reg |= 0x0080; in wm9713_set_dai_fmt()
969 reg |= 0x0040; in wm9713_set_dai_fmt()
976 reg |= 0x0002; in wm9713_set_dai_fmt()
981 reg |= 0x0001; in wm9713_set_dai_fmt()
984 reg |= 0x0003; in wm9713_set_dai_fmt()
987 reg |= 0x0043; in wm9713_set_dai_fmt()
993 return 0; in wm9713_set_dai_fmt()
1008 0x000c, 0x0004); in wm9713_pcm_hw_params()
1012 0x000c, 0x0008); in wm9713_pcm_hw_params()
1016 0x000c, 0x000c); in wm9713_pcm_hw_params()
1019 return 0; in wm9713_pcm_hw_params()
1029 snd_soc_component_update_bits(component, AC97_EXTENDED_STATUS, 0x0001, 0x0001); in ac97_hifi_prepare()
1045 snd_soc_component_update_bits(component, AC97_EXTENDED_STATUS, 0x0001, 0x0001); in ac97_aux_prepare()
1046 snd_soc_component_update_bits(component, AC97_PCI_SID, 0x8000, 0x8000); in ac97_aux_prepare()
1143 snd_soc_component_update_bits(component, AC97_EXTENDED_MID, 0xe400, 0x0000); in wm9713_set_bias_level()
1149 snd_soc_component_update_bits(component, AC97_EXTENDED_MID, 0xc400, 0x0000); in wm9713_set_bias_level()
1150 snd_soc_component_write(component, AC97_POWERDOWN, 0x0000); in wm9713_set_bias_level()
1154 snd_soc_component_write(component, AC97_EXTENDED_MID, 0xffff); in wm9713_set_bias_level()
1155 snd_soc_component_write(component, AC97_EXTENDED_MSTATUS, 0xffff); in wm9713_set_bias_level()
1156 snd_soc_component_write(component, AC97_POWERDOWN, 0xffff); in wm9713_set_bias_level()
1159 return 0; in wm9713_set_bias_level()
1167 snd_soc_component_update_bits(component, AC97_EXTENDED_MID, 0x7fff, in wm9713_soc_suspend()
1168 0x7fff); in wm9713_soc_suspend()
1169 snd_soc_component_write(component, AC97_EXTENDED_MSTATUS, 0xffff); in wm9713_soc_suspend()
1170 snd_soc_component_write(component, AC97_POWERDOWN, 0x6f00); in wm9713_soc_suspend()
1171 snd_soc_component_write(component, AC97_POWERDOWN, 0xffff); in wm9713_soc_suspend()
1173 return 0; in wm9713_soc_suspend()
1183 if (ret < 0) in wm9713_soc_resume()
1190 wm9713_set_pll(component, 0, wm9713->pll_in, 0); in wm9713_soc_resume()
1193 if (ret == 0) { in wm9713_soc_resume()
1226 snd_soc_component_update_bits(component, AC97_CD, 0x7fff, 0x0000); in wm9713_soc_probe()
1228 return 0; in wm9713_soc_probe()