hal: add support for pcm_ioctl() api
- Tinyalsa doesn't expose an api to call
ioctls exposed by the audio drivers.
- Add pcm_ioctl() api to support pcm ioctl.
Change-Id: I448252e8d3347257a73c56bc8ed341abc2dd2dab
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 3faa045..3b12283 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2745,6 +2745,19 @@
return 0;
}
+int pcm_ioctl(struct pcm *pcm, int request, ...)
+{
+ va_list ap;
+ void * arg;
+ int pcm_fd = *(int*)pcm;
+
+ va_start(ap, request);
+ arg = va_arg(ap, void *);
+ va_end(ap);
+
+ return ioctl(pcm_fd, request, arg);
+}
+
static struct hw_module_methods_t hal_module_methods = {
.open = adev_open,
};
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 51432c0..0dbf2d7 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -255,6 +255,8 @@
struct audio_usecase *get_usecase_from_list(struct audio_device *adev,
audio_usecase_t uc_id);
+int pcm_ioctl(struct pcm *pcm, int request, ...);
+
#define LITERAL_TO_STRING(x) #x
#define CHECK(condition) LOG_ALWAYS_FATAL_IF(!(condition), "%s",\
__FILE__ ":" LITERAL_TO_STRING(__LINE__)\