aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/echoaudio
diff options
context:
space:
mode:
authorTakashi Iwai2008-08-21 13:00:13 +0200
committerJaroslav Kysela2008-08-25 09:57:18 +0200
commit77a23f2695bb2de0cd74599400dc55109c531b72 (patch)
tree4960195e04016928dea83deb85e0f3bf97024a8a /sound/pci/echoaudio
parent46480b3a5f88f20dbf25d95fe74d7b4798d5bc86 (diff)
ALSA: Clean up SG-buffer helper functions and macros
Clean up SG-buffer helper functions and macros. Helpers take substream as arguments now. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/echoaudio')
-rw-r--r--sound/pci/echoaudio/echoaudio.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 160d47054922..8dbc5c4ba421 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -490,7 +490,6 @@ static int init_engine(struct snd_pcm_substream *substream,
{
struct echoaudio *chip;
int err, per, rest, page, edge, offs;
- struct snd_sg_buf *sgbuf;
struct audiopipe *pipe;
chip = snd_pcm_substream_chip(substream);
@@ -531,10 +530,6 @@ static int init_engine(struct snd_pcm_substream *substream,
return err;
}
- sgbuf = snd_pcm_substream_sgbuf(substream);
-
- DE_HWP(("pcm_hw_params table size=%d pages=%d\n",
- sgbuf->size, sgbuf->pages));
sglist_init(chip, pipe);
edge = PAGE_SIZE;
for (offs = page = per = 0; offs < params_buffer_bytes(hw_params);
@@ -543,16 +538,15 @@ static int init_engine(struct snd_pcm_substream *substream,
if (offs + rest > params_buffer_bytes(hw_params))
rest = params_buffer_bytes(hw_params) - offs;
while (rest) {
+ dma_addr_t addr;
+ addr = snd_pcm_sgbuf_get_addr(substream, offs);
if (rest <= edge - offs) {
- sglist_add_mapping(chip, pipe,
- snd_sgbuf_get_addr(sgbuf, offs),
- rest);
+ sglist_add_mapping(chip, pipe, addr, rest);
sglist_add_irq(chip, pipe);
offs += rest;
rest = 0;
} else {
- sglist_add_mapping(chip, pipe,
- snd_sgbuf_get_addr(sgbuf, offs),
+ sglist_add_mapping(chip, pipe, addr,
edge - offs);
rest -= edge - offs;
offs = edge;