21 #include <linux/time.h>
22 #include <linux/wait.h>
23 #include <linux/slab.h>
24 #include <linux/module.h>
33 #define FX_LSB_TRANSFER 0x01
34 #define FX_MSB_TRANSFER 0x02
35 #define FX_AUTO_INCR 0x04
37 #define WAIT_IDLE 0xff
44 unsigned int x = 0x80;
46 for (i = 0; i < 1000; i++) {
47 x =
inb (dev->fx_status);
48 if ((x & 0x80) == 0) {
65 if (!wavefront_fx_idle(dev)) {
69 outb (onoff ? 0x02 : 0x00, dev->fx_op);
81 "page must be >= 0 and <= 7\n");
85 if (addr < 0 || addr > 0x7f) {
87 "addr must be >= 0 and <= 7f\n");
94 outb (page, dev->fx_dsp_page);
95 outb (addr, dev->fx_dsp_addr);
96 outb ((data[0] >> 8), dev->fx_dsp_msb);
97 outb ((data[0] & 0xff), dev->fx_dsp_lsb);
100 page, addr, data[0]);
106 outb (page, dev->fx_dsp_page);
107 outb (addr, dev->fx_dsp_addr);
109 for (i = 0; i <
cnt; i++) {
110 outb ((data[i] >> 8), dev->fx_dsp_msb);
111 outb ((data[i] & 0xff), dev->fx_dsp_lsb);
112 if (!wavefront_fx_idle (dev)) {
119 "(0x%x, 0x%x, 0x%lx, %d) incomplete\n",
120 page, addr, (
unsigned long) data, cnt);
138 if (
inb (dev->fx_status) & 0x80) {
139 snd_printk (
"Hmm, probably a Maui or Tropez.\n");
150 if (!try_module_get(hw->
card->module))
160 module_put(hw->
card->module);
166 unsigned int cmd,
unsigned long arg)
173 unsigned short *page_data =
NULL;
191 wavefront_fx_mute (dev, r.
data[0]);
195 if (r.
data[2] <= 0) {
197 "<= 0 bytes to FX\n");
199 }
else if (r.
data[2] == 1) {
200 pd = (
unsigned short *) &r.
data[3];
202 if (r.
data[2] > 256) {
204 "> 512 bytes to FX\n");
209 r.
data[2] *
sizeof(
short));
210 if (IS_ERR(page_data))
211 return PTR_ERR(page_data);
215 err = wavefront_fx_memset (dev,
224 snd_printk (
"FX: ioctl %d not yet supported\n",
260 for (i = 0; i + 1 < firmware->
size; i += 2) {
261 if (firmware->
data[i] >= 8 && firmware->
data[i] < 16) {
265 if (!wavefront_fx_idle(dev)) {
271 " in register data\n");