diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2019-01-06 06:31:06 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-01-06 06:31:06 -0800 |
commit | c9a8e97cb29caa14b4ec72ad68a5d76f6cde1156 (patch) | |
tree | 7aab085b1dc11b4eae0ecc54a55a6ea337beae17 /hal/audio_extn | |
parent | 4a5424dfef4ed502cf34abfdc86e2276d7612743 (diff) | |
parent | 0fae9b58ce56aac456c267a7243be4870b76f146 (diff) | |
download | hardware_qcom_audio-c9a8e97cb29caa14b4ec72ad68a5d76f6cde1156.tar.gz hardware_qcom_audio-c9a8e97cb29caa14b4ec72ad68a5d76f6cde1156.tar.bz2 hardware_qcom_audio-c9a8e97cb29caa14b4ec72ad68a5d76f6cde1156.zip |
Merge "fm: Add getparameter to check FM status"
Diffstat (limited to 'hal/audio_extn')
-rw-r--r-- | hal/audio_extn/audio_extn.c | 1 | ||||
-rw-r--r-- | hal/audio_extn/audio_extn.h | 2 | ||||
-rw-r--r-- | hal/audio_extn/fm.c | 14 |
3 files changed, 17 insertions, 0 deletions
diff --git a/hal/audio_extn/audio_extn.c b/hal/audio_extn/audio_extn.c index ae1fef76..e03230ac 100644 --- a/hal/audio_extn/audio_extn.c +++ b/hal/audio_extn/audio_extn.c @@ -971,6 +971,7 @@ void audio_extn_get_parameters(const struct audio_device *adev, audio_extn_source_track_get_parameters(adev, query, reply); audio_extn_fbsp_get_parameters(query, reply); audio_extn_sound_trigger_get_parameters(adev, query, reply); + audio_extn_fm_get_parameters(query, reply); if (adev->offload_effects_get_parameters != NULL) adev->offload_effects_get_parameters(query, reply); audio_extn_ext_hw_plugin_get_parameters(adev->ext_hw_plugin, query, reply); diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h index b2b0e732..6fa6b781 100644 --- a/hal/audio_extn/audio_extn.h +++ b/hal/audio_extn/audio_extn.h @@ -963,9 +963,11 @@ int audio_extn_set_soundfocus_data(struct audio_device *adev, #ifndef FM_POWER_OPT #define audio_extn_fm_set_parameters(adev, parms) (0) +#define audio_extn_fm_get_parameters(query, reply) (0) #else void audio_extn_fm_set_parameters(struct audio_device *adev, struct str_parms *parms); +void audio_extn_fm_get_parameters(struct str_parms *query, struct str_parms *reply); #endif #ifndef APTX_DECODER_ENABLED diff --git a/hal/audio_extn/fm.c b/hal/audio_extn/fm.c index b635994d..0a048cd9 100644 --- a/hal/audio_extn/fm.c +++ b/hal/audio_extn/fm.c @@ -45,6 +45,7 @@ #define AUDIO_PARAMETER_KEY_FM_MUTE "fm_mute" #define AUDIO_PARAMETER_KEY_FM_RESTORE_VOLUME "fm_restore_volume" #define AUDIO_PARAMETER_KEY_FM_ROUTING "fm_routing" +#define AUDIO_PARAMETER_KEY_FM_STATUS "fm_status" #define FM_LOOPBACK_DRAIN_TIME_MS 2 static struct pcm_config pcm_config_fm = { @@ -252,6 +253,19 @@ exit: return ret; } +void audio_extn_fm_get_parameters(struct str_parms *query, struct str_parms *reply) +{ + int ret, val; + char value[32]={0}; + + ALOGV("%s: enter", __func__); + ret = str_parms_get_str(query, AUDIO_PARAMETER_KEY_FM_STATUS, value, sizeof(value)); + if (ret >= 0) { + val = (fmmod.is_fm_running ? 1: 0); + str_parms_add_int(reply, AUDIO_PARAMETER_KEY_FM_STATUS, val); + } +} + void audio_extn_fm_set_parameters(struct audio_device *adev, struct str_parms *parms) { |