diff options
author | Sugar Zhang <sugar.zhang@rock-chips.com> | 2018-04-27 11:18:36 +0800 |
---|---|---|
committer | Tao Huang <huangtao@rock-chips.com> | 2018-04-28 21:00:38 +0800 |
commit | f9cbc2829b33da1f203eba2147782d495a5976e0 (patch) | |
tree | 05452a7ef6d552b2ab28c5c52ab47333baa4e55e /include/sound | |
parent | d5f0ca9988c79c995d429e77897a9f6b1e72c1bb (diff) |
ASoC: rockchip: add support for vad
This patch add support for rockchip voice activity detection.
The vad is used to detect the amplitude of voice which is
received by analog mic, i2s digital mic or pdm digital mic
when soc is in low power mode. if the amplitude of voice is
over threshold, the vad will assert interrupt to wake up soc,
then soc will exit low power mode.
Change-Id: Idb7a3adb87ec4c07274eefd82da4672d493c7627
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/pcm.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index b0be09279943..e6dc30362a03 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -1399,6 +1399,25 @@ static inline u64 pcm_format_to_bits(snd_pcm_format_t pcm_format) return 1ULL << (__force int) pcm_format; } +#ifdef CONFIG_SND_SOC_ROCKCHIP_VAD +snd_pcm_sframes_t snd_pcm_vad_read(struct snd_pcm_substream *substream, + void __user *buf, snd_pcm_uframes_t frames); +/** + * snd_pcm_vad_avail - Get the available (readable) space for vad + * @runtime: PCM substream instance + * + * Result is between 0 ... (boundary - 1) + */ +snd_pcm_uframes_t snd_pcm_vad_avail(struct snd_pcm_substream *substream); +/** + * snd_pcm_vad_attached - Check whether vad is attached to substream or not + * @substream: PCM substream instance + * + * Result is true for attached or false for detached + */ +bool snd_pcm_vad_attached(struct snd_pcm_substream *substream); +#endif + /* printk helpers */ #define pcm_err(pcm, fmt, args...) \ dev_err((pcm)->card->dev, fmt, ##args) |