Lines Matching +full:off +full:- +full:chip
1 // SPDX-License-Identifier: GPL-2.0-or-later
18 struct snd_pdacf *chip = dev; in pdacf_interrupt() local
22 if ((chip->chip_status & (PDAUDIOCF_STAT_IS_STALE| in pdacf_interrupt()
27 stat = inw(chip->port + PDAUDIOCF_REG_ISR); in pdacf_interrupt()
30 dev_err(chip->card->dev, "PDAUDIOCF SRAM buffer overrun detected!\n"); in pdacf_interrupt()
31 if (chip->pcm_substream) in pdacf_interrupt()
37 snd_ak4117_check_rate_and_errors(chip->ak4117, 0); in pdacf_interrupt()
43 while (size-- > 0) { in pdacf_transfer_mono16()
53 while (size-- > 0) { in pdacf_transfer_mono32()
63 while (size-- > 0) { in pdacf_transfer_stereo16()
73 while (size-- > 0) { in pdacf_transfer_stereo32()
84 while (size-- > 0) { in pdacf_transfer_mono16sw()
94 while (size-- > 0) { in pdacf_transfer_mono32sw()
104 while (size-- > 0) { in pdacf_transfer_stereo16sw()
114 while (size-- > 0) { in pdacf_transfer_stereo32sw()
128 while (size-- > 0) { in pdacf_transfer_mono24le()
144 while (size-- > 0) { in pdacf_transfer_mono24be()
160 while (size-- > 0) { in pdacf_transfer_stereo24le()
180 while (size-- > 0) { in pdacf_transfer_stereo24be()
195 static void pdacf_transfer(struct snd_pdacf *chip, unsigned int size, unsigned int off) in pdacf_transfer() argument
197 unsigned long rdp_port = chip->port + PDAUDIOCF_REG_MD; in pdacf_transfer()
198 unsigned int xor = chip->pcm_xor; in pdacf_transfer()
200 if (chip->pcm_sample == 3) { in pdacf_transfer()
201 if (chip->pcm_little) { in pdacf_transfer()
202 if (chip->pcm_channels == 1) { in pdacf_transfer()
203 pdacf_transfer_mono24le((char *)chip->pcm_area + (off * 3), xor, size, rdp_port); in pdacf_transfer()
205 pdacf_transfer_stereo24le((char *)chip->pcm_area + (off * 6), xor, size, rdp_port); in pdacf_transfer()
208 if (chip->pcm_channels == 1) { in pdacf_transfer()
209 pdacf_transfer_mono24be((char *)chip->pcm_area + (off * 3), xor, size, rdp_port); in pdacf_transfer()
211 pdacf_transfer_stereo24be((char *)chip->pcm_area + (off * 6), xor, size, rdp_port); in pdacf_transfer()
216 if (chip->pcm_swab == 0) { in pdacf_transfer()
217 if (chip->pcm_channels == 1) { in pdacf_transfer()
218 if (chip->pcm_frame == 2) { in pdacf_transfer()
219 pdacf_transfer_mono16((u16 *)chip->pcm_area + off, xor, size, rdp_port); in pdacf_transfer()
221 pdacf_transfer_mono32((u32 *)chip->pcm_area + off, xor, size, rdp_port); in pdacf_transfer()
224 if (chip->pcm_frame == 2) { in pdacf_transfer()
225 pdacf_transfer_stereo16((u16 *)chip->pcm_area + (off * 2), xor, size, rdp_port); in pdacf_transfer()
227 pdacf_transfer_stereo32((u32 *)chip->pcm_area + (off * 2), xor, size, rdp_port); in pdacf_transfer()
231 if (chip->pcm_channels == 1) { in pdacf_transfer()
232 if (chip->pcm_frame == 2) { in pdacf_transfer()
233 pdacf_transfer_mono16sw((u16 *)chip->pcm_area + off, xor, size, rdp_port); in pdacf_transfer()
235 pdacf_transfer_mono32sw((u32 *)chip->pcm_area + off, xor, size, rdp_port); in pdacf_transfer()
238 if (chip->pcm_frame == 2) { in pdacf_transfer()
239 pdacf_transfer_stereo16sw((u16 *)chip->pcm_area + (off * 2), xor, size, rdp_port); in pdacf_transfer()
241 pdacf_transfer_stereo32sw((u32 *)chip->pcm_area + (off * 2), xor, size, rdp_port); in pdacf_transfer()
249 struct snd_pdacf *chip = dev; in pdacf_threaded_irq() local
250 int size, off, cont, rdp, wdp; in pdacf_threaded_irq() local
252 …if ((chip->chip_status & (PDAUDIOCF_STAT_IS_STALE|PDAUDIOCF_STAT_IS_CONFIGURED)) != PDAUDIOCF_STAT… in pdacf_threaded_irq()
255 …if (chip->pcm_substream == NULL || chip->pcm_substream->runtime == NULL || !snd_pcm_running(chip->… in pdacf_threaded_irq()
258 rdp = inw(chip->port + PDAUDIOCF_REG_RDP); in pdacf_threaded_irq()
259 wdp = inw(chip->port + PDAUDIOCF_REG_WDP); in pdacf_threaded_irq()
260 size = wdp - rdp; in pdacf_threaded_irq()
265 size /= chip->pcm_frame; in pdacf_threaded_irq()
267 size -= 32; in pdacf_threaded_irq()
270 chip->pcm_hwptr += size; in pdacf_threaded_irq()
271 chip->pcm_hwptr %= chip->pcm_size; in pdacf_threaded_irq()
272 chip->pcm_tdone += size; in pdacf_threaded_irq()
273 if (chip->pcm_frame == 2) { in pdacf_threaded_irq()
274 unsigned long rdp_port = chip->port + PDAUDIOCF_REG_MD; in pdacf_threaded_irq()
275 while (size-- > 0) { in pdacf_threaded_irq()
280 unsigned long rdp_port = chip->port + PDAUDIOCF_REG_MD; in pdacf_threaded_irq()
281 while (size-- > 0) { in pdacf_threaded_irq()
288 off = chip->pcm_hwptr + chip->pcm_tdone; in pdacf_threaded_irq()
289 off %= chip->pcm_size; in pdacf_threaded_irq()
290 chip->pcm_tdone += size; in pdacf_threaded_irq()
292 cont = chip->pcm_size - off; in pdacf_threaded_irq()
295 pdacf_transfer(chip, cont, off); in pdacf_threaded_irq()
296 off += cont; in pdacf_threaded_irq()
297 off %= chip->pcm_size; in pdacf_threaded_irq()
298 size -= cont; in pdacf_threaded_irq()
301 mutex_lock(&chip->reg_lock); in pdacf_threaded_irq()
302 while (chip->pcm_tdone >= chip->pcm_period) { in pdacf_threaded_irq()
303 chip->pcm_hwptr += chip->pcm_period; in pdacf_threaded_irq()
304 chip->pcm_hwptr %= chip->pcm_size; in pdacf_threaded_irq()
305 chip->pcm_tdone -= chip->pcm_period; in pdacf_threaded_irq()
306 mutex_unlock(&chip->reg_lock); in pdacf_threaded_irq()
307 snd_pcm_period_elapsed(chip->pcm_substream); in pdacf_threaded_irq()
308 mutex_lock(&chip->reg_lock); in pdacf_threaded_irq()
310 mutex_unlock(&chip->reg_lock); in pdacf_threaded_irq()