Ignore:
Timestamp:
Apr 21, 2025, 7:17:25 PM (4 months ago)
Author:
David Azarewicz
Message:

Merge from uniaud32-exp branch

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/include/sound/pcm.h

    r772 r777  
    3333        unsigned int info;              /* SNDRV_PCM_INFO_* */
    3434        u64 formats;                    /* SNDRV_PCM_FMTBIT_* */
     35        u32 subformats;                 /* for S32_LE, SNDRV_PCM_SUBFMTBIT_* */
    3536        unsigned int rates;             /* SNDRV_PCM_RATE_* */
    3637        unsigned int rate_min;          /* min rate */
     
    9798/* 3 is absent slot. */
    9899#define SNDRV_PCM_IOCTL1_FIFO_SIZE      4
     100#define SNDRV_PCM_IOCTL1_SYNC_ID        5
    99101
    100102#define SNDRV_PCM_TRIGGER_STOP          0
     
    124126#define SNDRV_PCM_RATE_352800           (1U<<13)        /* 352800Hz */
    125127#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 */
    126134
    127135#define SNDRV_PCM_RATE_CONTINUOUS       (1U<<30)        /* continuous range */
    128 #define SNDRV_PCM_RATE_KNOT             (1U<<31)        /* supports more non-continuos rates */
     136#define SNDRV_PCM_RATE_KNOT             (1U<<31)        /* supports more non-continuous rates */
    129137
    130138#define SNDRV_PCM_RATE_8000_44100       (SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_11025|\
     
    139147                                         SNDRV_PCM_RATE_352800|\
    140148                                         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)
    141152#define _SNDRV_PCM_FMTBIT(fmt)          (1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt)
    142153#define SNDRV_PCM_FMTBIT_S8             _SNDRV_PCM_FMTBIT(S8)
     
    222233#endif
    223234
     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
    224241struct snd_pcm_file {
    225242        struct snd_pcm_substream *substream;
     
    394411        snd_pcm_uframes_t silence_filled; /* already filled part of silence area */
    395412
    396         union snd_pcm_sync_id sync;     /* hardware synchronization ID */
     413        bool std_sync_id;               /* hardware synchronization - standard per card ID */
    397414
    398415        /* -- mmap -- */
     
    490507        unsigned int hw_opened: 1;
    491508        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 */
    492512};
    493513
     
    663683                flags = _snd_pcm_stream_lock_irqsave_nested(substream); \
    664684        } while (0)
     685
     686#ifndef TARGET_OS2
     687/* definitions for guard(); use like guard(pcm_stream_lock) */
     688DEFINE_LOCK_GUARD_1(pcm_stream_lock, struct snd_pcm_substream,
     689                    snd_pcm_stream_lock(_T->lock),
     690                    snd_pcm_stream_unlock(_T->lock))
     691DEFINE_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))
     694DEFINE_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
    665699
    666700/**
     
    11561190void snd_pcm_set_ops(struct snd_pcm * pcm, int direction,
    11571191                     const struct snd_pcm_ops *ops);
    1158 void snd_pcm_set_sync(struct snd_pcm_substream *substream);
     1192void 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 */
     1200static inline void snd_pcm_set_sync(struct snd_pcm_substream *substream)
     1201{
     1202        substream->runtime->std_sync_id = true;
     1203}
    11591204int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
    11601205                      unsigned int cmd, void *arg);                     
     
    13421387{
    13431388        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 buffer
    1353  * @substream: the substream to allocate the buffer to
    1354  * @size: the requested buffer size, in bytes
    1355  *
    1356  * Allocates the PCM substream buffer using vmalloc(), i.e., the memory is
    1357  * contiguous in kernel virtual space, but not in physical memory.  Use this
    1358  * 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 error
    1361  * code.
    1362  */
    1363 static inline int snd_pcm_lib_alloc_vmalloc_buffer
    1364                         (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 buffer
    1372  * @substream: the substream to allocate the buffer to
    1373  * @size: the requested buffer size, in bytes
    1374  *
    1375  * This function works like snd_pcm_lib_alloc_vmalloc_buffer(), but uses
    1376  * 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 error
    1379  * code.
    1380  */
    1381 static inline int snd_pcm_lib_alloc_vmalloc_32_buffer
    1382                         (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);
    13861389}
    13871390
Note: See TracChangeset for help on using the changeset viewer.