diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2019-03-04 12:01:54 +0100 |
---|---|---|
committer | Dominik Sliwa <dominik.sliwa@toradex.com> | 2019-03-04 12:01:54 +0100 |
commit | 348fa3f6871f56a37dcd16c99ca98118c6d79a38 (patch) | |
tree | 6fcae7785bae4ffb838fd6549f7d01ba6abf0763 /backport-include/sound |
Backports v4.19.24
Backports generated by toradex backports 515a1fa55cda2b1d952872e1786857481bd54fcc
against mainline kernel tag v4.19.24
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'backport-include/sound')
-rw-r--r-- | backport-include/sound/core.h | 20 | ||||
-rw-r--r-- | backport-include/sound/pcm.h | 29 |
2 files changed, 49 insertions, 0 deletions
diff --git a/backport-include/sound/core.h b/backport-include/sound/core.h new file mode 100644 index 0000000..79f8b31 --- /dev/null +++ b/backport-include/sound/core.h @@ -0,0 +1,20 @@ +#ifndef _BACKPORT_SOUND_CORE_H +#define _BACKPORT_SOUND_CORE_H +#include_next <sound/core.h> + +#if LINUX_VERSION_IS_LESS(3,15,0) +#define snd_card_new LINUX_BACKPORT(snd_card_new) +static inline +int snd_card_new(struct device *parent, int idx, const char *xid, + struct module *module, int extra_size, + struct snd_card **card_ret) +{ + int ret; + + ret = snd_card_create(idx, xid, module, extra_size, card_ret); + snd_card_set_dev(*card_ret, parent); + return ret; +} +#endif + +#endif /* _BACKPORT_SOUND_CORE_H */ diff --git a/backport-include/sound/pcm.h b/backport-include/sound/pcm.h new file mode 100644 index 0000000..d5794ef --- /dev/null +++ b/backport-include/sound/pcm.h @@ -0,0 +1,29 @@ +#ifndef __BACKPORT_SOUND_PCM_H +#define __BACKPORT_SOUND_PCM_H +#include_next <sound/pcm.h> +#include <linux/version.h> + +#if LINUX_VERSION_IS_LESS(3,19,0) +/** + * snd_pcm_stop_xrun - stop the running streams as XRUN + * @substream: the PCM substream instance + * + * This stops the given running substream (and all linked substreams) as XRUN. + * Unlike snd_pcm_stop(), this function takes the substream lock by itself. + * + * Return: Zero if successful, or a negative error code. + */ +static inline int snd_pcm_stop_xrun(struct snd_pcm_substream *substream) +{ + unsigned long flags; + int ret = 0; + + snd_pcm_stream_lock_irqsave(substream, flags); + if (snd_pcm_running(substream)) + ret = snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); + snd_pcm_stream_unlock_irqrestore(substream, flags); + return ret; +} +#endif /* LINUX_VERSION_IS_LESS(3,19,0) */ + +#endif /* __BACKPORT_SOUND_PCM_H */ |