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 v2 02/19] ASoC: add soc-card.c
Date: 28 May 2020 10:47:46 +0900	[thread overview]
Message-ID: <87blm825kt.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87eer425lw.wl-kuninori.morimoto.gx@renesas.com>


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

Current ALSA SoC has some snd_soc_card_xxx() functions,
and card->xxx() callbacks.
But, it is implemented randomly at random place.

To collect all card related functions into one place,
this patch creats new soc-card.c.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc-card.h | 11 +++++++++++
 include/sound/soc.h      |  1 +
 sound/soc/Makefile       |  2 +-
 sound/soc/soc-card.c     | 26 ++++++++++++++++++++++++++
 4 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 include/sound/soc-card.h
 create mode 100644 sound/soc/soc-card.c

diff --git a/include/sound/soc-card.h b/include/sound/soc-card.h
new file mode 100644
index 000000000000..997809bb3afb
--- /dev/null
+++ b/include/sound/soc-card.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * soc-card.h
+ *
+ * Copyright (C) 2019 Renesas Electronics Corp.
+ * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ */
+#ifndef __SOC_CARD_H
+#define __SOC_CARD_H
+
+#endif /* __SOC_CARD_H */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 11ee3ed87aa1..5b880e29d106 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1450,5 +1450,6 @@ static inline void snd_soc_dapm_mutex_unlock(struct snd_soc_dapm_context *dapm)
 }
 
 #include <sound/soc-component.h>
+#include <sound/soc-card.h>
 
 #endif
diff --git a/sound/soc/Makefile b/sound/soc/Makefile
index 70a5f19ea3a1..7f1747518e79 100644
--- a/sound/soc/Makefile
+++ b/sound/soc/Makefile
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-utils.o soc-dai.o soc-component.o
-snd-soc-core-objs += soc-pcm.o soc-io.o soc-devres.o soc-ops.o soc-link.o
+snd-soc-core-objs += soc-pcm.o soc-io.o soc-devres.o soc-ops.o soc-link.o soc-card.o
 snd-soc-core-$(CONFIG_SND_SOC_COMPRESS) += soc-compress.o
 
 ifneq ($(CONFIG_SND_SOC_TOPOLOGY),)
diff --git a/sound/soc/soc-card.c b/sound/soc/soc-card.c
new file mode 100644
index 000000000000..4bc6f26ea8cb
--- /dev/null
+++ b/sound/soc/soc-card.c
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// soc-card.c
+//
+// Copyright (C) 2019 Renesas Electronics Corp.
+// Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+//
+#include <sound/soc.h>
+
+#define soc_card_ret(dai, ret) _soc_card_ret(dai, __func__, ret)
+static inline int _soc_card_ret(struct snd_soc_card *card,
+				const char *func, int ret)
+{
+	switch (ret) {
+	case -EPROBE_DEFER:
+	case -ENOTSUPP:
+	case 0:
+		break;
+	default:
+		dev_err(card->dev,
+			"ASoC: error at %s on %s: %d\n",
+			func, card->name, ret);
+	}
+
+	return ret;
+}
-- 
2.17.1


  parent reply	other threads:[~2020-05-28  1:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28  1:47 [PATCH v2 00/19] ASoC: add soc-card Kuninori Morimoto
2020-05-28  1:47 ` [PATCH v2 01/19] ASoC: soc.h: convert bool to bit field for snd_soc_card Kuninori Morimoto
2020-05-28  1:47 ` Kuninori Morimoto [this message]
2020-05-28  1:47 ` [PATCH v2 03/19] ASoC: soc-card: move snd_soc_card_get_kcontrol() to soc-card Kuninori Morimoto
2020-05-28  1:48 ` [PATCH v2 04/19] ASoC: soc-card: move snd_soc_card_jack_new() " Kuninori Morimoto
2020-05-28  1:48 ` [PATCH v2 05/19] ASoC: soc-card: move snd_soc_card_set/get_drvdata() " Kuninori Morimoto
2020-05-28  1:48 ` [PATCH v2 06/19] ASoC: soc-card: move snd_soc_card_get_codec_dai() " Kuninori Morimoto
2020-05-28  1:48 ` [PATCH v2 07/19] ASoC: soc-card: move snd_soc_card_subclass " Kuninori Morimoto
2020-05-28  1:48 ` [PATCH v2 08/19] ASoC: soc-card: add snd_soc_card_suspend_pre() Kuninori Morimoto
2020-05-28  1:48 ` [PATCH v2 09/19] ASoC: soc-card: add snd_soc_card_suspend_post() Kuninori Morimoto
2020-05-28  1:48 ` [PATCH v2 10/19] ASoC: soc-card: add snd_soc_card_resume_pre() Kuninori Morimoto
2020-05-28  1:49 ` [PATCH v2 11/19] ASoC: soc-card: add snd_soc_card_resume_post() Kuninori Morimoto
2020-05-28  1:49 ` [PATCH v2 13/19] ASoC: soc-card: add snd_soc_card_probe() Kuninori Morimoto
2020-05-28  1:49 ` [PATCH v2 14/19] ASoC: soc-card: add snd_soc_card_late_probe() Kuninori Morimoto
2020-05-28  1:49 ` [PATCH v2 15/19] ASoC: soc-card: add snd_soc_card_remove() Kuninori Morimoto
2020-05-28  1:49 ` [PATCH v2 16/19] ASoC: soc-card: add snd_soc_card_set_bias_level() Kuninori Morimoto
2020-05-28  1:50 ` [PATCH v2 12/19] ASoC: soc-card: add probed bit field to snd_soc_card Kuninori Morimoto
2020-05-28  1:50 ` [PATCH v2 17/19] ASoC: soc-card: add snd_soc_card_set_bias_level_post() Kuninori Morimoto
2020-05-28  1:50 ` [PATCH v2 18/19] ASoC: soc-card: add snd_soc_card_add_dai_link() Kuninori Morimoto
2020-05-28  1:50 ` [PATCH v2 19/19] ASoC: soc-card: add snd_soc_card_remove_dai_link() Kuninori Morimoto
2020-05-29 23:17 ` [PATCH v2 00/19] ASoC: add soc-card Ranjani Sridharan
2020-05-30  1:18 ` 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=87blm825kt.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.