nm256.c (d2f6409584e2c62ffad81690562330ff3bf4a458) nm256.c (77933d7276ee8fa0e2947641941a6f7a100a327b)
1/*
2 * Driver for NeoMagic 256AV and 256ZX chipsets.
3 * Copyright (c) 2000 by Takashi Iwai <tiwai@suse.de>
4 *
5 * Based on nm256_audio.c OSS driver in linux kernel.
6 * The original author of OSS nm256 driver wishes to remain anonymous,
7 * so I just put my acknoledgment to him/her here.
8 * The original author's web page is found at

--- 271 unchanged lines hidden (view full) ---

280
281MODULE_DEVICE_TABLE(pci, snd_nm256_ids);
282
283
284/*
285 * lowlvel stuffs
286 */
287
1/*
2 * Driver for NeoMagic 256AV and 256ZX chipsets.
3 * Copyright (c) 2000 by Takashi Iwai <tiwai@suse.de>
4 *
5 * Based on nm256_audio.c OSS driver in linux kernel.
6 * The original author of OSS nm256 driver wishes to remain anonymous,
7 * so I just put my acknoledgment to him/her here.
8 * The original author's web page is found at

--- 271 unchanged lines hidden (view full) ---

280
281MODULE_DEVICE_TABLE(pci, snd_nm256_ids);
282
283
284/*
285 * lowlvel stuffs
286 */
287
288inline static u8
288static inline u8
289snd_nm256_readb(nm256_t *chip, int offset)
290{
291 return readb(chip->cport + offset);
292}
293
289snd_nm256_readb(nm256_t *chip, int offset)
290{
291 return readb(chip->cport + offset);
292}
293
294inline static u16
294static inline u16
295snd_nm256_readw(nm256_t *chip, int offset)
296{
297 return readw(chip->cport + offset);
298}
299
295snd_nm256_readw(nm256_t *chip, int offset)
296{
297 return readw(chip->cport + offset);
298}
299
300inline static u32
300static inline u32
301snd_nm256_readl(nm256_t *chip, int offset)
302{
303 return readl(chip->cport + offset);
304}
305
301snd_nm256_readl(nm256_t *chip, int offset)
302{
303 return readl(chip->cport + offset);
304}
305
306inline static void
306static inline void
307snd_nm256_writeb(nm256_t *chip, int offset, u8 val)
308{
309 writeb(val, chip->cport + offset);
310}
311
307snd_nm256_writeb(nm256_t *chip, int offset, u8 val)
308{
309 writeb(val, chip->cport + offset);
310}
311
312inline static void
312static inline void
313snd_nm256_writew(nm256_t *chip, int offset, u16 val)
314{
315 writew(val, chip->cport + offset);
316}
317
313snd_nm256_writew(nm256_t *chip, int offset, u16 val)
314{
315 writew(val, chip->cport + offset);
316}
317
318inline static void
318static inline void
319snd_nm256_writel(nm256_t *chip, int offset, u32 val)
320{
321 writel(val, chip->cport + offset);
322}
323
319snd_nm256_writel(nm256_t *chip, int offset, u32 val)
320{
321 writel(val, chip->cport + offset);
322}
323
324inline static void
324static inline void
325snd_nm256_write_buffer(nm256_t *chip, void *src, int offset, int size)
326{
327 offset -= chip->buffer_start;
328#ifdef SNDRV_CONFIG_DEBUG
329 if (offset < 0 || offset >= chip->buffer_size) {
330 snd_printk("write_buffer invalid offset = %d size = %d\n", offset, size);
331 return;
332 }

--- 588 unchanged lines hidden (view full) ---

921 snd_nm256_writew(chip, 0x214, 0);
922 /* stop sounds.. */
923 //snd_nm256_playback_stop(chip);
924 //snd_nm256_capture_stop(chip);
925 spin_unlock_irq(&chip->reg_lock);
926}
927
928
325snd_nm256_write_buffer(nm256_t *chip, void *src, int offset, int size)
326{
327 offset -= chip->buffer_start;
328#ifdef SNDRV_CONFIG_DEBUG
329 if (offset < 0 || offset >= chip->buffer_size) {
330 snd_printk("write_buffer invalid offset = %d size = %d\n", offset, size);
331 return;
332 }

--- 588 unchanged lines hidden (view full) ---

921 snd_nm256_writew(chip, 0x214, 0);
922 /* stop sounds.. */
923 //snd_nm256_playback_stop(chip);
924 //snd_nm256_capture_stop(chip);
925 spin_unlock_irq(&chip->reg_lock);
926}
927
928
929inline static void
929static inline void
930snd_nm256_intr_check(nm256_t *chip)
931{
932 if (chip->badintrcount++ > 1000) {
933 /*
934 * I'm not sure if the best thing is to stop the card from
935 * playing or just release the interrupt (after all, we're in
936 * a bad situation, so doing fancy stuff may not be such a good
937 * idea).

--- 720 unchanged lines hidden ---
930snd_nm256_intr_check(nm256_t *chip)
931{
932 if (chip->badintrcount++ > 1000) {
933 /*
934 * I'm not sure if the best thing is to stop the card from
935 * playing or just release the interrupt (after all, we're in
936 * a bad situation, so doing fancy stuff may not be such a good
937 * idea).

--- 720 unchanged lines hidden ---