aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/pcm.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-10 22:13:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-10 22:13:25 -0400
commita2ce35273c2f1aa0dcddd8822681d64ee5f31852 (patch)
treefac2b4d526b6ca6657ea7c1b0a25efe76a3a0b5e /include/sound/pcm.h
parentbf65dea87e87c53ba4f97c6432761498bc977efd (diff)
parentfd1a2a90d08b0052fa52bd36cebd0592c9e537c2 (diff)
Merge tag 'sound-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "This time it's a relatively calm update batch, but the amount isn't too small in the end. Here we go over some highlights: ALSA core: - One major change is the support of nonatomic PCM operations. This allows the trigger and other callbacks to call schedule(), which would be useful for mailbox type communications. Already some drivers (Digigram ones) have been converted to use together with threaded irqs as an example. - Improvement / fixes of DSD PCM format support HD-audio: - Large volume of rewrites are found in Realtek codec driver for converting Dell and HP quirks to generic forms. - Inverted dmic code cleanup from David. - Realtek COEF access has been optimized. - Now HD-audio jack infrastructure allows multiple callbacks, which fixes / simplifies the jack-dependent power controls on STAC/IDT and VIA codecs. - Many additional device-specific fixups as usual - A few deadcode cleanups, CA0132 code cleanup, etc. ASoC: - More componentization work from Lars-Peter, this time mainly cleaning up the suspend and bias level transition callbacks. - Real system support for the Intel drivers and a bunch of fixes and enhancements for the associated CODEC drivers, this is going to need a lot quirks over time due to the lack of any firmware description of the boards. - Jack detect support for simple card from Dylan Reid. - A bunch of small fixes and enhancements for the Freescale drivers. - New drivers for Analog Devices SSM4567, Cirrus Logic CS35L32, Everest Semiconductor ES8328 and Freescale cards using the ASRC in newer i.MX processors. - A few simple-card fixes, mostly cleanups but also a fix for interaction between GPIO 0 and simple-card. Misc: - Virtuoso / Oxygen updates by Clemens - USB-audio: Yamaha MOTIF XF MIDI port name fixes - Conversion of kernel messages to standard dev_*() in ctxfi driver" * tag 'sound-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (251 commits) ASoC: mc13783: Ensure we only try to dereference valid of_nodes ASoC: rockchip-i2s: fix infinite loop in rockchip_snd_txctrl ALSA: hda - Add dock port support to Thinkpad L440 (71aa:501e) ALSA: Allow pass NULL dev for snd_pci_quirk_lookup() ASoC: imx-es8328: Fix of_node_put() call with uninitialized object ASoC: soc-pcm: fix sig_bits determination in soc_pcm_apply_msb() ASoC: simple-card: Initialize headphone and mic GPIO numbers ASoC: imx-es8328: Fix missing return code in imx_es8328_probe() ALSA: hda - Add dock support for Thinkpad T440 (17aa:2212) ALSA: usb: caiaq: check for cdev->n_streams > 1 ASoC: 88pm860x-codec: Fix possibly missing string termination ASoC: core: fix use after free in snd_soc_remove_platform() ASoC: soc-dapm: fix use after free ALSA: hda - Make the inv dmic handling for Realtek use generic parser ALSA: hda - Add Inverted Internal mic for Samsung Ativ book 9 (NP900X3G) ALSA: hda - Add inverted internal mic for Asus Aspire 4830T ASoC: Intel: byt-rt5640: fix coccinelle warnings ASoC: fsl_esai doc: Add "fsl,vf610-esai" as compatible string ASoC: da732x: Remove unnecessary KERN_ERR in pr_err() ASoC: simple-card: Fix detect gpio documentation. ...
Diffstat (limited to 'include/sound/pcm.h')
-rw-r--r--include/sound/pcm.h52
1 files changed, 15 insertions, 37 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 6f3e10ca0e32..e862497f7556 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -183,6 +183,7 @@ struct snd_pcm_ops {
183#define SNDRV_PCM_FMTBIT_G723_40_1B _SNDRV_PCM_FMTBIT(G723_40_1B) 183#define SNDRV_PCM_FMTBIT_G723_40_1B _SNDRV_PCM_FMTBIT(G723_40_1B)
184#define SNDRV_PCM_FMTBIT_DSD_U8 _SNDRV_PCM_FMTBIT(DSD_U8) 184#define SNDRV_PCM_FMTBIT_DSD_U8 _SNDRV_PCM_FMTBIT(DSD_U8)
185#define SNDRV_PCM_FMTBIT_DSD_U16_LE _SNDRV_PCM_FMTBIT(DSD_U16_LE) 185#define SNDRV_PCM_FMTBIT_DSD_U16_LE _SNDRV_PCM_FMTBIT(DSD_U16_LE)
186#define SNDRV_PCM_FMTBIT_DSD_U32_LE _SNDRV_PCM_FMTBIT(DSD_U32_LE)
186 187
187#ifdef SNDRV_LITTLE_ENDIAN 188#ifdef SNDRV_LITTLE_ENDIAN
188#define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE 189#define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE
@@ -365,6 +366,7 @@ struct snd_pcm_runtime {
365 366
366struct snd_pcm_group { /* keep linked substreams */ 367struct snd_pcm_group { /* keep linked substreams */
367 spinlock_t lock; 368 spinlock_t lock;
369 struct mutex mutex;
368 struct list_head substreams; 370 struct list_head substreams;
369 int count; 371 int count;
370}; 372};
@@ -460,6 +462,7 @@ struct snd_pcm {
460 void (*private_free) (struct snd_pcm *pcm); 462 void (*private_free) (struct snd_pcm *pcm);
461 struct device *dev; /* actual hw device this belongs to */ 463 struct device *dev; /* actual hw device this belongs to */
462 bool internal; /* pcm is for internal use only */ 464 bool internal; /* pcm is for internal use only */
465 bool nonatomic; /* whole PCM operations are in non-atomic context */
463#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 466#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
464 struct snd_pcm_oss oss; 467 struct snd_pcm_oss oss;
465#endif 468#endif
@@ -492,8 +495,6 @@ int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree);
492 * Native I/O 495 * Native I/O
493 */ 496 */
494 497
495extern rwlock_t snd_pcm_link_rwlock;
496
497int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info); 498int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info);
498int snd_pcm_info_user(struct snd_pcm_substream *substream, 499int snd_pcm_info_user(struct snd_pcm_substream *substream,
499 struct snd_pcm_info __user *info); 500 struct snd_pcm_info __user *info);
@@ -537,41 +538,18 @@ static inline int snd_pcm_stream_linked(struct snd_pcm_substream *substream)
537 return substream->group != &substream->self_group; 538 return substream->group != &substream->self_group;
538} 539}
539 540
540static inline void snd_pcm_stream_lock(struct snd_pcm_substream *substream) 541void snd_pcm_stream_lock(struct snd_pcm_substream *substream);
541{ 542void snd_pcm_stream_unlock(struct snd_pcm_substream *substream);
542 read_lock(&snd_pcm_link_rwlock); 543void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream);
543 spin_lock(&substream->self_group.lock); 544void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream);
544} 545unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream);
545 546#define snd_pcm_stream_lock_irqsave(substream, flags) \
546static inline void snd_pcm_stream_unlock(struct snd_pcm_substream *substream) 547 do { \
547{ 548 typecheck(unsigned long, flags); \
548 spin_unlock(&substream->self_group.lock); 549 flags = _snd_pcm_stream_lock_irqsave(substream); \
549 read_unlock(&snd_pcm_link_rwlock); 550 } while (0)
550} 551void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream,
551 552 unsigned long flags);
552static inline void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream)
553{
554 read_lock_irq(&snd_pcm_link_rwlock);
555 spin_lock(&substream->self_group.lock);
556}
557
558static inline void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream)
559{
560 spin_unlock(&substream->self_group.lock);
561 read_unlock_irq(&snd_pcm_link_rwlock);
562}
563
564#define snd_pcm_stream_lock_irqsave(substream, flags) \
565do { \
566 read_lock_irqsave(&snd_pcm_link_rwlock, (flags)); \
567 spin_lock(&substream->self_group.lock); \
568} while (0)
569
570#define snd_pcm_stream_unlock_irqrestore(substream, flags) \
571do { \
572 spin_unlock(&substream->self_group.lock); \
573 read_unlock_irqrestore(&snd_pcm_link_rwlock, (flags)); \
574} while (0)
575 553
576#define snd_pcm_group_for_each_entry(s, substream) \ 554#define snd_pcm_group_for_each_entry(s, substream) \
577 list_for_each_entry(s, &substream->group->substreams, link_list) 555 list_for_each_entry(s, &substream->group->substreams, link_list)