1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29static int set_sample_rate(struct echoaudio *chip, u32 rate)
30{
31 u32 clock, control_reg, old_control_reg;
32
33 if (wait_handshake(chip))
34 return -EIO;
35
36 old_control_reg = le32_to_cpu(chip->comm_page->control_register);
37 control_reg = old_control_reg & ~INDIGO_EXPRESS_CLOCK_MASK;
38
39 switch (rate) {
40 case 32000:
41 clock = INDIGO_EXPRESS_32000;
42 break;
43 case 44100:
44 clock = INDIGO_EXPRESS_44100;
45 break;
46 case 48000:
47 clock = INDIGO_EXPRESS_48000;
48 break;
49 case 64000:
50 clock = INDIGO_EXPRESS_32000|INDIGO_EXPRESS_DOUBLE_SPEED;
51 break;
52 case 88200:
53 clock = INDIGO_EXPRESS_44100|INDIGO_EXPRESS_DOUBLE_SPEED;
54 break;
55 case 96000:
56 clock = INDIGO_EXPRESS_48000|INDIGO_EXPRESS_DOUBLE_SPEED;
57 break;
58 default:
59 return -EINVAL;
60 }
61
62 control_reg |= clock;
63 if (control_reg != old_control_reg) {
64 chip->comm_page->control_register = cpu_to_le32(control_reg);
65 chip->sample_rate = rate;
66 clear_handshake(chip);
67 return send_vector(chip, DSP_VC_UPDATE_CLOCKS);
68 }
69 return 0;
70}
71
72
73
74
75static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe,
76 int gain)
77{
78 int index;
79
80 if (snd_BUG_ON(pipe >= num_pipes_out(chip) ||
81 output >= num_busses_out(chip)))
82 return -EINVAL;
83
84 if (wait_handshake(chip))
85 return -EIO;
86
87 chip->vmixer_gain[output][pipe] = gain;
88 index = output * num_pipes_out(chip) + pipe;
89 chip->comm_page->vmixer[index] = gain;
90
91 DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain));
92 return 0;
93}
94
95
96
97
98static int update_vmixer_level(struct echoaudio *chip)
99{
100 if (wait_handshake(chip))
101 return -EIO;
102 clear_handshake(chip);
103 return send_vector(chip, DSP_VC_SET_VMIXER_GAIN);
104}
105
106
107
108static u32 detect_input_clocks(const struct echoaudio *chip)
109{
110 return ECHO_CLOCK_BIT_INTERNAL;
111}
112
113
114
115
116static int load_asic(struct echoaudio *chip)
117{
118 return 0;
119}
120