summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaska Uimonen <jaska.uimonen@intel.com>2019-09-27 15:14:07 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-10 11:27:14 +0100
commit6ef17b446081f41be552991b49c78d980f961a42 (patch)
tree5a7d9164efb3b40ebbc814361a5aa4b78877a4e5 /sound
parent772c18df9f3d1c08963c3a3ab4ffadc663af7d19 (diff)
downloadlinux-stable-6ef17b446081f41be552991b49c78d980f961a42.tar.gz
linux-stable-6ef17b446081f41be552991b49c78d980f961a42.tar.bz2
linux-stable-6ef17b446081f41be552991b49c78d980f961a42.zip
ASoC: rt5682: add NULL handler to set_jack function
[ Upstream commit a315e76fc544f09daf619530a7b2f85865e6b25e ] Implement NULL handler in set_jack function to disable irq's. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927201408.925-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/rt5682.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index 6f5dac09cede..21e7c430baf7 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -982,6 +982,16 @@ static int rt5682_set_jack_detect(struct snd_soc_component *component,
{
struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
+ rt5682->hs_jack = hs_jack;
+
+ if (!hs_jack) {
+ regmap_update_bits(rt5682->regmap, RT5682_IRQ_CTRL_2,
+ RT5682_JD1_EN_MASK, RT5682_JD1_DIS);
+ regmap_update_bits(rt5682->regmap, RT5682_RC_CLK_CTRL,
+ RT5682_POW_JDH | RT5682_POW_JDL, 0);
+ return 0;
+ }
+
switch (rt5682->pdata.jd_src) {
case RT5682_JD1:
snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_2,
@@ -1019,8 +1029,6 @@ static int rt5682_set_jack_detect(struct snd_soc_component *component,
break;
}
- rt5682->hs_jack = hs_jack;
-
return 0;
}