ASoC: msm8952-slimbus: register headset detection callback

In external codec, the callback to initialize mbhc is not
registered, which causes no headset detection issue.

CRs-fixed: 895387
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Change-Id: Ic72c82e45f296a4dcaa7b9dc7f8a91ba654b83f4
This commit is contained in:
Simmi Pateriya 2015-08-27 16:40:02 +05:30 committed by Gerrit - the friendly Code Review server
parent 131f3d3a15
commit 87aef8555f

View file

@ -413,14 +413,11 @@ static int msm8952_set_spk(struct snd_kcontrol *kcontrol,
static int msm8952_enable_codec_mclk(struct snd_soc_codec *codec, int enable,
bool dapm)
{
struct snd_soc_card *card = codec->card;
struct msm8952_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card);
pr_debug("%s: enable = %d\n", __func__, enable);
if (!strcmp(dev_name(pdata->codec->dev), "tomtom_codec"))
if (!strcmp(dev_name(codec->dev), "tomtom_codec"))
tomtom_codec_mclk_enable(codec, enable, dapm);
else if (!strcmp(dev_name(pdata->codec->dev), "tasha_codec"))
else if (!strcmp(dev_name(codec->dev), "tasha_codec"))
tasha_cdc_mclk_enable(codec, enable, dapm);
return 0;
@ -1945,6 +1942,7 @@ int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
if (!strcmp(dev_name(codec_dai->dev), "tomtom_codec")) {
pdata->msm8952_codec_fn.get_afe_config_fn =
tomtom_get_afe_config;
pdata->msm8952_codec_fn.mbhc_hs_detect = tomtom_hs_detect;
snd_soc_dapm_new_controls(dapm, msm8952_tomtom_dapm_widgets,
ARRAY_SIZE(msm8952_tomtom_dapm_widgets));
} else if (!strcmp(dev_name(codec_dai->dev), "tasha_codec")) {
@ -2124,8 +2122,8 @@ static void hs_detect_work(struct work_struct *work)
pr_err("%s: Failed to intialise mbhc %d\n", __func__, ret);
tomtom_enable_qfuse_sensing(pdata->codec);
/*
* Set pdata->codec back to NULL, to ensure codec pointer
* is not referenced further from this structure.
* Set pdata->codec back to NULL, to ensure codec pointer
* is not referenced further from this structure.
*/
pdata->codec = NULL;
pr_debug("%s: leave\n", __func__);