23 #include <linux/slab.h>
24 #include <linux/module.h>
25 #include <linux/kernel.h>
26 #include <linux/device.h>
38 static const u16 ad1980_reg[] = {
39 0x0090, 0x8000, 0x8000, 0x8000,
40 0x0000, 0x0000, 0x8008, 0x8008,
41 0x8808, 0x8808, 0x0000, 0x8808,
42 0x8808, 0x0000, 0x8000, 0x0000,
43 0x0000, 0x0000, 0x0000, 0x0000,
44 0x03c7, 0x0000, 0xbb80, 0xbb80,
45 0xbb80, 0xbb80, 0x0000, 0x8080,
46 0x8080, 0x2000, 0x0000, 0x0000,
47 0x0000, 0x0000, 0x0000, 0x0000,
48 0x0000, 0x0000, 0x0000, 0x0000,
49 0x0000, 0x0000, 0x0000, 0x0000,
50 0x0000, 0x0000, 0x0000, 0x0000,
51 0x8080, 0x0000, 0x0000, 0x0000,
52 0x0000, 0x0000, 0x0000, 0x0000,
53 0x0000, 0x0000, 0x1001, 0x0000,
54 0x0000, 0x0000, 0x4144, 0x5370
57 static const char *ad1980_rec_sel[] = {
"Mic",
"CD",
"NC",
"AUX",
"Line",
58 "Stereo Mix",
"Mono Mix",
"Phone"};
60 static const struct soc_enum ad1980_cap_src =
94 SOC_ENUM(
"Capture Source", ad1980_cap_src),
122 static int ac97_write(
struct snd_soc_codec *codec,
unsigned int reg,
136 .name =
"ad1980-hifi",
139 .stream_name =
"Playback",
145 .stream_name =
"Capture",
152 static int ad1980_reset(
struct snd_soc_codec *codec,
int try_warm)
174 while (retry_cnt++ < 10)
195 ret = ad1980_reset(codec, 0);
209 if (vendor_id2 != 0x5370) {
210 if (vendor_id2 != 0x5374) {
215 "Found AD1981 - only 2/2 IN/OUT Channels "
222 ac97_write(codec,
AC97_PCM, 0x0000);
248 .probe = ad1980_soc_probe,
249 .remove = ad1980_soc_remove,
251 .reg_word_size =
sizeof(
u16),
261 &soc_codec_dev_ad1980, &ad1980_dai, 1);
276 .probe = ad1980_probe,