nuttx/audio: add AUDIOIOC_GETSTATE ioctl

support get lower driver state

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
This commit is contained in:
yangyalei
2025-05-30 11:12:21 +08:00
committed by Alan C. Assis
parent 0af7c985b4
commit 2cc624a4c4
2 changed files with 43 additions and 7 deletions
+10
View File
@@ -118,6 +118,7 @@
#define AUDIOIOC_FLUSH _AUDIOIOC(20)
#define AUDIOIOC_GETPOSITION _AUDIOIOC(21)
#define AUDIOIOC_GETAUDIOINFO _AUDIOIOC(22)
#define AUDIOIOC_GETSTATE _AUDIOIOC(23)
/* Audio Device Types *******************************************************/
@@ -376,6 +377,15 @@
#define AUDIO_CHANNELS_RANGE(min, max) ((uint8_t)(((min) << 4) | ((max) & 0xf)))
/* State of appl and lower driver, higher value = higher priority */
#define AUDIO_STATE_OPEN 0
#define AUDIO_STATE_PREPARED 1
#define AUDIO_STATE_PAUSED 2
#define AUDIO_STATE_XRUN 3
#define AUDIO_STATE_DRAINING 4
#define AUDIO_STATE_RUNNING 5
/****************************************************************************
* Public Types
****************************************************************************/