git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
sound
/
isa
/
sb
/
emu8000_pcm.c
diff --git
a/sound/isa/sb/emu8000_pcm.c
b/sound/isa/sb/emu8000_pcm.c
index
5c4def8
..
91dc3d8
100644
(file)
--- a/
sound/isa/sb/emu8000_pcm.c
+++ b/
sound/isa/sb/emu8000_pcm.c
@@
-23,8
+23,6
@@
#include <sound/initval.h>
#include <sound/pcm.h>
#include <sound/initval.h>
#include <sound/pcm.h>
-#define chip_t emu8000_t
-
/*
* define the following if you want to use this pcm with non-interleaved mode
*/
/*
* define the following if you want to use this pcm with non-interleaved mode
*/
@@
-48,14
+46,12
@@
*/
*/
-typedef struct snd_emu8k_pcm emu8k_pcm_t;
-
struct snd_emu8k_pcm {
struct snd_emu8k_pcm {
-
emu8000_t
*emu;
- s
nd_pcm_substream_t
*substream;
+
struct snd_emu8000
*emu;
+ s
truct snd_pcm_substream
*substream;
unsigned int allocated_bytes;
unsigned int allocated_bytes;
- s
nd_util_memblk_t
*block;
+ s
truct snd_util_memblk
*block;
unsigned int offset;
unsigned int buf_size;
unsigned int period_size;
unsigned int offset;
unsigned int buf_size;
unsigned int period_size;
@@
-79,7
+75,7
@@
struct snd_emu8k_pcm {
* open up channels for the simultaneous data transfer and playback
*/
static int
* open up channels for the simultaneous data transfer and playback
*/
static int
-emu8k_open_dram_for_pcm(
emu8000_t
*emu, int channels)
+emu8k_open_dram_for_pcm(
struct snd_emu8000
*emu, int channels)
{
int i;
{
int i;
@@
-115,12
+111,11
@@
emu8k_open_dram_for_pcm(emu8000_t *emu, int channels)
/*
*/
static void
/*
*/
static void
-snd_emu8000_write_wait(
emu8000_t
*emu, int can_schedule)
+snd_emu8000_write_wait(
struct snd_emu8000
*emu, int can_schedule)
{
while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) {
if (can_schedule) {
{
while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) {
if (can_schedule) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
+ schedule_timeout_interruptible(1);
if (signal_pending(current))
break;
}
if (signal_pending(current))
break;
}
@@
-131,7
+126,7
@@
snd_emu8000_write_wait(emu8000_t *emu, int can_schedule)
* close all channels
*/
static void
* close all channels
*/
static void
-emu8k_close_dram(
emu8000_t
*emu)
+emu8k_close_dram(
struct snd_emu8000
*emu)
{
int i;
{
int i;
@@
-159,7
+154,7
@@
static int calc_rate_offset(int hz)
/*
*/
/*
*/
-static s
nd_pcm_hardware_t
emu8k_pcm_hw = {
+static s
truct snd_pcm_hardware
emu8k_pcm_hw = {
#ifdef USE_NONINTERLEAVE
.info = SNDRV_PCM_INFO_NONINTERLEAVED,
#else
#ifdef USE_NONINTERLEAVE
.info = SNDRV_PCM_INFO_NONINTERLEAVED,
#else
@@
-183,7
+178,7
@@
static snd_pcm_hardware_t emu8k_pcm_hw = {
/*
* get the current position at the given channel from CCCA register
*/
/*
* get the current position at the given channel from CCCA register
*/
-static inline int emu8k_get_curpos(
emu8k_pcm_t
*rec, int ch)
+static inline int emu8k_get_curpos(
struct snd_emu8k_pcm
*rec, int ch)
{
int val = EMU8000_CCCA_READ(rec->emu, ch) & 0xfffffff;
val -= rec->loop_start[ch] - 1;
{
int val = EMU8000_CCCA_READ(rec->emu, ch) & 0xfffffff;
val -= rec->loop_start[ch] - 1;
@@
-197,7
+192,7
@@
static inline int emu8k_get_curpos(emu8k_pcm_t *rec, int ch)
*/
static void emu8k_pcm_timer_func(unsigned long data)
{
*/
static void emu8k_pcm_timer_func(unsigned long data)
{
-
emu8k_pcm_t *rec = (emu8k_pcm_t
*)data;
+
struct snd_emu8k_pcm *rec = (struct snd_emu8k_pcm
*)data;
int ptr, delta;
spin_lock(&rec->timer_lock);
int ptr, delta;
spin_lock(&rec->timer_lock);
@@
-229,13
+224,13
@@
static void emu8k_pcm_timer_func(unsigned long data)
* open pcm
* creating an instance here
*/
* open pcm
* creating an instance here
*/
-static int emu8k_pcm_open(s
nd_pcm_substream_t
*subs)
+static int emu8k_pcm_open(s
truct snd_pcm_substream
*subs)
{
{
-
emu8000_t
*emu = snd_pcm_substream_chip(subs);
-
emu8k_pcm_t
*rec;
- s
nd_pcm_runtime_t
*runtime = subs->runtime;
+
struct snd_emu8000
*emu = snd_pcm_substream_chip(subs);
+
struct snd_emu8k_pcm
*rec;
+ s
truct snd_pcm_runtime
*runtime = subs->runtime;
- rec =
snd_kc
alloc(sizeof(*rec), GFP_KERNEL);
+ rec =
kz
alloc(sizeof(*rec), GFP_KERNEL);
if (! rec)
return -ENOMEM;
if (! rec)
return -ENOMEM;
@@
-259,11
+254,10
@@
static int emu8k_pcm_open(snd_pcm_substream_t *subs)
return 0;
}
return 0;
}
-static int emu8k_pcm_close(s
nd_pcm_substream_t
*subs)
+static int emu8k_pcm_close(s
truct snd_pcm_substream
*subs)
{
{
- emu8k_pcm_t *rec = subs->runtime->private_data;
- if (rec)
- kfree(rec);
+ struct snd_emu8k_pcm *rec = subs->runtime->private_data;
+ kfree(rec);
subs->runtime->private_data = NULL;
return 0;
}
subs->runtime->private_data = NULL;
return 0;
}
@@
-285,9
+279,9
@@
static int calc_pitch_target(int pitch)
/*
* set up the voice
*/
/*
* set up the voice
*/
-static void setup_voice(
emu8k_pcm_t
*rec, int ch)
+static void setup_voice(
struct snd_emu8k_pcm
*rec, int ch)
{
{
-
emu8000_t
*hw = rec->emu;
+
struct snd_emu8000
*hw = rec->emu;
unsigned int temp;
/* channel to be silent and idle */
unsigned int temp;
/* channel to be silent and idle */
@@
-338,10
+332,10
@@
static void setup_voice(emu8k_pcm_t *rec, int ch)
/*
* trigger the voice
*/
/*
* trigger the voice
*/
-static void start_voice(
emu8k_pcm_t
*rec, int ch)
+static void start_voice(
struct snd_emu8k_pcm
*rec, int ch)
{
unsigned long flags;
{
unsigned long flags;
-
emu8000_t
*hw = rec->emu;
+
struct snd_emu8000
*hw = rec->emu;
unsigned int temp, aux;
int pt = calc_pitch_target(rec->pitch);
unsigned int temp, aux;
int pt = calc_pitch_target(rec->pitch);
@@
-374,10
+368,10
@@
static void start_voice(emu8k_pcm_t *rec, int ch)
/*
* stop the voice immediately
*/
/*
* stop the voice immediately
*/
-static void stop_voice(
emu8k_pcm_t
*rec, int ch)
+static void stop_voice(
struct snd_emu8k_pcm
*rec, int ch)
{
unsigned long flags;
{
unsigned long flags;
-
emu8000_t
*hw = rec->emu;
+
struct snd_emu8000
*hw = rec->emu;
EMU8000_DCYSUSV_WRITE(hw, ch, 0x807F);
EMU8000_DCYSUSV_WRITE(hw, ch, 0x807F);
@@
-390,9
+384,9
@@
static void stop_voice(emu8k_pcm_t *rec, int ch)
spin_unlock_irqrestore(&rec->timer_lock, flags);
}
spin_unlock_irqrestore(&rec->timer_lock, flags);
}
-static int emu8k_pcm_trigger(s
nd_pcm_substream_t
*subs, int cmd)
+static int emu8k_pcm_trigger(s
truct snd_pcm_substream
*subs, int cmd)
{
{
-
emu8k_pcm_t
*rec = subs->runtime->private_data;
+
struct snd_emu8k_pcm
*rec = subs->runtime->private_data;
int ch;
switch (cmd) {
int ch;
switch (cmd) {
@@
-432,7
+426,7
@@
do { \
#ifdef USE_NONINTERLEAVE
/* copy one channel block */
#ifdef USE_NONINTERLEAVE
/* copy one channel block */
-static int emu8k_transfer_block(
emu8000_t
*emu, int offset, unsigned short *buf, int count)
+static int emu8k_transfer_block(
struct snd_emu8000
*emu, int offset, unsigned short *buf, int count)
{
EMU8000_SMALW_WRITE(emu, offset);
while (count > 0) {
{
EMU8000_SMALW_WRITE(emu, offset);
while (count > 0) {
@@
-446,14
+440,14
@@
static int emu8k_transfer_block(emu8000_t *emu, int offset, unsigned short *buf,
return 0;
}
return 0;
}
-static int emu8k_pcm_copy(s
nd_pcm_substream_t
*subs,
+static int emu8k_pcm_copy(s
truct snd_pcm_substream
*subs,
int voice,
snd_pcm_uframes_t pos,
void *src,
snd_pcm_uframes_t count)
{
int voice,
snd_pcm_uframes_t pos,
void *src,
snd_pcm_uframes_t count)
{
-
emu8k_pcm_t
*rec = subs->runtime->private_data;
-
emu8000_t
*emu = rec->emu;
+
struct snd_emu8k_pcm
*rec = subs->runtime->private_data;
+
struct snd_emu8000
*emu = rec->emu;
snd_emu8000_write_wait(emu, 1);
if (voice == -1) {
snd_emu8000_write_wait(emu, 1);
if (voice == -1) {
@@
-473,7
+467,7
@@
static int emu8k_pcm_copy(snd_pcm_substream_t *subs,
}
/* make a channel block silence */
}
/* make a channel block silence */
-static int emu8k_silence_block(
emu8000_t
*emu, int offset, int count)
+static int emu8k_silence_block(
struct snd_emu8000
*emu, int offset, int count)
{
EMU8000_SMALW_WRITE(emu, offset);
while (count > 0) {
{
EMU8000_SMALW_WRITE(emu, offset);
while (count > 0) {
@@
-484,13
+478,13
@@
static int emu8k_silence_block(emu8000_t *emu, int offset, int count)
return 0;
}
return 0;
}
-static int emu8k_pcm_silence(s
nd_pcm_substream_t
*subs,
+static int emu8k_pcm_silence(s
truct snd_pcm_substream
*subs,
int voice,
snd_pcm_uframes_t pos,
snd_pcm_uframes_t count)
{
int voice,
snd_pcm_uframes_t pos,
snd_pcm_uframes_t count)
{
-
emu8k_pcm_t
*rec = subs->runtime->private_data;
-
emu8000_t
*emu = rec->emu;
+
struct snd_emu8k_pcm
*rec = subs->runtime->private_data;
+
struct snd_emu8000
*emu = rec->emu;
snd_emu8000_write_wait(emu, 1);
if (voice == -1 && rec->voices == 1)
snd_emu8000_write_wait(emu, 1);
if (voice == -1 && rec->voices == 1)
@@
-512,14
+506,14
@@
static int emu8k_pcm_silence(snd_pcm_substream_t *subs,
* copy the interleaved data can be done easily by using
* DMA "left" and "right" channels on emu8k engine.
*/
* copy the interleaved data can be done easily by using
* DMA "left" and "right" channels on emu8k engine.
*/
-static int emu8k_pcm_copy(s
nd_pcm_substream_t
*subs,
+static int emu8k_pcm_copy(s
truct snd_pcm_substream
*subs,
int voice,
snd_pcm_uframes_t pos,
void __user *src,
snd_pcm_uframes_t count)
{
int voice,
snd_pcm_uframes_t pos,
void __user *src,
snd_pcm_uframes_t count)
{
-
emu8k_pcm_t
*rec = subs->runtime->private_data;
-
emu8000_t
*emu = rec->emu;
+
struct snd_emu8k_pcm
*rec = subs->runtime->private_data;
+
struct snd_emu8000
*emu = rec->emu;
unsigned short __user *buf = src;
snd_emu8000_write_wait(emu, 1);
unsigned short __user *buf = src;
snd_emu8000_write_wait(emu, 1);
@@
-543,13
+537,13
@@
static int emu8k_pcm_copy(snd_pcm_substream_t *subs,
return 0;
}
return 0;
}
-static int emu8k_pcm_silence(s
nd_pcm_substream_t
*subs,
+static int emu8k_pcm_silence(s
truct snd_pcm_substream
*subs,
int voice,
snd_pcm_uframes_t pos,
snd_pcm_uframes_t count)
{
int voice,
snd_pcm_uframes_t pos,
snd_pcm_uframes_t count)
{
-
emu8k_pcm_t
*rec = subs->runtime->private_data;
-
emu8000_t
*emu = rec->emu;
+
struct snd_emu8k_pcm
*rec = subs->runtime->private_data;
+
struct snd_emu8000
*emu = rec->emu;
snd_emu8000_write_wait(emu, 1);
EMU8000_SMALW_WRITE(emu, rec->loop_start[0] + pos);
snd_emu8000_write_wait(emu, 1);
EMU8000_SMALW_WRITE(emu, rec->loop_start[0] + pos);
@@
-571,10
+565,10
@@
static int emu8k_pcm_silence(snd_pcm_substream_t *subs,
/*
* allocate a memory block
*/
/*
* allocate a memory block
*/
-static int emu8k_pcm_hw_params(s
nd_pcm_substream_t
*subs,
- s
nd_pcm_hw_params_t
*hw_params)
+static int emu8k_pcm_hw_params(s
truct snd_pcm_substream
*subs,
+ s
truct snd_pcm_hw_params
*hw_params)
{
{
-
emu8k_pcm_t
*rec = subs->runtime->private_data;
+
struct snd_emu8k_pcm
*rec = subs->runtime->private_data;
if (rec->block) {
/* reallocation - release the old block */
if (rec->block) {
/* reallocation - release the old block */
@@
-596,9
+590,9
@@
static int emu8k_pcm_hw_params(snd_pcm_substream_t *subs,
/*
* free the memory block
*/
/*
* free the memory block
*/
-static int emu8k_pcm_hw_free(s
nd_pcm_substream_t
*subs)
+static int emu8k_pcm_hw_free(s
truct snd_pcm_substream
*subs)
{
{
-
emu8k_pcm_t
*rec = subs->runtime->private_data;
+
struct snd_emu8k_pcm
*rec = subs->runtime->private_data;
if (rec->block) {
int ch;
if (rec->block) {
int ch;
@@
-614,9
+608,9
@@
static int emu8k_pcm_hw_free(snd_pcm_substream_t *subs)
/*
*/
/*
*/
-static int emu8k_pcm_prepare(s
nd_pcm_substream_t
*subs)
+static int emu8k_pcm_prepare(s
truct snd_pcm_substream
*subs)
{
{
-
emu8k_pcm_t
*rec = subs->runtime->private_data;
+
struct snd_emu8k_pcm
*rec = subs->runtime->private_data;
rec->pitch = 0xe000 + calc_rate_offset(subs->runtime->rate);
rec->last_ptr = 0;
rec->pitch = 0xe000 + calc_rate_offset(subs->runtime->rate);
rec->last_ptr = 0;
@@
-660,16
+654,16
@@
static int emu8k_pcm_prepare(snd_pcm_substream_t *subs)
return 0;
}
return 0;
}
-static snd_pcm_uframes_t emu8k_pcm_pointer(s
nd_pcm_substream_t
*subs)
+static snd_pcm_uframes_t emu8k_pcm_pointer(s
truct snd_pcm_substream
*subs)
{
{
-
emu8k_pcm_t
*rec = subs->runtime->private_data;
+
struct snd_emu8k_pcm
*rec = subs->runtime->private_data;
if (rec->running)
return emu8k_get_curpos(rec, 0);
return 0;
}
if (rec->running)
return emu8k_get_curpos(rec, 0);
return 0;
}
-static s
nd_pcm_ops_t
emu8k_pcm_ops = {
+static s
truct snd_pcm_ops
emu8k_pcm_ops = {
.open = emu8k_pcm_open,
.close = emu8k_pcm_close,
.ioctl = snd_pcm_lib_ioctl,
.open = emu8k_pcm_open,
.close = emu8k_pcm_close,
.ioctl = snd_pcm_lib_ioctl,
@@
-683,15
+677,15
@@
static snd_pcm_ops_t emu8k_pcm_ops = {
};
};
-static void snd_emu8000_pcm_free(s
nd_pcm_t
*pcm)
+static void snd_emu8000_pcm_free(s
truct snd_pcm
*pcm)
{
{
-
emu8000_t
*emu = pcm->private_data;
+
struct snd_emu8000
*emu = pcm->private_data;
emu->pcm = NULL;
}
emu->pcm = NULL;
}
-int snd_emu8000_pcm_new(s
nd_card_t *card, emu8000_t
*emu, int index)
+int snd_emu8000_pcm_new(s
truct snd_card *card, struct snd_emu8000
*emu, int index)
{
{
- s
nd_pcm_t
*pcm;
+ s
truct snd_pcm
*pcm;
int err;
if ((err = snd_pcm_new(card, "Emu8000 PCM", index, 1, 0, &pcm)) < 0)
int err;
if ((err = snd_pcm_new(card, "Emu8000 PCM", index, 1, 0, &pcm)) < 0)