Changeset 777 for GPL/trunk/alsa-kernel/include/sound/pcm.h
- Timestamp:
- Apr 21, 2025, 7:17:25 PM (4 months ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-exp merged: 766-767,770-771,773-774
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/include/sound/pcm.h
r772 r777 33 33 unsigned int info; /* SNDRV_PCM_INFO_* */ 34 34 u64 formats; /* SNDRV_PCM_FMTBIT_* */ 35 u32 subformats; /* for S32_LE, SNDRV_PCM_SUBFMTBIT_* */ 35 36 unsigned int rates; /* SNDRV_PCM_RATE_* */ 36 37 unsigned int rate_min; /* min rate */ … … 97 98 /* 3 is absent slot. */ 98 99 #define SNDRV_PCM_IOCTL1_FIFO_SIZE 4 100 #define SNDRV_PCM_IOCTL1_SYNC_ID 5 99 101 100 102 #define SNDRV_PCM_TRIGGER_STOP 0 … … 124 126 #define SNDRV_PCM_RATE_352800 (1U<<13) /* 352800Hz */ 125 127 #define SNDRV_PCM_RATE_384000 (1U<<14) /* 384000Hz */ 128 #define SNDRV_PCM_RATE_705600 (1U<<15) /* 705600Hz */ 129 #define SNDRV_PCM_RATE_768000 (1U<<16) /* 768000Hz */ 130 /* extended rates since 6.12 */ 131 #define SNDRV_PCM_RATE_12000 (1U<<17) /* 12000Hz */ 132 #define SNDRV_PCM_RATE_24000 (1U<<18) /* 24000Hz */ 133 #define SNDRV_PCM_RATE_128000 (1U<<19) /* 128000Hz */ 126 134 127 135 #define SNDRV_PCM_RATE_CONTINUOUS (1U<<30) /* continuous range */ 128 #define SNDRV_PCM_RATE_KNOT (1U<<31) /* supports more non-continuo s rates */136 #define SNDRV_PCM_RATE_KNOT (1U<<31) /* supports more non-continuous rates */ 129 137 130 138 #define SNDRV_PCM_RATE_8000_44100 (SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_11025|\ … … 139 147 SNDRV_PCM_RATE_352800|\ 140 148 SNDRV_PCM_RATE_384000) 149 #define SNDRV_PCM_RATE_8000_768000 (SNDRV_PCM_RATE_8000_384000|\ 150 SNDRV_PCM_RATE_705600|\ 151 SNDRV_PCM_RATE_768000) 141 152 #define _SNDRV_PCM_FMTBIT(fmt) (1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt) 142 153 #define SNDRV_PCM_FMTBIT_S8 _SNDRV_PCM_FMTBIT(S8) … … 222 233 #endif 223 234 235 #define _SNDRV_PCM_SUBFMTBIT(fmt) BIT((__force int)SNDRV_PCM_SUBFORMAT_##fmt) 236 #define SNDRV_PCM_SUBFMTBIT_STD _SNDRV_PCM_SUBFMTBIT(STD) 237 #define SNDRV_PCM_SUBFMTBIT_MSBITS_MAX _SNDRV_PCM_SUBFMTBIT(MSBITS_MAX) 238 #define SNDRV_PCM_SUBFMTBIT_MSBITS_20 _SNDRV_PCM_SUBFMTBIT(MSBITS_20) 239 #define SNDRV_PCM_SUBFMTBIT_MSBITS_24 _SNDRV_PCM_SUBFMTBIT(MSBITS_24) 240 224 241 struct snd_pcm_file { 225 242 struct snd_pcm_substream *substream; … … 394 411 snd_pcm_uframes_t silence_filled; /* already filled part of silence area */ 395 412 396 union snd_pcm_sync_id sync; /* hardware synchronizationID */413 bool std_sync_id; /* hardware synchronization - standard per card ID */ 397 414 398 415 /* -- mmap -- */ … … 490 507 unsigned int hw_opened: 1; 491 508 unsigned int managed_buffer_alloc:1; 509 #ifdef CONFIG_SND_PCM_XRUN_DEBUG 510 unsigned int xrun_counter; /* number of times xrun happens */ 511 #endif /* CONFIG_SND_PCM_XRUN_DEBUG */ 492 512 }; 493 513 … … 663 683 flags = _snd_pcm_stream_lock_irqsave_nested(substream); \ 664 684 } while (0) 685 686 #ifndef TARGET_OS2 687 /* definitions for guard(); use like guard(pcm_stream_lock) */ 688 DEFINE_LOCK_GUARD_1(pcm_stream_lock, struct snd_pcm_substream, 689 snd_pcm_stream_lock(_T->lock), 690 snd_pcm_stream_unlock(_T->lock)) 691 DEFINE_LOCK_GUARD_1(pcm_stream_lock_irq, struct snd_pcm_substream, 692 snd_pcm_stream_lock_irq(_T->lock), 693 snd_pcm_stream_unlock_irq(_T->lock)) 694 DEFINE_LOCK_GUARD_1(pcm_stream_lock_irqsave, struct snd_pcm_substream, 695 snd_pcm_stream_lock_irqsave(_T->lock, _T->flags), 696 snd_pcm_stream_unlock_irqrestore(_T->lock, _T->flags), 697 unsigned long flags) 698 #endif 665 699 666 700 /** … … 1156 1190 void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, 1157 1191 const struct snd_pcm_ops *ops); 1158 void snd_pcm_set_sync(struct snd_pcm_substream *substream); 1192 void snd_pcm_set_sync_per_card(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, 1193 const unsigned char *id, unsigned int len); 1194 /** 1195 * snd_pcm_set_sync - set the PCM sync id 1196 * @substream: the pcm substream 1197 * 1198 * Use the default PCM sync identifier for the specific card. 1199 */ 1200 static inline void snd_pcm_set_sync(struct snd_pcm_substream *substream) 1201 { 1202 substream->runtime->std_sync_id = true; 1203 } 1159 1204 int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, 1160 1205 unsigned int cmd, void *arg); … … 1342 1387 { 1343 1388 return snd_pcm_set_managed_buffer_all(pcm, type, data, size, 0); 1344 }1345 1346 int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream,1347 size_t size, gfp_t gfp_flags);1348 int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream);1349 struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream,1350 unsigned long offset);1351 /**1352 * snd_pcm_lib_alloc_vmalloc_buffer - allocate virtual DMA buffer1353 * @substream: the substream to allocate the buffer to1354 * @size: the requested buffer size, in bytes1355 *1356 * Allocates the PCM substream buffer using vmalloc(), i.e., the memory is1357 * contiguous in kernel virtual space, but not in physical memory. Use this1358 * if the buffer is accessed by kernel code but not by device DMA.1359 *1360 * Return: 1 if the buffer was changed, 0 if not changed, or a negative error1361 * code.1362 */1363 static inline int snd_pcm_lib_alloc_vmalloc_buffer1364 (struct snd_pcm_substream *substream, size_t size)1365 {1366 return _snd_pcm_lib_alloc_vmalloc_buffer(substream, size,1367 GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO);1368 }1369 1370 /**1371 * snd_pcm_lib_alloc_vmalloc_32_buffer - allocate 32-bit-addressable buffer1372 * @substream: the substream to allocate the buffer to1373 * @size: the requested buffer size, in bytes1374 *1375 * This function works like snd_pcm_lib_alloc_vmalloc_buffer(), but uses1376 * vmalloc_32(), i.e., the pages are allocated from 32-bit-addressable memory.1377 *1378 * Return: 1 if the buffer was changed, 0 if not changed, or a negative error1379 * code.1380 */1381 static inline int snd_pcm_lib_alloc_vmalloc_32_buffer1382 (struct snd_pcm_substream *substream, size_t size)1383 {1384 return _snd_pcm_lib_alloc_vmalloc_buffer(substream, size,1385 GFP_KERNEL | GFP_DMA32 | __GFP_ZERO);1386 1389 } 1387 1390
Note:
See TracChangeset
for help on using the changeset viewer.