summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhani Kumar Uppalapati <phaniu@codeaurora.org>2016-09-29 17:27:34 -0700
committerPhani Kumar Uppalapati <phaniu@codeaurora.org>2016-09-29 18:05:49 -0700
commit46451883c7b134c6c8b0c6089b479280562cd56f (patch)
treed1dafcfb1d50c744ae6427701faaa2ece772e9f4
parent64f1a464c47546c70269fa8e21c975c7e94916f1 (diff)
ASoC: wcd934x: Add pre/post HPHL/R PA off notifications
Send headphone left/right PA off notifications in pre/post events for client drivers like MBHC, to update their status correctly. Change-Id: I2a27e9f59bd5d1ce99245df51cde9e6eb4133387 Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
-rw-r--r--sound/soc/codecs/wcd934x/wcd934x.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/sound/soc/codecs/wcd934x/wcd934x.c b/sound/soc/codecs/wcd934x/wcd934x.c
index 28914ed3f937..68fef3f036e3 100644
--- a/sound/soc/codecs/wcd934x/wcd934x.c
+++ b/sound/soc/codecs/wcd934x/wcd934x.c
@@ -1807,6 +1807,9 @@ static int tavil_codec_enable_hphr_pa(struct snd_soc_dapm_widget *w,
tavil_codec_override(codec, tavil->hph_mode, event);
break;
case SND_SOC_DAPM_PRE_PMD:
+ blocking_notifier_call_chain(&tavil->mbhc->notifier,
+ WCD_EVENT_PRE_HPHR_PA_OFF,
+ &tavil->mbhc->wcd_mbhc);
/* Enable DSD Mute before PA disable */
if (dsd_conf &&
(snd_soc_read(codec, WCD934X_CDC_DSD1_PATH_CTL) & 0x01))
@@ -1814,11 +1817,14 @@ static int tavil_codec_enable_hphr_pa(struct snd_soc_dapm_widget *w,
0x04, 0x04);
break;
case SND_SOC_DAPM_POST_PMD:
+ /* 5ms sleep is required after PA disable */
+ usleep_range(5000, 5100);
tavil_codec_override(codec, tavil->hph_mode, event);
+ blocking_notifier_call_chain(&tavil->mbhc->notifier,
+ WCD_EVENT_POST_HPHR_PA_OFF,
+ &tavil->mbhc->wcd_mbhc);
snd_soc_update_bits(codec, WCD934X_HPH_REFBUFF_LP_CTL,
0x06, 0x0);
- /* 5ms sleep is required after PA disable */
- usleep_range(5000, 5100);
break;
};
@@ -1876,6 +1882,9 @@ static int tavil_codec_enable_hphl_pa(struct snd_soc_dapm_widget *w,
tavil_codec_override(codec, tavil->hph_mode, event);
break;
case SND_SOC_DAPM_PRE_PMD:
+ blocking_notifier_call_chain(&tavil->mbhc->notifier,
+ WCD_EVENT_PRE_HPHL_PA_OFF,
+ &tavil->mbhc->wcd_mbhc);
/* Enable DSD Mute before PA disable */
if (dsd_conf &&
(snd_soc_read(codec, WCD934X_CDC_DSD0_PATH_CTL) & 0x01))
@@ -1883,11 +1892,14 @@ static int tavil_codec_enable_hphl_pa(struct snd_soc_dapm_widget *w,
0x04, 0x04);
break;
case SND_SOC_DAPM_POST_PMD:
+ /* 5ms sleep is required after PA disable */
+ usleep_range(5000, 5100);
tavil_codec_override(codec, tavil->hph_mode, event);
+ blocking_notifier_call_chain(&tavil->mbhc->notifier,
+ WCD_EVENT_POST_HPHL_PA_OFF,
+ &tavil->mbhc->wcd_mbhc);
snd_soc_update_bits(codec, WCD934X_HPH_REFBUFF_LP_CTL,
0x06, 0x0);
- /* 5ms sleep is required after PA disable */
- usleep_range(5000, 5100);
break;
};