summaryrefslogtreecommitdiff
path: root/include/uapi
diff options
context:
space:
mode:
authorJoris Verhaegen <verhaegen@google.com>2025-09-05 10:12:56 +0100
committerTakashi Iwai <tiwai@suse.de>2025-09-08 09:33:24 +0200
commit86eec88c5bddf9a57bfebe701d9c7a4d439aed9b (patch)
tree8f86d1d86f41955c282e437176c4843d975b74cf /include/uapi
parentf20a53974f79619d0ef6c9f17bb8693499fb6ebb (diff)
ALSA: compress_offload: Add SNDRV_COMPRESS_AVAIL64 ioctl
The previous patch introduced a 64-bit timestamp ioctl (SNDRV_COMPRESS_TSTAMP64). To provide a consistent API, this patch adds a corresponding 64-bit version of the SNDRV_COMPRESS_AVAIL ioctl. A new struct snd_compr_avail64 is added to the UAPI, which includes the 64-bit timestamp. The existing ioctl implementation is refactored to handle both the 32-bit and 64-bit variants. Reviewed-by: Miller Liang <millerliang@google.com> Tested-by: Joris Verhaegen <verhaegen@google.com> Signed-off-by: Joris Verhaegen <verhaegen@google.com> Acked-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250905091301.2711705-4-verhaegen@google.com
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/sound/compress_offload.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h
index 70b8921601f9..26f756cc2e62 100644
--- a/include/uapi/sound/compress_offload.h
+++ b/include/uapi/sound/compress_offload.h
@@ -84,6 +84,16 @@ struct snd_compr_avail {
struct snd_compr_tstamp tstamp;
} __attribute__((packed, aligned(4)));
+/**
+ * struct snd_compr_avail64 - avail descriptor with tstamp in 64 bit format
+ * @avail: Number of bytes available in ring buffer for writing/reading
+ * @tstamp: timestamp information
+ */
+struct snd_compr_avail64 {
+ __u64 avail;
+ struct snd_compr_tstamp64 tstamp;
+} __attribute__((packed, aligned(4)));
+
enum snd_compr_direction {
SND_COMPRESS_PLAYBACK = 0,
SND_COMPRESS_CAPTURE,
@@ -231,6 +241,7 @@ struct snd_compr_task_status {
#define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)
#define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)
#define SNDRV_COMPRESS_TSTAMP64 _IOR('C', 0x22, struct snd_compr_tstamp64)
+#define SNDRV_COMPRESS_AVAIL64 _IOR('C', 0x23, struct snd_compr_avail64)
#define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)
#define SNDRV_COMPRESS_RESUME _IO('C', 0x31)
#define SNDRV_COMPRESS_START _IO('C', 0x32)