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