diff options
author | James Courtier-Dutton <James@superbug.co.uk> | 2006-10-01 05:48:04 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-02-09 02:59:59 -0500 |
commit | 9f4bd5dde81b5cb94e4f52f2f05825aa0422f1ff (patch) | |
tree | 884d0016c361a555ab1bc95287e64a6c109a0609 /sound/pci/emu10k1/io.c | |
parent | 5986a2ec35836a878350c54af4bd91b1de6abc59 (diff) |
[ALSA] snd-emu10k1: Added support for emu1010, including E-Mu 1212m and E-Mu 1820m
Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/emu10k1/io.c')
-rw-r--r-- | sound/pci/emu10k1/io.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c index 029e7856c43b..27ab7d1788a0 100644 --- a/sound/pci/emu10k1/io.c +++ b/sound/pci/emu10k1/io.c | |||
@@ -167,6 +167,51 @@ int snd_emu10k1_spi_write(struct snd_emu10k1 * emu, | |||
167 | return 0; | 167 | return 0; |
168 | } | 168 | } |
169 | 169 | ||
170 | int snd_emu1010_fpga_write(struct snd_emu10k1 * emu, int reg, int value) | ||
171 | { | ||
172 | if (reg < 0 || reg > 0x3f) | ||
173 | return 1; | ||
174 | reg += 0x40; /* 0x40 upwards are registers. */ | ||
175 | if (value < 0 || value > 0x3f) /* 0 to 0x3f are values */ | ||
176 | return 1; | ||
177 | outl(reg, emu->port + A_IOCFG); | ||
178 | udelay(10); | ||
179 | outl(reg | 0x80, emu->port + A_IOCFG); /* High bit clocks the value into the fpga. */ | ||
180 | udelay(10); | ||
181 | outl(value, emu->port + A_IOCFG); | ||
182 | udelay(10); | ||
183 | outl(value | 0x80 , emu->port + A_IOCFG); /* High bit clocks the value into the fpga. */ | ||
184 | |||
185 | return 0; | ||
186 | } | ||
187 | |||
188 | int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, int reg, int *value) | ||
189 | { | ||
190 | if (reg < 0 || reg > 0x3f) | ||
191 | return 1; | ||
192 | reg += 0x40; /* 0x40 upwards are registers. */ | ||
193 | outl(reg, emu->port + A_IOCFG); | ||
194 | udelay(10); | ||
195 | outl(reg | 0x80, emu->port + A_IOCFG); /* High bit clocks the value into the fpga. */ | ||
196 | udelay(10); | ||
197 | *value = ((inl(emu->port + A_IOCFG) >> 8) & 0x7f); | ||
198 | |||
199 | return 0; | ||
200 | } | ||
201 | |||
202 | /* Each Destination has one and only one Source, | ||
203 | * but one Source can feed any number of Destinations simultaneously. | ||
204 | */ | ||
205 | int snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 * emu, int dst, int src) | ||
206 | { | ||
207 | snd_emu1010_fpga_write(emu, 0x00, ((dst >> 8) & 0x3f) ); | ||
208 | snd_emu1010_fpga_write(emu, 0x01, (dst & 0x3f) ); | ||
209 | snd_emu1010_fpga_write(emu, 0x02, ((src >> 8) & 0x3f) ); | ||
210 | snd_emu1010_fpga_write(emu, 0x03, (src & 0x3f) ); | ||
211 | |||
212 | return 0; | ||
213 | } | ||
214 | |||
170 | void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb) | 215 | void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb) |
171 | { | 216 | { |
172 | unsigned long flags; | 217 | unsigned long flags; |