alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: rt286: fix unexpected interrupt happens
@ 2020-07-09 10:13 shumingf
  2020-07-09 11:56 ` Pierre-Louis Bossart
  2020-07-09 22:00 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: shumingf @ 2020-07-09 10:13 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: oder_chiou, jack.yu, alsa-devel, lars, pierre-louis.bossart,
	derek.fang, Shuming Fan, flove

From: Shuming Fan <shumingf@realtek.com>

The HV/VREF should not turn off if the headphone jack plug-in.
This patch could solve the unexpected interrupt issue in some devices.

Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Shuming Fan <shumingf@realtek.com>
---
 sound/soc/codecs/rt286.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index 9593a9a27bf8..e8d14eefc41b 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -272,13 +272,13 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic)
 		regmap_read(rt286->regmap, RT286_GET_MIC1_SENSE, &buf);
 		*mic = buf & 0x80000000;
 	}
-	if (!*mic) {
+
+	if (!*hp) {
 		snd_soc_dapm_disable_pin(dapm, "HV");
 		snd_soc_dapm_disable_pin(dapm, "VREF");
-	}
-	if (!*hp)
 		snd_soc_dapm_disable_pin(dapm, "LDO1");
-	snd_soc_dapm_sync(dapm);
+		snd_soc_dapm_sync(dapm);
+	}
 
 	return 0;
 }
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: rt286: fix unexpected interrupt happens
  2020-07-09 10:13 [PATCH] ASoC: rt286: fix unexpected interrupt happens shumingf
@ 2020-07-09 11:56 ` Pierre-Louis Bossart
  2020-07-09 22:00 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Pierre-Louis Bossart @ 2020-07-09 11:56 UTC (permalink / raw)
  To: shumingf, broonie, lgirdwood
  Cc: oder_chiou, jack.yu, alsa-devel, lars, derek.fang, flove



On 7/9/20 5:13 AM, shumingf@realtek.com wrote:
> From: Shuming Fan <shumingf@realtek.com>
> 
> The HV/VREF should not turn off if the headphone jack plug-in.
> This patch could solve the unexpected interrupt issue in some devices.
> 
> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

For more context, this patch removes a recurring click with a ~1s period 
audible with headphones on Dell XPS13-9343.

> Signed-off-by: Shuming Fan <shumingf@realtek.com>
> ---
>   sound/soc/codecs/rt286.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
> index 9593a9a27bf8..e8d14eefc41b 100644
> --- a/sound/soc/codecs/rt286.c
> +++ b/sound/soc/codecs/rt286.c
> @@ -272,13 +272,13 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic)
>   		regmap_read(rt286->regmap, RT286_GET_MIC1_SENSE, &buf);
>   		*mic = buf & 0x80000000;
>   	}
> -	if (!*mic) {
> +
> +	if (!*hp) {
>   		snd_soc_dapm_disable_pin(dapm, "HV");
>   		snd_soc_dapm_disable_pin(dapm, "VREF");
> -	}
> -	if (!*hp)
>   		snd_soc_dapm_disable_pin(dapm, "LDO1");
> -	snd_soc_dapm_sync(dapm);
> +		snd_soc_dapm_sync(dapm);
> +	}
>   
>   	return 0;
>   }
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: rt286: fix unexpected interrupt happens
  2020-07-09 10:13 [PATCH] ASoC: rt286: fix unexpected interrupt happens shumingf
  2020-07-09 11:56 ` Pierre-Louis Bossart
@ 2020-07-09 22:00 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-07-09 22:00 UTC (permalink / raw)
  To: lgirdwood, shumingf
  Cc: oder_chiou, jack.yu, alsa-devel, lars, pierre-louis.bossart,
	derek.fang, flove

On Thu, 9 Jul 2020 18:13:45 +0800, shumingf@realtek.com wrote:
> The HV/VREF should not turn off if the headphone jack plug-in.
> This patch could solve the unexpected interrupt issue in some devices.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: rt286: fix unexpected interrupt happens
      commit: 12eb3ad0638c2a6af72de866e9d7837de16ee82f

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-09 22:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 10:13 [PATCH] ASoC: rt286: fix unexpected interrupt happens shumingf
2020-07-09 11:56 ` Pierre-Louis Bossart
2020-07-09 22:00 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).