All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [PATCH 02/24] ASoC: soc-component: move snd_soc_component_xxx_regmap() to soc-component
Date: 01 Jun 2020 10:36:02 +0900	[thread overview]
Message-ID: <877dwrzhx9.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87a71nzhy2.wl-kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

soc-component is handling snd_soc_component_xxx().
Move snd_soc_component_xxx_regmap() to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc-component.h |  1 +
 sound/soc/soc-component.c     | 50 +++++++++++++++++++++++++++++++++++
 sound/soc/soc-core.c          | 50 -----------------------------------
 3 files changed, 51 insertions(+), 50 deletions(-)

diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index 5663891148e3..481132141dc2 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -359,6 +359,7 @@ int snd_soc_component_stream_event(struct snd_soc_component *component,
 int snd_soc_component_set_bias_level(struct snd_soc_component *component,
 				     enum snd_soc_bias_level level);
 
+void snd_soc_component_setup_regmap(struct snd_soc_component *component);
 #ifdef CONFIG_REGMAP
 void snd_soc_component_init_regmap(struct snd_soc_component *component,
 				   struct regmap *regmap);
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index 76f4b953563c..3c96a1adaa8b 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -302,6 +302,56 @@ int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component,
 	return -ENOTSUPP;
 }
 
+void snd_soc_component_setup_regmap(struct snd_soc_component *component)
+{
+	int val_bytes = regmap_get_val_bytes(component->regmap);
+
+	/* Errors are legitimate for non-integer byte multiples */
+	if (val_bytes > 0)
+		component->val_bytes = val_bytes;
+}
+
+#ifdef CONFIG_REGMAP
+
+/**
+ * snd_soc_component_init_regmap() - Initialize regmap instance for the
+ *                                   component
+ * @component: The component for which to initialize the regmap instance
+ * @regmap: The regmap instance that should be used by the component
+ *
+ * This function allows deferred assignment of the regmap instance that is
+ * associated with the component. Only use this if the regmap instance is not
+ * yet ready when the component is registered. The function must also be called
+ * before the first IO attempt of the component.
+ */
+void snd_soc_component_init_regmap(struct snd_soc_component *component,
+				   struct regmap *regmap)
+{
+	component->regmap = regmap;
+	snd_soc_component_setup_regmap(component);
+}
+EXPORT_SYMBOL_GPL(snd_soc_component_init_regmap);
+
+/**
+ * snd_soc_component_exit_regmap() - De-initialize regmap instance for the
+ *                                   component
+ * @component: The component for which to de-initialize the regmap instance
+ *
+ * Calls regmap_exit() on the regmap instance associated to the component and
+ * removes the regmap instance from the component.
+ *
+ * This function should only be used if snd_soc_component_init_regmap() was used
+ * to initialize the regmap instance.
+ */
+void snd_soc_component_exit_regmap(struct snd_soc_component *component)
+{
+	regmap_exit(component->regmap);
+	component->regmap = NULL;
+}
+EXPORT_SYMBOL_GPL(snd_soc_component_exit_regmap);
+
+#endif
+
 int snd_soc_pcm_component_pointer(struct snd_pcm_substream *substream)
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b07eca2c6ccc..8e90426d2770 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2381,56 +2381,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
 	return 0;
 }
 
-static void snd_soc_component_setup_regmap(struct snd_soc_component *component)
-{
-	int val_bytes = regmap_get_val_bytes(component->regmap);
-
-	/* Errors are legitimate for non-integer byte multiples */
-	if (val_bytes > 0)
-		component->val_bytes = val_bytes;
-}
-
-#ifdef CONFIG_REGMAP
-
-/**
- * snd_soc_component_init_regmap() - Initialize regmap instance for the
- *                                   component
- * @component: The component for which to initialize the regmap instance
- * @regmap: The regmap instance that should be used by the component
- *
- * This function allows deferred assignment of the regmap instance that is
- * associated with the component. Only use this if the regmap instance is not
- * yet ready when the component is registered. The function must also be called
- * before the first IO attempt of the component.
- */
-void snd_soc_component_init_regmap(struct snd_soc_component *component,
-	struct regmap *regmap)
-{
-	component->regmap = regmap;
-	snd_soc_component_setup_regmap(component);
-}
-EXPORT_SYMBOL_GPL(snd_soc_component_init_regmap);
-
-/**
- * snd_soc_component_exit_regmap() - De-initialize regmap instance for the
- *                                   component
- * @component: The component for which to de-initialize the regmap instance
- *
- * Calls regmap_exit() on the regmap instance associated to the component and
- * removes the regmap instance from the component.
- *
- * This function should only be used if snd_soc_component_init_regmap() was used
- * to initialize the regmap instance.
- */
-void snd_soc_component_exit_regmap(struct snd_soc_component *component)
-{
-	regmap_exit(component->regmap);
-	component->regmap = NULL;
-}
-EXPORT_SYMBOL_GPL(snd_soc_component_exit_regmap);
-
-#endif
-
 #define ENDIANNESS_MAP(name) \
 	(SNDRV_PCM_FMTBIT_##name##LE | SNDRV_PCM_FMTBIT_##name##BE)
 static u64 endianness_format_map[] = {
-- 
2.17.1


  parent reply	other threads:[~2020-06-01  1:38 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01  1:35 [PATCH 00/24] ASoC: soc-component: collect component functions Kuninori Morimoto
2020-06-01  1:35 ` [PATCH 01/24] ASoC: soc-component: add soc_component_pin() and share code Kuninori Morimoto
2020-06-01  1:36 ` Kuninori Morimoto [this message]
2020-06-01  1:36 ` [PATCH 03/24] ASoC: soc-component: move snd_soc_component_initialize() to soc-component.c Kuninori Morimoto
2020-06-01  1:36 ` [PATCH 04/24] ASoC: soc-component: add soc_component_err() Kuninori Morimoto
2020-06-01  1:36 ` [PATCH 05/24] ASoC: soc-component: add snd_soc_pcm_component_prepare() Kuninori Morimoto
2020-06-01 18:22   ` Ranjani Sridharan
2020-06-01 23:12     ` Kuninori Morimoto
2020-06-01  1:36 ` [PATCH 06/24] ASoC: soc-component: add snd_soc_pcm_component_hw_params() Kuninori Morimoto
2020-06-01  1:36 ` [PATCH 07/24] ASoC: soc-component: add snd_soc_pcm_component_hw_free() Kuninori Morimoto
2020-06-01  1:36 ` [PATCH 08/24] ASoC: soc-component: add snd_soc_pcm_component_trigger() Kuninori Morimoto
2020-06-01  1:36 ` [PATCH 09/24] ASoC: soc-component: add snd_soc_component_compr_open() Kuninori Morimoto
2020-06-01 19:01   ` Ranjani Sridharan
2020-06-01 23:16     ` Kuninori Morimoto
2020-06-03 10:40       ` Mark Brown
2020-06-04  0:52         ` Kuninori Morimoto
2020-06-04  4:23           ` Kuninori Morimoto
2020-06-03 16:55   ` Ranjani Sridharan
2020-06-01  1:36 ` [PATCH 10/24] ASoC: soc-component: add snd_soc_component_compr_free() Kuninori Morimoto
2020-06-01  1:36 ` [PATCH 11/24] ASoC: soc-component: add snd_soc_component_compr_trigger() Kuninori Morimoto
2020-06-01  1:36 ` [PATCH 12/24] ASoC: soc-component: add snd_soc_component_compr_set_params() Kuninori Morimoto
2020-06-01  1:36 ` [PATCH 13/24] ASoC: soc-component: add snd_soc_component_compr_get_params() Kuninori Morimoto
2020-06-01  1:37 ` [PATCH 14/24] ASoC: soc-component: add snd_soc_component_compr_get_caps() Kuninori Morimoto
2020-06-01  1:37 ` [PATCH 15/24] ASoC: soc-component: add snd_soc_component_compr_get_codec_caps() Kuninori Morimoto
2020-06-01  1:37 ` [PATCH 16/24] ASoC: soc-component: add snd_soc_component_compr_ack() Kuninori Morimoto
2020-06-01  1:37 ` [PATCH 17/24] ASoC: soc-component: add snd_soc_component_compr_pointer() Kuninori Morimoto
2020-06-03 17:35   ` Ranjani Sridharan
2020-06-01  1:37 ` [PATCH 18/24] ASoC: soc-component: add snd_soc_component_compr_copy() Kuninori Morimoto
2020-06-03 17:39   ` Ranjani Sridharan
2020-06-01  1:37 ` [PATCH 19/24] ASoC: soc-component: add snd_soc_component_compr_set_metadata() Kuninori Morimoto
2020-06-03 17:40   ` Ranjani Sridharan
2020-06-01  1:37 ` [PATCH 20/24] ASoC: soc-component: add snd_soc_component_compr_get_metadata() Kuninori Morimoto
2020-06-03 17:41   ` Ranjani Sridharan
2020-06-01  1:37 ` [PATCH 21/24] ASoC: soc-component: add snd_soc_component_init() Kuninori Morimoto
2020-06-01  1:37 ` [PATCH 22/24] ASoC: soc-component: merge soc-io.c into soc-component.c Kuninori Morimoto
2020-06-01  1:37 ` [PATCH 23/24] ASoC: soc-component: merge soc_pcm_trigger_start/stop() Kuninori Morimoto
2020-06-01  1:37 ` [PATCH 24/24] ASoC: soc-component: tidyup Copyright Kuninori Morimoto

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=877dwrzhx9.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /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.