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 37bbcba..f0a5a97 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2913,6 +2913,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 1b2606c..a15d62a 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -299,6 +299,8 @@
bool is_offload_usecase(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__)\