Merge "hal: fix incompatible APIs"
diff --git a/hal/Android.mk b/hal/Android.mk
index 5d4a9ee..22c01c1 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -155,6 +155,10 @@
LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
endif
+ifeq ($(strip $(AUDIO_FEATURE_PCM_IOCTL_ENABLED)),true)
+ LOCAL_CFLAGS += -DPCM_IOCTL_ENABLED
+endif
+
LOCAL_COPY_HEADERS_TO := mm-audio
LOCAL_COPY_HEADERS := audio_extn/audio_defs.h
diff --git a/hal/audio_extn/hfp.c b/hal/audio_extn/hfp.c
index 0be8de8..fca7afe 100644
--- a/hal/audio_extn/hfp.c
+++ b/hal/audio_extn/hfp.c
@@ -89,6 +89,7 @@
ALOGV("%s: entry", __func__);
ALOGD("%s: (%f)\n", __func__, value);
+ hfpmod.hfp_volume = value;
if (value < 0.0) {
ALOGW("%s: (%f) Under 0.0, assuming 0.0\n", __func__, value);
value = 0.0;
@@ -97,7 +98,6 @@
ALOGW("%s: Volume brought with in range (%f)\n", __func__, value);
}
vol = lrint((value * 0x2000) + 0.5);
- hfpmod.hfp_volume = value;
if (!hfpmod.is_hfp_running) {
ALOGV("%s: HFP not active, ignoring set_hfp_volume call", __func__);
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 448f745..1584624 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 62ae6d9..fb4aaab 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -261,6 +261,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__)\