diff options
author | Shiv Maliyappanahalli <smaliyap@codeaurora.org> | 2013-09-26 15:29:50 -0700 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2013-11-26 03:57:53 -0800 |
commit | b5bd702dda8d0472c8acc8452905652ac31aa1a5 (patch) | |
tree | 7ebbb0771073c000f390793303e3f486297c2cf5 | |
parent | d6be0c4f4109ba1192ed02c146ea7a8ea03cefcd (diff) | |
download | android_external_tinyalsa-cm-11.0-XNPH30O-bacon-4f280f505a.tar.gz android_external_tinyalsa-cm-11.0-XNPH30O-bacon-4f280f505a.tar.bz2 android_external_tinyalsa-cm-11.0-XNPH30O-bacon-4f280f505a.zip |
pcm: add support for pcm_ioctl() apicm-11.0-XNPH33R-bacon-3628510d76cm-11.0-XNPH30O-bacon-4f280f505acm-11.0-XNPH25R-bacon-d22b777afacm-11.0-XNPH22R-bacon-03d77315ea
Tinyalsa doesn't expose an api to call ioctls exposed by
the audio drivers. Add pcm_ioctl() api.
Change-Id: Ie519840671f858c23b0acea7155b365c0d9ca59a
(cherry picked from commit bf0ff7a28a8c85508c0bbd1de46e085632fa3579)
(cherry picked from commit 72deed2f35003610748f5d61863348219ddbdd85)
(cherry picked from commit 3a0912fa06d3d1383b9ef84914c8eb864fe11136)
-rw-r--r-- | include/tinyalsa/asoundlib.h | 6 | ||||
-rw-r--r-- | pcm.c | 15 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/tinyalsa/asoundlib.h b/include/tinyalsa/asoundlib.h index ec526e6..c1cef00 100644 --- a/include/tinyalsa/asoundlib.h +++ b/include/tinyalsa/asoundlib.h @@ -1,5 +1,8 @@ /* asoundlib.h ** +** Copyright (c) 2013, The Linux Foundation. All rights reserved. +** Not a contribution. +** ** Copyright 2011, The Android Open Source Project ** ** Redistribution and use in source and binary forms, with or without @@ -203,6 +206,9 @@ int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int frames); int pcm_start(struct pcm *pcm); int pcm_stop(struct pcm *pcm); +/* ioctl function for PCM driver */ +int pcm_ioctl(struct pcm *pcm, int request, ...); + /* Interrupt driven API */ int pcm_wait(struct pcm *pcm, int timeout); @@ -1,5 +1,8 @@ /* pcm.c ** +** Copyright (c) 2013, The Linux Foundation. All rights reserved. +** Not a contribution. +** ** Copyright 2011, The Android Open Source Project ** ** Redistribution and use in source and binary forms, with or without @@ -1039,3 +1042,15 @@ int pcm_mmap_read(struct pcm *pcm, void *data, unsigned int count) return pcm_mmap_transfer(pcm, data, count); } + +int pcm_ioctl(struct pcm *pcm, int request, ...) +{ + va_list ap; + void * arg; + + va_start(ap, request); + arg = va_arg(ap, void *); + va_end(ap); + + return ioctl(pcm->fd, request, arg); +} |