1 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/ac97_codec.h linux-libc-headers-2.6.8.0/include/sound/ac97_codec.h
2 --- linux-libc-headers-2.6.8.0.orig/include/sound/ac97_codec.h 2004-08-18 20:07:05.000000000 +0200
3 +++ linux-libc-headers-2.6.8.0/include/sound/ac97_codec.h 2004-08-20 08:04:48.260207680 +0200
5 #define AC97_RATES_MIC_ADC 4
6 #define AC97_RATES_SPDIF 5
8 +/* shared controllers */
10 + AC97_SHARED_TYPE_NONE,
11 + AC97_SHARED_TYPE_ICH,
12 + AC97_SHARED_TYPE_ATIIXP,
20 typedef struct _snd_ac97_bus ac97_bus_t;
21 +typedef struct _snd_ac97_bus_ops ac97_bus_ops_t;
22 +typedef struct _snd_ac97_template ac97_template_t;
23 typedef struct _snd_ac97 ac97_t;
27 int (*build_post_spdif) (ac97_t *ac97);
30 -struct _snd_ac97_bus {
31 - /* -- lowlevel (hardware) driver specific -- */
32 +struct _snd_ac97_bus_ops {
33 void (*reset) (ac97_t *ac97);
34 void (*write) (ac97_t *ac97, unsigned short reg, unsigned short val);
35 unsigned short (*read) (ac97_t *ac97, unsigned short reg);
36 void (*wait) (ac97_t *ac97);
37 void (*init) (ac97_t *ac97);
40 +struct _snd_ac97_bus {
41 + /* -- lowlevel (hardware) driver specific -- */
42 + ac97_bus_ops_t *ops;
44 void (*private_free) (ac97_bus_t *bus);
47 unsigned short num; /* bus number */
48 - unsigned short vra: 1, /* bridge supports VRA */
49 + unsigned short no_vra: 1, /* bridge doesn't support VRA */
50 isdin: 1;/* independent SDIN */
51 unsigned int clock; /* AC'97 base clock (usually 48000Hz) */
52 spinlock_t bus_lock; /* used mainly for slot allocation */
53 unsigned short used_slots[2][4]; /* actually used PCM slots */
54 unsigned short pcms_count; /* count of PCMs */
55 struct ac97_pcm *pcms;
56 + unsigned int shared_type; /* type of shared controller betwen audio and modem */
58 snd_info_entry_t *proc;
61 +struct _snd_ac97_template {
63 + void (*private_free) (ac97_t *ac97);
64 + struct pci_dev *pci; /* assigned PCI device - used for quirks */
65 + unsigned short num; /* number of codec: 0 = primary, 1 = secondary */
66 + unsigned short addr; /* physical address of codec [0-3] */
67 + unsigned int scaps; /* driver capabilities */
68 + unsigned int limited_regs; /* allow limited registers only */
69 + DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */
73 /* -- lowlevel (hardware) driver specific -- */
74 struct snd_ac97_build_ops * build_ops;
76 unsigned short subsystem_vendor;
77 unsigned short subsystem_device;
79 + struct semaphore mutex; /* mutex for AD18xx multi-codecs and paging (2.3) */
80 unsigned short num; /* number of codec: 0 = primary, 1 = secondary */
81 unsigned short addr; /* physical address of codec [0-3] */
82 unsigned int id; /* identification of codec */
84 unsigned short id[3]; // codec IDs (lower 16-bit word)
85 unsigned short pcmreg[3]; // PCM registers
86 unsigned short codec_cfg[3]; // CODEC_CFG bits
87 - struct semaphore mutex;
89 unsigned int dev_flags; /* device specific */
93 return (ac97->ext_id & AC97_EI_AMAP) != 0;
95 +static inline int ac97_can_spdif(ac97_t * ac97)
97 + return (ac97->ext_id & AC97_EI_SPDIF) != 0;
101 -int snd_ac97_bus(snd_card_t * card, ac97_bus_t * _bus, ac97_bus_t ** rbus); /* create new AC97 bus */
102 -int snd_ac97_mixer(ac97_bus_t * bus, ac97_t * _ac97, ac97_t ** rac97); /* create mixer controls */
103 +int snd_ac97_bus(snd_card_t *card, int num, ac97_bus_ops_t *ops, void *private_data, ac97_bus_t **rbus); /* create new AC97 bus */
104 +int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97); /* create mixer controls */
106 void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value);
107 unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg);
108 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/asound.h linux-libc-headers-2.6.8.0/include/sound/asound.h
109 --- linux-libc-headers-2.6.8.0.orig/include/sound/asound.h 2004-08-18 20:07:05.000000000 +0200
110 +++ linux-libc-headers-2.6.8.0/include/sound/asound.h 2004-08-20 08:04:48.263207224 +0200
112 #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
113 #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
114 #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
115 -#define SNDRV_PCM_INFO_NONATOMIC_OPS 0x00800000 /* non-atomic prepare callback */
116 +#define SNDRV_PCM_INFO_MMAP_IOMEM 0x01000000 /* mmap on IO memory */
118 enum sndrv_pcm_state {
119 SNDRV_PCM_STATE_OPEN = 0, /* stream is open */
120 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/control.h linux-libc-headers-2.6.8.0/include/sound/control.h
121 --- linux-libc-headers-2.6.8.0.orig/include/sound/control.h 2004-08-18 20:07:05.000000000 +0200
122 +++ linux-libc-headers-2.6.8.0/include/sound/control.h 2004-08-20 08:04:48.265206920 +0200
124 typedef enum sndrv_ctl_event_type snd_ctl_event_type_t;
125 typedef struct sndrv_ctl_event snd_ctl_event_t;
127 -#define _snd_kcontrol_chip(kcontrol) ((kcontrol)->private_data)
128 -#define snd_kcontrol_chip(kcontrol) snd_magic_cast1(chip_t, _snd_kcontrol_chip(kcontrol), return -ENXIO)
129 +#define snd_kcontrol_chip(kcontrol) ((kcontrol)->private_data)
131 typedef int (snd_kcontrol_info_t) (snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo);
132 typedef int (snd_kcontrol_get_t) (snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
133 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/cs46xx.h linux-libc-headers-2.6.8.0/include/sound/cs46xx.h
134 --- linux-libc-headers-2.6.8.0.orig/include/sound/cs46xx.h 2004-08-18 20:07:05.000000000 +0200
135 +++ linux-libc-headers-2.6.8.0/include/sound/cs46xx.h 2004-08-20 08:04:48.269206312 +0200
140 +#include "pcm-indirect.h"
142 #include "ac97_codec.h"
143 #include "cs46xx_dsp_spos.h"
144 @@ -1650,14 +1651,7 @@
147 unsigned int shift; /* Shift count to trasform frames in bytes */
148 - unsigned int sw_bufsize;
149 - unsigned int sw_data; /* Offset to next dst (or src) in sw ring buffer */
150 - unsigned int sw_io;
151 - int sw_ready; /* Bytes ready to be transferred to/from hw */
152 - unsigned int hw_data; /* Offset to next dst (or src) in hw ring buffer */
153 - unsigned int hw_io; /* Ring buffer hw pointer */
154 - int hw_ready; /* Bytes ready for play (or captured) in hw ring buffer */
155 - size_t appl_ptr; /* Last seen appl_ptr */
156 + snd_pcm_indirect_t pcm_rec;
157 snd_pcm_substream_t *substream;
159 pcm_channel_descriptor_t * pcm_channel;
160 @@ -1695,14 +1689,7 @@
163 unsigned int shift; /* Shift count to trasform frames in bytes */
164 - unsigned int sw_bufsize;
165 - unsigned int sw_data; /* Offset to next dst (or src) in sw ring buffer */
166 - unsigned int sw_io;
167 - int sw_ready; /* Bytes ready to be transferred to/from hw */
168 - unsigned int hw_data; /* Offset to next dst (or src) in hw ring buffer */
169 - unsigned int hw_io; /* Ring buffer hw pointer */
170 - int hw_ready; /* Bytes ready for play (or captured) in hw ring buffer */
171 - size_t appl_ptr; /* Last seen appl_ptr */
172 + snd_pcm_indirect_t pcm_rec;
173 snd_pcm_substream_t *substream;
176 @@ -1723,8 +1710,6 @@
180 - struct snd_dma_device dma_dev;
183 void (*amplifier_ctrl)(cs46xx_t *, int);
184 void (*active_ctrl)(cs46xx_t *, int);
185 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/emu10k1.h linux-libc-headers-2.6.8.0/include/sound/emu10k1.h
186 --- linux-libc-headers-2.6.8.0.orig/include/sound/emu10k1.h 2004-08-18 20:07:05.000000000 +0200
187 +++ linux-libc-headers-2.6.8.0/include/sound/emu10k1.h 2004-08-20 08:04:48.272205856 +0200
197 #define FXBUS_PCM_RIGHT_FRONT 0x09
198 #define FXBUS_MIDI_REVERB 0x0c
199 #define FXBUS_MIDI_CHORUS 0x0d
200 +#define FXBUS_PCM_LEFT_SIDE 0x0e
201 +#define FXBUS_PCM_RIGHT_SIDE 0x0f
202 #define FXBUS_PT_LEFT 0x14
203 #define FXBUS_PT_RIGHT 0x15
206 #define A_EXTOUT_AFRONT_R 0x09 /* right */
207 #define A_EXTOUT_ACENTER 0x0a /* analog center */
208 #define A_EXTOUT_ALFE 0x0b /* analog LFE */
211 +#define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */
212 +#define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */
213 #define A_EXTOUT_AREAR_L 0x0e /* analog rear left */
214 #define A_EXTOUT_AREAR_R 0x0f /* right */
215 #define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */
216 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/es1688.h linux-libc-headers-2.6.8.0/include/sound/es1688.h
217 --- linux-libc-headers-2.6.8.0.orig/include/sound/es1688.h 2004-08-18 20:07:05.000000000 +0200
218 +++ linux-libc-headers-2.6.8.0/include/sound/es1688.h 2004-08-20 08:04:48.274205552 +0200
221 typedef struct _snd_es1688 es1688_t;
223 -#define chip_t es1688_t
227 #define ES1688P(codec, x) ((codec)->port + e_s_s_ESS1688##x)
228 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/info.h linux-libc-headers-2.6.8.0/include/sound/info.h
229 --- linux-libc-headers-2.6.8.0.orig/include/sound/info.h 2004-08-18 20:16:07.000000000 +0200
230 +++ linux-libc-headers-2.6.8.0/include/sound/info.h 2004-08-20 08:04:48.277205096 +0200
233 extern int snd_info_check_reserved_words(const char *str);
235 -#ifdef CONFIG_SND_OSSEMUL
236 +#if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
237 extern int snd_info_minor_register(void);
238 extern int snd_info_minor_unregister(void);
240 +#define snd_info_minor_register() /* NOP */
241 +#define snd_info_minor_unregister() /* NOP */
245 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/initval.h linux-libc-headers-2.6.8.0/include/sound/initval.h
246 --- linux-libc-headers-2.6.8.0.orig/include/sound/initval.h 2004-08-18 20:07:05.000000000 +0200
247 +++ linux-libc-headers-2.6.8.0/include/sound/initval.h 2004-08-20 08:04:48.279204792 +0200
252 -#ifndef MODULE_GENERIC_STRING
254 -#define MODULE_GENERIC_STRING(name, string) \
255 -static const char __module_generic_string_##name [] \
256 - __attribute__ ((unused, __section__(".modstring"))) = #name "=" string;
258 -#define MODULE_GENERIC_STRING(name, string)
262 -#define MODULE_CLASSES(val) MODULE_GENERIC_STRING(info_classes, val)
263 -#define MODULE_DEVICES(val) MODULE_GENERIC_STRING(info_devices, val)
264 -#define MODULE_PARM_SYNTAX(id, val) MODULE_GENERIC_STRING(info_parm_##id, val)
266 #define SNDRV_AUTO_PORT 1
267 #define SNDRV_AUTO_IRQ 0xffff
268 #define SNDRV_AUTO_DMA 0xffff
270 #define SNDRV_DEFAULT_DMA_SIZE { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE }
271 #define SNDRV_DEFAULT_PTR SNDRV_DEFAULT_STR
273 -#define SNDRV_BOOLEAN_TRUE_DESC "allows:{{0,Disabled},{1,Enabled}},default:1,dialog:check"
274 -#define SNDRV_BOOLEAN_FALSE_DESC "allows:{{0,Disabled},{1,Enabled}},default:0,dialog:check"
276 -#define SNDRV_ENABLED "enable:(enable)"
278 -#define SNDRV_INDEX_DESC SNDRV_ENABLED ",allows:{{0,7}},unique,skill:required,dialog:list"
279 -#define SNDRV_ID_DESC SNDRV_ENABLED ",unique"
280 -#define SNDRV_ENABLE_DESC SNDRV_BOOLEAN_FALSE_DESC
281 -#define SNDRV_ISAPNP_DESC SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC
282 -#define SNDRV_DMA8_DESC SNDRV_ENABLED ",allows:{{0,1},{3}},dialog:list"
283 -#define SNDRV_DMA16_DESC SNDRV_ENABLED ",allows:{{5,7}},dialog:list"
284 -#define SNDRV_DMA_DESC SNDRV_ENABLED ",allows:{{0,1},{3},{5,7}},dialog:list"
285 -#define SNDRV_IRQ_DESC SNDRV_ENABLED ",allows:{{5},{7},{9},{10,12},{14,15}},dialog:list"
286 -#define SNDRV_DMA_SIZE_DESC SNDRV_ENABLED ",allows:{{4,128}},default:64,skill:advanced"
287 -#define SNDRV_DMA8_SIZE_DESC SNDRV_ENABLED ",allows:{{4, 64}},default:64,skill:advanced"
288 -#define SNDRV_DMA16_SIZE_DESC SNDRV_ENABLED ",allows:{{4,128}},default:64,skill:advanced"
289 -#define SNDRV_PORT12_DESC SNDRV_ENABLED ",allows:{{0,0x3fff}},base:16"
290 -#define SNDRV_PORT_DESC SNDRV_ENABLED ",allows:{{0,0xffff}},base:16"
292 #ifdef SNDRV_LEGACY_AUTO_PROBE
293 static int snd_legacy_auto_probe(unsigned long *ports, int (*probe)(unsigned long port))
295 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/memalloc.h linux-libc-headers-2.6.8.0/include/sound/memalloc.h
296 --- linux-libc-headers-2.6.8.0.orig/include/sound/memalloc.h 2004-08-18 20:07:05.000000000 +0200
297 +++ linux-libc-headers-2.6.8.0/include/sound/memalloc.h 2004-08-20 08:04:48.281204488 +0200
301 struct snd_dma_device {
302 - int type; /* SNDRV_MEM_TYPE_XXX */
303 + int type; /* SNDRV_DMA_TYPE_XXX */
304 struct device *dev; /* generic device */
305 - unsigned int id; /* a unique ID */
308 #ifndef snd_dma_pci_data
310 * info for buffer allocation
312 struct snd_dma_buffer {
313 + struct snd_dma_device dev; /* device type */
314 unsigned char *area; /* virtual pointer */
315 dma_addr_t addr; /* physical address */
316 size_t bytes; /* buffer size in bytes */
318 int tblsize; /* allocated table size */
319 struct snd_sg_page *table; /* address table */
320 struct page **page_table; /* page table (for vmap/vunmap) */
321 - struct snd_dma_device dev;
322 + struct device *dev;
329 /* allocate/release a buffer */
330 -int snd_dma_alloc_pages(const struct snd_dma_device *dev, size_t size,
331 +int snd_dma_alloc_pages(int type, struct device *dev, size_t size,
332 struct snd_dma_buffer *dmab);
333 -int snd_dma_alloc_pages_fallback(const struct snd_dma_device *dev, size_t size,
334 +int snd_dma_alloc_pages_fallback(int type, struct device *dev, size_t size,
335 struct snd_dma_buffer *dmab);
336 -void snd_dma_free_pages(const struct snd_dma_device *dev, struct snd_dma_buffer *dmab);
337 +void snd_dma_free_pages(struct snd_dma_buffer *dmab);
339 /* buffer-preservation managements */
340 -size_t snd_dma_get_reserved(const struct snd_dma_device *dev, struct snd_dma_buffer *dmab);
341 -int snd_dma_free_reserved(const struct snd_dma_device *dev);
342 -int snd_dma_set_reserved(const struct snd_dma_device *dev, struct snd_dma_buffer *dmab);
344 +#define snd_dma_pci_buf_id(pci) (((unsigned int)(pci)->vendor << 16) | (pci)->device)
346 +size_t snd_dma_get_reserved_buf(struct snd_dma_buffer *dmab, unsigned int id);
347 +int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id);
349 /* basic memory allocation functions */
350 void *snd_malloc_pages(size_t size, unsigned int gfp_flags);
351 -void *snd_malloc_pages_fallback(size_t size, unsigned int gfp_flags, size_t *res_size);
352 void snd_free_pages(void *ptr, size_t size);
354 #endif /* __SOUND_MEMALLOC_H */
355 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/pcm.h linux-libc-headers-2.6.8.0/include/sound/pcm.h
356 --- linux-libc-headers-2.6.8.0.orig/include/sound/pcm.h 2004-08-18 20:07:05.000000000 +0200
357 +++ linux-libc-headers-2.6.8.0/include/sound/pcm.h 2004-08-20 08:04:48.286203728 +0200
359 typedef struct sndrv_mask snd_mask_t;
360 typedef struct snd_sg_buf snd_pcm_sgbuf_t;
362 -#define _snd_pcm_substream_chip(substream) ((substream)->private_data)
363 -#define snd_pcm_substream_chip(substream) snd_magic_cast1(chip_t, _snd_pcm_substream_chip(substream), return -ENXIO)
364 -#define _snd_pcm_chip(pcm) ((pcm)->private_data)
365 -#define snd_pcm_chip(pcm) snd_magic_cast1(chip_t, _snd_pcm_chip(pcm), return -ENXIO)
366 +#define snd_pcm_substream_chip(substream) ((substream)->private_data)
367 +#define snd_pcm_chip(pcm) ((pcm)->private_data)
369 typedef struct _snd_pcm_file snd_pcm_file_t;
370 typedef struct _snd_pcm_runtime snd_pcm_runtime_t;
372 #define SNDRV_PCM_TRIGGER_SUSPEND 5
373 #define SNDRV_PCM_TRIGGER_RESUME 6
375 +#define SNDRV_PCM_POS_XRUN ((snd_pcm_uframes_t)-1)
377 /* If you change this don't forget to change rates[] table in pcm_native.c */
378 #define SNDRV_PCM_RATE_5512 (1<<0) /* 5512Hz */
379 #define SNDRV_PCM_RATE_8000 (1<<1) /* 8000Hz */
381 unsigned char *dma_area; /* DMA area */
382 dma_addr_t dma_addr; /* physical bus address (not accessible from main CPU) */
383 size_t dma_bytes; /* size of DMA area */
384 - void *dma_private; /* private DMA data for the memory allocator */
386 + struct snd_dma_buffer *dma_buffer_p; /* allocated buffer */
388 #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
389 /* -- OSS things -- */
391 char name[32]; /* substream name */
392 int stream; /* stream (direction) */
393 size_t buffer_bytes_max; /* limit ring buffer size */
394 - struct snd_dma_device dma_device;
395 struct snd_dma_buffer dma_buffer;
396 + unsigned int dma_buf_id;
398 /* -- hardware operations -- */
399 unsigned int open_flag: 1; /* lowlevel device has been opened */
401 int snd_pcm_format_big_endian(snd_pcm_format_t format);
402 int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */
403 int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
404 -u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
405 +const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format);
406 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames);
407 snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian);
408 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
410 void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream);
411 void snd_pcm_period_elapsed(snd_pcm_substream_t *substream);
412 snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream,
413 - const void *buf, snd_pcm_uframes_t frames);
415 + snd_pcm_uframes_t frames);
416 snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream,
417 void *buf, snd_pcm_uframes_t frames);
418 snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream,
421 int snd_pcm_limit_hw_rates(snd_pcm_runtime_t *runtime);
423 +static inline void snd_pcm_set_runtime_buffer(snd_pcm_substream_t *substream,
424 + struct snd_dma_buffer *bufp)
426 + snd_pcm_runtime_t *runtime = substream->runtime;
428 + runtime->dma_buffer_p = bufp;
429 + runtime->dma_area = bufp->area;
430 + runtime->dma_addr = bufp->addr;
431 + runtime->dma_bytes = bufp->bytes;
433 + runtime->dma_buffer_p = NULL;
434 + runtime->dma_area = NULL;
435 + runtime->dma_addr = 0;
436 + runtime->dma_bytes = 0;
443 int snd_pcm_lib_malloc_pages(snd_pcm_substream_t *substream, size_t size);
444 int snd_pcm_lib_free_pages(snd_pcm_substream_t *substream);
446 -#define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_private)
447 +#define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_buffer_p->private_data)
448 #define snd_pcm_sgbuf_pages(size) snd_sgbuf_aligned_pages(size)
449 #define snd_pcm_sgbuf_get_addr(sgbuf,ofs) snd_sgbuf_get_addr(sgbuf,ofs)
450 struct page *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset);
451 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/pcm-indirect.h linux-libc-headers-2.6.8.0/include/sound/pcm-indirect.h
452 --- linux-libc-headers-2.6.8.0.orig/include/sound/pcm-indirect.h 1970-01-01 01:00:00.000000000 +0100
453 +++ linux-libc-headers-2.6.8.0/include/sound/pcm-indirect.h 2004-08-20 08:04:48.288203424 +0200
456 + * Helper functions for indirect PCM data transfer
458 + * Copyright (c) by Takashi Iwai <tiwai@suse.de>
459 + * Jaroslav Kysela <perex@suse.cz>
461 + * This program is free software; you can redistribute it and/or modify
462 + * it under the terms of the GNU General Public License as published by
463 + * the Free Software Foundation; either version 2 of the License, or
464 + * (at your option) any later version.
466 + * This program is distributed in the hope that it will be useful,
467 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
468 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
469 + * GNU General Public License for more details.
471 + * You should have received a copy of the GNU General Public License
472 + * along with this program; if not, write to the Free Software
473 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
476 +#ifndef __SOUND_PCM_INDIRECT_H
477 +#define __SOUND_PCM_INDIRECT_H
479 +#include <sound/pcm.h>
481 +typedef struct sndrv_pcm_indirect {
482 + unsigned int hw_buffer_size; /* Byte size of hardware buffer */
483 + unsigned int hw_queue_size; /* Max queue size of hw buffer (0 = buffer size) */
484 + unsigned int hw_data; /* Offset to next dst (or src) in hw ring buffer */
485 + unsigned int hw_io; /* Ring buffer hw pointer */
486 + int hw_ready; /* Bytes ready for play (or captured) in hw ring buffer */
487 + unsigned int sw_buffer_size; /* Byte size of software buffer */
488 + unsigned int sw_data; /* Offset to next dst (or src) in sw ring buffer */
489 + unsigned int sw_io; /* Current software pointer in bytes */
490 + int sw_ready; /* Bytes ready to be transferred to/from hw */
491 + snd_pcm_uframes_t appl_ptr; /* Last seen appl_ptr */
492 +} snd_pcm_indirect_t;
494 +typedef void (*snd_pcm_indirect_copy_t)(snd_pcm_substream_t *substream,
495 + snd_pcm_indirect_t *rec, size_t bytes);
498 + * helper function for playback ack callback
501 +snd_pcm_indirect_playback_transfer(snd_pcm_substream_t *substream,
502 + snd_pcm_indirect_t *rec,
503 + snd_pcm_indirect_copy_t copy)
505 + snd_pcm_runtime_t *runtime = substream->runtime;
506 + snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr;
507 + snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr;
511 + if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2))
512 + diff += runtime->boundary;
513 + rec->sw_ready += (int)frames_to_bytes(runtime, diff);
514 + rec->appl_ptr = appl_ptr;
516 + qsize = rec->hw_queue_size ? rec->hw_queue_size : rec->hw_buffer_size;
517 + while (rec->hw_ready < qsize && rec->sw_ready > 0) {
518 + unsigned int hw_to_end = rec->hw_buffer_size - rec->hw_data;
519 + unsigned int sw_to_end = rec->sw_buffer_size - rec->sw_data;
520 + unsigned int bytes = qsize - rec->hw_ready;
521 + if (rec->sw_ready < (int)bytes)
522 + bytes = rec->sw_ready;
523 + if (hw_to_end < bytes)
525 + if (sw_to_end < bytes)
529 + copy(substream, rec, bytes);
530 + rec->hw_data += bytes;
531 + if (rec->hw_data == rec->hw_buffer_size)
533 + rec->sw_data += bytes;
534 + if (rec->sw_data == rec->sw_buffer_size)
536 + rec->hw_ready += bytes;
537 + rec->sw_ready -= bytes;
542 + * helper function for playback pointer callback
543 + * ptr = current byte pointer
545 +static inline snd_pcm_uframes_t
546 +snd_pcm_indirect_playback_pointer(snd_pcm_substream_t *substream,
547 + snd_pcm_indirect_t *rec, unsigned int ptr)
549 + int bytes = ptr - rec->hw_io;
551 + bytes += rec->hw_buffer_size;
553 + rec->hw_ready -= bytes;
554 + rec->sw_io += bytes;
555 + if (rec->sw_io >= rec->sw_buffer_size)
556 + rec->sw_io -= rec->sw_buffer_size;
557 + if (substream->ops->ack)
558 + substream->ops->ack(substream);
559 + return bytes_to_frames(substream->runtime, rec->sw_io);
564 + * helper function for capture ack callback
567 +snd_pcm_indirect_capture_transfer(snd_pcm_substream_t *substream,
568 + snd_pcm_indirect_t *rec,
569 + snd_pcm_indirect_copy_t copy)
571 + snd_pcm_runtime_t *runtime = substream->runtime;
572 + snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr;
573 + snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr;
576 + if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2))
577 + diff += runtime->boundary;
578 + rec->sw_ready -= frames_to_bytes(runtime, diff);
579 + rec->appl_ptr = appl_ptr;
581 + while (rec->hw_ready > 0 &&
582 + rec->sw_ready < (int)rec->sw_buffer_size) {
583 + size_t hw_to_end = rec->hw_buffer_size - rec->hw_data;
584 + size_t sw_to_end = rec->sw_buffer_size - rec->sw_data;
585 + size_t bytes = rec->sw_buffer_size - rec->sw_ready;
586 + if (rec->hw_ready < (int)bytes)
587 + bytes = rec->hw_ready;
588 + if (hw_to_end < bytes)
590 + if (sw_to_end < bytes)
594 + copy(substream, rec, bytes);
595 + rec->hw_data += bytes;
596 + if ((int)rec->hw_data == rec->hw_buffer_size)
598 + rec->sw_data += bytes;
599 + if (rec->sw_data == rec->sw_buffer_size)
601 + rec->hw_ready -= bytes;
602 + rec->sw_ready += bytes;
607 + * helper function for capture pointer callback,
608 + * ptr = current byte pointer
610 +static inline snd_pcm_uframes_t
611 +snd_pcm_indirect_capture_pointer(snd_pcm_substream_t *substream,
612 + snd_pcm_indirect_t *rec, unsigned int ptr)
615 + int bytes = ptr - rec->hw_io;
617 + bytes += rec->hw_buffer_size;
619 + rec->hw_ready += bytes;
620 + qsize = rec->hw_queue_size ? rec->hw_queue_size : rec->hw_buffer_size;
621 + if (rec->hw_ready > qsize)
622 + return SNDRV_PCM_POS_XRUN;
623 + rec->sw_io += bytes;
624 + if (rec->sw_io >= rec->sw_buffer_size)
625 + rec->sw_io -= rec->sw_buffer_size;
626 + if (substream->ops->ack)
627 + substream->ops->ack(substream);
628 + return bytes_to_frames(substream->runtime, rec->sw_io);
631 +#endif /* __SOUND_PCM_INDIRECT_H */
632 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/sb16_csp.h linux-libc-headers-2.6.8.0/include/sound/sb16_csp.h
633 --- linux-libc-headers-2.6.8.0.orig/include/sound/sb16_csp.h 2004-08-18 20:07:05.000000000 +0200
634 +++ linux-libc-headers-2.6.8.0/include/sound/sb16_csp.h 2004-08-20 08:04:48.290203120 +0200
636 /* restart CSP and DMA transfer */
637 #define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16)
640 #endif /* __SOUND_SB16_CSP */
641 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/seq_kernel.h linux-libc-headers-2.6.8.0/include/sound/seq_kernel.h
642 --- linux-libc-headers-2.6.8.0.orig/include/sound/seq_kernel.h 2004-08-18 20:07:05.000000000 +0200
643 +++ linux-libc-headers-2.6.8.0/include/sound/seq_kernel.h 2004-08-20 08:04:48.292202816 +0200
645 int snd_seq_expand_var_event(const snd_seq_event_t *event, int count, char *buf, int in_kernel, int size_aligned);
646 int snd_seq_dump_var_event(const snd_seq_event_t *event, snd_seq_dump_func_t func, void *private_data);
648 +/* interface for OSS emulation */
649 +int snd_seq_set_queue_tempo(int client, snd_seq_queue_tempo_t *tempo);
651 /* port callback routines */
652 void snd_port_init_callback(snd_seq_port_callback_t *p);
653 snd_seq_port_callback_t *snd_port_alloc_callback(void);
654 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/soundfont.h linux-libc-headers-2.6.8.0/include/sound/soundfont.h
655 --- linux-libc-headers-2.6.8.0.orig/include/sound/soundfont.h 2004-08-18 20:07:05.000000000 +0200
656 +++ linux-libc-headers-2.6.8.0/include/sound/soundfont.h 2004-08-20 08:04:48.293202664 +0200
658 int zone_locked; /* locked time for zone */
659 int sample_locked; /* locked time for sample */
660 snd_sf_callback_t callback; /* callback functions */
661 + int presets_locked;
662 struct semaphore presets_mutex;
664 snd_util_memhdr_t *memhdr;
665 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/timer.h linux-libc-headers-2.6.8.0/include/sound/timer.h
666 --- linux-libc-headers-2.6.8.0.orig/include/sound/timer.h 2004-08-18 20:07:05.000000000 +0200
667 +++ linux-libc-headers-2.6.8.0/include/sound/timer.h 2004-08-20 08:04:48.295202360 +0200
669 typedef struct sndrv_timer_read snd_timer_read_t;
670 typedef struct sndrv_timer_tread snd_timer_tread_t;
672 -#define _snd_timer_chip(timer) ((timer)->private_data)
673 -#define snd_timer_chip(timer) snd_magic_cast1(chip_t, _snd_timer_chip(timer), return -ENXIO)
674 +#define snd_timer_chip(timer) ((timer)->private_data)
676 #define SNDRV_TIMER_DEVICES 16
678 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/trident.h linux-libc-headers-2.6.8.0/include/sound/trident.h
679 --- linux-libc-headers-2.6.8.0.orig/include/sound/trident.h 2004-08-18 20:07:05.000000000 +0200
680 +++ linux-libc-headers-2.6.8.0/include/sound/trident.h 2004-08-20 08:04:48.305200840 +0200
682 unsigned char bDMAStart;
685 - struct resource *res_port;
686 unsigned long midi_port;
688 unsigned int spurious_irq_count;
689 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/version.h linux-libc-headers-2.6.8.0/include/sound/version.h
690 --- linux-libc-headers-2.6.8.0.orig/include/sound/version.h 2004-08-18 20:07:05.000000000 +0200
691 +++ linux-libc-headers-2.6.8.0/include/sound/version.h 2004-08-20 08:04:48.307200536 +0200
693 /* include/version.h. Generated by configure. */
694 -#define CONFIG_SND_VERSION "1.0.4"
695 -#define CONFIG_SND_DATE " (Mon May 17 14:31:44 2004 UTC)"
696 +#define CONFIG_SND_VERSION "1.0.6"
697 +#define CONFIG_SND_DATE " (Sun Aug 15 07:17:53 2004 UTC)"
698 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/vx_core.h linux-libc-headers-2.6.8.0/include/sound/vx_core.h
699 --- linux-libc-headers-2.6.8.0.orig/include/sound/vx_core.h 2004-08-18 20:07:05.000000000 +0200
700 +++ linux-libc-headers-2.6.8.0/include/sound/vx_core.h 2004-08-20 08:04:48.309200232 +0200
702 /* clock and audio sources */
703 unsigned int audio_source; /* current audio input source */
704 unsigned int audio_source_target;
705 + unsigned int clock_mode; /* clock mode (VX_CLOCK_MODE_XXX) */
706 unsigned int clock_source; /* current clock source (INTERNAL_QUARTZ or UER_SYNC) */
707 unsigned int freq; /* current frequency */
708 unsigned int freq_detected; /* detected frequency from digital in */
715 + VX_CLOCK_MODE_AUTO, /* depending on the current audio source */
716 + VX_CLOCK_MODE_INTERNAL, /* fixed to internal quartz */
717 + VX_CLOCK_MODE_EXTERNAL /* fixed to UER sync */
722 VX_UER_MODE_CONSUMER,
723 diff -uNr linux-libc-headers-2.6.8.0.orig/include/sound/ymfpci.h linux-libc-headers-2.6.8.0/include/sound/ymfpci.h
724 --- linux-libc-headers-2.6.8.0.orig/include/sound/ymfpci.h 2004-08-18 20:07:05.000000000 +0200
725 +++ linux-libc-headers-2.6.8.0/include/sound/ymfpci.h 2004-08-20 08:04:48.311199928 +0200
727 struct gameport gameport;
730 - struct snd_dma_device dma_dev;
731 struct snd_dma_buffer work_ptr;
733 unsigned int bank_size_playback;