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>
This commit is contained in:
committed by
Jaroslav Kysela
parent
46480b3a5f
commit
77a23f2695
@@ -1483,7 +1483,6 @@ static int snd_riptide_prepare(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_riptide *chip = snd_pcm_substream_chip(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream);
|
||||
struct pcmhw *data = get_pcmhwdev(substream);
|
||||
struct cmdif *cif = chip->cif;
|
||||
unsigned char *lbuspath = NULL;
|
||||
@@ -1515,9 +1514,9 @@ static int snd_riptide_prepare(struct snd_pcm_substream *substream)
|
||||
lbuspath = data->paths.stereo;
|
||||
break;
|
||||
}
|
||||
snd_printdd("use sgdlist at 0x%p and buffer at 0x%p\n",
|
||||
data->sgdlist.area, sgbuf);
|
||||
if (data->sgdlist.area && sgbuf) {
|
||||
snd_printdd("use sgdlist at 0x%p\n",
|
||||
data->sgdlist.area);
|
||||
if (data->sgdlist.area) {
|
||||
unsigned int i, j, size, pages, f, pt, period;
|
||||
struct sgd *c, *p = NULL;
|
||||
|
||||
@@ -1535,6 +1534,7 @@ static int snd_riptide_prepare(struct snd_pcm_substream *substream)
|
||||
pt = 0;
|
||||
j = 0;
|
||||
for (i = 0; i < pages; i++) {
|
||||
unsigned int ofs, addr;
|
||||
c = &data->sgdbuf[i];
|
||||
if (p)
|
||||
p->dwNextLink = cpu_to_le32(data->sgdlist.addr +
|
||||
@@ -1542,8 +1542,9 @@ static int snd_riptide_prepare(struct snd_pcm_substream *substream)
|
||||
sizeof(struct
|
||||
sgd)));
|
||||
c->dwNextLink = cpu_to_le32(data->sgdlist.addr);
|
||||
c->dwSegPtrPhys =
|
||||
cpu_to_le32(sgbuf->table[j].addr + pt);
|
||||
ofs = j << PAGE_SHIFT;
|
||||
addr = snd_pcm_sgbuf_get_addr(substream, ofs) + pt;
|
||||
c->dwSegPtrPhys = cpu_to_le32(addr);
|
||||
pt = (pt + f) % PAGE_SIZE;
|
||||
if (pt == 0)
|
||||
j++;
|
||||
|
Reference in New Issue
Block a user