All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Fitzgerald via Alsa-devel <alsa-devel@alsa-project.org>
To: <broonie@kernel.org>, <pierre-louis.bossart@linux.intel.com>
Cc: peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	patches@opensource.cirrus.com,
	Simon Trimmer <simont@opensource.cirrus.com>,
	Richard Fitzgerald <rf@opensource.cirrus.com>
Subject: [PATCH v3 5/8] ASoC: wm_adsp: Expose the DSP boot work actions as wm_adsp_power_up()
Date: Mon, 20 Mar 2023 11:22:42 +0000	[thread overview]
Message-ID: <167931140832.26.15416831831977214867@mailman-core.alsa-project.org> (raw)
In-Reply-To: <20230320112245.115720-1-rf@opensource.cirrus.com>


[-- Attachment #0: Type: message/rfc822, Size: 7480 bytes --]

From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: <broonie@kernel.org>, <pierre-louis.bossart@linux.intel.com>
Cc: peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, Simon Trimmer <simont@opensource.cirrus.com>, Richard Fitzgerald <rf@opensource.cirrus.com>
Subject: [PATCH v3 5/8] ASoC: wm_adsp: Expose the DSP boot work actions as wm_adsp_power_up()
Date: Mon, 20 Mar 2023 11:22:42 +0000
Message-ID: <20230320112245.115720-6-rf@opensource.cirrus.com>

From: Simon Trimmer <simont@opensource.cirrus.com>

To support self-booting DSPs that are considered always running, the work
that is usually invoked as part of a DAPM sequence needs to be triggered
by a client of wm_adsp as part of it's startup sequence.

These actions load firmware files that might create ALSA controls and
apply configuration to the device.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 sound/soc/codecs/wm_adsp.c | 27 ++++++++++++++++++---------
 sound/soc/codecs/wm_adsp.h |  2 ++
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 8176b6173de9..d4bffa2f7005 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -998,11 +998,8 @@ int wm_adsp2_preloader_put(struct snd_kcontrol *kcontrol,
 }
 EXPORT_SYMBOL_GPL(wm_adsp2_preloader_put);
 
-static void wm_adsp_boot_work(struct work_struct *work)
+int wm_adsp_power_up(struct wm_adsp *dsp)
 {
-	struct wm_adsp *dsp = container_of(work,
-					   struct wm_adsp,
-					   boot_work);
 	int ret = 0;
 	char *wmfw_filename = NULL;
 	const struct firmware *wmfw_firmware = NULL;
@@ -1013,16 +1010,28 @@ static void wm_adsp_boot_work(struct work_struct *work)
 					     &wmfw_firmware, &wmfw_filename,
 					     &coeff_firmware, &coeff_filename);
 	if (ret)
-		return;
+		return ret;
 
-	cs_dsp_power_up(&dsp->cs_dsp,
-			wmfw_firmware, wmfw_filename,
-			coeff_firmware, coeff_filename,
-			wm_adsp_fw_text[dsp->fw]);
+	ret = cs_dsp_power_up(&dsp->cs_dsp,
+			      wmfw_firmware, wmfw_filename,
+			      coeff_firmware, coeff_filename,
+			      wm_adsp_fw_text[dsp->fw]);
 
 	wm_adsp_release_firmware_files(dsp,
 				       wmfw_firmware, wmfw_filename,
 				       coeff_firmware, coeff_filename);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(wm_adsp_power_up);
+
+static void wm_adsp_boot_work(struct work_struct *work)
+{
+	struct wm_adsp *dsp = container_of(work,
+					   struct wm_adsp,
+					   boot_work);
+
+	wm_adsp_power_up(dsp);
 }
 
 int wm_adsp_early_event(struct snd_soc_dapm_widget *w,
diff --git a/sound/soc/codecs/wm_adsp.h b/sound/soc/codecs/wm_adsp.h
index 173dcae2c260..769904d34a87 100644
--- a/sound/soc/codecs/wm_adsp.h
+++ b/sound/soc/codecs/wm_adsp.h
@@ -91,6 +91,8 @@ int wm_adsp1_event(struct snd_soc_dapm_widget *w,
 int wm_adsp_early_event(struct snd_soc_dapm_widget *w,
 			struct snd_kcontrol *kcontrol, int event);
 
+int wm_adsp_power_up(struct wm_adsp *dsp);
+
 irqreturn_t wm_adsp2_bus_error(int irq, void *data);
 irqreturn_t wm_halo_bus_error(int irq, void *data);
 irqreturn_t wm_halo_wdt_expire(int irq, void *data);
-- 
2.30.2


  parent reply	other threads:[~2023-03-20 11:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 11:22 [PATCH v3 0/8] ASoC: Initial support for Cirrus Logic CS35L56 Richard Fitzgerald
2023-03-20 11:22 ` [PATCH v3 1/8] firmware: cs_dsp: Introduce no_core_startstop for self-booting DSPs Richard Fitzgerald
2023-03-20 11:22 ` Richard Fitzgerald via Alsa-devel
2023-03-20 11:22 ` [PATCH v3 2/8] ASoC: wm_adsp: Use no_core_startstop to prevent creating preload control Richard Fitzgerald via Alsa-devel
2023-03-20 11:22 ` Richard Fitzgerald
2023-03-20 11:22 ` [PATCH v3 3/8] firmware: cs_dsp: Support DSPs that don't require firmware download Richard Fitzgerald
2023-03-20 11:22 ` Richard Fitzgerald via Alsa-devel
2023-03-20 11:22 ` [PATCH v3 4/8] ASoC: wm_adsp: " Richard Fitzgerald
2023-03-20 11:22 ` Richard Fitzgerald via Alsa-devel
2023-03-20 11:22 ` [PATCH v3 5/8] ASoC: wm_adsp: Expose the DSP boot work actions as wm_adsp_power_up() Richard Fitzgerald
2023-03-20 11:22 ` Richard Fitzgerald via Alsa-devel [this message]
2023-03-20 11:22 ` [PATCH v3 6/8] ASoC: wm_adsp: Add support for loading bin files without wmfw Richard Fitzgerald
2023-03-20 11:22 ` Richard Fitzgerald via Alsa-devel
2023-03-20 11:22 ` [PATCH v3 7/8] ASoC: wm_adsp: Simplify the logging of requested firmware files Richard Fitzgerald
2023-03-20 11:22 ` Richard Fitzgerald via Alsa-devel
2023-03-20 11:22 ` [PATCH v3 8/8] ASoC: cs35l56: Add driver for Cirrus Logic CS35L56 Richard Fitzgerald via Alsa-devel
2023-03-20 11:22 ` Richard Fitzgerald
2023-03-21 16:51 ` [PATCH v3 0/8] ASoC: Initial support " 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=167931140832.26.15416831831977214867@mailman-core.alsa-project.org \
    --to=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rf@opensource.cirrus.com \
    --cc=simont@opensource.cirrus.com \
    --cc=yung-chuan.liao@linux.intel.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.