mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aaron Kling via B4 Relay <devnull+webgeek1234.gmail.com@kernel.org>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	 Weidong Wang <wangweidong.a@awinic.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Val Packett <val@packett.cool>,
	Aaron Kling <webgeek1234@gmail.com>
Subject: [PATCH 5/6] ASoC: codecs: aw88166: remove async start
Date: Fri, 25 Sep 2026 02:47:33 -0500	[thread overview]
Message-ID: <20260925-aw88166-cleanup-v1-5-11f74cb5fe28@gmail.com> (raw)
In-Reply-To: <20260925-aw88166-cleanup-v1-0-11f74cb5fe28@gmail.com>

From: Aaron Kling <webgeek1234@gmail.com>

Codec drivers are not supposed to do anything like this. The result was
that the first second or so of playback was essentially inaudible, and
very short alert sounds could be missed entirely. Let's not do this.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
---
 sound/soc/codecs/aw88166.c | 33 ++++-----------------------------
 sound/soc/codecs/aw88166.h |  5 -----
 2 files changed, 4 insertions(+), 34 deletions(-)

diff --git a/sound/soc/codecs/aw88166.c b/sound/soc/codecs/aw88166.c
index ab7af3eaceb28..6b98864de81a9 100644
--- a/sound/soc/codecs/aw88166.c
+++ b/sound/soc/codecs/aw88166.c
@@ -24,7 +24,6 @@ struct aw88166 {
 	struct aw_device *aw_pa;
 	struct mutex lock;
 	struct gpio_desc *reset_gpio;
-	struct delayed_work start_work;
 	struct regmap *regmap;
 	struct aw_container *aw_cfg;
 
@@ -1148,16 +1147,7 @@ static void aw88166_start_pa(struct aw88166 *aw88166)
 		dev_err(aw88166->aw_pa->dev, "start failure (%d)\n", ret);
 }
 
-static void aw88166_startup_work(struct work_struct *work)
-{
-	struct aw88166 *aw88166 =
-		container_of(work, struct aw88166, start_work.work);
-
-	guard(mutex)(&aw88166->lock);
-	aw88166_start_pa(aw88166);
-}
-
-static void aw88166_start(struct aw88166 *aw88166, bool sync_start)
+static void aw88166_start(struct aw88166 *aw88166)
 {
 	int ret;
 
@@ -1173,12 +1163,7 @@ static void aw88166_start(struct aw88166 *aw88166, bool sync_start)
 		return;
 	}
 
-	if (sync_start == AW88166_SYNC_START)
-		aw88166_start_pa(aw88166);
-	else
-		queue_delayed_work(system_dfl_wq,
-			&aw88166->start_work,
-			AW88166_START_WORK_DELAY_MS);
+	aw88166_start_pa(aw88166);
 }
 
 static int aw_dev_check_sysint(struct aw_device *aw_dev)
@@ -1550,7 +1535,7 @@ static int aw88166_profile_set(struct snd_kcontrol *kcontrol,
 
 	if (aw88166->aw_pa->status) {
 		aw88166_stop(aw88166->aw_pa);
-		aw88166_start(aw88166, AW88166_SYNC_START);
+		aw88166_start(aw88166);
 	}
 
 	return 1;
@@ -1725,7 +1710,7 @@ static int aw88166_playback_event(struct snd_soc_dapm_widget *w,
 	guard(mutex)(&aw88166->lock);
 	switch (event) {
 	case SND_SOC_DAPM_PRE_PMU:
-		aw88166_start(aw88166, AW88166_ASYNC_START);
+		aw88166_start(aw88166);
 		break;
 	case SND_SOC_DAPM_POST_PMD:
 		aw88166_stop(aw88166->aw_pa);
@@ -1759,8 +1744,6 @@ static int aw88166_codec_probe(struct snd_soc_component *component)
 	struct aw88166 *aw88166 = snd_soc_component_get_drvdata(component);
 	int ret;
 
-	INIT_DELAYED_WORK(&aw88166->start_work, aw88166_startup_work);
-
 	ret = aw88166_request_firmware_file(aw88166);
 	if (ret)
 		dev_err(aw88166->aw_pa->dev, "%s failed\n", __func__);
@@ -1768,16 +1751,8 @@ static int aw88166_codec_probe(struct snd_soc_component *component)
 	return ret;
 }
 
-static void aw88166_codec_remove(struct snd_soc_component *aw_codec)
-{
-	struct aw88166 *aw88166 = snd_soc_component_get_drvdata(aw_codec);
-
-	cancel_delayed_work_sync(&aw88166->start_work);
-}
-
 static const struct snd_soc_component_driver soc_codec_dev_aw88166 = {
 	.probe = aw88166_codec_probe,
-	.remove = aw88166_codec_remove,
 	.dapm_widgets = aw88166_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(aw88166_dapm_widgets),
 	.dapm_routes = aw88166_audio_map,
diff --git a/sound/soc/codecs/aw88166.h b/sound/soc/codecs/aw88166.h
index 1a61e56f607c9..b8dbfe0f307c4 100644
--- a/sound/soc/codecs/aw88166.h
+++ b/sound/soc/codecs/aw88166.h
@@ -670,11 +670,6 @@ enum AW88166_DEV_DSP_CFG {
 	AW88166_DEV_DSP_BYPASS = 1,
 };
 
-enum {
-	AW88166_SYNC_START = 0,
-	AW88166_ASYNC_START,
-};
-
 enum {
 	AW88166_RECORD_SEC_DATA = 0,
 	AW88166_RECOVERY_SEC_DATA = 1,

-- 
2.54.0



  parent reply	other threads:[~2026-09-25  7:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25  7:47 [PATCH 0/6] ASoC: codecs: aw88166: fixes and cleanup Aaron Kling via B4 Relay
2026-09-25  7:47 ` [PATCH 1/6] ASoC: codecs: aw88166: support changing sample rate and bit width Aaron Kling via B4 Relay
2026-09-25 14:00   ` Mark Brown
2026-09-25 15:56     ` Aaron Kling
2026-09-25  7:47 ` [PATCH 2/6] ASoC: codecs: aw88166: add TDM support Aaron Kling via B4 Relay
2026-09-25  7:47 ` [PATCH 3/6] ASoC: codecs: aw88166: reduce log spam Aaron Kling via B4 Relay
2026-09-25  7:47 ` [PATCH 4/6] ASoC: codecs: aw88166: remove fade in/out on start/stop Aaron Kling via B4 Relay
2026-09-25 14:11   ` Mark Brown
2026-09-25 15:59     ` Aaron Kling
2026-09-25 16:27       ` Mark Brown
2026-09-25  7:47 ` Aaron Kling via B4 Relay [this message]
2026-09-25 14:12   ` [PATCH 5/6] ASoC: codecs: aw88166: remove async start Mark Brown
2026-09-25 15:44     ` Aaron Kling
2026-09-25 16:06       ` Mark Brown
2026-09-25 16:16         ` Aaron Kling
2026-09-25 16:27           ` Mark Brown
2026-09-25 14:35   ` Cezary Rojewski
2026-09-25 15:42     ` Aaron Kling
2026-09-25  7:47 ` [PATCH 6/6] ASoC: codecs: aw88166: make volume control usable Aaron Kling via B4 Relay
2026-09-25 14:18   ` Mark Brown
2026-09-25 16:05     ` Aaron Kling
2026-09-25 16:18       ` Mark Brown
2026-09-25 16:25         ` Aaron Kling
2026-09-25 16:33           ` 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=20260925-aw88166-cleanup-v1-5-11f74cb5fe28@gmail.com \
    --to=devnull+webgeek1234.gmail.com@kernel.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=val@packett.cool \
    --cc=wangweidong.a@awinic.com \
    --cc=webgeek1234@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®