mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 02:21:16 +00:00
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:
parent
131f3d3a15
commit
87aef8555f
1 changed files with 5 additions and 7 deletions
|
@ -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,
|
static int msm8952_enable_codec_mclk(struct snd_soc_codec *codec, int enable,
|
||||||
bool dapm)
|
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);
|
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);
|
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);
|
tasha_cdc_mclk_enable(codec, enable, dapm);
|
||||||
|
|
||||||
return 0;
|
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")) {
|
if (!strcmp(dev_name(codec_dai->dev), "tomtom_codec")) {
|
||||||
pdata->msm8952_codec_fn.get_afe_config_fn =
|
pdata->msm8952_codec_fn.get_afe_config_fn =
|
||||||
tomtom_get_afe_config;
|
tomtom_get_afe_config;
|
||||||
|
pdata->msm8952_codec_fn.mbhc_hs_detect = tomtom_hs_detect;
|
||||||
snd_soc_dapm_new_controls(dapm, msm8952_tomtom_dapm_widgets,
|
snd_soc_dapm_new_controls(dapm, msm8952_tomtom_dapm_widgets,
|
||||||
ARRAY_SIZE(msm8952_tomtom_dapm_widgets));
|
ARRAY_SIZE(msm8952_tomtom_dapm_widgets));
|
||||||
} else if (!strcmp(dev_name(codec_dai->dev), "tasha_codec")) {
|
} 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);
|
pr_err("%s: Failed to intialise mbhc %d\n", __func__, ret);
|
||||||
tomtom_enable_qfuse_sensing(pdata->codec);
|
tomtom_enable_qfuse_sensing(pdata->codec);
|
||||||
/*
|
/*
|
||||||
* Set pdata->codec back to NULL, to ensure codec pointer
|
* Set pdata->codec back to NULL, to ensure codec pointer
|
||||||
* is not referenced further from this structure.
|
* is not referenced further from this structure.
|
||||||
*/
|
*/
|
||||||
pdata->codec = NULL;
|
pdata->codec = NULL;
|
||||||
pr_debug("%s: leave\n", __func__);
|
pr_debug("%s: leave\n", __func__);
|
||||||
|
|
Loading…
Reference in a new issue