diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-11 12:16:54 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-11 12:16:54 -0400 |
| commit | d3570a5a7b8d0604fa012129f92637dc1534f62c (patch) | |
| tree | 15d290595c363a2bdd4f4d6b3a2f7433e6e48f6d /include/sound/memalloc.h | |
| parent | 37d9869ed928268409b48f52c57449918c0fd307 (diff) | |
| parent | 72474be62d6ec2e0337ff01ecbd737f9c5c242c7 (diff) | |
Merge branch 'for-linus' of git://git.alsa-project.org/alsa-kernel
* 'for-linus' of git://git.alsa-project.org/alsa-kernel: (258 commits)
ALSA: hda: VREF powerdown for headphones
ALSA: hda: STAC_HP_M4
ALSA: ASoC: Check for machine type in GTA01 machine driver
ALSA: mtpav - Fix race in probe
ALSA: usb-audio: dynamic detection of MIDI interfaces in uaxx-quirk
ALSA: Add a note on dependency of RTC stuff
ALSA: ASoC: add new param mux to dapm_mux_update_power
ALSA: Increase components array size
ALSA: ASoC: Correct inverted Mic PGA Switch control in wm8510 driver
ALSA: hda: comment typo fix
ALSA: hda: comment typo fix
ALSA: hda - Fix PCI SSID for ASROCK K18N78FullHD-hSLI
ALSA: snd-usb-audio: support for Edirol UA-4FX device
ALSA: usb - Fix possible Oops at USB-MIDI disconnection
ALSA: hda - Fix another ALC889A (rev 0x100101)
ALSA: hda: add more board-specific information for Realtek ALC662 rev1
ALSA: Correct Vladimir Barinov's e-mail address
ALSA: cs46xx: Add PCI IDs for TerraTec and Hercules cards
ALSA: hda: SPDIF stream muting support
ALSA: hda: appletv support
...
Diffstat (limited to 'include/sound/memalloc.h')
| -rw-r--r-- | include/sound/memalloc.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index ae2921d9ddcc..d787a6b4a101 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
| @@ -65,6 +65,11 @@ struct snd_dma_buffer { | |||
| 65 | /* | 65 | /* |
| 66 | * Scatter-Gather generic device pages | 66 | * Scatter-Gather generic device pages |
| 67 | */ | 67 | */ |
| 68 | void *snd_malloc_sgbuf_pages(struct device *device, | ||
| 69 | size_t size, struct snd_dma_buffer *dmab, | ||
| 70 | size_t *res_size); | ||
| 71 | int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab); | ||
| 72 | |||
| 68 | struct snd_sg_page { | 73 | struct snd_sg_page { |
| 69 | void *buf; | 74 | void *buf; |
| 70 | dma_addr_t addr; | 75 | dma_addr_t addr; |
| @@ -92,9 +97,18 @@ static inline unsigned int snd_sgbuf_aligned_pages(size_t size) | |||
| 92 | */ | 97 | */ |
| 93 | static inline dma_addr_t snd_sgbuf_get_addr(struct snd_sg_buf *sgbuf, size_t offset) | 98 | static inline dma_addr_t snd_sgbuf_get_addr(struct snd_sg_buf *sgbuf, size_t offset) |
| 94 | { | 99 | { |
| 95 | return sgbuf->table[offset >> PAGE_SHIFT].addr + offset % PAGE_SIZE; | 100 | dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr; |
| 101 | addr &= PAGE_MASK; | ||
| 102 | return addr + offset % PAGE_SIZE; | ||
| 96 | } | 103 | } |
| 97 | 104 | ||
| 105 | /* | ||
| 106 | * return the virtual address at the corresponding offset | ||
| 107 | */ | ||
| 108 | static inline void *snd_sgbuf_get_ptr(struct snd_sg_buf *sgbuf, size_t offset) | ||
| 109 | { | ||
| 110 | return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE; | ||
| 111 | } | ||
| 98 | 112 | ||
| 99 | /* allocate/release a buffer */ | 113 | /* allocate/release a buffer */ |
| 100 | int snd_dma_alloc_pages(int type, struct device *dev, size_t size, | 114 | int snd_dma_alloc_pages(int type, struct device *dev, size_t size, |
