All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [alsa-devel] [PATCH 07/13] ASoC: SOF: core: check for mandatory fw_ready op during SOF probe
Date: Fri, 27 Sep 2019 15:05:32 -0500	[thread overview]
Message-ID: <20190927200538.660-8-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20190927200538.660-1-pierre-louis.bossart@linux.intel.com>

From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

fw_ready should be a mandatory op. Make sure fw_ready ops is set
during probe.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/core.c     | 3 ++-
 sound/soc/sof/ipc.c      | 6 ------
 sound/soc/sof/sof-priv.h | 2 +-
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index 15167b8220ed..5998861a9002 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -466,7 +466,8 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
 	if (!sof_ops(sdev) || !sof_ops(sdev)->probe || !sof_ops(sdev)->run ||
 	    !sof_ops(sdev)->block_read || !sof_ops(sdev)->block_write ||
 	    !sof_ops(sdev)->send_msg || !sof_ops(sdev)->load_firmware ||
-	    !sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->ipc_pcm_params)
+	    !sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->ipc_pcm_params ||
+	    !sof_ops(sdev)->fw_ready)
 		return -EINVAL;
 
 	INIT_LIST_HEAD(&sdev->pcm_list);
diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c
index b946c81197a1..26675dfe0240 100644
--- a/sound/soc/sof/ipc.c
+++ b/sound/soc/sof/ipc.c
@@ -792,12 +792,6 @@ struct snd_sof_ipc *snd_sof_ipc_init(struct snd_sof_dev *sdev)
 	struct snd_sof_ipc *ipc;
 	struct snd_sof_ipc_msg *msg;
 
-	/* check if mandatory ops required for ipc are defined */
-	if (!sof_ops(sdev)->fw_ready) {
-		dev_err(sdev->dev, "error: ipc mandatory ops not defined\n");
-		return NULL;
-	}
-
 	ipc = devm_kzalloc(sdev->dev, sizeof(*ipc), GFP_KERNEL);
 	if (!ipc)
 		return NULL;
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index 348759035dd0..44f789bf7fb0 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -133,7 +133,7 @@ struct snd_sof_dsp_ops {
 	 * FW ready checks for ABI compatibility and creates
 	 * memory windows at first boot
 	 */
-	int (*fw_ready)(struct snd_sof_dev *sdev, u32 msg_id); /* optional */
+	int (*fw_ready)(struct snd_sof_dev *sdev, u32 msg_id); /* mandatory */
 
 	/* connect pcm substream to a host stream */
 	int (*pcm_open)(struct snd_sof_dev *sdev,
-- 
2.20.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2019-09-27 20:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27 20:05 [alsa-devel] [PATCH 00/13] ASoC: SOF: fixes and improvements Pierre-Louis Bossart
2019-09-27 20:05 ` [alsa-devel] [PATCH 01/13] ASoC: SOF: loader: fix kernel oops on firmware boot failure Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: loader: fix kernel oops on firmware boot failure" to the asoc tree Mark Brown
2019-09-27 20:05 ` [alsa-devel] [PATCH 02/13] ASoC: SOF: topology: fix parse fail issue for byte/bool tuple types Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: topology: fix parse fail issue for byte/bool tuple types" to the asoc tree Mark Brown
2019-09-27 20:05 ` [alsa-devel] [PATCH 03/13] ASoC: SOF: trace: move to opt-in with Kconfig and module parameter Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: trace: move to opt-in with Kconfig and module parameter" to the asoc tree Mark Brown
2019-09-27 20:05 ` [alsa-devel] [PATCH 04/13] ASoC: SOF: ipc: retain DSP context after FW exception Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: ipc: retain DSP context after FW exception." to the asoc tree Mark Brown
2019-09-27 20:05 ` [alsa-devel] [PATCH 05/13] ASoC: SOF: pcm: fix resource leak in hw_free Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: pcm: fix resource leak in hw_free" to the asoc tree Mark Brown
2019-09-27 20:05 ` [alsa-devel] [PATCH 06/13] ASoC: SOF: pcm: harden PCM STOP sequence Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: pcm: harden PCM STOP sequence" to the asoc tree Mark Brown
2019-09-27 20:05 ` Pierre-Louis Bossart [this message]
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: core: check for mandatory fw_ready op during SOF probe" " Mark Brown
2019-09-27 20:05 ` [alsa-devel] [PATCH 08/13] ASoC: SOF: ipc: introduce no_stream_position in sof_ipc_stream_params struct Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: ipc: introduce no_stream_position in sof_ipc_stream_params struct" to the asoc tree Mark Brown
2019-09-27 20:05 ` [alsa-devel] [PATCH 09/13] ASoC: SOF: Intel: hda: fix reset of host_period_bytes Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: Intel: hda: fix reset of host_period_bytes" to the asoc tree Mark Brown
2019-09-27 20:05 ` [alsa-devel] [PATCH 10/13] ASoC: SOF: Intel: hda: fix warnings during FW load Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: Intel: hda: fix warnings during FW load" to the asoc tree Mark Brown
2019-09-27 20:05 ` [alsa-devel] [PATCH 11/13] ASoC: SOF: Intel: initialise and verify FW crash dump data Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: Intel: initialise and verify FW crash dump data." to the asoc tree Mark Brown
2019-09-27 20:05 ` [alsa-devel] [PATCH 12/13] ASoC: SOF: Intel: Add context data to any IPC timeout Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: Intel: Add context data to any IPC timeout." to the asoc tree Mark Brown
2019-09-27 20:05 ` [alsa-devel] [PATCH 13/13] ASoC: SOF: Intel: hda: Disable DMI L1 entry during capture Pierre-Louis Bossart
2019-10-01 17:56   ` [alsa-devel] Applied "ASoC: SOF: Intel: hda: Disable DMI L1 entry during capture" to the asoc tree 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=20190927200538.660-8-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=tiwai@suse.de \
    /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.