189
189
SOC_SINGLE("3D Depth", AC97_REC_GAIN_MIC, 0, 15, 1),
192
static int wm9713_voice_shutdown(struct snd_soc_dapm_widget *w,
193
struct snd_kcontrol *kcontrol, int event)
195
struct snd_soc_codec *codec = w->codec;
198
BUG_ON(event != SND_SOC_DAPM_PRE_PMD);
200
/* Gracefully shut down the voice interface. */
201
status = ac97_read(codec, AC97_EXTENDED_MID) | 0x1000;
202
rate = ac97_read(codec, AC97_HANDSET_RATE) & 0xF0FF;
203
ac97_write(codec, AC97_HANDSET_RATE, rate | 0x0200);
204
schedule_timeout_interruptible(msecs_to_jiffies(1));
205
ac97_write(codec, AC97_HANDSET_RATE, rate | 0x0F00);
206
ac97_write(codec, AC97_EXTENDED_MID, status);
192
212
/* We have to create a fake left and right HP mixers because
193
213
* the codec only has a single control that is shared by both channels.
194
214
* This makes it impossible to determine the audio path using the current
400
420
SND_SOC_DAPM_MIXER("HP Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
401
421
SND_SOC_DAPM_MIXER("Line Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
402
422
SND_SOC_DAPM_MIXER("Capture Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
403
SND_SOC_DAPM_DAC("Voice DAC", "Voice Playback", AC97_EXTENDED_MID, 12, 1),
423
SND_SOC_DAPM_DAC_E("Voice DAC", "Voice Playback", AC97_EXTENDED_MID, 12, 1,
424
wm9713_voice_shutdown, SND_SOC_DAPM_PRE_PMD),
404
425
SND_SOC_DAPM_DAC("Aux DAC", "Aux Playback", AC97_EXTENDED_MID, 11, 1),
405
426
SND_SOC_DAPM_PGA("Left ADC", AC97_EXTENDED_MID, 5, 1, NULL, 0),
406
427
SND_SOC_DAPM_PGA("Right ADC", AC97_EXTENDED_MID, 4, 1, NULL, 0),
939
static void wm9713_voiceshutdown(struct snd_pcm_substream *substream,
940
struct snd_soc_dai *dai)
942
struct snd_soc_codec *codec = dai->codec;
945
/* Gracefully shut down the voice interface. */
946
status = ac97_read(codec, AC97_EXTENDED_STATUS) | 0x1000;
947
rate = ac97_read(codec, AC97_HANDSET_RATE) & 0xF0FF;
948
ac97_write(codec, AC97_HANDSET_RATE, rate | 0x0200);
949
schedule_timeout_interruptible(msecs_to_jiffies(1));
950
ac97_write(codec, AC97_HANDSET_RATE, rate | 0x0F00);
951
ac97_write(codec, AC97_EXTENDED_MID, status);
954
960
static int ac97_hifi_prepare(struct snd_pcm_substream *substream,
955
961
struct snd_soc_dai *dai)
1020
1026
static struct snd_soc_dai_ops wm9713_dai_ops_voice = {
1021
1027
.hw_params = wm9713_pcm_hw_params,
1022
.shutdown = wm9713_voiceshutdown,
1023
1028
.set_clkdiv = wm9713_set_dai_clkdiv,
1024
1029
.set_pll = wm9713_set_dai_pll,
1025
1030
.set_fmt = wm9713_set_dai_fmt,
1035
1040
.channels_min = 1,
1036
1041
.channels_max = 2,
1037
1042
.rates = WM9713_RATES,
1038
.formats = SNDRV_PCM_FMTBIT_S16_LE,},
1043
.formats = SND_SOC_STD_AC97_FMTS,},
1040
1045
.stream_name = "HiFi Capture",
1041
1046
.channels_min = 1,
1042
1047
.channels_max = 2,
1043
1048
.rates = WM9713_RATES,
1044
.formats = SNDRV_PCM_FMTBIT_S16_LE,},
1049
.formats = SND_SOC_STD_AC97_FMTS,},
1045
1050
.ops = &wm9713_dai_ops_hifi,
1051
1056
.channels_min = 1,
1052
1057
.channels_max = 1,
1053
1058
.rates = WM9713_RATES,
1054
.formats = SNDRV_PCM_FMTBIT_S16_LE,},
1059
.formats = SND_SOC_STD_AC97_FMTS,},
1055
1060
.ops = &wm9713_dai_ops_aux,
1069
1074
.rates = WM9713_PCM_RATES,
1070
1075
.formats = WM9713_PCM_FORMATS,},
1071
1076
.ops = &wm9713_dai_ops_voice,
1077
.symmetric_rates = 1,
1074
1080
EXPORT_SYMBOL_GPL(wm9713_dai);