diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-05-03 18:50:51 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-05-03 18:50:51 +0400 |
commit | 972505ccde9a3bdc8455f4cf3d3f37d17f8f10a3 (patch) | |
tree | 1de7203fad25ae6bd672993f8e0bac03c2473544 /sound/pci/lola | |
parent | fe3d393eda2a716c2ea7fcd63e105657911ed245 (diff) | |
download | linux-972505ccde9a3bdc8455f4cf3d3f37d17f8f10a3.tar.xz |
ALSA: lola - Use SG-buffer
Completely switch to SG-buffer now, as it's working stably.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/lola')
-rw-r--r-- | sound/pci/lola/lola.c | 1 | ||||
-rw-r--r-- | sound/pci/lola/lola_pcm.c | 26 |
2 files changed, 4 insertions, 23 deletions
diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c index 7c13ace3c33b..3d2516b11f22 100644 --- a/sound/pci/lola/lola.c +++ b/sound/pci/lola/lola.c @@ -588,7 +588,6 @@ static int __devinit lola_create(struct snd_card *card, struct pci_dev *pci, chip->irq = -1; chip->sample_rate_min = sample_rate_min[dev]; - chip->granularity = granularity[dev]; /* FIXME */ if (chip->granularity != LOLA_GRANULARITY_MAX) { diff --git a/sound/pci/lola/lola_pcm.c b/sound/pci/lola/lola_pcm.c index ef738e6c9919..dc2e811dcb3c 100644 --- a/sound/pci/lola/lola_pcm.c +++ b/sound/pci/lola/lola_pcm.c @@ -26,28 +26,10 @@ #include <sound/pcm.h> #include "lola.h" -/* #define USE_SG_BUFFER */ - #define LOLA_MAX_BDL_ENTRIES 8 #define LOLA_MAX_BUF_SIZE (1024*1024*1024) #define LOLA_BDL_ENTRY_SIZE (16 * 16) -#ifdef USE_SG_BUFFER -#define get_addr(substream, ofs) \ - snd_pcm_sgbuf_get_addr(substream, ofs) -#define get_size(substream, ofs, size) \ - snd_pcm_sgbuf_get_chunk_size(substream, ofs, size) -#define ops_page snd_pcm_sgbuf_ops_page -#define PREALLOC_TYPE SNDRV_DMA_TYPE_DEV_SG -#else -#define get_addr(substream, ofs) \ - ((substream)->runtime->dma_addr + ofs) -#define get_size(substream, ofs, size) \ - (size) -#define ops_page NULL -#define PREALLOC_TYPE SNDRV_DMA_TYPE_DEV -#endif - static struct lola_pcm *lola_get_pcm(struct snd_pcm_substream *substream) { struct lola *chip = snd_pcm_substream_chip(substream); @@ -276,12 +258,12 @@ static int setup_bdle(struct snd_pcm_substream *substream, if (str->frags >= LOLA_MAX_BDL_ENTRIES) return -EINVAL; - addr = get_addr(substream, ofs); + addr = snd_pcm_sgbuf_get_addr(substream, ofs); /* program the address field of the BDL entry */ bdl[0] = cpu_to_le32((u32)addr); bdl[1] = cpu_to_le32(upper_32_bits(addr)); /* program the size field of the BDL entry */ - chunk = get_size(substream, ofs, size); + chunk = snd_pcm_sgbuf_get_chunk_size(substream, ofs, size); bdl[2] = cpu_to_le32(chunk); /* program the IOC to enable interrupt * only when the whole fragment is processed @@ -530,7 +512,7 @@ static struct snd_pcm_ops lola_pcm_ops = { .prepare = lola_pcm_prepare, .trigger = lola_pcm_trigger, .pointer = lola_pcm_pointer, - .page = ops_page, + .page = snd_pcm_sgbuf_ops_page, }; int __devinit lola_create_pcm(struct lola *chip) @@ -559,7 +541,7 @@ int __devinit lola_create_pcm(struct lola *chip) snd_pcm_set_ops(pcm, i, &lola_pcm_ops); } /* buffer pre-allocation */ - snd_pcm_lib_preallocate_pages_for_all(pcm, PREALLOC_TYPE, + snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, snd_dma_pci_data(chip->pci), 1024 * 64, 32 * 1024 * 1024); return 0; |