Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
To: lgirdwood@gmail.com, broonie@kernel.org,
	pierre-louis.bossart@linux.intel.com
Cc: daniel.baluta@nxp.com, alsa-devel@alsa-project.org,
	yung-chuan.liao@linux.intel.com,
	ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com
Subject: [PATCH] ASoC: SOF: ipc3: Remove the ipc3-ops.h header file
Date: Wed,  4 May 2022 13:28:31 +0300	[thread overview]
Message-ID: <20220504102831.10071-1-peter.ujfalusi@linux.intel.com> (raw)

Only the main IPC ops struct should be visible outside of IPC3 code to make
sure that the code is correctly abstracted.

Instead of keeping the ipc3-ops.h with only the high level ops struct
declaration, put the ipc3_ops to sof-priv.h and move all other ops struct
declaration into ipc3-priv.h

New IPC implementation should follow this route: the main IPC ops should be
declared in sof-priv.h and no other IPC version related header be used
for generic code.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 sound/soc/sof/ipc.c           |  1 -
 sound/soc/sof/ipc3-control.c  |  2 +-
 sound/soc/sof/ipc3-loader.c   |  1 -
 sound/soc/sof/ipc3-ops.h      | 21 ---------------------
 sound/soc/sof/ipc3-pcm.c      |  2 +-
 sound/soc/sof/ipc3-priv.h     |  3 +++
 sound/soc/sof/ipc3-topology.c |  2 +-
 sound/soc/sof/ipc3.c          |  1 -
 sound/soc/sof/sof-priv.h      |  3 +++
 9 files changed, 9 insertions(+), 27 deletions(-)
 delete mode 100644 sound/soc/sof/ipc3-ops.h

diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c
index a6ec4b5a4923..41f3a217be5d 100644
--- a/sound/soc/sof/ipc.c
+++ b/sound/soc/sof/ipc.c
@@ -17,7 +17,6 @@
 #include "sof-priv.h"
 #include "sof-audio.h"
 #include "ops.h"
-#include "ipc3-ops.h"
 
 /**
  * sof_ipc_send_msg - generic function to prepare and send one IPC message
diff --git a/sound/soc/sof/ipc3-control.c b/sound/soc/sof/ipc3-control.c
index 4347adcc6543..3fdc0d854e65 100644
--- a/sound/soc/sof/ipc3-control.c
+++ b/sound/soc/sof/ipc3-control.c
@@ -9,7 +9,7 @@
 
 #include "sof-priv.h"
 #include "sof-audio.h"
-#include "ipc3-ops.h"
+#include "ipc3-priv.h"
 
 /* IPC set()/get() for kcontrols. */
 static int sof_ipc3_set_get_kcontrol_data(struct snd_sof_control *scontrol, bool set)
diff --git a/sound/soc/sof/ipc3-loader.c b/sound/soc/sof/ipc3-loader.c
index 14158c52a2b7..f3c741b49519 100644
--- a/sound/soc/sof/ipc3-loader.c
+++ b/sound/soc/sof/ipc3-loader.c
@@ -9,7 +9,6 @@
 #include "sof-priv.h"
 #include "sof-audio.h"
 #include "ipc3-priv.h"
-#include "ipc3-ops.h"
 #include "ops.h"
 
 static int ipc3_fw_ext_man_get_version(struct snd_sof_dev *sdev,
diff --git a/sound/soc/sof/ipc3-ops.h b/sound/soc/sof/ipc3-ops.h
deleted file mode 100644
index a4784626a3d7..000000000000
--- a/sound/soc/sof/ipc3-ops.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
-/*
- * This file is provided under a dual BSD/GPLv2 license.  When using or
- * redistributing this file, you may do so under either license.
- *
- * Copyright(c) 2021 Intel Corporation. All rights reserved.
- *
- * Author: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
- */
-
-#ifndef __SOUND_SOC_SOF_IPC3_OPS_H
-#define __SOUND_SOC_SOF_IPC3_OPS_H
-
-#include "sof-priv.h"
-
-extern const struct sof_ipc_tplg_ops ipc3_tplg_ops;
-extern const struct sof_ipc_ops ipc3_ops;
-extern const struct sof_ipc_tplg_control_ops tplg_ipc3_control_ops;
-extern const struct sof_ipc_pcm_ops ipc3_pcm_ops;
-
-#endif
diff --git a/sound/soc/sof/ipc3-pcm.c b/sound/soc/sof/ipc3-pcm.c
index d7b6c67b2180..c8774a891d6f 100644
--- a/sound/soc/sof/ipc3-pcm.c
+++ b/sound/soc/sof/ipc3-pcm.c
@@ -8,7 +8,7 @@
 //
 
 #include <sound/pcm_params.h>
-#include "ipc3-ops.h"
+#include "ipc3-priv.h"
 #include "ops.h"
 #include "sof-priv.h"
 #include "sof-audio.h"
diff --git a/sound/soc/sof/ipc3-priv.h b/sound/soc/sof/ipc3-priv.h
index a9b9201508a5..82f9d0cbfb93 100644
--- a/sound/soc/sof/ipc3-priv.h
+++ b/sound/soc/sof/ipc3-priv.h
@@ -12,6 +12,9 @@
 #include "sof-priv.h"
 
 /* IPC3 specific ops */
+extern const struct sof_ipc_pcm_ops ipc3_pcm_ops;
+extern const struct sof_ipc_tplg_ops ipc3_tplg_ops;
+extern const struct sof_ipc_tplg_control_ops tplg_ipc3_control_ops;
 extern const struct sof_ipc_fw_loader_ops ipc3_loader_ops;
 
 /* helpers for fw_ready and ext_manifest parsing */
diff --git a/sound/soc/sof/ipc3-topology.c b/sound/soc/sof/ipc3-topology.c
index 220ab6c6803f..043554d7cb4a 100644
--- a/sound/soc/sof/ipc3-topology.c
+++ b/sound/soc/sof/ipc3-topology.c
@@ -11,7 +11,7 @@
 #include <sound/pcm_params.h>
 #include "sof-priv.h"
 #include "sof-audio.h"
-#include "ipc3-ops.h"
+#include "ipc3-priv.h"
 #include "ops.h"
 
 /* Full volume for default values */
diff --git a/sound/soc/sof/ipc3.c b/sound/soc/sof/ipc3.c
index efcd201597fa..a8ffc4f99565 100644
--- a/sound/soc/sof/ipc3.c
+++ b/sound/soc/sof/ipc3.c
@@ -12,7 +12,6 @@
 #include "sof-priv.h"
 #include "sof-audio.h"
 #include "ipc3-priv.h"
-#include "ipc3-ops.h"
 #include "ops.h"
 
 typedef void (*ipc3_rx_callback)(struct snd_sof_dev *sdev, void *msg_buf);
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index a1141ea8d907..4801849cb2ab 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -763,4 +763,7 @@ static inline int sof_resume_clients(struct snd_sof_dev *sdev)
 }
 #endif /* CONFIG_SND_SOC_SOF_CLIENT */
 
+/* Main ops for IPC implementations */
+extern const struct sof_ipc_ops ipc3_ops;
+
 #endif
-- 
2.36.0


             reply	other threads:[~2022-05-04 10:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 10:28 Peter Ujfalusi [this message]
2022-05-04 20:37 ` [PATCH] ASoC: SOF: ipc3: Remove the ipc3-ops.h header file 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=20220504102831.10071-1-peter.ujfalusi@linux.intel.com \
    --to=peter.ujfalusi@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox