All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: tiwai@suse.com, pierre-louis.bossart@linux.intel.com,
	lgirdwood@gmail.com, ranjani.sridharan@linux.intel.com,
	kai.vehmanen@linux.intel.com, daniel.baluta@nxp.com
Cc: broonie@kernel.org, Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Jaroslav Kysela <perex@perex.cz>,
	Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	Payal Kshirsagar <payalskshirsagar1234@gmail.com>,
	Rander Wang <rander.wang@intel.com>,
	sound-open-firmware@alsa-project.org (moderated list:SOUND -
	SOUND OPEN FIRMWARE (SOF) DRIVERS),
	alsa-devel@alsa-project.org (moderated list:SOUND - SOC LAYER /
	DYNAMIC AUDIO POWER MANAGEM...),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v4 1/3] ASoC: SOF: Intel: hda: Resume codec to do jack detection
Date: Wed, 13 Jan 2021 02:11:23 +0800	[thread overview]
Message-ID: <20210112181128.1229827-1-kai.heng.feng@canonical.com> (raw)

Instead of queueing jackpoll_work, runtime resume the codec to let it
use different jack detection methods based on jackpoll_interval.

This partially matches SOF driver's behavior with commit a6e7d0a4bdb0
("ALSA: hda: fix jack detection with Realtek codecs when in D3"), the
difference is SOF unconditionally resumes the codec.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
v4:
 No change.
v3: 
 Remove wrong assumption that only Realtek codec is used by SOF.
v2:
 No change.

 sound/soc/sof/intel/hda-codec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
index 6875fa570c2c..df59c79cfdfc 100644
--- a/sound/soc/sof/intel/hda-codec.c
+++ b/sound/soc/sof/intel/hda-codec.c
@@ -93,8 +93,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev)
 		 * has been recorded in STATESTS
 		 */
 		if (codec->jacktbl.used)
-			schedule_delayed_work(&codec->jackpoll_work,
-					      codec->jackpoll_interval);
+			pm_request_resume(&codec->core.dev);
 }
 #else
 void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) {}
-- 
2.29.2


WARNING: multiple messages have this Message-ID (diff)
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: tiwai@suse.com, pierre-louis.bossart@linux.intel.com,
	lgirdwood@gmail.com, ranjani.sridharan@linux.intel.com,
	kai.vehmanen@linux.intel.com, daniel.baluta@nxp.com
Cc: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	"moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER
	MANAGEM..." <alsa-devel@alsa-project.org>,
	broonie@kernel.org, open list <linux-kernel@vger.kernel.org>,
	Rander Wang <rander.wang@intel.com>,
	Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Payal Kshirsagar <payalskshirsagar1234@gmail.com>,
	"moderated list:SOUND - SOUND OPEN FIRMWARE SOF DRIVERS"
	<sound-open-firmware@alsa-project.org>
Subject: [PATCH v4 1/3] ASoC: SOF: Intel: hda: Resume codec to do jack detection
Date: Wed, 13 Jan 2021 02:11:23 +0800	[thread overview]
Message-ID: <20210112181128.1229827-1-kai.heng.feng@canonical.com> (raw)

Instead of queueing jackpoll_work, runtime resume the codec to let it
use different jack detection methods based on jackpoll_interval.

This partially matches SOF driver's behavior with commit a6e7d0a4bdb0
("ALSA: hda: fix jack detection with Realtek codecs when in D3"), the
difference is SOF unconditionally resumes the codec.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
v4:
 No change.
v3: 
 Remove wrong assumption that only Realtek codec is used by SOF.
v2:
 No change.

 sound/soc/sof/intel/hda-codec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
index 6875fa570c2c..df59c79cfdfc 100644
--- a/sound/soc/sof/intel/hda-codec.c
+++ b/sound/soc/sof/intel/hda-codec.c
@@ -93,8 +93,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev)
 		 * has been recorded in STATESTS
 		 */
 		if (codec->jacktbl.used)
-			schedule_delayed_work(&codec->jackpoll_work,
-					      codec->jackpoll_interval);
+			pm_request_resume(&codec->core.dev);
 }
 #else
 void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) {}
-- 
2.29.2


             reply	other threads:[~2021-01-12 18:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 18:11 Kai-Heng Feng [this message]
2021-01-12 18:11 ` [PATCH v4 1/3] ASoC: SOF: Intel: hda: Resume codec to do jack detection Kai-Heng Feng
2021-01-12 18:11 ` [PATCH v4 2/3] ASoC: SOF: Intel: hda: Modify existing helper to disable WAKEEN Kai-Heng Feng
2021-01-12 18:11   ` Kai-Heng Feng
2021-01-12 18:11 ` [PATCH v4 3/3] ASoC: SOF: Intel: hda: Avoid checking jack on system suspend Kai-Heng Feng
2021-01-12 18:11   ` Kai-Heng Feng
2021-01-13  8:36   ` Kai Vehmanen
2021-01-13  8:36     ` Kai Vehmanen
2021-01-13 15:26 ` [PATCH v4 1/3] ASoC: SOF: Intel: hda: Resume codec to do jack detection Mark Brown
2021-01-13 15:26   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210112181128.1229827-1-kai.heng.feng@canonical.com \
    --to=kai.heng.feng@canonical.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=guennadi.liakhovetski@linux.intel.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=payalskshirsagar1234@gmail.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rander.wang@intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.