#include <linux/module.h>
#include <linux/pm.h>
#include <linux/delay.h>
+#include <linux/spinlock.h>
#include "sound_config.h"
#include "nm256.h"
#include "nm256_coeff.h"
return;
}
- save_flags (flags);
- cli ();
+ spin_lock_irqsave(&card->lock,flags);
/*
* If we're not currently recording, set up the start and end registers
* for the recording engine.
}
else {
/* Not sure what else to do here. */
- restore_flags (flags);
+ spin_unlock_irqrestore(&card->lock,flags);
return;
}
}
nm256_writePort8 (card, 2, NM_RECORD_ENABLE_REG,
NM_RECORD_ENABLE_FLAG | NM_RECORD_FREERUN);
- restore_flags (flags);
+ spin_unlock_irqrestore(&card->lock,flags);
}
/* Stop the play engine. */
card->requested_amt = amt;
- save_flags (flags);
- cli ();
+ spin_lock_irqsave(&card->lock,flags);
if ((card->curPlayPos + amt) >= ringsize) {
u32 rem = ringsize - card->curPlayPos;
if (! card->playing)
startPlay (card);
- restore_flags (flags);
+ spin_unlock_irqrestore(&card->lock,flags);
}
/* We just got a card playback interrupt; process it. */
base = card->mixer;
- save_flags (flags);
- cli ();
+ spin_lock_irqsave(&card->lock,flags);
nm256_isReady (dev);
}
- restore_flags (flags);
+ spin_unlock_irqrestore(&card->lock,flags);
udelay (1000);
return ! done;
card->playing = 0;
card->recording = 0;
card->rev = rev;
+ spin_lock_init(&card->lock);
/* Init the memory port info. */
for (x = 0; x < 2; x++) {