diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-08-21 07:00:13 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-08-25 03:57:18 -0400 |
commit | 77a23f2695bb2de0cd74599400dc55109c531b72 (patch) | |
tree | 4960195e04016928dea83deb85e0f3bf97024a8a /sound/pci/riptide/riptide.c | |
parent | 46480b3a5f88f20dbf25d95fe74d7b4798d5bc86 (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/riptide/riptide.c')
-rw-r--r-- | sound/pci/riptide/riptide.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index 124f9a2f1535..e9f0706ed3e4 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c | |||
@@ -1483,7 +1483,6 @@ static int snd_riptide_prepare(struct snd_pcm_substream *substream) | |||
1483 | { | 1483 | { |
1484 | struct snd_riptide *chip = snd_pcm_substream_chip(substream); | 1484 | struct snd_riptide *chip = snd_pcm_substream_chip(substream); |
1485 | struct snd_pcm_runtime *runtime = substream->runtime; | 1485 | struct snd_pcm_runtime *runtime = substream->runtime; |
1486 | struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream); | ||
1487 | struct pcmhw *data = get_pcmhwdev(substream); | 1486 | struct pcmhw *data = get_pcmhwdev(substream); |
1488 | struct cmdif *cif = chip->cif; | 1487 | struct cmdif *cif = chip->cif; |
1489 | unsigned char *lbuspath = NULL; | 1488 | unsigned char *lbuspath = NULL; |
@@ -1515,9 +1514,9 @@ static int snd_riptide_prepare(struct snd_pcm_substream *substream) | |||
1515 | lbuspath = data->paths.stereo; | 1514 | lbuspath = data->paths.stereo; |
1516 | break; | 1515 | break; |
1517 | } | 1516 | } |
1518 | snd_printdd("use sgdlist at 0x%p and buffer at 0x%p\n", | 1517 | snd_printdd("use sgdlist at 0x%p\n", |
1519 | data->sgdlist.area, sgbuf); | 1518 | data->sgdlist.area); |
1520 | if (data->sgdlist.area && sgbuf) { | 1519 | if (data->sgdlist.area) { |
1521 | unsigned int i, j, size, pages, f, pt, period; | 1520 | unsigned int i, j, size, pages, f, pt, period; |
1522 | struct sgd *c, *p = NULL; | 1521 | struct sgd *c, *p = NULL; |
1523 | 1522 | ||
@@ -1535,6 +1534,7 @@ static int snd_riptide_prepare(struct snd_pcm_substream *substream) | |||
1535 | pt = 0; | 1534 | pt = 0; |
1536 | j = 0; | 1535 | j = 0; |
1537 | for (i = 0; i < pages; i++) { | 1536 | for (i = 0; i < pages; i++) { |
1537 | unsigned int ofs, addr; | ||
1538 | c = &data->sgdbuf[i]; | 1538 | c = &data->sgdbuf[i]; |
1539 | if (p) | 1539 | if (p) |
1540 | p->dwNextLink = cpu_to_le32(data->sgdlist.addr + | 1540 | p->dwNextLink = cpu_to_le32(data->sgdlist.addr + |
@@ -1542,8 +1542,9 @@ static int snd_riptide_prepare(struct snd_pcm_substream *substream) | |||
1542 | sizeof(struct | 1542 | sizeof(struct |
1543 | sgd))); | 1543 | sgd))); |
1544 | c->dwNextLink = cpu_to_le32(data->sgdlist.addr); | 1544 | c->dwNextLink = cpu_to_le32(data->sgdlist.addr); |
1545 | c->dwSegPtrPhys = | 1545 | ofs = j << PAGE_SHIFT; |
1546 | cpu_to_le32(sgbuf->table[j].addr + pt); | 1546 | addr = snd_pcm_sgbuf_get_addr(substream, ofs) + pt; |
1547 | c->dwSegPtrPhys = cpu_to_le32(addr); | ||
1547 | pt = (pt + f) % PAGE_SIZE; | 1548 | pt = (pt + f) % PAGE_SIZE; |
1548 | if (pt == 0) | 1549 | if (pt == 0) |
1549 | j++; | 1550 | j++; |