summaryrefslogtreecommitdiff
path: root/include/sound/pcm.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-03-30 09:46:51 +0200
committerTakashi Iwai <tiwai@suse.de>2020-03-30 09:46:51 +0200
commitaa21c3d4b941739651e77747d2f7a20a6c1d87bc (patch)
treeae46596c4fe5803fbd4746459a09a09cff5487e8 /include/sound/pcm.h
parent476c02e0b4fd9071d158f6a1a1dfea1d36ee0ffd (diff)
parent652bb5d8df4b3a79ed350db35cda12637e63efa7 (diff)
Merge branch 'for-next' into for-linus
Diffstat (limited to 'include/sound/pcm.h')
-rw-r--r--include/sound/pcm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index f657ff08f317..31a4b300e4c9 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -1415,6 +1415,15 @@ static inline u64 pcm_format_to_bits(snd_pcm_format_t pcm_format)
return 1ULL << (__force int) pcm_format;
}
+/**
+ * pcm_for_each_format - helper to iterate for each format type
+ * @f: the iterator variable in snd_pcm_format_t type
+ */
+#define pcm_for_each_format(f) \
+ for ((f) = SNDRV_PCM_FORMAT_FIRST; \
+ (__force int)(f) <= (__force int)SNDRV_PCM_FORMAT_LAST; \
+ (f) = (__force snd_pcm_format_t)((__force int)(f) + 1))
+
/* printk helpers */
#define pcm_err(pcm, fmt, args...) \
dev_err((pcm)->card->dev, fmt, ##args)