24 #include <asm/irq_regs.h>
44 tasklet_schedule(&chip->
tq);
53 static inline void pdacf_transfer_mono16(
u16 *
dst,
u16 xor,
unsigned int size,
unsigned long rdp_port)
56 *dst++ =
inw(rdp_port) ^
xor;
61 static inline void pdacf_transfer_mono32(
u32 *dst,
u32 xor,
unsigned int size,
unsigned long rdp_port)
63 register u16 val1, val2;
69 *dst++ = ((((
u32)val2 & 0xff) << 24) | ((
u32)val1 << 8)) ^
xor;
73 static inline void pdacf_transfer_stereo16(
u16 *dst,
u16 xor,
unsigned int size,
unsigned long rdp_port)
76 *dst++ =
inw(rdp_port) ^
xor;
77 *dst++ =
inw(rdp_port) ^
xor;
81 static inline void pdacf_transfer_stereo32(
u32 *dst,
u32 xor,
unsigned int size,
unsigned long rdp_port)
83 register u16 val1, val2, val3;
89 *dst++ = ((((
u32)val2 & 0xff) << 24) | ((
u32)val1 << 8)) ^
xor;
90 *dst++ = (((
u32)val3 << 16) | (val2 & 0xff00)) ^
xor;
94 static inline void pdacf_transfer_mono16sw(
u16 *dst,
u16 xor,
unsigned int size,
unsigned long rdp_port)
102 static inline void pdacf_transfer_mono32sw(
u32 *dst,
u32 xor,
unsigned int size,
unsigned long rdp_port)
104 register u16 val1, val2;
107 val1 =
inw(rdp_port);
108 val2 =
inw(rdp_port);
110 *dst++ =
swab32((((val2 & 0xff) << 24) | ((
u32)val1 << 8)) ^ xor);
114 static inline void pdacf_transfer_stereo16sw(
u16 *dst,
u16 xor,
unsigned int size,
unsigned long rdp_port)
122 static inline void pdacf_transfer_stereo32sw(
u32 *dst,
u32 xor,
unsigned int size,
unsigned long rdp_port)
124 register u16 val1, val2, val3;
127 val1 =
inw(rdp_port);
128 val2 =
inw(rdp_port);
129 val3 =
inw(rdp_port);
130 *dst++ =
swab32((((val2 & 0xff) << 24) | ((
u32)val1 << 8)) ^ xor);
131 *dst++ =
swab32((((
u32)val3 << 16) | (val2 & 0xff00)) ^ xor);
135 static inline void pdacf_transfer_mono24le(
u8 *dst,
u16 xor,
unsigned int size,
unsigned long rdp_port)
137 register u16 val1, val2;
141 val1 =
inw(rdp_port);
142 val2 =
inw(rdp_port);
144 xval1 = (((val2 & 0xff) << 8) | (val1 << 16)) ^
xor;
145 *dst++ = (
u8)(xval1 >> 8);
146 *dst++ = (
u8)(xval1 >> 16);
147 *dst++ = (
u8)(xval1 >> 24);
151 static inline void pdacf_transfer_mono24be(
u8 *dst,
u16 xor,
unsigned int size,
unsigned long rdp_port)
153 register u16 val1, val2;
157 val1 =
inw(rdp_port);
158 val2 =
inw(rdp_port);
160 xval1 = (((val2 & 0xff) << 8) | (val1 << 16)) ^
xor;
161 *dst++ = (
u8)(xval1 >> 24);
162 *dst++ = (
u8)(xval1 >> 16);
163 *dst++ = (
u8)(xval1 >> 8);
167 static inline void pdacf_transfer_stereo24le(
u8 *dst,
u32 xor,
unsigned int size,
unsigned long rdp_port)
169 register u16 val1, val2, val3;
170 register u32 xval1, xval2;
173 val1 =
inw(rdp_port);
174 val2 =
inw(rdp_port);
175 val3 =
inw(rdp_port);
176 xval1 = ((((
u32)val2 & 0xff) << 24) | ((
u32)val1 << 8)) ^
xor;
177 xval2 = (((
u32)val3 << 16) | (val2 & 0xff00)) ^
xor;
178 *dst++ = (
u8)(xval1 >> 8);
179 *dst++ = (
u8)(xval1 >> 16);
180 *dst++ = (
u8)(xval1 >> 24);
181 *dst++ = (
u8)(xval2 >> 8);
182 *dst++ = (
u8)(xval2 >> 16);
183 *dst++ = (
u8)(xval2 >> 24);
187 static inline void pdacf_transfer_stereo24be(
u8 *dst,
u32 xor,
unsigned int size,
unsigned long rdp_port)
189 register u16 val1, val2, val3;
190 register u32 xval1, xval2;
193 val1 =
inw(rdp_port);
194 val2 =
inw(rdp_port);
195 val3 =
inw(rdp_port);
196 xval1 = ((((
u32)val2 & 0xff) << 24) | ((
u32)val1 << 8)) ^
xor;
197 xval2 = (((
u32)val3 << 16) | (val2 & 0xff00)) ^
xor;
198 *dst++ = (
u8)(xval1 >> 24);
199 *dst++ = (
u8)(xval1 >> 16);
200 *dst++ = (
u8)(xval1 >> 8);
201 *dst++ = (
u8)(xval2 >> 24);
202 *dst++ = (
u8)(xval2 >> 16);
203 *dst++ = (
u8)(xval2 >> 8);
207 static void pdacf_transfer(
struct snd_pdacf *
chip,
unsigned int size,
unsigned int off)
210 unsigned int xor = chip->
pcm_xor;
215 pdacf_transfer_mono24le((
char *)chip->
pcm_area + (off * 3), xor, size, rdp_port);
217 pdacf_transfer_stereo24le((
char *)chip->
pcm_area + (off * 6), xor, size, rdp_port);
221 pdacf_transfer_mono24be((
char *)chip->
pcm_area + (off * 3), xor, size, rdp_port);
223 pdacf_transfer_stereo24be((
char *)chip->
pcm_area + (off * 6), xor, size, rdp_port);
231 pdacf_transfer_mono16((
u16 *)chip->
pcm_area + off, xor, size, rdp_port);
233 pdacf_transfer_mono32((
u32 *)chip->
pcm_area + off, xor, size, rdp_port);
237 pdacf_transfer_stereo16((
u16 *)chip->
pcm_area + (off * 2), xor, size, rdp_port);
239 pdacf_transfer_stereo32((
u32 *)chip->
pcm_area + (off * 2), xor, size, rdp_port);
245 pdacf_transfer_mono16sw((
u16 *)chip->
pcm_area + off, xor, size, rdp_port);
247 pdacf_transfer_mono32sw((
u32 *)chip->
pcm_area + off, xor, size, rdp_port);
251 pdacf_transfer_stereo16sw((
u16 *)chip->
pcm_area + (off * 2), xor, size, rdp_port);
253 pdacf_transfer_stereo32sw((
u32 *)chip->
pcm_area + (off * 2), xor, size, rdp_port);
308 pdacf_transfer(chip, cont, off);