#include <linux/errno.h>
#include <linux/sound.h>
#include <linux/soundcard.h>
+#include <linux/mutex.h>
-#include <asm/semaphore.h>
#include <asm/uaccess.h>
#include <asm/hardware.h>
#include <asm/arch/dma.h>
.hw_remove = omap_tsc2101_remove,
.hw_suspend = omap_tsc2101_suspend,
.hw_resume = omap_tsc2101_resume,
- .sem = __SEMAPHORE_INIT(tsc2101_state.sem, 1),
+ .mutex = __MUTEX_INITIALIZER(tsc2101_state.mutex),
};
/* This will be defined in the Audio.h */
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/completion.h>
+#include <linux/mutex.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/hardware.h>
-#include <asm/semaphore.h>
#include "omap-audio-dma-intfc.h"
#include "omap-audio.h"
}
memcpy(&audio_state, codec_state, sizeof(audio_state_t));
- sema_init(&audio_state.sem, 1);
+ mutex_init(&audio_state.mutex);
ret = platform_device_register(&omap_audio_device);
if (ret != 0) {
return -ESTALE;
}
- down(&state->sem);
+ mutex_lock(&state->mutex);
/* access control */
err = -ENODEV;
err = 0;
out:
- up(&state->sem);
+ mutex_unlock(&state->mutex);
if (err) {
module_put(state->owner);
module_put(THIS_MODULE);
FN_IN;
- down(&state->sem);
+ mutex_lock(&state->mutex);
if (file->f_mode & FMODE_READ) {
audio_discard_buf(is);
state->hw_shutdown(state->data);
}
- up(&state->sem);
+ mutex_unlock(&state->mutex);
module_put(state->owner);
module_put(THIS_MODULE);
int (*hw_suspend) (void);
int (*hw_resume) (void);
struct pm_dev *pm_dev;
- struct semaphore sem; /* to protect against races in attach() */
+ struct mutex mutex; /* to protect against races in attach() */
} audio_state_t;
#ifdef AUDIO_PM