summaryrefslogtreecommitdiffstats
path: root/msm8909/hal/voice.h
diff options
context:
space:
mode:
authorUday Kishore Pasupuleti <upasupul@codeaurora.org>2016-01-06 19:12:41 -0800
committerPrashant Malani <pmalani@google.com>2016-01-08 17:00:16 -0800
commit582e0a5e965897ea54ecfa5fe206797dab577a45 (patch)
tree3d99bdf637b54008f1e906975d75f7de7bfb6fb6 /msm8909/hal/voice.h
parentbefe610a877c3b150a6dd90cf358df4945b8f9a6 (diff)
downloadhardware_qcom_audio-582e0a5e965897ea54ecfa5fe206797dab577a45.tar.gz
hardware_qcom_audio-582e0a5e965897ea54ecfa5fe206797dab577a45.tar.bz2
hardware_qcom_audio-582e0a5e965897ea54ecfa5fe206797dab577a45.zip
audio: msm8909w caf release LW.BR.1.0-00410-8x09w.0
MSM8909w Audio HAL code copied from CAF release LW.BR.1.0-00410-8x09w.0 dbcce50 hal: Port wcd9326 changes to 8909 410c530 hal: update error handling for pcm_prepare failures ff79309 hal: fix compilation issues with audio FM extention 762d7eb policy_hal: add support for fm device loopback 7c418f9 audio_policy: modify few methods to appropriately override base 8b12163 audio: Add support to enable split A2DP a0559fa Revert "Revert "policy_hal: Function prototype correction for custom policy"." Fixed makefiles to be compatible with PDK without kernel source Change-Id: I9c6f2139adee62426b877516deeb41d4ed8052b2
Diffstat (limited to 'msm8909/hal/voice.h')
-rw-r--r--msm8909/hal/voice.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/msm8909/hal/voice.h b/msm8909/hal/voice.h
new file mode 100644
index 00000000..9be8443f
--- /dev/null
+++ b/msm8909/hal/voice.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+ * Not a contribution.
+ *
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef VOICE_H
+#define VOICE_H
+
+#define BASE_SESS_IDX 0
+#define VOICE_SESS_IDX (BASE_SESS_IDX)
+
+#ifdef MULTI_VOICE_SESSION_ENABLED
+#define MAX_VOICE_SESSIONS 5
+#else
+#define MAX_VOICE_SESSIONS 1
+#endif
+
+#define BASE_CALL_STATE 1
+#define CALL_INACTIVE (BASE_CALL_STATE)
+#define CALL_ACTIVE (BASE_CALL_STATE + 1)
+
+#define VOICE_VSID 0x10C01000
+
+#define AUDIO_PARAMETER_KEY_INCALLMUSIC "incall_music_enabled"
+#define AUDIO_PARAMETER_VALUE_TRUE "true"
+
+struct audio_device;
+struct str_parms;
+struct stream_in;
+struct stream_out;
+typedef int audio_usecase_t;
+
+struct call_state {
+ int current;
+ int new;
+};
+
+struct voice_session {
+ struct pcm *pcm_rx;
+ struct pcm *pcm_tx;
+ struct call_state state;
+ uint32_t vsid;
+};
+
+struct voice {
+ struct voice_session session[MAX_VOICE_SESSIONS];
+ int tty_mode;
+ bool mic_mute;
+ float volume;
+ bool is_in_call;
+ bool in_call;
+};
+
+enum {
+ INCALL_REC_NONE = -1,
+ INCALL_REC_UPLINK,
+ INCALL_REC_DOWNLINK,
+ INCALL_REC_UPLINK_AND_DOWNLINK,
+};
+
+int voice_start_usecase(struct audio_device *adev, audio_usecase_t usecase_id);
+int voice_stop_usecase(struct audio_device *adev, audio_usecase_t usecase_id);
+
+int voice_start_call(struct audio_device *adev);
+int voice_stop_call(struct audio_device *adev);
+int voice_set_parameters(struct audio_device *adev, struct str_parms *parms);
+void voice_get_parameters(struct audio_device *adev, struct str_parms *query,
+ struct str_parms *reply);
+void voice_init(struct audio_device *adev);
+bool voice_is_in_call(struct audio_device *adev);
+bool voice_is_in_call_rec_stream(struct stream_in *in);
+int voice_set_mic_mute(struct audio_device *dev, bool state);
+bool voice_get_mic_mute(struct audio_device *dev);
+int voice_set_volume(struct audio_device *adev, float volume);
+int voice_check_and_set_incall_rec_usecase(struct audio_device *adev,
+ struct stream_in *in);
+int voice_check_and_set_incall_music_usecase(struct audio_device *adev,
+ struct stream_out *out);
+int voice_check_and_stop_incall_rec_usecase(struct audio_device *adev,
+ struct stream_in *in);
+void voice_update_devices_for_all_voice_usecases(struct audio_device *adev);
+#endif //VOICE_H