summaryrefslogtreecommitdiffstats
path: root/hal/msm8960
diff options
context:
space:
mode:
authorKuirong Wang <kuirongw@codeaurora.org>2016-05-24 15:21:56 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-06-23 10:37:38 -0700
commit1cad714fb6a37159c1f84fa5b5f978c6dc7989bc (patch)
treecfdc91f80ed47772fd3d9bde1dd23424156f064a /hal/msm8960
parenta9f7cee0718c0bee1d7bbe27ef6603e104822fe1 (diff)
downloadhardware_qcom_audio-1cad714fb6a37159c1f84fa5b5f978c6dc7989bc.tar.gz
hardware_qcom_audio-1cad714fb6a37159c1f84fa5b5f978c6dc7989bc.tar.bz2
hardware_qcom_audio-1cad714fb6a37159c1f84fa5b5f978c6dc7989bc.zip
hal: Add device sidetone support for USB audio ADSP solution
Add device sidetone support for USB ADSP solution if the USB headset has the sidetone capability. CRs-Fixed: 1019158 Change-Id: Ie40c286eb9988aeb5093f32c7f81cdb142e88eb6
Diffstat (limited to 'hal/msm8960')
-rw-r--r--hal/msm8960/platform.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c
index 2c60f3ba..b35e8e96 100644
--- a/hal/msm8960/platform.c
+++ b/hal/msm8960/platform.c
@@ -1234,3 +1234,26 @@ bool platform_check_backends_match(snd_device_t snd_device1 __unused,
{
return true;
}
+
+int platform_set_sidetone(struct audio_device *adev,
+ snd_device_t out_snd_device,
+ bool enable,
+ char *str)
+{
+ int ret;
+ if (out_snd_device == SND_DEVICE_OUT_USB_HEADSET) {
+ ret = audio_extn_usb_enable_sidetone(out_snd_device, enable);
+ if (ret)
+ ALOGI("%s: usb device %d does not support device sidetone\n",
+ __func__, out_snd_device);
+ } else {
+ ALOGV("%s: sidetone out device(%d) mixer cmd = %s\n",
+ __func__, out_snd_device, str);
+
+ if (enable)
+ audio_route_apply_and_update_path(adev->audio_route, str);
+ else
+ audio_route_reset_and_update_path(adev->audio_route, str);
+ }
+ return 0;
+}