mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
ASoC: Machine: check jack status during resume
codec suspend/resume does not happen when using intel HD header. To allow MIC jack detection to work always, some supply widgets are kept On during probe. This does not allow codec to perform suspend/resume cycle when system goes to low power mode. So any jack plug/unplug during SC7 will not be detected, as IRQs are disabled during this period. Though codec resume path checks for the jack state, but the resume call does not happen because of above mentioned reason. Hence in current patch, machine driver can check the jack state during it resume callback. Bug 200383009 Change-Id: I78dc982df1da633d8eec1cd48a1c9a00ab06bbff Signed-off-by: Sameer Pujar <spujar@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1649452 GVS: Gerrit_Virtual_Submit Reviewed-by: Mohan Kumar D <mkumard@nvidia.com> Reviewed-by: Sharad Gupta <sharadg@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
@@ -75,6 +75,7 @@ struct tegra_machine {
|
|||||||
#ifdef CONFIG_SWITCH
|
#ifdef CONFIG_SWITCH
|
||||||
int jack_status;
|
int jack_status;
|
||||||
#endif
|
#endif
|
||||||
|
struct snd_soc_codec *ext_codec;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* used for soc specific data */
|
/* used for soc specific data */
|
||||||
@@ -121,6 +122,7 @@ static void tegra_machine_pcm_shutdown(struct snd_pcm_substream *);
|
|||||||
static int tegra_machine_pcm_startup(struct snd_pcm_substream *);
|
static int tegra_machine_pcm_startup(struct snd_pcm_substream *);
|
||||||
static void tegra_machine_pcm_shutdown(struct snd_pcm_substream *);
|
static void tegra_machine_pcm_shutdown(struct snd_pcm_substream *);
|
||||||
static int tegra_machine_suspend_pre(struct snd_soc_card *);
|
static int tegra_machine_suspend_pre(struct snd_soc_card *);
|
||||||
|
static int tegra_machine_resume_post(struct snd_soc_card *);
|
||||||
static int tegra_machine_pcm_hw_params(struct snd_pcm_substream *,
|
static int tegra_machine_pcm_hw_params(struct snd_pcm_substream *,
|
||||||
struct snd_pcm_hw_params *);
|
struct snd_pcm_hw_params *);
|
||||||
static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *,
|
static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *,
|
||||||
@@ -356,6 +358,7 @@ static const struct snd_kcontrol_new tegra_machine_controls[] = {
|
|||||||
static struct snd_soc_card snd_soc_tegra_card = {
|
static struct snd_soc_card snd_soc_tegra_card = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.suspend_pre = tegra_machine_suspend_pre,
|
.suspend_pre = tegra_machine_suspend_pre,
|
||||||
|
.resume_post = tegra_machine_resume_post,
|
||||||
.controls = tegra_machine_controls,
|
.controls = tegra_machine_controls,
|
||||||
.num_controls = ARRAY_SIZE(tegra_machine_controls),
|
.num_controls = ARRAY_SIZE(tegra_machine_controls),
|
||||||
.dapm_widgets = tegra_machine_dapm_widgets,
|
.dapm_widgets = tegra_machine_dapm_widgets,
|
||||||
@@ -877,6 +880,16 @@ static int tegra_machine_suspend_pre(struct snd_soc_card *card)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int tegra_machine_resume_post(struct snd_soc_card *card)
|
||||||
|
{
|
||||||
|
struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
|
||||||
|
|
||||||
|
if (machine->ext_codec)
|
||||||
|
return trigger_jack_status_check(machine->ext_codec);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int tegra_machine_dspk_init(struct snd_soc_pcm_runtime *rtd)
|
static int tegra_machine_dspk_init(struct snd_soc_pcm_runtime *rtd)
|
||||||
{
|
{
|
||||||
struct snd_soc_card *card = rtd->card;
|
struct snd_soc_card *card = rtd->card;
|
||||||
@@ -1239,6 +1252,7 @@ static int tegra_machine_driver_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
machine->pdata = pdata;
|
machine->pdata = pdata;
|
||||||
machine->pcard = card;
|
machine->pcard = card;
|
||||||
|
machine->ext_codec = NULL;
|
||||||
|
|
||||||
ret = tegra_alt_asoc_utils_init(&machine->audio_clock,
|
ret = tegra_alt_asoc_utils_init(&machine->audio_clock,
|
||||||
&pdev->dev,
|
&pdev->dev,
|
||||||
@@ -1270,6 +1284,7 @@ static int tegra_machine_driver_probe(struct platform_device *pdev)
|
|||||||
if (!machine->is_codec_dummy) {
|
if (!machine->is_codec_dummy) {
|
||||||
/* setup for jack detection only in non-dummy case */
|
/* setup for jack detection only in non-dummy case */
|
||||||
rt5659_set_jack_detect(codec, &tegra_machine_hp_jack);
|
rt5659_set_jack_detect(codec, &tegra_machine_hp_jack);
|
||||||
|
machine->ext_codec = codec;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user