This source file includes following definitions.
- wm_put
- snd_vt1724_amp_init
- snd_vt1724_amp_add_controls
1
2
3
4
5
6
7
8
9
10 #include <linux/delay.h>
11 #include <linux/interrupt.h>
12 #include <linux/init.h>
13 #include <sound/core.h>
14
15 #include "ice1712.h"
16 #include "envy24ht.h"
17 #include "amp.h"
18
19 static void wm_put(struct snd_ice1712 *ice, int reg, unsigned short val)
20 {
21 unsigned short cval;
22 cval = (reg << 9) | val;
23 snd_vt1724_write_i2c(ice, WM_DEV, cval >> 8, cval & 0xff);
24 }
25
26 static int snd_vt1724_amp_init(struct snd_ice1712 *ice)
27 {
28 static const unsigned short wm_inits[] = {
29 WM_ATTEN_L, 0x0000,
30 WM_ATTEN_R, 0x0000,
31 WM_DAC_CTRL, 0x0008,
32 WM_INT_CTRL, 0x0001,
33 };
34
35 unsigned int i;
36
37
38
39
40 ice->num_total_dacs = 6;
41 ice->num_total_adcs = 2;
42
43
44
45
46 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AV710) {
47 for (i = 0; i < ARRAY_SIZE(wm_inits); i += 2)
48 wm_put(ice, wm_inits[i], wm_inits[i+1]);
49 }
50
51 return 0;
52 }
53
54 static int snd_vt1724_amp_add_controls(struct snd_ice1712 *ice)
55 {
56 if (ice->ac97)
57
58
59 snd_ac97_write_cache(ice->ac97, 0x5a,
60 snd_ac97_read(ice->ac97, 0x5a) & ~0x8000);
61 return 0;
62 }
63
64
65
66 struct snd_ice1712_card_info snd_vt1724_amp_cards[] = {
67 {
68 .subvendor = VT1724_SUBDEVICE_AV710,
69 .name = "Chaintech AV-710",
70 .model = "av710",
71 .chip_init = snd_vt1724_amp_init,
72 .build_controls = snd_vt1724_amp_add_controls,
73 },
74 {
75 .subvendor = VT1724_SUBDEVICE_AUDIO2000,
76 .name = "AMP Ltd AUDIO2000",
77 .model = "amp2000",
78 .chip_init = snd_vt1724_amp_init,
79 .build_controls = snd_vt1724_amp_add_controls,
80 },
81 { }
82 };
83