From ba7ae3241cc9608e7696885806793e36a37dcb75 Mon Sep 17 00:00:00 2001 From: Nikesh Oswal Date: Wed, 7 Mar 2012 13:09:39 +0530 Subject: asoc: machine: add api to query voice call state Change-Id: I0b2b50c007d9e7b722b2c4bbc0282c51a8d18b00 Reviewed-on: http://git-master/r/88239 Reviewed-by: Rohan Somvanshi Tested-by: Rohan Somvanshi --- sound/soc/tegra/tegra_aic326x.c | 3 +++ sound/soc/tegra/tegra_asoc_utils.c | 11 +++++++++++ sound/soc/tegra/tegra_max98088.c | 11 +---------- sound/soc/tegra/tegra_wm8753.c | 3 +++ 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/sound/soc/tegra/tegra_aic326x.c b/sound/soc/tegra/tegra_aic326x.c index 76d56c8829c2..1267830d8d53 100644 --- a/sound/soc/tegra/tegra_aic326x.c +++ b/sound/soc/tegra/tegra_aic326x.c @@ -71,6 +71,8 @@ #define DAI_LINK_BT_VOICE_CALL 4 #define NUM_DAI_LINKS 5 +extern int g_is_call_mode; + struct tegra_aic326x { struct tegra_asoc_utils_data util_data; struct tegra_aic326x_platform_data *pdata; @@ -152,6 +154,7 @@ static int tegra_aic326x_call_mode_put(struct snd_kcontrol *kcontrol, } machine->is_call_mode = is_call_mode_new; + g_is_call_mode = machine->is_call_mode; return 1; } diff --git a/sound/soc/tegra/tegra_asoc_utils.c b/sound/soc/tegra/tegra_asoc_utils.c index 1f336d82bfe3..04e7e3c15cd0 100644 --- a/sound/soc/tegra/tegra_asoc_utils.c +++ b/sound/soc/tegra/tegra_asoc_utils.c @@ -29,6 +29,17 @@ #include "tegra_asoc_utils.h" +int g_is_call_mode; + +bool tegra_is_voice_call_active() +{ + if (g_is_call_mode) + return true; + else + return false; +} +EXPORT_SYMBOL_GPL(tegra_is_voice_call_active); + int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate, int mclk) { diff --git a/sound/soc/tegra/tegra_max98088.c b/sound/soc/tegra/tegra_max98088.c index 61f45936e440..1a4650104c7a 100644 --- a/sound/soc/tegra/tegra_max98088.c +++ b/sound/soc/tegra/tegra_max98088.c @@ -82,7 +82,7 @@ const char *tegra_max98088_i2s_dai_name[TEGRA30_NR_I2S_IFC] = { }; #endif -static int g_is_call_mode; +extern int g_is_call_mode; struct tegra_max98088 { struct tegra_asoc_utils_data util_data; @@ -98,15 +98,6 @@ struct tegra_max98088 { struct snd_soc_card *pcard; }; -bool tegra_is_voice_call_active() -{ - if (g_is_call_mode) - return true; - else - return false; -} -EXPORT_SYMBOL_GPL(tegra_is_voice_call_active); - static int tegra_call_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { diff --git a/sound/soc/tegra/tegra_wm8753.c b/sound/soc/tegra/tegra_wm8753.c index 94268dba5016..62c1c056a619 100644 --- a/sound/soc/tegra/tegra_wm8753.c +++ b/sound/soc/tegra/tegra_wm8753.c @@ -63,6 +63,8 @@ #define GPIO_INT_MIC_EN BIT(2) #define GPIO_EXT_MIC_EN BIT(3) +extern int g_is_call_mode; + struct tegra_wm8753 { struct tegra_asoc_utils_data util_data; struct tegra_wm8753_platform_data *pdata; @@ -523,6 +525,7 @@ static int tegra_call_mode_put(struct snd_kcontrol *kcontrol, } machine->is_call_mode = is_call_mode_new; + g_is_call_mode = machine->is_call_mode; return 1; } -- cgit v1.2.3